kirupa.com

03 / MOTION

Motion

Every animation on kirupa.com: what moves, when it stops, how readers turn it off, and how to build and test new motion.

Agent Instructions / motion

You are adding or changing motion on KIRUPA. Read /design/sections/motion.md first. Reuse an existing vocabulary: the header sky, the kirupaBot launcher, background icons (motion.js, also on the forum), content reveals (reveal.js), or the home page's icons, tour, and section reveal. Add a new one only for clear orientation, feedback, or delight, with one owner, a still state, a reduced-motion path, and an off switch, ideally a Customize Theme choice. Keep decorative layers aria-hidden, pointer-transparent, out of print and forced colors, and outside the text column. Never hold back or move text being read, code, tables, embeds, forms, quiz UI, or live demos; mark labs, games, and runnable examples with data-live-demo, and opt out with data-reveal-skip, data-motion-avoid, data-motion, or data-reveal. Animate only opacity and transform, read layout only when a scroll settles, stop work offscreen and in hidden tabs, and treat anchors, same-page links, Home and End, the scrollbar, scripts, find in page, and focus as jumps that show content at once. Verify in WebKit and Chromium with trackpad-style wheel flicks, reduced motion, no JavaScript, jumps, keyboard focus, and print; run tools/motion.browser.mjs; and compare CLS, long tasks, and input latency with the layer off. Bump the footer's v keys with every motion file change, never reference or request a new ?v= key before its upload, and republish the forum from discourse/ after background icon changes. Previews pause locally and offscreen, and never change saved preferences. Sound stays off unless explicitly requested. Follow WCAG 2.2 AA for new or changed content: semantic HTML, keyboard access, visible focus, readable contrast in every theme, text alternatives, labeled controls, and explicit errors. Support zoom/reflow, respect reduced motion, and keep sound optional. Read /design/sections/accessibility.md for acceptance checks. Report unresolved barriers; automated checks alone do not establish conformance.

KIRUPA moves for orientation and a little delight, never at the cost of reading. Every moving thing has one owner, a still state, and a way to turn it off. These are the motion vocabularies on the site:

VocabularyWhereWhat movesTurns off with
Header skyEvery page on the current designClouds on 60-300s loops, plus each style's own artReduced motion
kirupaBot launcherEvery page with kirupaBotA 5.333s float, a 5s bounce, and a 5s icon turnReduced motion
Background iconsBeside the text column where there's room, on kirupa.com and the forumThe reader's style icons, moved by scrollingCustomize Theme > Background icons, or reduced motion (Still)
Content revealsBlocks that start below the window, except on the forumOpacity and a short rise, once per blockCustomize Theme > Content reveals, or reduced motion
Home page iconsThe home page's openingUp to 12 icons that wander and danceBackground icons > Off or Still, or reduced motion
Home page tourThe home page's "Ever wondered..." questionsA new question every 5.5sHover or focus holds it; Off, Still, or reduced motion stops it
Home page revealThe home page's sectionsA 24px rise over 0.7s, 70ms apartContent reveals > Off, or reduced motion
Sketch headerThe Sketch header's page of sketchesStepped, flip-book loops: the cloud drifts, the sun's rays turn and breathe, the gears tick, the robot shuffles and tilts its head, steam curls, the lamp flickers, the arm sways, and the paper plane bobsReduced motion; paused offscreen or in a hidden tab
3D page tiltArticle headings, callouts, code, and cards, in the 3D styleA tilt of up to 2.5 degrees toward the mouse, as if the page were a tray in your handsTouch, or reduced motion
Who's Online globeWho's OnlineA slowly turning globeReduced motion
404 dancersThe 404 pageStyle icons dancing behind the messageReduced motion

Customize Theme opens from every page's header. Its Background icons and Content reveals groups govern the site-wide layers, and the home page follows them too. The forum's Customize Theme has the Background icons group only.

Header sky and kirupaBot

