red finch/dev, home
← All projects

MattressBuilder

Preview

Web app

A website for designing your own mattress in 3D. You stack layers of wool, latex, foam and coils, drag them into the order you want, and watch the bed change as you go.

A prototype, and nothing is for sale. The 3D builder from June 2026 is online again since 5 November 2026, without the claims its first pages made. The planner that replaced it in July has its own address now.

What it is

A mattress is a stack of layers inside a zip cover: a support core of coils or firm foam at the bottom, softer latex or foam on top. Small online shops sell each of those layers on its own, and some people use them to build their own beds. MattressBuilder is a prototype of a site for designing one before you buy.

It has three pages. The home page explains the idea. A survey asks five or six questions about how you sleep and puts together a starting stack as you answer. The builder then shows that stack in 3D.

The builder has seven kinds of layer: a quilted cover, wool, latex, memory foam, pocketed coils, base foam and a wood foundation. You can add, remove and swap them, pick a thickness for latex and foam, and choose Twin, Queen or King. On a desktop you can pick a layer up in the 3D view and drag it to a new place in the stack. In June a list beside it priced each layer and kept a running total.

Nothing was ever for sale, and those prices were round numbers typed into the code, not quotes from any shop. That first version was online for six weeks. Then I rebuilt the site as a plainer planner on real parts and real prices. On 5 November 2026 I put the 3D builder back at mattressbuilder.redfinch.dev, without the prices and without the claims its first pages made, and gave the planner its own address.

What it looked like

  • The builder page. A panel on the left lists the layers, each with a menu for its material and arrows to move it. Beside it a mattress is drawn in 3D as separate layers with numbered badges: a quilted cover, wool, two slabs of latex, a row of coils, base foam and a wood foundation. A card below describes how the build will feel.
    The builder in June 2026. Every layer is drawn in the browser, and the coil layer alone is 126 cylinders. The card at the bottom wears an AI badge, but a fixed scoring rule wrote it.
  • The survey page. On the left a chat titled Sleep concierge asks how you sleep and what feel you are after, with a button for each answer. On the right a panel titled Your build, taking shape shows five layers as coloured bars, from a quilted cover down to a wood foundation.
    The survey. It reads like a chat, and the build on the right changes with each answer.

Why I started it

MattressBuilder starts from one complaint. It is hard to find out what is inside a brand-name mattress and what those parts cost. The parts are not secret, though. Shops sell them openly, by thickness and firmness, at prices anyone can look up.

A bed built from loose layers is also not glued shut. If one layer wears out or turns out too firm, you replace that layer and keep the rest.

My plan from December 2025 gave one more reason. Few people knew you could buy a mattress this way at all. So the first job in the plan was a site that made it easy to see what you were building.

The plan was to start as a front door. The site would pass each order to an existing shop, and later it would make its own layers. It never got that far.

How it got here

This is the oldest idea on this site. It spent a year as sketches and plans before it was a page anyone could open.

  1. June 2025First sketches. Three static mockups and a logo, then four prototypes that drew the layers with CSS.
  2. December 2025A three-page plan for the business. It already describes the site: a chat that helps you choose, and a page where you drag layers and see what they cost.
  3. April 2026The first builder in Three.js, a library for 3D in the browser. 3,055 lines in one file, from about a day of sessions with Claude.
  4. May 2026A repository, the survey, and a catalog of seven layer types. Several experiments stayed on side branches.
  5. 13 June 2026Online at mattressbuilder.redfinch.dev. The next day took 15 commits and 30 releases to make it work on a phone.
  6. 25 July 2026Replaced by the planner, a rebuild on a catalog of real parts.
  7. 5 November 2026Back at mattressbuilder.redfinch.dev, with the untrue claims and the prices taken out. The planner moves to its own address.

The hard parts

A 3D view that works on a phone

On the day after launch the builder turned out to be unusable on a phone. The 3D view took only mouse input. Layers moved by drag and drop, which a touch screen does not support. The canvas also took its size from the wrong box, so the mattress was drawn 686 pixels wide and 2,596 tall, then squeezed into a view of 343 by 320.

Fixing the shape showed the next problem. The camera was set up for a wide screen, so on a phone the bottom of the stack was cut off. The fix made the camera's distance and height follow the shape of the canvas. It overcorrected: in the version that went offline in July the top of the stack was cut off on a phone instead. The version online now, and the 3D view on this page, keep the whole stack in the frame.

Phones also got arrow buttons to move a layer, pinch to zoom, and a bar at the bottom that kept the price in view while you changed the stack.

A builder nobody could reach

For its first 28 hours online, every link to the builder led back to the home page. The links pointed at a file the host had been told to skip, and the host answered any unknown address with the home page.

The same fix made the survey's result arrive. Until then the builder ignored it and opened its default stack.

Pages that said things that were not true

The first pages promised free shipping, a 100-night trial and a lifetime warranty. They showed three customer reviews and a monthly payment price. Two features wore an AI badge and ran on fixed rules. None of this was real. AI agents wrote the pages, and where a fact was missing they wrote what a mattress site usually says.

Nothing was for sale, so nobody paid for a promise. But the site was public for six weeks with those lines on it. One was caught at launch: the sign-up form said a copy had been emailed, and no email was ever sent.

The 3D builder that is online again has none of those lines. Each of its pages says it is a prototype from June 2026 and that nothing is for sale. It shows no prices and asks for no email address.

The rebuild started from one rule: never estimate a price. Every price in it was read from a shop's own page.

Work that never reached the main branch

In May most of the work happened on side branches, one for each session with an AI agent. They held a way to save designs, a coach panel, and a sign-in and email system. Four of those branches were never merged, and several more sessions left no commit at all.

So the builder that went online in June came from the plain version of 10 May. The link that carries a survey result into the builder was written three times, because the first two versions stayed on branches that were never merged. Most of that work exists only on my laptop.

Reduced motion that still moved

Some people set their device to cut down on animation. The first attempt to respect that changed the default length of every animation. But nearly every animation on the site set its own length, 17 of them in the builder alone, so everything still moved. The fix speeds up the whole timeline, so each animation ends at once.

The planner that followed

In July 2026 I rebuilt the site from scratch as a planner. It dropped Three.js and draws the stack with CSS. Its catalog holds 221 parts and 1,315 prices from seven shops, each read from the shop's own page on 25 July 2026, and its result is a parts list you can order from.

The planner is at mattressbuilder-planner.web.app. I have not updated its catalog since July, so many of its prices will have changed.

What it ran on

This is what the 3D builder ran on when it was first online, from 13 June to 25 July 2026. The version online now is the same three pages, with the sign-up, the prices and the untrue lines taken out.

LayerWhatNotes
PagesThree HTML pages, each with its CSS and JavaScript inside7,300 lines in all. No framework and no build step.
3D viewThree.js r128Every layer is a box with a texture drawn in the browser. No image or model file is loaded.
MotionGSAP 3.12.5Layers fly into place, and the stack opens and closes.
CatalogOne JavaScript fileSeven layer types with their colours, thicknesses and placeholder prices.
SurveyPlain JavaScriptOne function of fixed rules turns the answers into a stack. No model is called.
Sign-upsFirestoreAn email address and the build, written once. Nobody can read them from a browser, and nothing was ever sent.
HostingFirebase HostingGitHub Actions deployed each push to the main branch.
BackendFastAPI and SQLiteWritten for a chat with a real model behind it. Never deployed.
TestsNone automatedChecked by hand and by agent passes in a browser.
days online in June and July 2026
42
releases
31
commits in this first site, on every branch
32
lines in the three pages
7,300

Counts read from the repository and the hosting record on 5 Nov 2026.

Other projects

  • A music ranking and concert discovery app. You sort the music you love into tiers, then use that crate to compare taste with friends and find concerts by those artists near you.

    App · iOS · Android · Web

    2,380 commitssince Jun 2026
  • Crate ingest pipeline

    In development

    A pipeline that finds concerts on the venues' and promoters' own pages and in the ticketing feeds, and turns them into one clean record for each show. I am building it to feed the concert listings in The Crate, and later to offer as a dataset of its own.

    Data pipeline

    570 commitssince Oct 2026
  • A phone app that works like a light on your porch. Turn your light on when you're up for company, and the friends who see it can knock or text you.

    App · Android · iOS in review

    539 commitssince Sep 2026