fix(www): prevent flicker and reveal macos-hint on landing page (#27)
Hide entry-animated elements at first paint (html.anime-ready guard in global.css) so the landing page no longer flashes visible content before anime.js loads. Adds a <noscript> fallback and a JS load-error fallback to guarantee content is never permanently hidden, and reveals the hero immediately for prefers-reduced-motion users. Includes #macos-hint in the hero entrance timeline so the macOS command box animates in correctly.
This commit is contained in:
@@ -25,7 +25,7 @@ const isProd = import.meta.env.PROD;
|
||||
---
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en" data-theme-auto>
|
||||
<html lang="en" data-theme-auto class="anime-ready">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
@@ -64,6 +64,21 @@ const isProd = import.meta.env.PROD;
|
||||
|
||||
<Seo jsonLd={jsonLd} />
|
||||
|
||||
{
|
||||
// No-JS safety net: without JavaScript the anime.js entrance timeline
|
||||
// never runs, so force every entry-animated element back to visible.
|
||||
// (global.css hides them via the html.anime-ready selector.)
|
||||
}
|
||||
<noscript>
|
||||
<style>
|
||||
html.anime-ready .hero-animate > *,
|
||||
html.anime-ready .hero-screenshot,
|
||||
html.anime-ready .section-animate > * {
|
||||
opacity: 1 !important;
|
||||
}
|
||||
</style>
|
||||
</noscript>
|
||||
|
||||
{
|
||||
isProd && (
|
||||
<script
|
||||
|
||||
Reference in New Issue
Block a user