The shared header moves five clouds with transform, on linear loops of 60, 80, 100, 300, and 200 seconds that each start at a random point.

Style scripts add Sci-Fi's moving atlas, Ukiyo-e's sails, birds, and mist, Plakat's band of flat shapes and the shape in front of each section heading, and 3D's floating toys, which bob and lean toward the pointer; 3D also tilts the page's headings and cards a few degrees toward a mouse. It writes the angle only on the elements on screen (writing it on <html> would restyle the whole page every frame), and a block still revealing waits until it lands.

Minimal's reading line and Terminal's status-line percentage follow article scroll instead of looping; Terminal's block cursor blinks. Every style's stylesheet stops its keyframes for reduced motion. You can see the sky on the homepage and inspect its real animation here:

Sky and navigation motion

LOCAL PREVIEW

Activate this specimen to load its real styles. No saved preferences change.

The kirupaBot launcher floats on a 5.333s loop while its icon bounces and turns on 5s loops. Hover and press stop the float and push the button into its hard shadow, and the panel opens with a short reveal; chat messages arrive in 0.18s steps and the typing dots blink each second. Theme variants change the material and easing, never whether the control stays findable and clickable. Reduced motion stops every loop. Neither the sky nor the launcher has an on-page pause yet: reduced motion is their only off switch.

Background icons

Background icons put a few of the reader's own style icons in the empty space beside the text column, moved by scrolling. They never cover the words. kirupa.js loads motion.js and motion.css after the page has loaded, only where icons can show. The layer keeps these clearances:

  • Each margin is a lane from 16px inside the window's edge to 28px from the column. A lane narrower than 64px is dropped.
  • A rail beside the column narrows its lane when it's taller than 60% of the window (fixed) or half the column (on the page).
  • The topic and forum rails, the end-of-article sign-off, the kirupaBot launcher, the onboarding card, the search status, and anything marked data-motion-avoid keep 16px of clearance when fixed and 20px on the page.
  • Images, figures, SVGs, tables, code, iframes, video, and canvases that spill past the column keep 20px. Only the column's first three levels are checked, at most 600 elements.
  • The docked orange keeps 18px, and icons stay below the header art and 12px inside the column's top and bottom, so they never reach the newsletter or footer.
  • kirupa.js skips the download when neither side of the column has 108px, and loads it if a resize makes room.

The art is the reader's own style set, from the same kirupaTwemojiSets and kirupaTwemojiNames map the header uses, like the 404 page's dancers:

StyleSetArt used
Plakatplakat72px PNGs; plakatDark light-ink art on dark pages
Pixel and Terminalpixel-twemoji-16128px PNGs at 32px or 48px, on whole pixels; Terminal's as 1-bit outlines in its foreground
Smoooothsmooooth72px PNGs
Sci-Fiscifi-twemoji72px PNGs
Minimalminimal-twemoji72px PNGs; minimalDark light-ink art on dark pages
Ukiyo-eukiyoe-twemoji72px PNGs
Sketchsketch72px PNGs
3D3d72px PNGs

The 144px sets swap to their 72px copies, which saves most of the bytes (Smooooth: about 21 KB down to 7 KB an icon). Each page draws from one pool: AI pages (30 icons), code topics (26), quizzes (19), Learn (14), or the site pool (16). The order is a shuffle seeded by the page's path, so a page always gets the same icons in the same places. An icon a set lacks tries another icon twice, then shows the original /icon/<code>.svg. html[data-motion-section] picks a pool, and html[data-motion-icons] lists codes of its own.

Readers choose the details in Customize Theme > Background icons. Only choices that differ from the defaults are stored, so readers who never change anything follow future defaults:

SettingChoicesDefaultWhat it sets
MotionOff, Still, Calm, Playful, Lively, DriftPlayfulHow the icons move, below
IconsSparse, Some, LotsSomeOne icon per 120,000, 68,000, or 38,000 square pixels of lane
StrengthFaint, Soft, BoldFaintOpacity 0.22, 0.34, or 0.52
LinesOn, OffOnBonds between nearby icons
Drift restsAfter 3s, NeverAfter 3sWhether Drift stops 3s after scrolling

