wider black keys and better contrast on D key

This commit is contained in:
2026-01-25 11:45:18 +00:00
parent d055ffa941
commit e2ee7a57e6

View File

@@ -49,8 +49,8 @@ export default function ColorKeyboard({
style={ style={
isActive isActive
? { ? {
backgroundColor: note === "E" ? "#000000" : "#ffffff", backgroundColor: ["D", "E"].includes(note) ? "#000000" : "#ffffff",
color: note === "E" ? "#ffffff" : "#000000", color: ["D", "E"].includes(note) ? "#ffffff" : "#000000",
} }
: { backgroundColor: color } : { backgroundColor: color }
} }
@@ -64,6 +64,7 @@ export default function ColorKeyboard({
{BLACK_KEYS.map((key) => { {BLACK_KEYS.map((key) => {
const color = colorByNote[key.note]; const color = colorByNote[key.note];
const isActive = color.toLowerCase() === value.toLowerCase(); const isActive = color.toLowerCase() === value.toLowerCase();
const width = 10;
return ( return (
<Toggle <Toggle
@@ -76,8 +77,8 @@ export default function ColorKeyboard({
isActive ? "" : "", isActive ? "" : "",
)} )}
style={{ style={{
width: "8%", width: `${width}%`,
left: `${(key.position + 1) * (100 / WHITE_KEYS.length) - 4}%`, left: `${(key.position + 1) * (100 / WHITE_KEYS.length) - width / 2}%`,
backgroundColor: color, backgroundColor: color,
}} }}
aria-label={`Select ${key.note}`} aria-label={`Select ${key.note}`}