Skip to content

Commit

Permalink
handle illuminated buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
dannybunschoten committed Aug 26, 2024
1 parent 49cad60 commit b8b9b2a
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import WinningLine, {
} from "./components/Winningline";
import { ScoreBoard } from "./components/ScoreBoard";
import { Fruit } from "./commons/fruits";
import LockButton from "./components/LockButton";

const ITEMS: Fruit[] = [
"cherries",
Expand Down Expand Up @@ -101,6 +102,9 @@ export default function Home() {
initializeRollWheelOffsets,
);
const [points, setPoints] = useState(10);
const [lockedWheels, setLockedWheels] = useState(
Array(NUMBER_OF_WHEELS).fill(false),
);
const isRolling = rollWheelOffsets.some((offset) => offset !== 0);
const linesWithScores = WINNINGLINES.map((line) => ({
line,
Expand Down Expand Up @@ -212,15 +216,16 @@ export default function Home() {
)}
wheelIndex={index}
/>
<button
style={{
WebkitTextStroke: "4px black",
paintOrder: "stroke fill",
}}
className="rounded-lg border-2 border-black bg-red text-[36px] tracking-wider text-white"
>
Lock
</button>
<LockButton
pressed={lockedWheels[index]}
pressHandler={() =>
setLockedWheels(
lockedWheels.map((lockedWheel, lockIndex) =>
index === lockIndex ? !lockedWheel : lockedWheel,
),
)
}
/>
</div>
))}
</div>
Expand Down

0 comments on commit b8b9b2a

Please sign in to comment.