From 6c68cb168a6020e0589c99add348bb7a73f4eda6 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Thu, 5 Feb 2026 21:38:57 -0500 Subject: shifter stuff + updated downloads --- src/components/ToggleShifter.tsx | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) (limited to 'src/components/ToggleShifter.tsx') diff --git a/src/components/ToggleShifter.tsx b/src/components/ToggleShifter.tsx index 4737a6f..725a8cc 100644 --- a/src/components/ToggleShifter.tsx +++ b/src/components/ToggleShifter.tsx @@ -1,14 +1,26 @@ import Shifter from './Shifter.tsx'; -import { useState } from "react"; +import { useEffect, useState } from "react"; export default function ToggleShifter() { - const [isShowingShifter, setShowingShifter] = useState(false); - - return ( - <> - {isShowingShifter && ( - - )} - - ) + const [isShowingShifter, setShowingShifter] = useState(false); + + useEffect(() => { + const handleKeyDown = (event: KeyboardEvent) => { + if (event.key === "s") { + setShowingShifter(prev => !prev); + } + }; + + window.addEventListener("keydown", handleKeyDown); + + return () => { + window.removeEventListener("keydown", handleKeyDown); + }; + }, []); + + return ( + <> + {isShowingShifter && } + + ); } -- cgit v1.2.3