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: home page theme: the browser bar takes the page's background, and blocked storage still follows the system's setting

matin8271f9602b97
diff --git a/index.html b/index.html
index 792f039c..76d7fde0 100644
--- a/index.html
+++ b/index.html
@@ -9,7 +9,7 @@
<meta name="keywords" content="web animation, CSS animation, animation examples, scroll animation, page transitions, micro-interactions, kinetic typography, WebGL, frontend animation reference, motion design, animation handbook">
<meta name="author" content="matinmonshizadeh">
<meta name="robots" content="index, follow, max-image-preview:large">
-<meta name="theme-color" content="#0b0b0d">
+<meta name="theme-color" content="#f8f7f4">
<link rel="canonical" href="https://matinmonshizadeh.github.io/animation-handbook/">
<link rel="icon" type="image/png" sizes="96x96" href="favicon.png">
<link rel="icon" type="image/svg+xml" href="favicon.svg">
@@ -45,7 +45,11 @@
"keywords": "web animation, CSS animation, scroll animation, page transitions, micro-interactions, kinetic typography, WebGL, motion design"
}
</script>
-<script>document.documentElement.classList.add('js');(function(){try{var t=localStorage.getItem('ah-theme');if(!t)t=matchMedia('(prefers-color-scheme: light)').matches?'light':'dark';document.documentElement.dataset.theme=t;}catch(e){}})();</script>
+<script>document.documentElement.classList.add('js');
+// The theme is the visitor's own pick (ah-theme), else the system's, which is read first, outside the try: blocked storage
+// throws, and the system's setting must still count. The browser's bar (theme-color) takes the page's background of the theme.
+function setTheme(t){document.documentElement.dataset.theme=t;document.querySelector('meta[name="theme-color"]').content=t==='dark'?'#0e0e11':'#f8f7f4';}
+(function(){var t=matchMedia('(prefers-color-scheme: light)').matches?'light':'dark';try{t=localStorage.getItem('ah-theme')||t;}catch(e){}setTheme(t);})();</script>
<script src="assets/js/demo-page.js?v=6" defer></script>
<style>
@font-face{font-family:'Schibsted Grotesk';src:url('assets/fonts/schibsted-latin-ext.woff2') format('woff2');font-weight:400 900;font-display:swap;unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@@ -1929,7 +1933,7 @@ if(startCat){const g=$('cat-'+startCat);if(g)g.scrollIntoView();}
(function(){const btn=$('theme-toggle');if(!btn)return;
btn.addEventListener('click',()=>{const next=document.documentElement.dataset.theme==='dark'?'light':'dark';
- document.documentElement.dataset.theme=next;try{localStorage.setItem('ah-theme',next);}catch(e){}});})();
+ setTheme(next);try{localStorage.setItem('ah-theme',next);}catch(e){}});})();
// ---------- Copy prompt on the cards ----------
// The text is the page's own: the home page reads the page's HTML and builds the text with the shared page script