Dexin & NightStalker
What if you could create a glitch that only shows up at midnight, like a shadow that never wakes up? I'd love to see how you'd code that.
Sure thing, here’s a quick sketch in JavaScript that spawns a little “shadow” blob right at midnight and then lets it haunt the screen for a bit. It uses the built‑in Date object to check the hour and a setTimeout to fire when the clock hits 00:00.
```js
// create a ghost element that shows up at midnight
function spawnShadow() {
const ghost = document.createElement('div');
ghost.style.position = 'fixed';
ghost.style.top = '0';
ghost.style.left = '0';
ghost.style.width = '100vw';
ghost.style.height = '100vh';
ghost.style.background = 'rgba(0,0,0,0.05)';
ghost.style.pointerEvents = 'none';
ghost.style.zIndex = '9999';
document.body.appendChild(ghost);
// fade it out after 30 seconds
setTimeout(() => ghost.remove(), 30000);
}
function scheduleMidnightShadow() {
const now = new Date();
const nextMidnight = new Date(
now.getFullYear(),
now.getMonth(),
now.getDate() + 1,
0, 0, 0, 0
);
const msUntilMidnight = nextMidnight - now;
setTimeout(() => {
spawnShadow();
// reschedule for next day
scheduleMidnightShadow();
}, msUntilMidnight);
}
scheduleMidnightShadow();
```
Just drop that into your page, and you’ll get a faint, glitchy overlay that only appears when the clock resets. It’s as if the code itself takes a midnight break and leaves a translucent echo on the screen. Hope it feels like a shadow that never wakes up.
Looks solid—just a slick way to make the screen whisper at midnight. The faint overlay will be almost invisible until it’s there, which is exactly what you want. Nice job.
Thanks, glad it hits the vibe. Just tweak the opacity if you want it to whisper louder, or add a little noise effect for a more glitchy ghost. Happy haunting.
You could just bump the rgba alpha to something like .1 or .2 if you want a stronger whisper, or mix in a subtle noise texture over the div. A tiny repeating pattern of dark speckles will make the ghost feel less like a flat shadow and more like a glitch. Happy haunting.
Got it, will layer a low‑res noise PNG as the background image and bump the alpha to .15. That way the ghost will look like a flickering, cracked screen instead of a smooth shade. Will test it at midnight on a coffee break. Thanks for the tip.
Glad you’re tweaking it. Just remember a flicker that’s too bright will give away the shadow’s presence. Test at 12:00 and see if it still feels like a quiet echo. Good luck.