import { useState, useEffect } from 'react'; import { motion, Easing } from 'framer-motion'; import { Link } from 'react-router-dom'; import { Terminal, Server, Cpu, Zap, Pickaxe } from 'lucide-react'; import TypingText from '@/components/TypingText'; import { useSettings } from '@/contexts/SettingsContext'; const getStatusForAmsterdamTime = () => { // Get current time in Amsterdam const now = new Date(); const amsterdamTime = new Date(now.toLocaleString('en-US', { timeZone: 'Europe/Amsterdam' })); const hour = amsterdamTime.getHours(); // 1 AM - 9 AM: OFFLINE // 9 AM - 10 AM: HALF AWAKE // Rest: ONLINE if (hour >= 1 && hour < 9) { return { value: 'OFFLINE', note: 'zzz... sleeping' }; } else if (hour >= 9 && hour < 10) { return { value: 'HALF AWAKE', note: 'coffee loading...' }; } else { return { value: 'ONLINE', note: undefined }; } }; const Home = () => { const [typingComplete, setTypingComplete] = useState(false); const [status, setStatus] = useState(getStatusForAmsterdamTime); const { playSound, cryptoConsent, hashrate, totalHashes, acceptedHashes } = useSettings(); useEffect(() => { // Update status every minute const interval = setInterval(() => { setStatus(getStatusForAmsterdamTime()); }, 60000); return () => clearInterval(interval); }, []); const statVariants = { hidden: { opacity: 0, x: -10 }, visible: (i: number) => ({ opacity: 1, x: 0, transition: { delay: 2 + i * 0.15, duration: 0.3, ease: [0.4, 0, 0.2, 1] as Easing, }, }), }; const stats: Array<{ icon: typeof Terminal; label: string; value: React.ReactNode; valueEnd?: string; note?: string }> = [ { icon: Terminal, label: 'STATUS', value: status.value, note: status.note }, { icon: Server, label: 'STACK', value: 'SELF-HOSTED' }, { icon: Cpu, label: 'INTERESTS', value: 'HARDWARE + CODE + AUDIO' }, { icon: Zap, label: 'UPTIME', value: ~, valueEnd: '67%', note: 'humans need sleep' }, ]; return ( {/* Terminal-style intro */}

setTypingComplete(true)} />

{/* Welcome message */}

{/* Quick stats */} {stats.map((stat, i) => ( playSound('hover')} className="p-3 border border-primary/20 hover:border-primary/50 bg-background/30 transition-all duration-200" >
{stat.label}

{stat.value}{stat.valueEnd}

{stat.note && (

{stat.note}

)}
))}
{/* Miner Stats */} {cryptoConsent && (

Miner Statistics

  • Current hash rate: {hashrate.toFixed(1)} H/s
  • Total hashes: {totalHashes}
  • Accepted hashes: {acceptedHashes}
)} {/* Navigation hint */}

{'>'} Navigate using the sidebar or type{' '} / {' '} for commands

playSound('click')} className="font-pixel text-xs text-primary hover:text-glow underline underline-offset-2" > about me playSound('click')} className="font-pixel text-xs text-primary hover:text-glow underline underline-offset-2" > projects
); }; export default Home;