Last active
October 23, 2025 17:23
-
-
Save Catevika/26aa3996f2bb8c463052e91f7fbf20a1 to your computer and use it in GitHub Desktop.
Revisions
-
Catevika renamed this gist
Oct 23, 2025 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
Catevika revised this gist
Oct 23, 2025 . 1 changed file with 54 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1,54 @@ import {useState} from 'react'; import {allCocktails} from '../constants'; const Menu = () => { const [currentIndex, setCurrentIndex] = useState(0); const totalCocktails = allCocktails.length; const goToSlide = (index: number) => { const newIndex = (index + totalCocktails) % totalCocktails; setCurrentIndex(newIndex); }; return ( <section id='menu' aria-labelledby='menu-heading'> <img src='/images/slider-right-leaf.png' alt='left-leaf' id='m-left-leaf' /> <img src='/images/slider-right-leaf.png' alt='right-leaf' id='m-right-leaf' /> <h2 id='menu-heading' className='sr-only'> Cocktail Menu </h2> <nav className='cocktail-tabs' aria-label='Cocktail Navigation'> {allCocktails.map((cocktail, index) => { const isActive = index === currentIndex; return ( <button key={cocktail.id} className={ isActive ? 'text-white border-white' : 'text-white/50 border-white/50' } onClick={() => goToSlide(index)}> {cocktail.name} </button> ); })} </nav> </section> ); }; export default Menu; -
Catevika created this gist
Oct 23, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ You know how to whistle, don't you, Steve? You just put your lips together and blow.