// Format for day display const day = time.getDate().toString().padStart(2, "0"); const month = (time.getMonth() + 1).toString().padStart(2, "0"); const colorMap = { greenClassic: { dark: { digits: "text-green-400", background: "bg-green-950", glow: "shadow-[0_0_10px_rgba(74,222,128,VAR)]", border: "border-green-700", inner: "bg-black" }, light: { digits: "text-green-600", background: "bg-green-100", glow: "shadow-[0_0_10px_rgba(74,222,128,VAR)]", border: "border-green-400", inner: "bg-white" } }, purpleTeal: { dark: { digits: "text-teal-400", background: "bg-purple-900", glow: "shadow-[0_0_10px_rgba(45,212,191,VAR)]", border: "border-purple-600", inner: "bg-black" }, light: { digits: "text-purple-600", background: "bg-teal-100", glow: "shadow-[0_0_10px_rgba(147,51,234,VAR)]", border: "border-teal-400", inner: "bg-white" } }, pinkTeal: { dark: { digits: "text-pink-500", background: "bg-teal-900", glow: "shadow-[0_0_10px_rgba(236,72,153,VAR)]", border: "border-teal-700", inner: "bg-black" }, light: { digits: "text-teal-600", background: "bg-pink-100", glow: "shadow-[0_0_10px_rgba(13,148,136,VAR)]", border: "border-pink-400", inner: "bg-white" } }, pinkPurple: { dark: { digits: "text-pink-400", background: "bg-purple-950", glow: "shadow-[0_0_10px_rgba(236,72,153,VAR)]", border: "border-pink-500", inner: "bg-black" }, light: { digits: "text-purple-600", background: "bg-pink-100", glow: "shadow-[0_0_10px_rgba(147,51,234,VAR)]", border: "border-pink-400", inner: "bg-white" } }, yellowPink: { dark: { digits: "text-yellow-300", background: "bg-gray-900", glow: "shadow-[0_0_10px_rgba(250,204,21,VAR)]", border: "border-pink-500", inner: "bg-black" }, light: { digits: "text-gray-800", background: "bg-yellow-100", glow: "shadow-[0_0_10px_rgba(31,41,55,VAR)]", border: "border-pink-400", inner: "bg-white" } }, neonGreen: { dark: { digits: "text-[#0CFF0C]", background: "bg-black", glow: "shadow-[0_0_10px_rgba(12,255,12,VAR)]", border: "border-[#FF7F7F]", inner: "bg-black" }, light: { digits: "text-[#00AA00]", background: "bg-gray-100", glow: "shadow-[0_0_10px_rgba(0,170,0,VAR)]", border: "border-[#FFA3A3]", inner: "bg-white" } } }; const colors = colorMap[settings.colorScheme]?.[settings.theme] || colorMap.pinkTeal.dark; const glowValue = colors.glow.replace("VAR", settings.glowIntensity.toString()); // Function to update a single setting const updateSetting = (key, value) = { setSettings(prev = ({ ...prev, [key]: value })); }; return (
{/* Main clock container */}
{/* Clock */}
className={`${colors.digits} text-6xl leading-none tracking-wider font-normal`} style={{ fontFamily: "'DSEG7', monospace", letterSpacing: '0.05em' }} {hours} motion.span animate={{ opacity: blinkState ? 1 : 0.3 }} transition={{ duration: 0.3 }} className="inline-block mx-1" : /motion.span {minutes}
{!settings.use24HourFormat && ( span className={`${colors.digits} ml-2 text-3xl align-top`} style={{ fontFamily: "'DSEG7', monospace" }}{ampm} )}
{settings.showSeconds && (
: {seconds}
)} {settings.displayDate && (
{day}-{month}
)}
button onClick={() = setShowMenu(!showMenu)} className="h-4 w-4 rounded-full bg-gray-500 hover:bg-gray-400 active:bg-gray-600 transition-colors duration-150 cursor-pointer" aria-label="Settings"
{/* 90s Style Menu */} {showMenu && ( div ref={menuRef} className="absolute top-[105%] left-0 right-0 w-full bg-gray-200 border-4 border-gray-700 rounded-md shadow-lg z-10" style={{ boxShadow: '0 4px 8px rgba(0,0,0,0.5), inset 1px 1px 0px #fff, inset -1px -1px 0px #888', }}
Settings
{/* Color Scheme */}
{/* Toggle Settings */}
{/* Theme Toggle */}
className={`w-10 h-5 ${settings.theme === 'dark' ? 'bg-blue-500' : 'bg-gray-400'} rounded-sm relative cursor-pointer`} style={{ boxShadow: 'inset 1px 1px 3px rgba(0,0,0,0.3)' }} onClick={() = updateSetting('theme', settings.theme === 'dark' ? 'light' : 'dark')}
className={`absolute w-4 h-4 bg-white border border-gray-400 rounded-sm transition-transform ${settings.theme === 'dark' ? 'translate-x-5' : 'translate-x-0'}`} style={{ boxShadow: '0 1px 2px rgba(0,0,0,0.3)', top: '1px', }}
{/* 24 Hour Format */}
updateSetting('use24HourFormat', !settings.use24HourFormat)} >
{/* Show Seconds */}
updateSetting('showSeconds', !settings.showSeconds)} >
{/* Show Date */}
updateSetting('displayDate', !settings.displayDate)} >
{/* Glow Intensity Slider */}

Glow Intensity:

{settings.glowIntensity.toFixed(1)}
{/* OK Button */}
)} {/* Font loading - inline to ensure it works */}
style dangerouslySetInnerHTML={{ __html: ` @font-face { font-family: 'DSEG7'; src: url('https://cdn.jsdelivr.net/npm/dseg@0.46.0/fonts/DSEG7-Classic/DSEG7Classic-Regular.woff2') format('woff2'); font-weight: normal; font-style: normal; font-display: block; } input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; background: white; border: 1px solid #666; border-radius: 0; box-shadow: 0 1px 2px rgba(0,0,0,0.3); cursor: pointer; } input[type=range]::-moz-range-thumb { width: 16px; height: 16px; background: white; border: 1px solid #666; border-radius: 0; box-shadow: 0 1px 2px rgba(0,0,0,0.3); cursor: pointer; } `}} />
); }