Skip to content

Commit 3ed70e4

Browse files
Ferryx349cameri
andauthored
fix(website): stop hero headline overlapping the film frame (#899)
Reserve headline space and slightly scale down the hero title and film on wide layouts. Co-authored-by: Ricardo Cabral <me@ricardocabral.io>
1 parent bb69376 commit 3ed70e4

2 files changed

Lines changed: 14 additions & 7 deletions

File tree

‎.changeset/website-hero-overlap.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'nostream-website': patch
3+
---
4+
5+
Prevent the home hero headline from overlapping the hero film on wide viewports by slightly reducing headline and film scale and reserving space above the frame.

‎website/site/src/components/home/Hero.astro‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ import { VERSION } from '../../data/site'
2525
.stage {
2626
--pad-y: clamp(18px, 3.5vh, 44px);
2727
--pad-x: clamp(14px, 3.5vw, 56px);
28-
--film-h: calc(100svh - 68px - 2 * var(--pad-y) - 36px);
28+
/* Headline band keeps the film from creeping under the h1 on wide layouts. */
29+
--hero-headline-band: clamp(72px, 11vh, 96px);
30+
--film-h: calc(100svh - 68px - 2 * var(--pad-y) - 36px - var(--hero-headline-band));
2931

3032
position: relative;
3133
z-index: 0;
@@ -45,10 +47,10 @@ import { VERSION } from '../../data/site'
4547
position: absolute;
4648
z-index: 3;
4749
left: var(--pad-x);
48-
top: clamp(12px, 2.2vh, 26px);
49-
max-width: min(560px, calc(100% - 2 * var(--pad-x)));
50+
top: clamp(12px, 2.2vh, 22px);
51+
max-width: min(520px, calc(100% - 2 * var(--pad-x)));
5052
margin: 0;
51-
font-size: clamp(24px, 3vw, 38px);
53+
font-size: clamp(22px, 2.65vw, 34px);
5254
line-height: 1.12;
5355
letter-spacing: -0.02em;
5456
pointer-events: none;
@@ -86,12 +88,12 @@ import { VERSION } from '../../data/site'
8688
.stage :global(.hero-film) {
8789
position: absolute;
8890
z-index: 2;
89-
top: 50%;
91+
top: calc(50% + var(--hero-headline-band) * 0.22);
9092
right: var(--pad-x);
9193
transform: translateY(-50%);
92-
width: min(1320px, 86vw, calc(var(--film-h) * 16 / 9));
94+
width: min(1180px, 80vw, calc(var(--film-h) * 16 / 9));
9395
max-width: calc(100% - 2 * var(--pad-x));
94-
max-height: calc(var(--film-h) + 36px);
96+
max-height: var(--film-h);
9597
}
9698

9799
.stage :global(.hero-film .film-crisp.screen) {

0 commit comments

Comments
 (0)