'use client'; import React, { useEffect, useState } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import Image from 'next/image'; export function InitialLoader({ shouldShowLoader = true }: { shouldShowLoader?: boolean }) { const [isLoading, setIsLoading] = useState(shouldShowLoader); const finishLoading = () => { // Set a session cookie so the server knows not to render the loader again document.cookie = "etib_initial_loader_v5=true; path=/; samesite=lax"; setIsLoading(false); }; useEffect(() => { if (!shouldShowLoader) return; // Just show the animation for a short time to allow UI to mount, // we don't preload 10MB videos anymore to save pagespeed! const timeout = setTimeout(() => { finishLoading(); }, 1200); // Cleanup return () => clearTimeout(timeout); }, [shouldShowLoader]); // Wenn wir serverseitig rendern und es nicht zeigen sollen, return null if (!shouldShowLoader) return null; return ( {isLoading && ( {/* Subtle grid background */}
{/* Deep Glow */}
{/* Single Masked Logo Container to prevent double-logo offset */}
{/* Base logo color (slightly dimmed to make the sweep visible) */}
{/* Sweeping intense white light */}
{/* Elegant Progress Bar */}
System Online
)} ); }