"use client";
import { useEffect, useState } from "react";
import { HeroTilt } from "./hero-tilt";
const BOOT_LINES = [
"> initializing eldov.win...",
"> loading context bus...",
"> scanning fleet...",
"> ready.",
];
const ROTATING = [
"Self-Hoster",
"Bot-Bauer",
"Multi-Agent-Fleet-Owner",
"Open-Source-Themer",
"Casino-Bot-Dev",
"Prediction-Market-Trader",
];
export function HeroBanner({ dict, heroImage }: { dict: { kicker: string; title: string; lede: string; cta: { title: string; body: string } }; heroImage: string }) {
const [lineIdx, setLineIdx] = useState(0);
const [typed, setTyped] = useState("");
const [done, setDone] = useState(false);
const [rotIdx, setRotIdx] = useState(0);
// Boot-Animation: zeilenweise tippen, 280ms pro Zeile.
useEffect(() => {
if (lineIdx >= BOOT_LINES.length) { setDone(true); return; }
const line = BOOT_LINES[lineIdx];
let i = 0;
const id = setInterval(() => {
i += 1;
setTyped(line.slice(0, i));
if (i >= line.length) {
clearInterval(id);
setTimeout(() => {
setLineIdx((v) => v + 1);
setTyped("");
}, 380);
}
}, 24);
return () => clearInterval(id);
}, [lineIdx]);
// Rotating titles (für die Unterzeile), 2.5s pro Wort.
useEffect(() => {
if (!done) return;
const id = setInterval(() => setRotIdx((v) => (v + 1) % ROTATING.length), 2500);
return () => clearInterval(id);
}, [done]);
return (