Building Nook: A Cozy Pixel-Art Pomodoro App
ProjectReactCanvasPixel ArtWeb AudioGamification

Building Nook: A Cozy Pixel-Art Pomodoro App

2026-11-18

I wanted a calm place to focus at work: a timer, a to-do list, some rain sounds, and nothing else competing for attention. Apps like Flocus get the mood right, so I started building my own version. Somewhere along the way it grew a second half: a tiny pixel-art room that you furnish with the minutes you spend focusing.

The result is Nook: a pomodoro dashboard on one side, and a little isometric room that grows with you on the other.

Try it live at nook-pomodoro.web.app.

The room in Nook: everything here was bought with focus minutesThe room in Nook: everything here was bought with focus minutes

The Dashboard

The first half is a classic focus dashboard: a pomodoro timer, tasks, notes, an ambience mixer, a music player for YouTube or Spotify links, and animated backgrounds. Every widget is a draggable glass card, so you can arrange the screen however you like. A small robot buddy watches your cursor, cheers when you finish a task, and notices when you wander off to another tab in the middle of a session.

The dashboard viewThe dashboard view

Two parts of it turned out to be more interesting than expected.

A timer that doesn't drift

The obvious approach, setInterval that subtracts one second each tick, breaks as soon as the tab goes into the background. Browsers throttle timers in inactive tabs, so a 25-minute session can quietly take 27. The fix is to count down against a deadline instead of counting ticks:

const start = () => { endAt.current = Date.now() + remaining * 1000 setRunning(true) } useEffect(() => { if (!running) return const id = setInterval(() => { setRemaining(Math.max(0, Math.round((endAt.current - Date.now()) / 1000))) }, 250) return () => clearInterval(id) }, [running])

A tick can be late, but it can never be wrong: whenever it fires, it reads the true time left.

Ambient sounds without a single audio file

I didn't want to ship megabytes of rain recordings, so every ambience sound is synthesized live with the Web Audio API. Everything starts from noise. White noise has equal energy at all frequencies and sounds harsh. Pink noise falls off at higher frequencies and sounds like steady rain. Brown noise falls off even more steeply and sounds like a deep rumble.

Brown noise is just a leaky random walk:

let last = 0 for (let i = 0; i < length; i++) { const white = Math.random() * 2 - 1 last = (last + 0.02 * white) / 1.02 data[i] = last * 3.5 }

To loop a noise buffer forever without an audible click at the seam, I generate a little extra and cross-fade the tail into the head, so the last sample flows straight into the first:

for (let i = 0; i < length; i++) { if (i < fade) { const t = i / fade out[i] = raw[i] * t + raw[length + i] * (1 - t) } else out[i] = raw[i] }

From there, each sound is a small audio graph:

  • Rain is pink noise through a band of filters, plus tiny randomly scheduled "drip" bursts.
  • Fireplace is low-passed brown noise for the rumble, plus short crackles that occasionally fire in clusters.
  • Ocean is brown noise whose volume is driven by a very slow oscillator (about one swell every 12 seconds).
  • Forest is soft noise with randomly timed bird chirps made from oscillators sweeping in pitch.

The Room: Isometric Pixel Art in Code

The second half started from a reference image of an isometric pixel-art shop, the kind of cozy diorama you see on r/PixelArt. I wanted something like that, but I also wanted it to change: new furniture, day and night, a character who reacts to the timer. Drawing every combination by hand wasn't realistic, so the whole room is drawn procedurally.

Projection

Isometric pixel art uses a 2:1 grid: moving one unit along an axis moves two pixels sideways and one pixel down. With world coordinates x, y (floor) and z (height), the projection is a single line:

const P = (x, y, z = 0) => [ Math.round(OX + x - y), Math.round(OY + (x + y) / 2 - z), ]

Everything is drawn onto a tiny 256×224 canvas, which is then scaled up 3–4× with image-rendering: pixelated so each pixel becomes a crisp square.

Why I wrote my own polygon fill

My first attempt used the normal canvas path API, ctx.fill(). Scaled up, it looked muddy: canvas anti-aliases polygon edges, so every slanted edge got a fringe of half-transparent pixels, and at 4× those turned into blurry smears.

