The trial notice walks the width of the bar instead of standing in it

cc186c4 put the news about the trial into the bar, one line, and asked nothing
more of it. On the landing page that line is a sentence, not a label: at 1440 it
fits, on a phone it wraps into a paragraph and the bar grows a shelf of text
above the hero. So the band is drawn as a track and the sentence is set in
motion — one line that is never wider than the window because it is never asked
to fit in it.

It is the same band cc186c4 wrote, moved to the last shelf of the bar, under
the menu line rather than beside the header. Two copies of the string ride the
track, the second hidden from screen readers so the news is announced once, and
the track slides exactly half its own width: the copy that was waiting arrives
where the one before it left, so the loop has no seam and the 72px of air lives
in each copy's right padding rather than between the two. `width: max-content`
on the track is what makes that half-exact — the track is the two copies and
nothing else, so -50% is one copy by construction and not by measurement.
40s, linear, infinite; the animation is dropped under
`prefers-reduced-motion: reduce`, where the sentence simply sits at the left
edge of the band, clipped the way it already is mid-scroll.

The colour is the theme's own ink, not the page's amber: the notice is the
product's voice about itself, so it wears the accent the rest of the landing
page wears and follows the visitor through all five themes. The bare accent is
too bright to read on the light theme's paper, though, and the worst pair is
itself in the theme set — the bare accent lands at 4.0:1 on the violet dark
page, which a 12px line may not wear. So the ink is `color-mix`ed 78% accent
toward the page's text colour: the hue that says "theme colour" survives, and
the value walks toward whichever extreme the page already uses, which is the
one direction that is always safe. Worst pair across the ten theme/page
combinations is 5.66:1.

The bar is fixed, so the shelf it gained is a shelf the hero has to pay for:
`scroll-padding-top` goes 116 to 148 (62px of nav + 43px of subnav + 32px of
notice, plus a little air) and the hero's top padding 184 to 216. Below 1160px
the subnav is gone and only the notice is owed: 144, up from 112. The numbers
are hardcoded rather than measured — the bar's height is a sum of three fixed
shelf heights, and a ResizeObserver watching a 32px band would be machinery
that reports what the stylesheet already says.

Verified: npx tsc --noEmit clean, npm run build clean. In the running app
through a probe: navBottom 139.08, subBottom 105.89, notice.top 105.89 then
height 32.19, so the band sits directly under the menu line; trackW 1426.625 is
exactly 2 x spanW 713.312, so -50% is one copy and the loop is seamless; the
transform was observed mid-flight (matrix -12.48 to -39.53 over 1.5s) with
overflow hidden and the animation named; h1Top 267.59 clears navBottom 139.08,
the same gap the hero had before. At 390x800: noticeTop 62, height 32.19,
subnav hidden, one line, no wrap, h1Top 195.59. The band was viewed in both
themes and at both widths. Contrast of the mixed ink against each page, all ten
theme/page pairs, measured from the rendered pixels: 6.79 / 9.89 / 5.66 / 10.22
/ 12.64 light and 10.98 / 7.69 / 12.72 / 6.76 / 5.67 dark.

