diff --git a/client/src/components/slideshow/RecipeSlideshow.tsx b/client/src/components/slideshow/RecipeSlideshow.tsx index 93333bd..893ef40 100644 --- a/client/src/components/slideshow/RecipeSlideshow.tsx +++ b/client/src/components/slideshow/RecipeSlideshow.tsx @@ -19,7 +19,7 @@ type RecipeSlideshowProps = { export function RecipeSlideshow({ recipes }: RecipeSlideshowProps) { // emblaRef kobler Embla opp til vinduet, også brukes emblaAPI til å styre slideshowet. const [emblaRef, emblaApi] = useEmblaCarousel({ loop: true }, [ - Autoplay({ delay: 5000, stopOnMouseEnter: true, stopOnFocusIn: true}), + Autoplay({ delay: 5000, stopOnMouseEnter: true, stopOnFocusIn: true, stopOnInteraction: false}), ]); // Husker hvilken av sidene i slideshowet som vises, sånn at riktig prikk blir farget inn. const [selectedIndex, setSelectedIndex] = useState(0); @@ -51,7 +51,7 @@ export function RecipeSlideshow({ recipes }: RecipeSlideshowProps) { }, [emblaApi]); return ( -
+
{/* Vinduet: det skjuler slidene som ikke vises */}
{/* Raden med alle slidene som Embla flytter sidelengs */} @@ -59,24 +59,31 @@ export function RecipeSlideshow({ recipes }: RecipeSlideshowProps) { {recipes.map((recipe) => ( // Én slide som bruker hele bredden i vinduet
-
-
-
+
+
UKENS OPPSKRIFT
-

{recipe.title}

-

{recipe.description}

-
-

{recipe.prepTimeMinutes} min

-

{recipe.servings} porsjoner

+
+
+ UKENS OPPSKRIFT +
+

{recipe.title}

+

{recipe.description}

+
+

{recipe.prepTimeMinutes} min

+

{recipe.servings} porsjoner

-
    +
      {recipe.tags.map((tag) => ( -
    • +
    • {tag.name}
    • ))} @@ -84,7 +91,7 @@ export function RecipeSlideshow({ recipes }: RecipeSlideshowProps) { Se oppskrift
{/* Tomt alternativ for bildet, ettersom tittelen allerede står rett ved siden av bildet. */} - +
))} @@ -96,7 +103,7 @@ export function RecipeSlideshow({ recipes }: RecipeSlideshowProps) { type="button" aria-label="Forrige oppskrift" onClick={() => emblaApi?.scrollPrev()} - className="absolute left-0 top-1/2 -translate-y-1/2 flex h-12 w-12 items-center justify-center rounded-full bg-background/80 hover:bg-background focus-visible:outline-2 focus-visible:outline-primary" + className="absolute left-0 top-1/2 -translate-y-1/2 hidden md:flex h-12 w-12 items-center justify-center rounded-full bg-background/80 hover:bg-background focus-visible:outline-2 focus-visible:outline-primary" > @@ -104,7 +111,7 @@ export function RecipeSlideshow({ recipes }: RecipeSlideshowProps) { type="button" aria-label="Neste oppskrift" onClick={() => emblaApi?.scrollNext()} - className="absolute right-0 top-1/2 -translate-y-1/2 flex h-12 w-12 items-center justify-center rounded-full bg-background/80 hover:bg-background focus-visible:outline-2 focus-visible:outline-primary" + className="absolute right-0 top-1/2 -translate-y-1/2 hidden md:flex h-12 w-12 items-center justify-center rounded-full bg-background/80 hover:bg-background focus-visible:outline-2 focus-visible:outline-primary" >