Gyre
- group .........
- Text effects
- source ........
- https://ui.aryank.space/components/gyre
- markdown ......
- /lab/gyre.md
- human .........
- /lab/gyre
── WHAT_IT_IS ────────────────────────────────────────────────────────────────────────────────
Your words in extruded iridescent foil, running round the edge of their box, ring behind ring, until the deeper rings fade into black. Resize the box and the rings re-fit live, picking how many copies of the phrase close one lap. Move the pointer and the rings shift in parallax; scroll the wheel to push them faster. The words, separator, letter size, depth, bevel, ring spacing, lens, seven foil colours, glints, glow and grain are all props, with a light mode alongside the dark default. Three.js with opentype.js glyphs, one instanced shader, bloom and film grain.
── BEHAVIOUR ────────────────────────────────────────────────────────────────────────────────
* Every ring is the same rectangle further away
The CPU sends each letter instance three numbers: arc position, ring and scale. The vertex shader walks a rounded rectangle to that position, bends the letter along the tangent, and pushes ring k back to depth d0 times q to the k. So the rings shrink geometrically into the fog without any per-ring layout.
* The phrase always closes the loop
From the letter size the engine solves for how many copies of the phrase fit exactly one lap. On resize it keeps the count until another one fits clearly better, then eases between counts while holding the reading position on the nearest copy.
* Two cuts per letter
The front three rings use a finer cut, seven curve segments, a three-step bevel and tessellated faces so the bend stays smooth. Deeper rings use a three-segment cut. Glyphs are extruded once and drawn instanced, about 300k triangles in a 820 by 560 box.
* Kerning comes from the font
Outlines, cap height and kerning pairs are read with opentype.js, which is why it is a dependency. Three's FontLoader format has no kerning table.
* It pauses itself
The loop stops while the box is off screen or the tab is hidden, and wakes on resize, pointer, wheel or a theme change.