diff --git a/app/components/tvone-hero.tsx b/app/components/tvone-hero.tsx index 6abd37e..7559439 100644 --- a/app/components/tvone-hero.tsx +++ b/app/components/tvone-hero.tsx @@ -1,136 +1,76 @@ "use client"; import Image from "next/image"; -import { useState, useEffect } from "react"; +import { useState } from "react"; const slides = [ { id: 1, tag: "MÚSICA", - title: "Diddy na XB Label? Gerilson Israel responde após anúncio de lançamento de nova música em conjunto.", + title: + "Diddy na XB Label? Gerilson Israel responde após anúncio de lançamento de nova música em conjunto.", byline: "Por Redação — 24 de Março, 2025", - image: "https://images.unsplash.com/photo-1493225457124-a3eb161ffa5f?w=1400&q=80", + image: + "https://images.unsplash.com/photo-1493225457124-a3eb161ffa5f?w=1400&q=80", }, { id: 2, tag: "CULTURA", title: "Festivais de verão: calendário completo e bilhetes à venda esta semana.", byline: "Por Equipa tvone — 23 de Março, 2025", - image: "https://images.unsplash.com/photo-1459749411175-04bf5292ceea?w=1400&q=80", + image: + "https://images.unsplash.com/photo-1459749411175-04bf5292ceea?w=1400&q=80", }, { id: 3, tag: "TV", title: "Novas séries internacionais chegam às plataformas — o que não pode perder.", byline: "Por Redação — 22 de Março, 2025", - image: "https://images.unsplash.com/photo-1522869635100-9f4c5e86aa37?w=1400&q=80", + image: + "https://images.unsplash.com/photo-1522869635100-9f4c5e86aa37?w=1400&q=80", }, ]; export function TvoneHero() { const [active, setActive] = useState(0); - const [isPaused, setIsPaused] = useState(false); - - // --- AUTO-PLAY LOGIC --- - useEffect(() => { - if (isPaused) return; - - const interval = setInterval(() => { - setActive((prev) => (prev + 1) % slides.length); - }, 3000); // 3 Seconds - - return () => clearInterval(interval); - }, [isPaused, active]); + const slide = slides[active]!; return ( -
setIsPaused(true)} - onMouseLeave={() => setIsPaused(false)} - > - - {/* --- SMOOTH BACKGROUND CROSSFADE --- */} -
- {slides.map((s, i) => ( -
- +
+
+ +
+
+ + {slide.tag} + +

+ {slide.title} +

+

{slide.byline}

+
+
+
+ {slides.map((s, i) => ( +
- ))} -
-
- -
-
- -
- {/* Main Image Crossfade */} - {slides.map((s, i) => ( - {s.title} - ))} - -
- - {/* Text Content */} -
-
- - {slides[active].tag} - -
- -

- {slides[active].title} -

- -

- - {slides[active].byline} -

-
-
- - {/* iOS Floating Control Bar */} -
- -
+ ))}
); -} \ No newline at end of file +}