import React, { useState, useEffect } from 'react' import { LoadingScreen } from './LoadingScreen' import { HeartLogo } from './HeartLogo' // Using direct PNG logo on landing header interface LandingPageProps { onLogin: () => void } export function LandingPage({ onLogin }: LandingPageProps) { const [loading, setLoading] = useState(false) const [showLanding, setShowLanding] = useState(false) const [isStandby, setIsStandby] = useState(true) // false = LIVE, true = STDBY const [asciiArt, setAsciiArt] = useState('') const [isGlitching, setIsGlitching] = useState(false) // Note: Removed VN preview and ASCII features to focus on an Art Deco/Nouveau landing. // Auto-fade in landing page content after component mounts useEffect(() => { const timer = setTimeout(() => { setShowLanding(true) }, 500) // Delay before fading in content return () => clearTimeout(timer) }, []) // Removed VN dialogue preview / typing effect. // Load ASCII art for overlay in hero (right/bottom) useEffect(() => { fetch('/ascii/ascii1.txt') .then((res) => res.text()) .then((txt) => setAsciiArt(txt.replace(/\n+$/, ''))) .catch(() => setAsciiArt('')) }, []) // Occasionally trigger a brief glitch on the word "futurist" useEffect(() => { let armTimer: number | undefined let activeTimer: number | undefined let cancelled = false const arm = () => { // Random delay between glitches: 0.8s–2s (slightly punchier) const delay = 800 + Math.random() * 1200 armTimer = window.setTimeout(() => { setIsGlitching(true) // Glitch duration: 150ms–350ms (snappier) const dur = 150 + Math.random() * 200 activeTimer = window.setTimeout(() => { setIsGlitching(false) if (!cancelled) arm() }, dur) }, delay) } arm() return () => { cancelled = true if (armTimer) clearTimeout(armTimer) if (activeTimer) clearTimeout(activeTimer) } }, []) // Handle loading screen completion const handleLoadingComplete = () => { // Call the original onLogin immediately to transition to VN page // Don't reset loading states as we're leaving the landing page onLogin() } // Handle login button click const handleLogin = () => { setLoading(true) } // Removed ASCII art effects and rendering. return (
{ const img = (e.currentTarget as HTMLImageElement); img.onerror = null; img.src = '/logo/crane-logo.png'; }}
/>