Each Motion choice has its own model. Depth is how far an icon travels for each pixel scrolled: 1 moves with the page, and smaller values lag behind it:

MotionDepthMovesSettles
OffNoneNothing; the layer is hiddenNot applicable
Still1With the page, like stickers; no script runs while scrollingAlways still
Calm0.2 to 0.5Slower than the page while you scrollThe moment you stop
Playful0.28 to 0.6Lags, tilts up to 9 degrees, and springs backWithin about a second
Lively0.28 to 0.58Dances while you scroll1.2s after the last scroll
Drift0.28 to 0.58Wanders and dances on its own, like the home page's icons3s after you stop, unless Drift rests is Never

Playful's spring adds 0.38 x depth x each frame's scroll distance to an offset capped at 42px, pulls it back with a stiffness of 85 + 40 x depth and a damping of 11, and stops below 0.08px and 0.6px a second. Its tilt is 0.035 degrees per px/s of spring speed.

Lively and Drift dance with five keyframe sets (an 8px bob, a 9-degree sway, a 12px hop, a jelly squash, and a shimmy) on 1.1-2.4s beats; Drift also wanders 10px and 4 degrees on 6-13s loops.

A jump of more than a window, such as an anchor or the End key, moves everything at once without a wobble. Pixel keeps icons on whole pixels and never tilts them. Only Drift moves on its own; the others move only while you scroll.

Each lane splits into one to four sub-columns, one per 110px, each at its own depth, so neighbors slide past each other and the lines form and break. A lane gets round(lane width x (window height + 144) / density) icons, at least 1 and at most 16, on a window-sized strip that wraps around as you scroll, so a long page costs no more than a short one and a window shows at most 32.

Still places icons down the page instead, at the same density, at most 120. It measures their pitch once, spreading them out when a page is too long for 120, and keeps it until the margins or the number of icons change; each slot draws random numbers of its own. A page that grows only gains icons below the ones it has, and a window that changes height moves none.

