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.

10.1 KB
Raw Blame
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Page not found — Animation Handbook</title>
<meta name="robots" content="noindex">
<meta name="theme-color" content="#f8f7f4">
<!-- GitHub Pages serves this page at every address it has no file for, at any depth, so every address here is absolute. -->
<link rel="icon" type="image/png" sizes="96x96" href="/animation-handbook/favicon.png">
<link rel="icon" type="image/svg+xml" href="/animation-handbook/favicon.svg">
<link rel="apple-touch-icon" href="/animation-handbook/apple-touch-icon.png">
<script>
// The theme is the visitor's own pick on the home page (ah-theme), else the system's, as on the home page.
(function(){var t=matchMedia('(prefers-color-scheme: light)').matches?'light':'dark';
  try{var s=localStorage.getItem('ah-theme');if(s==='light'||s==='dark')t=s;}catch(e){}
  document.documentElement.dataset.theme=t;document.querySelector('meta[name="theme-color"]').content=t==='dark'?'#0e0e11':'#f8f7f4';})();
// Where a missing address leads: {go} to move on at once, else {words} for the search box. rest is the address's query
// and fragment. GitHub Pages tells capital letters from small ones, so an address with capitals moves to its lowercase
// path (percent escapes keep their case, so a lowercase path never moves again), and only within the handbook, so it
// never leaves the site. /animations/ and a category folder have no page of their own: they open Browse all; /finder and
// /find open the finder, a view of the home page, keeping only its answers (what, when and how). Any other address offers
// the words of its last part ("rotate-inn" gives "rotate inn"), skipping an index or readme file; a part made only of
// digits offers none.
function whereTo(path,rest){
  var lower=path.replace(/%[0-9A-Fa-f]{2}|[A-Z]+/g,function(s){return s.charAt(0)==='%'?s:s.toLowerCase();});
  if(/^\/animation-handbook\/animations(\/\d\d-[a-z0-9-]+)?(\/(index\.html?)?)?$/.test(lower))return {go:'/animation-handbook/?view=all#results'};
  if(/^\/animation-handbook\/find(er)?\/?$/.test(lower)){
    var keep=(rest||'').replace(/#.*$/,'').replace(/^\?/,'').split('&').filter(function(p){return /^(what|when|how)=[a-z]+$/.test(p);});
    return {go:'/animation-handbook/?view=find'+(keep.length?'&'+keep.join('&'):'')};
  }
  if(lower!==path&&lower.indexOf('/animation-handbook/')===0)return {go:lower+(rest||'')};
  var parts=path.split('/').filter(Boolean);
  if(parts[0]==='animation-handbook')parts.shift();
  var last=parts.pop()||'';
  if(/^(index|readme)(\.[a-z]+)?$/i.test(last))last=parts.pop()||'';
  try{last=decodeURIComponent(last);}catch(e){}
  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);
if(to.go)location.replace(to.go);
else document.addEventListener('DOMContentLoaded',function(){var q=document.getElementById('q');if(to.words&&!q.value)q.value=to.words;});
</script>
<style>
@font-face{font-family:'Schibsted Grotesk';src:url('/animation-handbook/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}
@font-face{font-family:'Schibsted Grotesk';src:url('/animation-handbook/assets/fonts/schibsted-latin.woff2') format('woff2');font-weight:400 900;font-display:swap;unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}

/* the home page's colors: light, then dark by the system's setting (no script) or by data-theme */
:root{
  --bg:#f8f7f4;--surface:#ffffff;--ink:#16161b;--ink-2:#45454f;--muted:#676771;--line:#e5e3dc;--brand:#2f5bea;
  --shadow:0 1px 2px rgba(22,22,27,.04),0 8px 24px rgba(22,22,27,.06);
  --text:'Schibsted Grotesk',system-ui,-apple-system,'Segoe UI',sans-serif;--gut:clamp(16px,4vw,40px);
  color-scheme:light;
}
@media(prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --bg:#0e0e11;--surface:#17171c;--ink:#f4f4f2;--ink-2:#c6c6cc;--muted:#9c9ca5;--line:rgba(255,255,255,.13);--brand:#86a8ff;
  --shadow:0 1px 2px rgba(0,0,0,.3),0 8px 24px rgba(0,0,0,.25);color-scheme:dark;
}}
:root[data-theme="dark"]{
  --bg:#0e0e11;--surface:#17171c;--ink:#f4f4f2;--ink-2:#c6c6cc;--muted:#9c9ca5;--line:rgba(255,255,255,.13);--brand:#86a8ff;
  --shadow:0 1px 2px rgba(0,0,0,.3),0 8px 24px rgba(0,0,0,.25);color-scheme:dark;
}
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html,body{background:var(--bg);color:var(--ink)}
body{display:flex;flex-direction:column;min-height:100vh;min-height:100svh;font-family:var(--text);font-size:16px;line-height:1.5;-webkit-font-smoothing:antialiased}
a{color:inherit}
button,input{font:inherit;color:inherit}
:focus-visible{outline:3px solid var(--brand);outline-offset:3px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.i{width:18px;height:18px;flex:none;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.wrap{width:min(1280px,calc(100% - 2 * var(--gut)));margin-inline:auto}

/* top bar */
.top{display:flex;align-items:center;min-height:76px}
.brand{display:inline-flex;align-items:center;gap:12px;min-height:44px;text-decoration:none;font-size:17px;font-weight:800;letter-spacing:-.015em;white-space:nowrap}
.mark{width:30px;height:30px;flex:none}
.mark .ring{fill:var(--bg);stroke:currentColor;stroke-width:1.8}
.mark .ball{fill:currentColor}

/* the message, the search and the ways back */
.lost{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:clamp(24px,6vw,64px) 0 clamp(48px,10vw,112px);text-align:center}
.pill{padding:8px 16px;border-radius:999px;background:var(--surface);border:1px solid var(--line);font-size:14px;font-weight:600;color:var(--ink-2)}
.h1{margin-top:22px;font-size:clamp(32px,5.2vw,56px);font-weight:800;line-height:1.06;letter-spacing:-.035em}
.sub{margin-top:16px;max-width:560px;font-size:clamp(16px,1.4vw,19px);line-height:1.55;color:var(--ink-2);text-wrap:pretty}
.search{display:flex;align-items:center;width:min(640px,100%);margin-top:clamp(20px,3vw,32px);padding:8px 8px 8px 24px;border-radius:999px;background:var(--surface);border:1px solid var(--line);box-shadow:var(--shadow)}
.search:focus-within{border-color:var(--brand);box-shadow:0 0 0 3px color-mix(in srgb,var(--brand) 22%,transparent),var(--shadow)}
.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}
.ways{display:flex;flex-wrap:wrap;justify-content:center;gap:12px;margin-top:24px}
.way{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:0 22px;border-radius:999px;border:1px solid var(--line);background:var(--surface);font-size:16px;font-weight:700;text-decoration:none}
@media(hover:hover){.way:hover{border-color:var(--ink)}}

/* phone */
@media(max-width:600px){
  .top{min-height:60px}
  .brand{gap:10px;font-size:15px}
  .mark{width:28px;height:28px}
  .search{padding:5px 5px 5px 18px}
  #q{min-height:44px;margin-left:10px;font-size:16px}
  .go{width:44px;min-height:44px;padding:0}
  .go-l{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap} /* hidden from sight, still read out */
  .go .i{display:block}
  .ways{flex-direction:column;align-self:stretch}
}
/* the narrowest phones: below 350px "Find an animation by what you saw" takes two lines, which would fill its pill edge to edge with one
   word alone. Some air above and below and balanced lines fix that; a 22px line keeps the text of a one-line way exactly where it was
   (they stay 48px tall). 359px, as on the home page, leaves 360px and up as it was. */
@media(max-width:359px){
  .way{padding:6px 22px;line-height:1.375;text-wrap:balance}
}
</style>
</head>
<body>
<header class="wrap top">
  <a class="brand" href="/animation-handbook/"><svg class="mark" viewBox="0 0 32 32" aria-hidden="true"><circle class="ring" cx="11.16" cy="20.84" r="6.1"/><circle class="ring" cx="15.12" cy="16.88" r="6.1"/><circle class="ring" cx="18.51" cy="13.49" r="6.1"/><circle class="ball" cx="21.2" cy="10.8" r="6.6"/></svg><span>Animation Handbook</span></a>
</header>
<main class="wrap lost">
  <p class="pill">Error 404</p>
  <h1 class="h1">This page isn't here</h1>
  <p class="sub">The link may be old or mistyped. Search for the animation you were after, or browse them all.</p>
  <form class="search" role="search" action="/animation-handbook/#results" method="get">
    <label class="sr" for="q">Describe the animation you want</label>
    <svg class="i" viewBox="0 0 24 24" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="M20 20l-3.5-3.5"/></svg>
    <input id="q" name="q" type="search" enterkeyhint="search" autocomplete="off" spellcheck="false" placeholder="For example: a button that bounces when clicked">
    <button type="submit" class="go"><span class="go-l">Search</span><svg class="i" viewBox="0 0 24 24" aria-hidden="true"><path d="M5 12h14M13 6l6 6-6 6"/></svg></button>
  </form>
  <nav class="ways" aria-label="Ways back">
    <a class="way" href="/animation-handbook/">Go to the home page</a>
    <a class="way" href="/animation-handbook/?view=all#results">Browse all 176 animations</a>
    <a class="way" href="/animation-handbook/?view=find">Find an animation by what you saw</a>
  </nav>
</main>
</body>
</html>