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.

feat: the home page keeps its GitHub button on phones as a round star beside the dark-mode button

matin3ab7ecf29aba
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5d3a15f3..dc3454df 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,11 @@
The main steps of Animation Handbook, newest first, with the number of animations at each one.
+## Unreleased
+
+- A Star on GitHub button at the end of every animation page's top bar and under its Copy prompt, and a round star on the
+ home page for phones.
+
## 1.0.0 — 2026-10-10
The same 166 animations, easier to reach and to work on.
diff --git a/index.html b/index.html
index a7710ff0..4094ce82 100644
--- a/index.html
+++ b/index.html
@@ -270,7 +270,7 @@ button,input{font:inherit;color:inherit}
/* phone */
@media(max-width:600px){
.top{min-height:60px}
- .top .nav .lnk,.gh{display:none}
+ .top .nav .lnk{display:none}
.brand{gap:10px;font-size:15px}
.mark{width:28px;height:28px}
.pill{gap:8px;padding:7px 13px;font-size:13px}
@@ -321,7 +321,9 @@ button,input{font:inherit;color:inherit}
}
/* beyond the design: widths and places it does not show */
-@media(max-width:760px){.gh{display:none}} /* the top bar fits from 601px up */
+@media(max-width:760px){.gh{position:relative;width:44px;padding:0;justify-content:center;gap:0}.gh-t{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}.gh-c{display:none}} /* from 760px down the GitHub button is a round star beside the dark-mode button: the word is still read out, the count goes */
+@media(min-width:601px) and (max-width:620px){.top .nav .lnk{padding:0 11px}} /* at 601px "Browse all" and "How it works" are there too: a little less padding makes room for the star */
+@media(max-width:359px){.gh{display:none}} /* below 360px there is no room for it beside the dark-mode button */
@media(max-width:1238px){.fl2,.fl5{display:none}} /* the two shapes that would crowd the 720px search box below 1239px */
.acts{flex-wrap:wrap} /* a narrow card puts Try it under Copy prompt */
#q{text-overflow:ellipsis} /* a placeholder that does not fit ends in an ellipsis, not cut by the button */
@@ -1446,7 +1448,7 @@ button,input{font:inherit;color:inherit}
<svg class="i moon" viewBox="0 0 24 24" aria-hidden="true"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/></svg>
<svg class="i sun" viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/></svg>
</button>
- <a class="gh" id="gh-stars" href="https://github.com/matinmonshizadeh/animation-handbook" target="_blank" rel="noopener noreferrer"><svg class="i" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3l2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1-4.4-4.3 6.1-.9z"/></svg>GitHub <span class="gh-c" id="gh-star-count"></span></a>
+ <a class="gh" id="gh-stars" href="https://github.com/matinmonshizadeh/animation-handbook" target="_blank" rel="noopener noreferrer"><svg class="i" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3l2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1-4.4-4.3 6.1-.9z"/></svg><span class="gh-t">GitHub</span> <span class="gh-c" id="gh-star-count"></span></a>
</nav>
</header>
diff --git a/tests/pages.test.js b/tests/pages.test.js
index 68e81cda..7108e7e2 100644
--- a/tests/pages.test.js
+++ b/tests/pages.test.js
@@ -825,3 +825,13 @@ test('every place has one tile, one phone-bar chip and one count, and the markup
assert.equal(counted.filter(tag => attr(tag, 'data-count') === key).length, 1, `one ${key} count`);
}
});
+
+test('the home page keeps its GitHub button on phones as a round star, and leaves it out only below 360px', () => {
+ assert.equal(count(HOME, '</svg><span class="gh-t">GitHub</span> <span class="gh-c" id="gh-star-count"></span></a>'), 1,
+ 'the word GitHub has a span of its own, so small screens can hide it from sight and still read it out');
+ const css = [...HOME.matchAll(/<style>([\s\S]*?)<\/style>/g)].map(m => m[1]).join('\n');
+ const hiding = cssRules(css).filter(rule => rule.selector.split(',').some(part => part.trim() === '.gh') &&
+ /(^|;)\s*display:\s*none/.test(rule.body));
+ assert.equal(hiding.length, 1, 'one rule hides the GitHub button');
+ assert.equal(count(HOME, '@media(max-width:359px){.gh{display:none}}'), 1, 'and it is for screens under 360px');
+});