Repository navigation
Docs: landing, show content before the scripts load - #203
Merged
Merged
Conversation
The head script set data-dk-js on first paint, which hid every .dk-reveal element (the hero included) until React hydrated and the reveal hook ran. On a slow phone that left the page blank under the header for a few seconds. Content now stays visible until the reveal hook runs. The hook shows what's already on screen and the hero, then turns on the hidden state for the rest. The hero animates in with CSS alone, so it plays on first paint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On a phone, devkit.yaci.xyz showed only the header on a blank background for a few seconds before the page appeared.
Cause: the inline
<head>script setdata-dk-json<html>before first paint. That turned onhtml[data-dk-js] .dk-reveal { opacity: 0 }for every scroll-reveal element, including the hero. They only became visible once React hydrated anduseRevealadded.in. On a slow phone, downloading and running the JS takes seconds, and the page stayed empty for that time. The illustrations weren't the cause.Fix: the content is now visible as soon as the HTML arrives, so no loading spinner is needed.
_document.tsx: the head script no longer setsdata-dk-js. It only sets the theme.useReveal:data-dk-js, so only content below the fold is hidden and fades in on scroll;landing.css: the hero fades up with a CSS-onlydk-riseanimation, so its entrance plays on first paint, not after hydration. Reduced motion still turns it off.Testing
I tested the production build (
out/) on a 390px viewport throttled to 1.6 Mbps with 150 ms latency and 6× CPU.next buildpasses.🤖 Generated with Claude Code