Inspiration
Everyone has that one email. You read it, meant to answer "later", and now you can't open your inbox without a small wave of guilt. Inbox anxiety already feels like a haunting, so for the Costume Contest I made it literal: an email client whose interface rots the longer you ignore people.
What it does
Cursed Inbox shows your unanswered email by candlelight. Each message ages in real time and decays as it ages. Its row turns sepia and blurs, blood drips from the top edge, cracks spread, and the text corrupts into glyphs. After 21 days a message rises: it twitches at the top of the list and its sender starts whispering at you. As the whole house gets more haunted, a heartbeat speeds up and the candle shrinks.
The only way out is to answer. When you reply, the letter burns into embers that fly to the Graveyard, where it becomes a tombstone showing how long you made it wait.
There are two modes:
- Haunt my Gmail: sign in with Google and your real inbox haunts you. It re-syncs every 20 seconds. New mail slides in, threads you answer in Gmail are buried automatically, and a sender who writes again comes back from the grave. Replies are saved as Gmail drafts in the right thread and are never sent for you.
- Demo house: 12 fictional emails on a fast clock where one second is one hour. They include an overdue Necronomicon for Beginners, Grandma's three-sleeved sweater, and a calendar invite to your own funeral.
How I built it
It's plain HTML, CSS and JavaScript, with no framework, no build step and no backend. Everything runs in the browser.
Each email has one number, its decay:
$$d = \min\left(1,\ \frac{t_{\text{waiting}}}{504\ \text{h}}\right)$$
JavaScript writes $d$ into a CSS custom property --d on each row, and CSS turns it into every visual effect: filters, tilt, drips, cracks and parchment stains. Adding a new effect usually needs only CSS.
The house's overall haunt level is the average decay across all emails, with answered ones counting as zero:
$$H = \frac{1}{N}\sum_{i=1}^{N} d_i$$
$H$ drives the red vignette, the title glitch, the candle radius $r = \max(170,\ 340 - 170H)$ px and the heartbeat interval $T = 1.5 - 0.85H$ seconds.
Once $d > 0.15$, each character of a message is corrupted with probability $p = 0.45\,(d - 0.15)$. The random choices come from a seeded generator (mulberry32 over a hash of the message ID). The same seed always gives the same sequence, so the damage grows steadily instead of flickering every second.
The sound is generated live with the Web Audio API, so there are no audio files. The drone is three detuned sawtooth oscillators through a low-pass filter, and a lookahead scheduler plays the heartbeat.
Gmail mode uses Google Identity Services in the browser with the gmail.readonly and gmail.compose scopes. The access token stays in memory only. Each sync lists recent threads and caches them by historyId, so a quiet inbox costs one request per sync.
The repo includes a Kiro spec (requirements in EARS format, a design doc and a task list), steering files for tone and code conventions, and agent hooks that run on save. The hooks check for unsafe DOM writes and off-tone sample emails.
Challenges I ran into
- Defining "waiting on you." Gmail has no such flag. A thread counts if any message arrived after my last sent reply, and drafts don't count as replies. The clock starts at the first unanswered message, so a sender writing again doesn't reset it.
- Building drafts by hand. The Gmail API takes a raw RFC 2822 message. I had to get threading right (
In-Reply-To,References) and encode emoji in subjects as MIME encoded-words. I also strip newlines from header values, so a crafted address can't inject extra headers. - Lost clicks. When an email rose, the list was rebuilt, and a click in progress could land on the wrong letter. Now the existing rows are moved into the new order instead of rebuilt.
- Keeping horror readable. Too much decay makes the inbox unusable. Corruption starts at 15% and cracks at 45%. You can blow out the candle with
L, and reduced-motion settings turn off all animation.
What I learned
- One CSS variable per element is a powerful way to drive a whole visual system from very little JavaScript.
- Seeded randomness makes procedural effects feel deliberate instead of noisy.
- Gmail's thread model and MIME encoding are full of edge cases, and offline tests with stubbed API responses caught bugs before I touched a real inbox.
- Restraint matters. The scariest moments are slow ones, like a whisper drifting past or text that's slightly wrong.
What's next
- Outlook support
- A shared haunted house for team inboxes, where everyone sees the same ghosts
- Sending replies directly, with a confirmation step
Before you paste it, check these:
- "I" or "we": I wrote it in first person singular. Change it to "we" if you're on a team.
- The Kiro paragraph: it only says the Kiro files are in the repo, because I wrote them after the code. If the rules ask how you used Kiro, describe what you actually did in Kiro. Don't claim more than that, because judges may check.
- Gmail mode: both Gmail sections describe a feature that needs the client ID in config.js. If Gmail sign-in isn't working by the deadline, cut those parts so judges don't try something that fails.
Built With
- canvas
- css3
- gmail-api
- google-fonts
- google-identity-services
- html5
- javascript
- kiro
- localstorage
- node.js
- oauth2
- web-audio-api
- web-speech-api