Repository navigation
🐛 fix(hero): scale the wide hero as one composition on every window shape - #39
Conversation
…hape The portrait, the headline, the focus titles, the text columns and the vertical positions each switched between following the width and the height at a different aspect ratio. Narrowing a window therefore shrank the portrait and text with the width while the text stayed pinned high, and an ultrawide window stretched the name and the columns to its edges. The wide layout is now the 16:10 composition scaled by one unit, --hero-unit: min(1vw, 1.6svh). On a narrower or squarer window the same composition is smaller, with the spare height above it, so the text stays beside the face and the torso still runs under the name. On an ultrawide window the composition is centred. At 16:10 nothing changes.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…o reach the name Sending all the spare height above the composition left a band of up to 30% of the screen above the head on squarer windows. The composition now rises only until the portrait's bottom tucks under the name, which halves that band (229 px instead of 401 px at 1589x1360) and keeps the torso dissolving into the name. Windows at 16:10 or wider are unchanged.
Summary
The wide hero now keeps its proportions as the window changes shape.
Cause. Each part of the composition switched between following the window's width and its height, at a different aspect ratio:
min(104svh, 65vw): switches at 1.6:1min(2.6vw, 4.6svh): switches at 1.77:1min(2vw, 3.5svh): switches at 1.75:1vwsvhAs a window narrowed at a fixed height, the portrait and text shrank with the width while the text stayed pinned high. The result was small, cramped text near the top, with a towering portrait and dead space below it. On ultrawide windows, the name and the text columns stretched to the edges, far from the portrait.
Fix. The wide layout is the 16:10 composition, scaled by one unit:
--hero-unit: min(1vw, 1.6svh). The following all derive from that unit:Test plan
bun run checkbun run test:coverage: 213 tests, 100%bun run build:testbun run test:e2e:pr: 25 passedpreview.pjborowiecki.comDocs
CHANGELOG.mdSummary by CodeRabbit