Repository navigation
fix(studio): keep the tilted hero member cards sharp - #337
Merged
Merged
Conversation
The hero member rows scrolled through a transform animation. The browser then draws each row once into a GPU layer, flat, and the compositor rotates it by 3 degrees and shifts it by fractions of a pixel at every frame. Both steps resample the bitmap, which blurs names, roles and photos. Pausing did not help: the layer stays while the animation exists. The hero rows now move through `left`, on a new `marquee-ultra-slow-painted` keyframe: the browser repaints them each frame inside the rotated space, with no layer to resample. Same speed, same path, same tilt and fades. `MarqueeTrack` takes this mode through a `painted` prop, so the companies strip keeps its GPU slide.
On hover, a card rises by 6px, tilts by one more degree and takes the `hover` shadow, over the `slow` duration (mockup `equipe`). Under reduced motion, only the shadow changes. Each row clips its overflow, so the space between the rows moves from the column gap into padding on each row list. Rows and cards keep the same 24px spacing.
The hover lift sits under motion-safe instead of a reduced-motion reset, and the painted keyframe moves by an exact third so the loop has no seam.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The row clips its overflow, so the shadow was cut off below the card. The lift and the tilt carry the hover on their own.
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.
Why
The member cards that scroll at the top of
/studiolook blurry: soft names, soft photos. Reported by Morgane.Cause
The scroll animation runs on
transform, so Chrome puts each row on its own GPU layer. That layer is drawn flat. The compositor then resamples it twice: once for the parent'srotate(-3deg)tilt, and once for the sub-pixel step of the slide. Both resamplings blur text and photos.Measured on the dev server with headless Chrome. The score is the mean squared luminance gradient over the same crop at the same animation time (higher is sharper):
Fix
MarqueeTrackgets an opt-inpaintedprop. A painted track moves throughleftinstead oftransform. The browser repaintslefteach frame inside the rotated space, so text and photos are drawn at their final angle and stay sharp. Aw: maxwrapper sits around the track so that theleftpercentage refers to the track width, astranslateXdid.painted. The tilt, the fades and the two opposite rows are unchanged.preset/gains one keyframe and one token (marquee-ultra-slow-painted). They are additive, and only the studio hero uses them.After the fix: 502 / 270 as shipped, 501 / 270 paused, which matches the no-layer ceiling.
Before and after (DPR 2, same frame)
DPR 1
The screenshots live on the
pr-assets/studio-hero-blurbranch. Delete it once this PR is merged.Cost of repainting
Repainting two rows each frame was measured on the dev build:
Hover, as in the mockup
The
equipemockup lifts a card on hover. The hero cards now lift 6px and tilt 1deg more, over theslowduration. They take no shadow: the row clips its overflow, so a shadow was cut off below the card. The rows gained 12px of vertical padding so a lifted card is not clipped. The spacing between and around the rows stays at 24px.Under reduced motion the card does not move.
Reduced motion
Unchanged. Same group box, the same 18 cards in a flat wrapping grid at the same positions, no animation, pause button hidden. The before and after captures look identical.
Checks
pnpm check && pnpm typecheckpnpm test:run app/components/studio_motionSafeinstead of being reset under_motionReduce, and the painted keyframe moves by an exact third (calc(-100% / 3)). Left open, for the reviewer to judge:preset/changed. Only/studioand/en/studiouse the new token. Rows to add under Studio: