Skip to content

176 web animation techniques, each a live demo with plain settings and a ready-made prompt for your AI assistant. No dependencies, no build step.

fix: repo-files review: CI on the Node 24 actions, the 404 page hides the browser's clear button and reads encoded slashes, tests for its redirects and files, the sitemap dates the home page by what it loads, and plainer changelog, PR template and security lines

matinaab41e2caa60
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index 2a536f90..ce65d84f 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -8,6 +8,7 @@
- [ ] `node --test "tests/*.test.js"` passes
- [ ] The page check gives six `ok` lines for every page the change touches (`node tools/check-pages.mjs --base http://127.0.0.1:<port> <page folder>`)
+- [ ] If the change touches the home page, or a page's settings or prompt, the home page check gives six `ok` lines too (`node tools/check-pages.mjs --base http://127.0.0.1:<port> home`)
- [ ] If a shared file changed (`assets/css/demo-page.css`, `assets/js/demo-page.js`), `?v=N` is bumped on every page and on the home page
## A new technique
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index a7092eb1..771fe4e3 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -14,8 +14,8 @@ jobs:
tests:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-node@v4
+ - uses: actions/checkout@v7
+ - uses: actions/setup-node@v7
with:
node-version: 22
- run: node --test "tests/*.test.js"
diff --git a/404.html b/404.html
index 79bc4d75..01c922d7 100644
--- a/404.html
+++ b/404.html
@@ -30,7 +30,8 @@ function whereTo(path,rest){
var last=parts.pop()||'';
if(/^(index|readme)(\.[a-z]+)?$/i.test(last))last=parts.pop()||'';
try{last=decodeURIComponent(last);}catch(e){}
- var words=last.replace(/\.[a-z]+$/i,'').replace(/[-_+.\s]+/g,' ').trim().slice(0,80);
+ last=last.split('/').filter(Boolean).pop()||''; // an encoded slash (%2F) leaves folders in the segment
+ var words=last.replace(/\.[a-z]+$/i,'').replace(/[-_+.\s]+/g,' ').slice(0,80).trim();
return {words:/[^\d\s]/.test(words)?words:''};
}
var to=whereTo(location.pathname,location.search+location.hash);
@@ -83,6 +84,7 @@ button,input{font:inherit;color:inherit}
.search>.i{width:22px;height:22px;color:var(--muted)}
#q{flex:1;min-width:0;min-height:48px;margin-left:12px;border:0;background:none;font-size:17px;text-overflow:ellipsis;outline:none;-webkit-appearance:none;appearance:none}
#q::placeholder{color:var(--muted)}
+#q::-webkit-search-cancel-button{display:none}
#q:focus-visible{outline:none}
.go{display:inline-flex;align-items:center;justify-content:center;flex:none;min-height:48px;padding:0 26px;border-radius:999px;border:0;background:var(--ink);color:var(--bg);font-size:16px;font-weight:700;cursor:pointer}
.go .i{display:none}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index fbcaefbc..5d3a15f3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,7 +13,7 @@ The same 166 animations, easier to reach and to work on.
- A 404 page: a mistyped address leads to the right page, to the full list or to the search. GitHub Pages now serves
the files as they are, so no extra pages are built from the repository's notes.
- A code of conduct, a security policy and the site font's license, and the tests run on GitHub Actions for every push
- and pull request.
+ to main and every pull request.
## 2026-10-02 — 166 animations
diff --git a/SECURITY.md b/SECURITY.md
index 91c19022..98dcaf40 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -1,8 +1,9 @@
# Security policy
Animation Handbook is a static website: HTML, CSS and JavaScript files that GitHub Pages serves as they are. It has no
-server code, no accounts, no sign-up, nothing that collects what visitors type and no stored data of its own. The only
-version looked after is the one on the `main` branch, which is the live site at
+server code, no accounts, no sign-up and nothing that collects what visitors type. All it keeps is in the visitor's own
+browser: the light or dark theme they picked, and the repository's star count, which the home page reads from GitHub's
+public API. The only version looked after is the one on the `main` branch, which is the live site at
https://matinmonshizadeh.github.io/animation-handbook/.
## What to report
diff --git a/docs/superpowers/specs/2026-09-30-home-page-redesign-design.md b/docs/superpowers/specs/2026-09-30-home-page-redesign-design.md
index 592e14ea..1bcabf6a 100644
--- a/docs/superpowers/specs/2026-09-30-home-page-redesign-design.md
+++ b/docs/superpowers/specs/2026-09-30-home-page-redesign-design.md
@@ -1,7 +1,7 @@
# Home Page Redesign — "Friendly guide"
**Status:** approved direction (A), spec for review · **Date:** 2026-09-30
-**Design canvas:** (a private design canvas, not published) (row "A · Friendly guide": desktop, phone, phone after tapping Buttons)
+**Design canvas:** a private design canvas, not published (row "A · Friendly guide": desktop, phone, phone after tapping Buttons)
## Why
diff --git a/tests/pages.test.js b/tests/pages.test.js
index da878c0f..e635bf14 100644
--- a/tests/pages.test.js
+++ b/tests/pages.test.js
@@ -611,6 +611,31 @@ test('the 404 page stays out of search results and every address in it works at
const addresses = [...html.matchAll(/\s(?:href|src|action)="([^"]*)"/g), ...html.matchAll(/url\(\s*['"]?([^'")\s]+)/g)].map(m => m[1]);
assert.ok(addresses.length > 0, 'the page has addresses to check');
for (const address of addresses) assert.match(address, /^(?:\/animation-handbook\/|https:\/\/|#)/, address);
+ // Each file the page loads or links on the site is in the repository (a folder address stands for its index.html).
+ for (const address of addresses.filter(a => a.startsWith('/animation-handbook/'))) {
+ const file = address.replace(/^\/animation-handbook\//, '').replace(/[?#].*$/, '');
+ assert.ok(fs.existsSync(path.join(ROOT, file === '' || file.endsWith('/') ? file + 'index.html' : file)), `${address} is in the repository`);
+ }
+});
+
+test('the 404 page sends a mistyped address where it belongs and never off the site', () => {
+ const html = read(path.join(ROOT, '404.html'));
+ const start = html.indexOf('function whereTo(');
+ assert.ok(start >= 0, 'whereTo in 404.html');
+ let depth = 0, end = html.indexOf('{', start);
+ for (; end < html.length; end++) { if (html[end] === '{') depth++; else if (html[end] === '}' && --depth === 0) break; }
+ const whereTo = vm.runInNewContext('(' + html.slice(start, end + 1) + ')');
+ const cases = [
+ ['/animation-handbook/animations/02-entrance-and-exit/Rotate-In/', '?x=1#y', { go: '/animation-handbook/animations/02-entrance-and-exit/rotate-in/?x=1#y' }],
+ ['/animation-handbook/animations/', '', { go: '/animation-handbook/?view=all#results' }],
+ ['/animation-handbook/animations/02-entrance-and-exit/', '', { go: '/animation-handbook/?view=all#results' }],
+ ['/animation-handbook/animations/02-entrance-and-exit/rotate-inn/', '', { words: 'rotate inn' }],
+ ['/animation-handbook/animations%2F02-entrance-and-exit%2Frotate-in/', '', { words: 'rotate in' }],
+ ['/animation-handbook/12345', '', { words: '' }],
+ ['/FOO/Bar', '', { words: 'Bar' }],
+ ['//evil.example/X', '', { words: 'X' }]
+ ];
+ for (const [where, rest, want] of cases) assert.deepEqual({ ...whereTo(where, rest) }, want, where + rest);
});
// Where the bracket that opens at HOME[from] ('[' or '{') is closed. It steps over strings and // comments, so a quote or bracket
diff --git a/tools/update-sitemap.mjs b/tools/update-sitemap.mjs
index b72564b5..21319f3a 100644
--- a/tools/update-sitemap.mjs
+++ b/tools/update-sitemap.mjs
@@ -5,7 +5,8 @@
// The home page comes first, then every page in the order of the CATS array in index.html (the home page's order),
// at the home page's canonical address. A page's lastmod is the date of the last commit that touched its folder
// (git log -1 --format=%cs -- <folder>), or today's date when the folder has changes that are not committed yet (a
-// new page too). The home page's lastmod is the latest of index.html, assets/ and the newest page. changefreq and
+// new page too). The home page's lastmod is the latest of index.html and the files it loads (the page script and
+// the two fonts): a change to a page alone does not change the home page. changefreq and
// priority stay as they are: weekly and 1.0 for the home page, monthly and 0.7 for every page.
// Without --out it rewrites sitemap.xml at the repo root, keeping its line endings; --out writes the same text to
// another file instead, to compare. It prints how many URLs it wrote and how many dates changed.
@@ -80,7 +81,8 @@ async function datesOf(targets, atOnce = 8) {
return dates;
}
const pageDates = await datesOf(pages);
-const homeDate = [...await datesOf(['index.html', 'assets/']), ...pageDates].sort().pop();
+const homeDate = (await datesOf(['index.html', 'assets/js/demo-page.js', 'assets/fonts/schibsted-latin.woff2',
+ 'assets/fonts/schibsted-latin-ext.woff2'])).sort().pop();
const escape = s => s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
const line = (loc, lastmod, changefreq, priority) =>