So the painter fills shapes with its own scanline rasterizer: for every pixel row, find where the polygon's edges cross the row's center line and fill whole pixels between those crossings. Each pixel is either fully colored or not colored at all:

for (let row = minY; row < maxY; row++) { const yc = row + 0.5 const xs = [] for (const [[ax, ay], [bx, by]] of edges) { if ((ay <= yc && by > yc) || (by <= yc && ay > yc)) xs.push(ax + ((yc - ay) / (by - ay)) * (bx - ax)) } xs.sort((a, b) => a - b) for (let i = 0; i + 1 < xs.length; i += 2) ctx.fillRect(Math.round(xs[i]), row, Math.round(xs[i + 1]) - Math.round(xs[i]), 1) }

Furniture from boxes

Almost every object is built from one primitive: a shaded box. A box shows three faces (top, left and right), each a lighter or darker shade of a base color. Then come the two details that make it read as pixel art instead of flat shapes: a dark outline around the silhouette and a bright line along the top front edges, like light catching a bevel.

A desk is four legs, a drawer block and a tabletop. A bookshelf is a box with a dark recess and rows of thin, colored "books" painted onto its front face. Things are drawn back to front, sorted by how close they sit to the viewer, so nearer furniture naturally covers what's behind it.

Making it feel alive

The room redraws ten times per second, which leaves room for small touches:

  • The character types (with code scrolling on the screen) while you focus, stretches with a steaming mug on breaks, and dozes off with a floating z when the timer is idle.
  • The window shows the real sky: blue during the day, orange at dusk, stars at night. The wall clock keeps real time.
  • At night, the room dims with a dark blue overlay, and then every light source (lamp, monitor, fireplace, aquarium, neon sign) is added back on top using the lighter blend mode, so lights glow instead of being darkened.
  • The cat naps on the rug while you work and wakes up when you take a break.

The Night lab theme after dark: lights are added back on top of the dimmed roomThe Night lab theme after dark: lights are added back on top of the dimmed room

Turning Focus Into a Game

The room gives you a reason to come back, so the last piece was a simple economy. The key rule is that rewards only pay out when a focus session completes. Skipping doesn't count, and since coins scale with minutes, a 5-minute session can't out-earn a 25-minute one.

  • 1 coin and 1 XP per focus minute, and 3 coins per finished task.
  • Level n needs 25(n−1)225(n-1)^2 focus minutes, so levels arrive quickly at first and then spread out: one session gets you to level 2, a few days of work to level 4.
  • Daily streaks: your first session each day extends the streak and pays a bonus that grows with it, capped so a long streak doesn't break the economy:
function nextStreak(streak, today) { if (streak.last === today) return { count: streak.count, bonus: 0 } const count = streak.last === yesterday(today) ? streak.count + 1 : 1 return { count, bonus: 5 + 2 * Math.min(count, 10) } }

Best streaks of 3, 7, 14 and 30 days put bronze, silver, gold and diamond trophies on a shelf in the room.

The shop has 24 pieces of furniture, 4 room themes, and a wardrobe for the character: free colors and hair styles, plus accessories (glasses, headphones, cat ears, a wizard hat, a crown at level 8) that show up on the character at the desk.

The wardrobe: customize your character, then watch them wear it at the deskThe wardrobe: customize your character, then watch them wear it at the desk

What I Learned

  • Constraints make pixel art easier, not harder. A tiny canvas and a single box primitive pushed me toward a consistent style much faster than free-form drawing would have.
  • Synthesis beats samples for ambience. A few dozen lines of Web Audio replaced what would otherwise be large audio files, and the sounds never loop audibly.
  • Small rewards work. Watching a new plant appear in the corner after a 25-minute session is a surprisingly good reason to start the next one.

Update: A Room You Design Yourself

Since writing this, the room has grown into a small living world, inspired by Habbo Hotel and Stardew Valley:

  • Decorate freely. Drag furniture anywhere, rotate it, or put it back in storage, and pick from floors and wallpapers. Hovering anything in the shop previews it in your room first.
  • A character who lives there. They walk to the desk and work during focus. On breaks they water plants, make coffee, read, play guitar, or pet the cat and dog, using whatever furniture you've placed.
  • A world outside. The room sits on a snowy island in a pixel-art town at dusk, or under a starry night sky.

Next on the list: daily quests and a second room.