The page is a room

  • three.js
  • nonsense

We talk about web pages in the vocabulary of buildings. Content sits above the fold or below it. Every page has a footer, some have a sidebar, and when you link to a specific spot you drop an anchor. We navigate pages. We leave through an exit intent popup. The metaphor is architectural all the way down — and then we render the whole thing on a surface with the depth of a sheet of paper.

The screen you are reading this on is a plane. Two axes. The browser spends extraordinary effort maintaining that fiction: the z-axis exists, but it is rationed out in integers called z-index, and no matter how large a number you feed it, nothing ever comes out of the page or falls into it. The third axis is load-bearing in the metaphor and absent in the medium.

But the fiction is thinner than it looks. Every element on this page already has a position in three dimensions; the third coordinate just happens to be zero. A page is a room drawn flat — walls folded down like a cardboard box unglued and pressed under glass. Nothing in the spec says the box has to stay flat. The browser can rotate any element in 3D. It simply assumes you would never rotate the floor you are standing on.

Architects call the drawing of a building seen from directly above a plan. What you are looking at right now is a plan. You have been reading floor plans your entire life, one scroll at a time, standing outside them.

Some pages have a trapdoor. You just have to find the loose board.

← All posts