-
01 · 20 Nov
We started with CSS 3D
The stack of layers was built twice, in CSS 3D and in WebGL, and both were measured: 60 frames per second each.
CSS 3D won. It weighed 0.5 KB, not 4.1, and the text stayed HTML: sharp, selectable and readable by a screen reader.
-
02 · 1 Dec
Until the camera had to go in
To tell the MES, the camera had to go into the line: 3D machines, up close and moving.
In CSS 3D, every face of every box is an element the browser sorts and composites on every frame. One runner is easy; with the crowd, the frames drop. Next to this, measured now: as you scroll down, the camera goes into the crowd.
-
03
three.js did not fit the budget
The usual way out is three.js. But a page’s scene has a budget of 80 KB compressed, and the whole of three.js weighs 167.
Either the budget holds or the change does not ship.
-
04
WebGL 2, written by hand
Only what was needed, with no library: boxes with three tones depending on where each face points, and edges that open on screen with their own smoothing. The whole MES flow weighs 18 KB.
The same crowd, the same zoom: 60 frames per second.
-
05
The best of both
Today they live together. The plates of the shorts are still CSS 3D, with their text in HTML; what is inside them (the line, the hospital game, the MES flow) is WebGL, and every frame it follows its plate’s matrix.
The thin lines are not painted on the plates either: a canvas draws them on top, sharp at any angle.
KB gzipped
This is HTML: sharp and selectable, on top of the WebGL.
CSS 3DWebGL · — frames per second · slowest, — ms