Skip to content

fix: fit landing card previews to a real stage instead of a flat scale#97

Merged
starc007 merged 1 commit into
mainfrom
fix/landing-preview-sizing
Jul 6, 2026
Merged

fix: fit landing card previews to a real stage instead of a flat scale#97
starc007 merged 1 commit into
mainfrom
fix/landing-preview-sizing

Conversation

@starc007

@starc007 starc007 commented Jul 6, 2026

Copy link
Copy Markdown
Owner

What

Landing cards flat-scaled every preview by 0.8, so anything with a bigger natural footprint (or a w-full layout with no definite width to resolve against) got clipped or collapsed into a narrow "mobile" column.

  • New PreviewFit: renders each preview at a fixed 460px stage (so w-full/flex-wrap layouts resolve exactly like they do on the component's own detail page), measures its natural height, and scales the whole stage to fit the card — still capped at the original 0.8 (0.84 on hover) for normal-size previews.
  • Fixed a measurement bug along the way: the old fit math read getBoundingClientRect() on the same element the scale transform was applied to, which reflects the post-transform box and compounded into the wrong scale every render.
  • Autoplay the shader-background preview (cycles variants every 2.4s, pauses on hover/focus, respects reduced motion) instead of sitting frozen on one variant.
  • Stop stretching short testimonial cards to match a taller neighbor's height (h-full in a marquee row).

Test plan

  • bun run check clean (typecheck, lint, registry — 42 components)

Landing cards flat-scaled every preview by 0.8, so anything with a bigger
natural footprint (or a w-full layout with no definite width to resolve
against) got clipped or collapsed into a narrow column. PreviewFit now
renders each preview at a fixed 460px stage, measures its natural height,
and scales the whole stage to fit the card (still capped at 0.8 for
normal-size previews).

Also: autoplay the shader-background preview instead of sitting frozen on
one variant, and stop stretching short testimonial cards to match a taller
neighbor's height.
@starc007 starc007 merged commit 140a79c into main Jul 6, 2026
2 checks passed
@starc007 starc007 deleted the fix/landing-preview-sizing branch July 6, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant