import { useNavigate } from "react-router-dom"; import { ArrowRight } from "lucide-react"; import React, { useState, useEffect, useRef } from "react"; import { useTheme } from "next-themes"; import { useQuery } from "@tanstack/react-query"; import Silk from "@/components/Silk"; import CountUp from "@/components/CountUp"; import { trackCtaClick } from "@/lib/analytics"; import { fetchProjects } from "@/lib/projects"; const SPARKLE_SVG = ( ); function DemoButtonLetters({ text }: { text: string }) { const chars = text.split(""); return ( <> {chars.map((char, i) => ( {char} ))} > ); } const FOUNDING_DATE = new Date("2026-01-25"); // Samstag, 25. Januar 2026 const Hero = () => { const navigate = useNavigate(); const { resolvedTheme } = useTheme(); const [companyAge, setCompanyAge] = useState(""); const secondBtnRef = useRef(null); // Projektzähler kommt live aus Gitea – gleicher queryKey wie im Abschnitt // „Projekte", react-query teilt sich den einen Request. const { data: projectsSnapshot } = useQuery({ queryKey: ["projects"], queryFn: ({ signal }) => fetchProjects(signal), staleTime: 5 * 60 * 1000, refetchOnWindowFocus: false, retry: 1, }); const projectCount = projectsSnapshot?.total ?? 10; useEffect(() => { const calculateAge = () => { const now = new Date(); const diff = now.getTime() - FOUNDING_DATE.getTime(); const totalSeconds = Math.floor(diff / 1000); const days = Math.floor(totalSeconds / (60 * 60 * 24)); const hours = Math.floor((totalSeconds % (60 * 60 * 24)) / (60 * 60)); const years = Math.floor(days / 365); const remainingDays = days % 365; if (years > 0) { setCompanyAge(`${years}J ${remainingDays}T ${hours}h`); } else { setCompanyAge(`${days}T ${hours}h`); } }; calculateAge(); const interval = setInterval(calculateAge, 60 * 60 * 1000); // Update every hour (only days/hours shown) return () => clearInterval(interval); }, []); // ── Silk-Hintergrund Farben ── const isDark = resolvedTheme === "dark"; // Silk: Hauptfarbe (Wellenspitzen) const silkColor = isDark ? "#6a6a6a" : "#ffffff"; // Silk: Zweite Farbe (Wellentäler) const silkColor2 = isDark ? "#000000" : "#c0c0c0"; // Silk: Rausch-Intensität const silkNoise = isDark ? 4 : 1.5; return ( {/* Silk animated background */} {/* Label */} Digitalisierung für KMU {/* Main Heading - Large Uppercase */} Wir digitalisieren Ihr Unternehmen {/* Subheadline */} Website, Automatisierung und vernetzte Prozesse – aus einer Hand. So wächst Ihr Unternehmen, ohne dass Ihr Team mehr Aufwand im Alltag hat. {/* CTA Buttons */} { trackCtaClick("Kostenlose Potenzialanalyse sichern", "hero"); navigate("/kontakt"); }} aria-label="Kostenlose Potenzialanalyse sichern" > { const el = document.getElementById("projects"); if (el) el.scrollIntoView({ behavior: "smooth" }); else navigate("/#projects"); }} aria-label="Projekte ansehen" > {SPARKLE_SVG} {/* Trust Line */} Für Unternehmen, die nicht stehen bleiben wollen. {/* Bottom Stats Row */} Projekte {companyAge} Am Markt Systemverfügbarkeit 🇩🇪 Serverstandort in Deutschland ); }; export default Hero;
Website, Automatisierung und vernetzte Prozesse – aus einer Hand. So wächst Ihr Unternehmen, ohne dass Ihr Team mehr Aufwand im Alltag hat.
Für Unternehmen, die nicht stehen bleiben wollen.