Co-authored-by: PenguinHarness <noreply@penguin.local>
This commit is contained in:
2026-09-29 20:37:07 +07:00
parent cc186c4d09
commit 8e330ee28b
2 changed files with 40 additions and 3 deletions
+11
View File
@@ -720,6 +720,17 @@ export function Landing() {
))}
</div>
</div>
{/* The trial notice: the last shelf of the bar, under the menu line. It
scrolls because it is one long sentence that would otherwise wrap on
a phone and stand as a paragraph. The sentence is rendered twice —
the second copy is the one that walks in as the first walks out, and
is hidden from screen readers so the news is announced once. */}
<div className="lp-notice" role="status" data-key="trial-notice">
<div className="lp-notice-track">
<span>{t('notice.trial')}</span>
<span aria-hidden="true">{t('notice.trial')}</span>
</div>
</div>
{menu ? (
<div className="lp-sheet">
{nav.map((entry) => <a key={entry.href} href={entry.href} onClick={() => setMenu(false)}>{c(entry.label)}</a>)}
+29 -3
View File
@@ -63,7 +63,9 @@
[data-theme="light"] .lp-plan.vip { background: linear-gradient(180deg, var(--accent-soft), rgba(255, 255, 255, 0.92)); }
[data-theme="light"] .lp-toast { background: rgba(255, 255, 255, 0.98); box-shadow: 0 20px 50px rgba(20, 22, 28, 0.22); }
html { scroll-behavior: smooth; scroll-padding-top: 116px; }
/* The jump target has to clear the fixed bar: 62px of nav + 43px of subnav +
32px of notice, plus a little air. */
html { scroll-behavior: smooth; scroll-padding-top: 148px; }
.lp ::selection { background: var(--lp-amber); color: #10121a; }
.lp-wrap { max-width: 1180px; margin: 0 auto; padding: 0 22px; }
.lp h1, .lp h2, .lp h3 { font-family: var(--lp-display); font-weight: 800; line-height: 1.1; margin: 0; }
@@ -139,6 +141,29 @@ html { scroll-behavior: smooth; scroll-padding-top: 116px; }
white-space: nowrap;
}
.lp-subnav-link:hover { color: var(--lp-text); border-color: var(--accent-line); }
/* The trial notice: the bar's third shelf, under the menu line. One line, so it
never wraps and the bar keeps a fixed height the hero's padding can match.
The sentence is printed twice and the track slides exactly half its own width
— the second copy arrives where the first left, so the loop has no seam and
the gap lives in each copy's right padding rather than between them. */
.lp-notice { border-top: 1px solid var(--lp-line); overflow: hidden; padding: 6px 0; }
.lp-notice-track { display: flex; width: max-content; animation: lp-notice-roll 40s linear infinite; }
.lp-notice-track span {
padding-right: 72px;
white-space: nowrap;
font-size: 12px;
/* The theme's own ink, not the page's amber: on the light theme the plain
accent is too bright to read on paper. Pulled a fifth of the way toward the
page's text colour, because the bare accent lands at 4.0:1 on the violet
dark theme, which a 12px line may not wear — the mix keeps the hue and
walks toward whichever extreme the page already uses. */
color: color-mix(in srgb, var(--lp-ink-amber) 78%, var(--lp-text));
letter-spacing: 0.02em;
}
@keyframes lp-notice-roll { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
.lp-notice-track { animation: none; }
}
.lp-nav .lp-spacer { flex: 1 1 auto; }
.lp-tools { display: flex; gap: 6px; }
.lp-tool {
@@ -205,7 +230,7 @@ html { scroll-behavior: smooth; scroll-padding-top: 116px; }
@media (min-width: 1161px) { .lp-sheet { display: none; } }
/* --- 2. hero ------------------------------------------------------------ */
.lp-hero { position: relative; padding: 184px 0 74px; overflow: hidden; }
.lp-hero { position: relative; padding: 216px 0 74px; overflow: hidden; }
.lp-glow {
position: absolute;
inset: -30% -10% auto -10%;
@@ -577,7 +602,8 @@ html { scroll-behavior: smooth; scroll-padding-top: 116px; }
.lp-tool { width: 30px; height: 30px; font-size: 11px; }
.lp-burger { padding: 6px; }
.lp-sec { padding: 64px 0; }
.lp-hero { padding: 112px 0 52px; }
/* The subnav is gone under 1160px, so only the notice has to be paid for. */
.lp-hero { padding: 144px 0 52px; }
.lp-grid, .lp-quotes, .lp-price, .lp-stats { grid-template-columns: minmax(0, 1fr); }
.lp-stat { display: flex; align-items: baseline; gap: 10px; }
.lp-social { margin-left: 0; }