feat(registry): add the kinetic type ring block - #23
Merged
Merged
Conversation
The preview page centred every block in a `min-h-svh` column, so one that sizes itself off its parent had no height to read and sat in a band of page background. A single `1fr` row offers the screen height instead of imposing it: `items-center` leaves a block at the height its content asks for, centred as before, while one that sets `h-full` resolves against the row and fills the screen.
A phrase wrapped once around a ring built in real 3D. Every glyph is measured and given an arc as wide as the letter itself, so `I` and `W` space evenly, and the type size is solved from the stage so the loop closes at any width — a `ResizeObserver` re-solves it on any box change. Nothing starts until a solve lands. The first paint usually beats layout, and gating the intro on that is what keeps it from playing to an empty stage. The solve owns the outer span's transform and GSAP owns the glyph inside it, so a re-solve mid-intro cannot wipe a tween. A dot falls, squashes on impact and pulls the letters out of a blur in a sweep that rolls round from the one nearest the camera. After that the ring idles; drag, scroll and the arrow keys add spin that decays back to the idle rate, and the dot swells or shrinks with the push.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds Kinetic Type Ring, a block whose phrase is wrapped once around a ring built in real 3D.
The block
Every glyph is measured and given an arc as wide as the letter itself, so
IandWspace evenly rather than sitting on a fixed grid. The type size is solved from the stage so the loop closes at any width, and aResizeObserverre-solves on any box change — the ring fills the same share of the stage on a phone as in a full-width hero.A dot falls, squashes on impact, and pulls the letters out of a blur in a sweep that rolls round from the one nearest the camera. After that the ring idles; drag, scroll and the arrow keys add spin that decays back to the idle rate, and the dot swells or shrinks with the push.
Two things worth calling out in review:
Under
prefers-reduced-motion: reducethe ring is laid out and shaded, the dot sits in the middle, and nothing moves. The ring itself isaria-hidden— the phrase reaches screen readers once from a visually-hidden paragraph instead of letter by letter — and the stage is focusable with the arrow keys doing what dragging does.Preview page
The preview page centred every block in a
min-h-svhcolumn, so a block that sizes itself off its parent had no height to read and sat in a band of page background. It now uses a single1frrow, which offers the screen height instead of imposing it:items-centerleaves every other block at the height its content asks for, centred exactly as before.Checks
pnpm registry:build— generated files committed, no driftpnpm typecheckpnpm test— 795 passing, 9 of them newpnpm build