import React, { useEffect, useState } from 'react'; import { useNavigate } from 'react-router-dom'; import { StorageService } from '../services/storageService'; import { UserProfile } from '../types'; import { Logo } from '../components/ui/Logo'; import { TypewriterLoop, TextReveal } from '../components/animations/TextReveal'; import { ArrowRight, Activity, Zap } from 'lucide-react'; const Greeting: React.FC = () => { const navigate = useNavigate(); const [profile, setProfile] = useState(null); const [showContent, setShowContent] = useState(false); const [showInteraction, setShowInteraction] = useState(false); const [showWish, setShowWish] = useState(false); useEffect(() => { const init = async () => { const p = await StorageService.getProfile(); if (!p) { navigate('/auth'); return; } setProfile(p); // Accelerated entrance sequence for better UX setTimeout(() => setShowContent(true), 100); // Trigger wish text setTimeout(() => { setShowWish(true); }, 1000); // Reveal the button much faster so it's not "missed" setTimeout(() => { setShowInteraction(true); }, 2000); }; init(); }, [navigate]); const handleEnter = () => { navigate('/'); }; if (!profile) return null; const firstName = profile.name.split(' ')[0]; // Time-based wish logic const hour = new Date().getHours(); const timeOfDay = hour < 12 ? "morning" : hour < 18 ? "afternoon" : "evening"; const wishText = `Wishing you a productive ${timeOfDay}.`; return (
{/* High-Resolution Dynamic Background Decor - Updated to Mountain Night */}
{/* Overlays - Darker for text legibility without boxes */}
{/* Massive Background Logo Watermark */}
{/* Top Status Indicators */}
Identity Verified
System Ready
{/* Logo Section */}
{/* Main Welcome Title */}

Welcome to Rudraksha

{/* Dynamic Greeting Text - Clean (No Box) */}
{/* Wish text */}
{showWish && (
)}
{/* Interaction Button - "START DAY" */}
{/* Interaction Hint */}
); }; export default Greeting;