
Speeding marquee
Scroll, Text, Hover
Scroll inside the preview
The scrolling page of a made-up course, the Keelson Analyst Track, five chapters from the first brief to a job offer. Fixed at the top there is a short 300 pixel ruler: a small tick every 10vh of scroll, a tall named tick at every chapter, the track sliding under a still needle and a lens that lifts the nearby ticks from 9 to 18 pixels. Under the mouse the ruler turns into five buttons that take you to a chapter. On the right a glass pill keeps the points: +100 the first time you reach each chapter, the number counting for 2 seconds and the edge lighting up gold.
Rebuilt from scratch studying why.zero.university by Sindhur Dutta, Zero: the idea is theirs; code, copy and images are ours. Read how it’s made
A folder that runs on its own: index.html, style.css, script.js and the libraries from a CDN. The React and Vue tabs hold the same demo as a ready component, which switches its animations off when it leaves the page.
<!doctype html>
<!--
"Chapter ruler" from Animorio · https://animorio.com
License: free on your own sites and your clients’ sites, paid work included.
Not for resale, redistribution, templates or code collections · https://animorio.com/en/license/
-->
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Keelson Analyst Track</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/geist@5.3.0/index.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/geist-mono@5.3.0/index.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<!-- the scrolling page of a made-up course, the Keelson Analyst Track: five chapters from a real brief to a job offer.
Fixed at the top, a short ruler tells where you are: one small tick every 10vh of scroll, a tall tick with its
name at every chapter, the track sliding under a still needle and a lens that lifts the ticks near it. Hover the
ruler and it turns into five buttons that take you to a chapter. On the right a glass pill keeps your points:
+100 the first time you reach each chapter. -->
<div class="hud" data-hud>
<nav class="ruler" data-ruler aria-label="Chapters">
<div class="ruler__track" data-track aria-hidden="true"></div>
<div class="ruler__needle" data-needle aria-hidden="true"></div>
<div class="ruler__nav" data-nav></div>
</nav>
<div class="xp" data-xp aria-live="polite">
<svg class="xp__icon" viewBox="0 0 16 16" aria-hidden="true">
<path class="xp__hex" d="M8 1.6 13.5 4.8v6.4L8 14.4 2.5 11.2V4.8z"/>
<path class="xp__core" d="M8 5.2 10.4 6.6v2.8L8 10.8 5.6 9.4V6.6z"/>
</svg>
<span class="xp__value" data-xp-value>0</span>
<span class="xp__label">XP</span>
<span class="xp__gain" data-xp-gain aria-hidden="true">+100</span>
</div>
</div>
<main class="course">
<section class="chapter" data-chapter data-label="Brief">
<div class="chapter__inner">
<p class="chapter__kicker"><b>Keelson Analyst Track</b><span class="soft">Brief, weeks 1 to 2</span></p>
<h2 class="chapter__title" data-title>Start with a real brief.</h2>
<p class="chapter__line">A grocery chain wants to know why baskets got smaller. You get the same email their analyst got.</p>
<div class="meta">
<div class="meta__cell"><span>Lessons</span><b>6</b></div>
<div class="meta__cell"><span>Time</span><b>4 h 20</b></div>
<div class="reward" data-reward><span class="reward__idle">+100 XP</span><span class="reward__done"><svg viewBox="0 0 12 12" aria-hidden="true"><path d="M2.4 6.3 4.9 8.7 9.6 3.6" pathLength="1"/></svg>Earned</span></div>
</div>
</div>
</section>
<section class="chapter" data-chapter data-label="Data">
<div class="chapter__inner">
<p class="chapter__kicker"><b>Data</b><span class="soft">Weeks 3 to 5</span></p>
<h2 class="chapter__title" data-title>Clean what they give you.</h2>
<p class="chapter__line">Forty thousand receipts, three date formats and one missing week. Nobody tidies it for you.</p>
<div class="meta">
<div class="meta__cell"><span>Lessons</span><b>8</b></div>
<div class="meta__cell"><span>Time</span><b>6 h 10</b></div>
<div class="reward" data-reward><span class="reward__idle">+100 XP</span><span class="reward__done"><svg viewBox="0 0 12 12" aria-hidden="true"><path d="M2.4 6.3 4.9 8.7 9.6 3.6" pathLength="1"/></svg>Earned</span></div>
</div>
</div>
</section>
<section class="chapter" data-chapter data-label="Model">
<div class="chapter__inner">
<p class="chapter__kicker"><b>Model</b><span class="soft">Weeks 6 to 8</span></p>
<h2 class="chapter__title" data-title>Find the reason, not a chart.</h2>
<p class="chapter__line">Build the basket model in a notebook a reviewer can run again from the first cell.</p>
<div class="meta">
<div class="meta__cell"><span>Lessons</span><b>7</b></div>
<div class="meta__cell"><span>Time</span><b>5 h 40</b></div>
<div class="reward" data-reward><span class="reward__idle">+100 XP</span><span class="reward__done"><svg viewBox="0 0 12 12" aria-hidden="true"><path d="M2.4 6.3 4.9 8.7 9.6 3.6" pathLength="1"/></svg>Earned</span></div>
</div>
</div>
</section>
<section class="chapter" data-chapter data-label="Pitch">
<div class="chapter__inner">
<p class="chapter__kicker"><b>Pitch</b><span class="soft">Weeks 9 to 10</span></p>
<h2 class="chapter__title" data-title>Say it in four slides.</h2>
<p class="chapter__line">Present to a hiring manager who has already read a hundred decks this year.</p>
<div class="meta">
<div class="meta__cell"><span>Lessons</span><b>5</b></div>
<div class="meta__cell"><span>Time</span><b>3 h 30</b></div>
<div class="reward" data-reward><span class="reward__idle">+100 XP</span><span class="reward__done"><svg viewBox="0 0 12 12" aria-hidden="true"><path d="M2.4 6.3 4.9 8.7 9.6 3.6" pathLength="1"/></svg>Earned</span></div>
</div>
</div>
</section>
<section class="chapter" data-chapter data-label="Offer">
<div class="chapter__inner">
<p class="chapter__kicker"><b>Offer</b><span class="soft">Week 11</span></p>
<h2 class="chapter__title" data-title>Walk in with proof.</h2>
<p class="chapter__line">Your project, reviewed and signed, goes to the partner teams that are hiring now.</p>
<div class="meta">
<div class="meta__cell"><span>Partner teams</span><b>38</b></div>
<div class="meta__cell"><span>To an offer</span><b>9 wks</b></div>
<div class="reward" data-reward><span class="reward__idle">+100 XP</span><span class="reward__done"><svg viewBox="0 0 12 12" aria-hidden="true"><path d="M2.4 6.3 4.9 8.7 9.6 3.6" pathLength="1"/></svg>Earned</span></div>
</div>
</div>
</section>
</main>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/ScrollTrigger.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/lenis@1.3.26/dist/lenis.min.js"></script>
<script src="script.js"></script>
</body>
</html>Change values, colours and text with the controls and watch the animation respond live. Or write in the code yourself. Then download the folder with your changes.
72 values to change
With the Animorio connector, Claude Code, ChatGPT, Cursor or VS Code take it from here, guide included, and fit it into your project. Paste this request:
Take “Chapter ruler” from Animorio and fit it into my siteThe ruler is built from the real heights of the chapters: a tall tick for each chapter at its position (offsetTop over the maximum scroll) and between one and the next Math.round(height in vh / 10) - 1 small ticks, one every 10vh. The track is (number of ticks - 1) times 12 pixels wide and every tick sits at progress times width, minus half a step. On resize it is rebuilt.
On every frame of the GSAP ticker the scroll progress moves the track by centre minus progress times width, with a translate3d: at progress 0 the first tick is under the needle, at 1 the last one. The needle, 2 by 18 pixels, never moves. On the sides a mask from transparent to black at 8% and 92% makes the ticks fade at the edges.
The lens reaches three times the average gap between two small ticks. For each tick inside it the distance becomes n between 0 and 1, the smoothstep n times n times (3 - 2n) gives the height from 18 down to 9 pixels, rounded to a tenth: the style is written only when the height really changes, and far ticks go back to rest only once.
With the mouse over it the ruler takes the is-nav class: track and needle go to opacity 0 in 0.25 seconds, the mask comes off and five buttons appear 26 pixels apart, with a line under each from 28 to 40 pixels; the active one is 2 tall. A click asks Lenis to scroll to the chapter with a cubic ease while a 12 pixel ring turns in place of the name. On a phone a tap opens and closes the buttons.
A Set remembers the chapters already seen: on a first visit the total becomes chapters seen times 100 and a 2 second power2.out tween writes the number into a single text node, leaving the rest of the pill alone. The is-ripple class, removed and added again after reading offsetWidth, restarts two 1.8 second keyframes from zero: the gold ring with its halo and the warming fill.
Lenis 1.3.26 does the smooth scroll and calls ScrollTrigger.update; its raf runs in the GSAP ticker. Each chapter has a ScrollTrigger that, when it reaches 72% of the window, lifts the words of the title out of their slot, one every 0.07 seconds, then the line and the figures.
| Name | File | Default | What it changes |
|---|---|---|---|
RULER_WIDTH | script.js | 300 | Width of the ruler in pixels (the site uses 300). |
TICK_EVERY | script.js | 10 | One small tick every this many vh of scroll (the site uses 10). |
TICK_STEP | script.js | 12 | Pixels between two ticks on the ruler (the site uses 12). |
LENS_STEPS | script.js | 3 | How many ticks on each side the lens lifts (the site uses 3). |
LENS_HEIGHT | script.js | 18 | Height in pixels of the tick right under the needle; at rest they are 9. |
POINTS | script.js | 100 | Points for reaching a chapter the first time (the site gives 100). |
COUNT_TIME | script.js | 2 | Seconds the number takes to count up to the new total (the site uses 2). |
GLOW_TIME | script.js | 1.8 | Seconds the edge of the pill stays lit (the site uses 1.8). |
SMOOTH | script.js | 1.1 | Seconds of the Lenis smooth scroll; 0 for the browser’s plain scroll. |
For a long page split into chapters or stages: an online course, a training path, a scrolling story, a case study, an annual report or the onboarding of an app. When you want to tell people where they are without a progress bar, and reward those who keep going with a small points game.
The same animations with adapted sizes: the ruler stays, narrower (up to 300 pixels, leaving room for the pill) and moved to the left, the pill on the right on the same row, the chapter buttons closer together; the chapters are sized on the height too. Without a mouse a tap on the ruler opens the buttons and a tap outside closes them.
No lens: the ticks all stay short and the track only follows the scroll. No smooth scroll and no ride to the chapters: the button jumps at once. The points change without counting, the gold edge only fades, titles and chips fade in.
GSAP 3.15.0, ScrollTrigger 3.15.0, Lenis 1.3.26, Geist (font variabile) 5.3.0, Geist Mono (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 10 KB; the libraries: GSAP + ScrollTrigger 45 KB, Lenis 5.3 KB.
Tested on 11 November 2026
Use it in your own projects and in your clients’ projects. Do not resell it or redistribute it as is. GSAP stays under its own Standard license. Full license.
Support Animorio
Animorio stays free thanks to the people who support it. If you like, buy us a coffee: it helps us make the next animations.
You asked for
We made it for you: it’s in the library, with the preview, the Playground and the code to copy.
An animation you can’t find, or a site to take apart in the journal: tell us which. We pick the next ones from here.
With your account’s email and password.
or with your email
You’re signed in as .
With your account, you can download the zip of every animation and every pack, for free.