The script runs one requestAnimationFrame loop only while scrolling or settling: it stops once every spring rests, three frames pass without scrolling, and 100ms pass after the last scroll event. Icons have these sizes, opacities, and lines:

  • Icons are 26-42px below 1100px wide and 30-52px wider, nearer ones bigger, at most 56px and never wider than their sub-column less 8px. Pixel uses 32px or 48px.
  • Opacity is the Strength value x 0.82-1.18 by nearness, x 1.15 on dark pages (Minimal: x 0.9 light, x 1 dark), with saturation at 0.7 (Smooooth 0.75, Sci-Fi 0.8, Minimal 1). The layer fades in over 1.2s, and icons fade over 0.35s as they meet an obstacle or move to a new spot.
  • Lines join icons in the same lane that are less than 170px apart and more than 10px past their edges, at most two per icon, like atoms. They strengthen from 170px to 94px apart and fade out within 30-110px of the window's top and bottom.
  • Pixel and Terminal draw dotted 2px lines on whole pixels (Terminal's in its foreground color), Plakat straight solid 1.25px hairlines in its ink, Smooooth 1.75px curves, Sci-Fi 1px dashed traces in its frame color, Minimal 1px hairlines in the text color, Ukiyo-e 1.25px brushed curves, Sketch quick 1.5px pen lines in its ink, and 3D soft, rounded 3px strings in its accent.

The layer lays out again when the window resizes, when the page or the column changes size (150ms after it settles), when the style, color, or mode changes, when fonts load, and 1.5s after it starts.

A layout that leaves an icon's spot alone leaves the icon alone, mid-spring and mid-tilt included, so content arriving while you scroll, such as an image or the forum's next topics, never snaps an icon back. When a resize or a new choice does move icons, each one on screen fades out where it was while it fades in at its new spot; reduced motion skips the fade.

This specimen runs the production motion.js and motion.css under the footer's cache key, beside the site's real tutorial grid in a 1280 x 800 window scaled to fit. Its controls use Customize Theme's choices but change only this preview, and the line below them reports what the layer is doing. Scroll inside it; Pause motion, like scrolling it out of view, shows the reduced-motion state:

Background icons

LOCAL PREVIEW

Activate this specimen to load its real styles. No saved preferences change.

kirupaBackgroundIcons.status() says why the icons are or aren't showing, and Customize Theme turns it into the hint under its choices:

status()Meaning
waiting-for-load, waitingThe page hasn't finished loading and gone idle yet
loadedmotion.js is running
offMotion is Off
switched offThe footer's rollback switch is off
classic pageThe page uses the old stylesheet
pageA quiz (#quizApp, .quizStage), kirupaBot's chat page (.kb-chat-shell), the icon-field home page previews ([data-hp-hero]), a page with its own motion (html[data-motion], .kmotion), or no text column
data saverThe browser asks to save data
forced colorsHigh-contrast colors are on
demoThe page has a live demo
narrowNeither side of the column has 108px

A page has a live demo when anything is marked data-live-demo, or its column holds a canvas, an autoplaying video, an iframe other than a YouTube video or forum comments, an object or embed (Flash and Silverlight examples), a Ruffle player, a .swfPlayer, a .codepen, a range slider, an output, role="application", or a looping animation already running. Background icons and content reveals share this check and both stand down. Reduced motion doesn't block the icons; it turns every choice into Still.

The layer is aria-hidden, takes no pointer events or keyboard focus, never anchors scrolling, and is hidden in print and forced colors. Its interfaces are:

  • window.kirupaBackgroundIcons (owned by kirupa.js; the footer defines on and v): options, defaults, settings(), save(changes), load(), and status().
  • window.kirupaMotion (from motion.js): get() returns the settings plus effective, reason, count, lanes, and reducedMotion; relayout() and debug() serve tests.
  • Events: kirupa:backgroundicons when a choice changes (detail: the settings) and kirupa:motionchange when the layer changes (detail: get()).
  • Storage: kirupaBackgroundIcons holds only non-default choices as JSON. Icon names come with the pools (code#name), so nothing caches a name map.
  • An address can try settings for one view, as in ?motion=calm&icons=lots; saving a choice clears them.
  • Rollback: set kirupaBackgroundIcons.on to false in footer.shtml. Bump its v after changing motion.js or motion.css.

Background icons on the forum

The forum runs the same layer in all six of its themes. discourse/motion-source.mjs copies the Background icons block from kirupa.js, plus motion.js and motion.css, into the forum's KIRUPA Theme Selector when its themes are built, so the presets, defaults, events, and status() match the site's. kirupa-forum-motion.js supplies what differs on Discourse:

  • The column is Discourse's content wrapper, #main-outlet-wrapper: the sidebar, topics, timeline, and banner. It's 1350px wide with the sidebar and 1110px without, so the 108px room check passes only in windows about 1570px and wider, or about 1330px with the sidebar hidden. Hiding the sidebar loads the icons without a resize, and showing it clears them; phones and narrower windows load nothing.
  • Icons keep clear of the sticky header, Pixel's header sky, the composer, the chat drawer, the onboarding card, and anything marked data-motion-avoid. Modals, menus, the lightbox, and Customize Theme open above them.
  • status() reports page on admin pages and full-page chat, and demo when a post holds a live demo, using the site's check on the posts each time Discourse changes page. Reduced motion, data saver, forced colors, and print work as on kirupa.com.
  • Every forum page uses the site icon pool. The art comes from kirupa.com's absolute URLs, and the name map is bundled, since kirupa.com's has no cross-origin access.
  • Choices are saved per browser as kirupaForumBackgroundIcons, apart from kirupa.com's kirupaBackgroundIcons, and Reset to default clears them.
  • The forum has no content reveals, and its Customize Theme leaves out the Content reveals group.
  • The selector's kirupa_background_icons theme setting, on by default, removes the layer and its choices for everyone and keeps readers' saved choices.
  • discourse/tests/motion.mjs checks it, including content arriving mid-scroll: run npm run test:browser -- --state <state.json> --published --motion-only in discourse/, in Chromium and again with --browser webkit.

Content reveals

Content reveals fade blocks of a page up the first time they scroll into view, like the home page's sections. kirupa.js loads reveal.js and reveal.css after the page has loaded, and readers choose in Customize Theme > Content reveals:

ChoiceWhat movesDurationRiseStaggerStarts
OffNothingNoneNoneNoneNever
Figures onlyImages, SVG diagrams, pictures, and figures, never words400ms8px, growing from 94%NoneWhen any part is in view
All sections (default)Every block700ms24px70ms, at most 4 steps (280ms)When it's 8% of the window above the bottom edge

Both animate only opacity and a transform, with the home page's cubic-bezier(.2, .7, .2, 1) easing. A block counts as a figure when it is one, or holds one and no text. All sections' 700ms is longer than the 500ms NN/g found reads as slow; it matches the home page by choice.

These guarantees hold on every page:

  • Progressive: the HTML and stylesheet hide nothing. Only blocks below the window at the first measurement are held, so without JavaScript, for crawlers, and in print, the page is complete.
  • Above the fold never animates, and neither does anything above the window or peeking into it, counting an image that overhangs its block.
  • Each block reveals once and is then forgotten.
  • Stopping shows anything still held on screen, with its reveal: on scrollend, with a 400ms fallback, or 200ms after the last scroll where scrollend isn't supported.
  • A block arriving from above, or with its top in the top 35% of the window, shows at once.
  • A held block takes no clicks, so a press can't focus a link that's about to move.
  • Screen readers read held text; opacity never hides it from them.

Scrolling the reader does reveals as it goes. Anything else that moves the page is a jump, which shows what it lands on at once until the reader scrolls again:

InputResult
Trackpad or mouse wheel, momentum includedReveals as it goes
TouchReveals as it goes
Arrow keys, Page Up, Page Down, and SpaceReveal as they go
Opening at an anchorShows at once for the first 1.5s
A link to a spot on the same page, even a smooth oneShows at once
Home, End, and Cmd+Up or Cmd+DownShows at once
More than 80% of a window in one step, without reader input in the last secondShows at once
The scrollbar, autoscroll, or a scriptShows at once after 40ms of scrolling with no reader input in the last half second
Find in page (Ctrl or Cmd+F, Ctrl or Cmd+G, F3)Shows everything
Keyboard focus on a held blockShows that block
PrintingShows everything
Hiding the tabFinishes every fade in progress

The fast-scroll guard is off. Showing blocks at once above 2,400px a second skipped most reveals, because ordinary trackpad flicks pass that speed: a flick on the AI agent article peaked near 3,600px a second in WebKit. The wheel and touch listeners are passive, and the capturing key listener never calls preventDefault, so nothing holds up a scroll.

Code, tables, embeds, canvases, video, audio, Flash and Ruffle players, CodePens, syntax-highlighted blocks, forms and form controls, meters, progress bars, quiz UI, kirupaBot, the background icons, the onboarding card, dialogs, details, and anything hidden, fixed, sticky, already transformed, or already animating are never held. A wrapper that holds one of them is opened instead, so its other children still reveal.

Interactive widgets are found from their parts up, so nothing a reader is using moves or waits:

  • A part is a form, an output, a live region, a widget role (status, log, alert, timer, marquee, progressbar, application, toolbar, tablist, tabpanel, grid, treegrid, tree, listbox, menu, menubar, or radiogroup), anything marked data-live-demo, kirupaBot's chat, or a control: a button, input, select, textarea, editable region, or control role.
  • Hidden parts don't count, and neither does a lone copy or run button beside a code block.
  • Each part climbs to the biggest box inside the nearest content: the column, an article with its own h1 or h2, a box with three or more paragraphs, headings, lists, quotes, or figures of its own, or a frame whose widgets all sit inside its sections, articles, headers, footers, asides, or navs.
  • A box with a widget part or two controls is a widget and stays exactly as it is. A lone control keeps only the box it sits in still, so Learn's "Show all" button doesn't stop the list above it from revealing.

Lists longer than six items reveal item by item. Sections, articles, headers, footers, the column, divs with three or more children, and anything taller than 1.5 windows are opened, up to four levels deep.

kirupaContentReveals.status() reports like the icons: waiting-for-load, waiting, loaded, off, switched off, classic page, page (quizzes, quiz previews, kirupaBot's chat page, html[data-reveal] pages, and the home page), forced colors, reduced motion, or demo. reveal.js also stays off without IntersectionObserver, and for crawlers that name themselves (bot, crawl, spider, slurp, lighthouse, inspectiontool, or preview in the user agent). Turning on reduced motion or high-contrast colors mid-page ends every fade at once and shows everything.

This specimen runs the production reveal.js and reveal.css under the footer's cache key, in a short article that scrolls inside its frame. Choose a mode and scroll with a trackpad, a wheel, or the arrow keys; Replay reveals goes back to the top and holds everything below the frame again. Pause motion, like reduced motion, shows everything:

Content reveals

LOCAL PREVIEW

Activate this specimen to load its real styles. No saved preferences change.

One IntersectionObserver watches every block, and each block is unobserved once it shows. Positions are read only when a scroll settles, never while it runs. Only opacity and transform animate, with no will-change, so text never reflows; reveal.css applies nothing until the script marks a block. Both layers load after the page's load event, once the browser is idle or within 2s (400ms where requestIdleCallback is missing). Measured on kirupa.com at 1440x900, medians of 5 runs on the AI agent article, the long JavaScript objects tutorial, and Learn:

MeasureBefore revealsAll sectionsReveals Off
Layout shift (CLS)0-0.00060-0.00060-0.0006
Long tasks000
Scroll frames, 95th percentile16.7-16.8ms16.7-16.8ms16.7-16.8ms
Slowest of 3 clicks and 3 Page Downs32-48ms32-40ms32-40ms
The same, with a 4x slower CPU32-40ms40-80ms40-56ms
reveal.js script timeNone6-46ms (6-99ms at 4x)None

Background icons were on in every run; motion.js took 9-39ms of script at normal speed and 5-116ms at 4x.

Its interfaces are:

  • window.kirupaContentReveals (owned by kirupa.js): on, v, options, defaults, settings(), save(changes), load(), and status().
  • window.kirupaReveals (from reveal.js): get() returns the choice, mode, reason, and counts (blocks, kept, animated, instant, and waiting); debug() and blocks() serve tests.
  • The kirupa:contentreveals event (detail: { reveals }) announces a new choice and restarts reveal.js from where the page is.
  • Markup: html[data-kreveal] names the running mode. Held blocks have .kreveal-wait, revealing ones .kreveal-go with --kreveal-delay, and blocks shown at once .kreveal-now.
  • Storage: kirupaContentReveals holds {"reveals": ...} only when it isn't All sections, and ?reveals=off or ?reveals=figures tries a choice for one view.
  • Rollback: set kirupaContentReveals.on to false in footer.shtml, which also hides the choice. Bump its v after changing reveal.js or reveal.css.

Reveals cost reading time, so the previews measured it. A simulated reader went through the long JavaScript tutorial at 1440x900, scrolling a screenful and stopping to read, with each option:

RevealStops on fading textWait to readAnimations a minute
None0 of 6None0
Figures only (0.4s)0 of 6None6
Fade up (12px over 0.45s)6 of 60.22s66
Headings first6 of 60.23s66
Cascade (60ms apart)6 of 60.31s66
The home page's reveal, now All sections6 of 60.44s, up to 0.47s66
Scroll-linked6 of 6Until you scroll againNot measured

All sections is the default because the site's owner chose the home page's reveal for every page after comparing these previews; the guarantees above keep its cost to that short wait at each stop. Figures only exists for readers who would rather the words never move, and it delayed no text in any test. Scroll-linked is never used: it can't reveal just once, and whatever sits at the bottom of the window stays half-faded until the next scroll. The scroll motion previews keep every option for comparison.

The research agrees on the limits. NN/g found that scroll-triggered text animations delay readers (2017), that fades longer than 500ms read as too slow, and suggest 100-400ms fades, played once, one element type at a time (2023). The onset of motion captures attention even when it's irrelevant (Abrams and Christ, 2003), and animation beside a task slows information seeking, most when it's bright or resembles the task (Zhang, 2000). That's why the icons stay faint, desaturated, and in the margins, settle when scrolling stops, and why every reveal plays once.

Home page

The live homepage uses the shared layers like any page: its search box and numbered sections carry data-motion-avoid, as tutorial text does, so Background icons stay in the gutters beside them, and Content reveals bring in its sections. The earlier icon-field design, kept on the index_preview*.htm previews, draws its own motion, so both site-wide layers stand down on [data-hp-hero] there, and Customize Theme's hints describe that page instead. Its pieces are:

  • Icons: one per AI Fundamentals explainer, swapped to the reader's style by the header. The page shows up to 12 (the first icon of each of its 8 tracks, plus 4 more), and windows narrower than 700px show up to 8, taken round-robin so every track keeps one. They're 38-56px (30-40px narrow), placed in the open space around the words with 22px of clearance. Each wanders 12px and 5 degrees on a 6-13s loop and dances on a 1.2-2.6s beat.
  • Hovering an icon shows its title and track and makes it boogie, and a click opens the explainer. The icons are links with tabindex="-1" in an aria-hidden layer, because every explainer is also linked in the page.
  • Tour: the four "Ever wondered..." questions light up their track's icons in turn, 2.6s after the page opens and then every 5.5s, with a progress bar. Hover or focus holds a question, and leaving resumes 5.5s later. It doesn't advance while the tab is hidden.
  • Tour label: on windows wider than 1200px it hangs under or over a lit icon beside the column, 24px from the words and 16px from the window's edge, on a 36px line. Narrower windows put it beside an icon on a 38px line. It's 190-290px wide, needs 170px of room, stays clear of the words and the kirupaBot launcher, and moves back into view 160ms after a scroll settles. With no room, the icons light up alone.
  • Its own reveal: sections rise 24px and fade in over 0.7s, 70ms apart for up to 4 that arrive together, once each, when they're 8% of the window above its bottom edge.
  • Background icons > Motion: Off hides the icons, the tour label, and the titles. Still holds the icons and stops the tour on the first question's track, as reduced motion does. Every other choice lets them move.
  • Content reveals: Off shows every section at once. Figures only shows text and cards at once, lets only the icons rise 8px over 0.4s, and still fills the track meters. All sections keeps the whole-section reveal. Reduced motion shows everything at once in every mode.

Authoring motion

Opt a page, section, or element out with these hooks:

HookWhereEffect
data-live-demoA lab, game, or runnable exampleThe page counts as a live demo: no icons and no reveals
data-reveal-skipAny elementThat element is never held
data-motion-avoidAny elementIcons keep 16-20px clear of it
data-motion<html>The page runs its own motion: no icons and no Background icons choice
data-reveal<html>The page runs its own reveal: no reveals and no Content reveals choice
data-hp-heroThe home page's openingBoth layers stand down
data-motion-section<html>Picks an icon pool: ai, code, quiz, learn, or site
data-motion-icons<html>Lists the icon codes to use, separated by spaces

A new animation needs a reason: orientation, feedback, or a deliberate moment of delight. Give it one owner, a still state, a reduced-motion path, and a way to turn it off, ideally a Customize Theme choice. Animate opacity and transform, read layout only when a scroll settles, stop work offscreen and in hidden tabs, and never move text someone is reading.

Testing

Test motion the way readers scroll. tools/motion.browser.mjs runs the site-wide layers in WebKit or Chromium (BROWSER=webkit or chromium; point DESIGN_PLAYWRIGHT_PATH at .github/tools/node_modules/playwright/index.mjs). By default it serves this checkout with its includes expanded and no network; set BASE to read a running site instead, which it never posts to. It checks that:

  • Articles, tutorials, and Learn reveal under trackpad-style wheel flicks and leave nothing hidden once they stop, while above the fold never dims.
  • The End key, keyboard focus, anchors, find in page, and print show content at once, and nothing is hidden without JavaScript or with reduced motion.
  • Labs, coding exercises, quizzes, and the home page stand down, the home page runs its own reveal, and widgets with their markers removed are never held.
  • Background icons stay out of the text column and rails, follow each Motion choice, turn Still for reduced motion, and leave the page for Off.
  • Content arriving mid-scroll snaps no spring back and moves no Still icon on screen, and a resize that moves icons crossfades them.
  • Customize Theme stores only choices that differ from the defaults, and Reset clears them.

Scroll with many small mouse.wheel steps that slow down like a trackpad's momentum, in WebKit as well as Chromium. A programmatic scroll is a jump and shows everything at once, so it proves nothing about reveals. Check every style in light and dark, and compare CLS, long tasks, and the slowest click or key with the layer off.

Motion files are cached hard. The origin ignores ?v=, and Cloudflare's edge keeps CSS and JS for about 31 days under each exact URL, so follow these rules:

  • Bump the footer's v for motion.* or reveal.*, and the kirupa.js key, with every change, and publish footer.shtml last.
  • Upload a file before anything references its new key, and never request a new key before its upload: the edge would keep the old bytes under the new key for a month.
  • A rollback needs fresh keys too, because going back to an old key serves whatever the edge holds for it.
  • design/generated/motion-specimen-config.js copies the footer's keys and Customize Theme's choices for these specimens, under its own content hash, so rebuild the design system after changing them.
  • Do give every animation a reason, a still state, a reduced-motion path, and a way to turn it off.
  • Do animate opacity and transform, read layout only when scrolling settles, and stop work offscreen and in hidden tabs.
  • Do mark labs, games, and runnable examples with data-live-demo.
  • Do test with trackpad-style wheel flicks in WebKit and Chromium, not programmatic scrolls.
  • Do keep keyboard focus and hit targets stable through a transition.
  • Do not move or hold back text someone is reading, code, tables, embeds, or anything they can interact with.
  • Do not move decoration when content arrives; only a resize or a new choice may, and then crossfade.
  • Do not start motion while the reader is still, except Drift, which readers choose, and the home page's opening.
  • Do not use a spinning or bouncing object to conceal a loading error.
  • Do not request a new ?v= key before its file is uploaded.
Source mapssi/newDesign/src/motion.jsssi/newDesign/src/motion.cssssi/newDesign/src/reveal.jsssi/newDesign/src/reveal.cssssi/newDesign/src/kirupa.jsssi/newDesign/src/footer.shtmlssi/newDesign/src/header.shtmlssi/newDesign/src/kirupabot-widget.cssssi/newDesign/styles/scifi.jsssi/newDesign/styles/ukiyoe.jsssi/newDesign/styles/plakat.jshome_proposal/icons.jshome_proposal/home.jshome_proposal/home.csshome_proposal/variants.csshome_proposal/preview.csstools/motion.browser.mjsscroll_preview/overview.htmdiscourse/motion-source.mjsdiscourse/selector/javascripts/discourse/lib/kirupa-forum-motion.jsdiscourse/tests/motion.mjs