Skip to content

docs: play a short entrance animation in the home page hero - #71

Merged
shenxianpeng merged 1 commit into
mainfrom
feature/hero-entrance-animation
Sep 30, 2026
Merged

shenxianpeng merged 1 commit into
mainfrom
feature/hero-entrance-animation

Conversation

@shenxianpeng

Copy link
Copy Markdown
Member

The hero illustration now plays a short entrance once on load and then rests on the same static picture as before:

Time What happens
0.1s the yellow ring around the illustration is drawn (1.1s)
0.15s the review card rises
0.3s the ring around "already checked" is drawn
0.35s the "clang-format 21 · clang-tidy 21" pin slides in
0.45s the three diff lines slide in one after another
0.85s the github-actions clang-tidy suggestion rises
1.05s the small check beside the headline is drawn
1.45s "Commit suggestion" is pressed
1.7s the auto-fix commit chip pops up
2.0s the large check is drawn

It is CSS only: a block of keyframes in home.css, and pathLength="1" on the four hand-drawn paths in home.html, which the drawing needs. With "reduce motion" turned on, nothing moves.

The strokes keep their width when the SVGs stretch (vector-effect: non-scaling-stroke), so on screen a path is 0.67 to 1.25 times its pathLength (measured at 375px and 1280px). The drawing uses 1.5-long dashes to cover that, and its last frame removes the dashes, so the finished picture is the unchanged static stroke.

Checked with mkdocs serve at 1280px and 375px wide by seeking the animations to 0.1, 0.55, 0.9, 1.05, 1.65 and 2.05 seconds and to the end: no stray stroke before the drawing starts, the end state matches the current page, and there is no horizontal scroll.

The hero illustration now plays a short entrance once on load and then rests on the same static picture as before:

| Time | What happens |
|---|---|
| 0.1s | the yellow ring around the illustration is drawn (1.1s) |
| 0.15s | the review card rises |
| 0.3s | the ring around "already checked" is drawn |
| 0.35s | the "clang-format 21 · clang-tidy 21" pin slides in |
| 0.45s | the three diff lines slide in one after another |
| 0.85s | the github-actions clang-tidy suggestion rises |
| 1.05s | the small check beside the headline is drawn |
| 1.45s | "Commit suggestion" is pressed |
| 1.7s | the auto-fix commit chip pops up |
| 2.0s | the large check is drawn |

It is CSS only: a block of keyframes in `home.css`, and `pathLength="1"` on the four hand-drawn paths in `home.html`, which the drawing needs. With "reduce motion" turned on, nothing moves.

The strokes keep their width when the SVGs stretch (`vector-effect: non-scaling-stroke`), so on screen a path is 0.67 to 1.25 times its `pathLength` (measured at 375px and 1280px). The drawing uses 1.5-long dashes to cover that, and its last frame removes the dashes, so the finished picture is the unchanged static stroke.

Checked with `mkdocs serve` at 1280px and 375px wide by seeking the animations to 0.1, 0.55, 0.9, 1.05, 1.65 and 2.05 seconds and to the end: no stray stroke before the drawing starts, the end state matches the current page, and there is no horizontal scroll.
@netlify

netlify Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cpp-linter-github-io ready!

Name Link
🔨 Latest commit 0ba6cf9
🔍 Latest deploy log https://app.netlify.com/projects/cpp-linter-github-io/deploys/6abcd6a4ff3d980008f7cae6
😎 Deploy Preview https://deploy-preview-71--cpp-linter-github-io.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@shenxianpeng
shenxianpeng merged commit 788125a into main Sep 30, 2026
7 checks passed
@shenxianpeng
shenxianpeng deleted the feature/hero-entrance-animation branch September 30, 2026 09:40
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.

1 participant