Skip to content

fix(website): prevent hero headline overlapping the film frame - #899

Merged
cameri merged 2 commits into
mainfrom
fix/website-hero-overlap
Oct 18, 2026
Merged

cameri merged 2 commits into
mainfrom
fix/website-hero-overlap

Conversation

@Ferryx349

@Ferryx349 Ferryx349 commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

Description

On wide viewports, the home hero headline (“Nostr runs on relays…”) could sit under the top-left of the hero film frame, making the copy hard to read. This change reserves a headline band above the film and slightly scales down the title and frame so they stay visually separated without shrinking the hero much.

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Non-functional change (docs, style, minor refactor)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my code changes.
  • I added a changeset, or this is docs-only and I added an empty changeset.
  • All new and existing tests passed.

Reserve headline space and slightly scale down the hero title and film on wide layouts.
@changeset-bot

changeset-bot Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7a37cbc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
nostream-website Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

🧹 Site preview for this PR was deleted (PR closed).

@cameri
cameri merged commit 3ed70e4 into main Oct 18, 2026
11 of 12 checks passed
@cameri
cameri deleted the fix/website-hero-overlap branch October 18, 2026 18:32
@cameri
cameri temporarily deployed to website-preview October 18, 2026 18:32 — with GitHub Actions Inactive
@greptile-apps

greptile-apps Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; no actionable issues were found.

Summary

The PR gives the hero headline more room above the film.

  • The wide home hero keeps its headline clear of the film frame.

No actionable issues were found. Visual checks were not run because the website dependencies are not installed.

Reviews (1) · Last reviewed commit: "fix(website): stop hero headline overlap..." · Reviewed by Greptile

chappie-daemon added a commit that referenced this pull request Nov 5, 2026
Hero.astro caps the film at min(1180px, 80vw, film-h * 16/9), so the poster
paints in at most 1180x664 CSS px and 1440x810 is 1.22x that box, not the
1.06x this comment claimed from #876's 1359x764 measurement - that layout
predates the cap in #899. Greptile caught it on #1062.
cameri added a commit that referenced this pull request Nov 5, 2026
Closes #876

### What changed

`website/site/public/media/hero-poster.webp` is encoded at **1440×810**
instead of 1920×1080, and `scripts/build-media.mjs` resizes to 1440 so
the next `pnpm run media` keeps the size instead of restoring 1920.

1440 covers the box the film actually paints in: `Hero.astro` caps it at
`min(1180px, 80vw, film-h * 16/9)`, so at most 1180×664 CSS px — 1440 is
**1.22×** that, enough for a 1.25× display, and no `devicePixelRatio`
branch is needed. The 1359×764 in #876 was the layout before that cap
landed in #899, two days after the audit; the issue's numbers describe a
box the site no longer has.

### Before / after

| | bytes | dimensions |
|---|---|---|
| before | 42,926 | 1920 × 1080 |
| after | **30,878** | 1440 × 810 |

**−12,048 B, −28.1%.** Both below the issue's ≤ 45 KB bound.

Note the source file was already smaller than the 73,916 B the
2026-10-17 audit measured — it was re-encoded during the #858 rebrand —
so the absolute saving is smaller than the audit's 36.9 KiB estimate,
while the resolution waste it reported is removed.

### Visual check

SSIM of the new file against the old one, both scaled with lanczos to
the comparison size:

| comparison size | SSIM |
|---|---|
| 1180 × 664 (the film's CSS cap today) | 0.9968 |
| 1359 × 764 (the layout #876 measured) | 0.9964 |
| 2718 × 1528 (2× device pixels) | 0.9932 |

### `og:image` was never this file

The issue's second consumer no longer exists: `Base.astro` defaults
`ogImage` to `/media/social-card.png`, generated at 1200×630 by
`build-social-card.mjs` (#884). Nothing overrides it — `grep -rn
"ogImage=" website/site/src` returns only the default and the prop
declaration. So the "must stay 1920×1080" constraint does not apply, and
no second 1920 file is kept.

Built output confirms both:

```
dist/media/hero-poster.webp   30,878 B   1440,810
poster="/media/hero-poster.webp"
property="og:image" content="https://nostream.dev/media/social-card.png"
```

### Verification

- `pnpm build` in `website/site` succeeds (prebuild's brand + hero-NIP
checks included); the asset in `dist/media/` is the new one at 30,878 B.
- CLS: the film keeps `aspect-ratio: 16/9` on the `<video>`, unchanged
by this PR, so the poster's intrinsic size does not enter layout.

### Out of scope

`admin-poster.webp` and `peering-poster.webp` are encoded by the same
script at 1920 and have the same geometry mismatch. They are not
measured by this issue's audit and are left alone; the fix is one
`resize()` call each when someone measures them.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Performance**
* Reduced the landing page hero image width from 1920 to 1440 pixels,
lowering the image’s download size while preserving visual quality.
  * Social preview imagery remains unchanged.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

This branch was previously deployed

1 inactive deployment
website-preview — 7a37cbc2 Deployed Oct 18, 2026 by cameri via preview #84
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.

2 participants