import { useState, FormEvent } from 'react'; interface Props { onLogin: () => void; } const PASSWORD = 'GoogleyBear2020!'; export default function LoginScreen({ onLogin }: Props) { const [input, setInput] = useState(''); const [error, setError] = useState(false); const [shake, setShake] = useState(false); const handleSubmit = (e: FormEvent) => { e.preventDefault(); if (input === PASSWORD) { sessionStorage.setItem('kira-auth', '1'); onLogin(); } else { setError(true); setShake(true); setTimeout(() => setShake(false), 500); setTimeout(() => setError(false), 2000); } }; return (
🌸

hey kayla!

enter the magic word ✨

{ setInput(e.target.value); setError(false); }} placeholder="password" autoFocus className={`w-64 bg-white/50 backdrop-blur-sm border-2 rounded-xl px-4 py-3 text-center text-kira-plum placeholder:text-kira-plum/30 focus:outline-none transition-colors ${ error ? 'border-red-400 bg-red-50/50' : 'border-kira-pink/30 focus:border-kira-pink' }`} /> {error && (
hmm, that's not it 💭
)}
); }