From 8349e48d2974e87d8993333559d68b241a2ca47d Mon Sep 17 00:00:00 2001 From: MaanavD Date: Mon, 10 Jun 2024 15:43:00 -0700 Subject: [PATCH 1/2] Fixed many accessibility issues. --- .../InfiniteMovingCards.svelte | 17 ++++++++- src/routes/+layout.svelte | 2 +- src/routes/components/code-blocks.svelte | 36 ++++++++++++------- src/routes/components/customers.svelte | 2 +- src/routes/components/header.svelte | 4 ++- 5 files changed, 45 insertions(+), 16 deletions(-) diff --git a/src/lib/components/ui/InfiniteMovingCards/InfiniteMovingCards.svelte b/src/lib/components/ui/InfiniteMovingCards/InfiniteMovingCards.svelte index ddb822eb9454c..6c56315258661 100644 --- a/src/lib/components/ui/InfiniteMovingCards/InfiniteMovingCards.svelte +++ b/src/lib/components/ui/InfiniteMovingCards/InfiniteMovingCards.svelte @@ -57,14 +57,29 @@ } } }; + + const toggleScroll = () => { + if (scrollerRef) { + const currentState = window.getComputedStyle(scrollerRef).animationPlayState; + scrollerRef.style.animationPlayState = currentState === 'running' ? 'paused' : 'running'; + } + }; + + const handleKeyDown = (event: { key: string; preventDefault: () => void; }) => { + if (event.key === 'Enter' || event.key === ' ') { + event.preventDefault(); // Prevent default spacebar scrolling behavior + toggleScroll(); + } + };
+