diff --git a/frontend/src/lib/components/SlideCarousel.svelte b/frontend/src/lib/components/SlideCarousel.svelte index f4d438b..2ae2828 100644 --- a/frontend/src/lib/components/SlideCarousel.svelte +++ b/frontend/src/lib/components/SlideCarousel.svelte @@ -3,6 +3,7 @@ let activeIndex = $state(0); let isFullscreen = $state(false); + let isExpanded = $state(false); // Default to hidden (collapsed) let carouselEl = $state(null); function next() { @@ -33,8 +34,13 @@ } } + function toggleExpand() { + isExpanded = !isExpanded; + } + // Keyboard navigation function handleKeydown(e: KeyboardEvent) { + if (!isExpanded && !isFullscreen) return; if (e.key === 'ArrowRight') next(); if (e.key === 'ArrowLeft') prev(); if (e.key === 'f' || e.key === 'F') toggleFullscreen(); @@ -45,76 +51,137 @@ if (typeof document !== 'undefined') { document.addEventListener('fullscreenchange', () => { isFullscreen = !!document.fullscreenElement; + if (isFullscreen) isExpanded = true; }); } -