Skip to content
animorio
IT
Back to the library

Colour-shifting hero title

Scroll, TextGSAP, Canvas, CSS onlyAdvancedCompressed weight: Demo 9.4 KBGSAP 28 KBLenis 5.3 KBFreeDownload the zip

Scroll inside the preview

A scroll animation for the opening (hero) of a page: Ignite Fund, a made-up fund investing in climate technology. The full screen ‘video’ is the thermal camera of a heat storage test cell, and the headline is written twice: a dark copy on the cream paper and a light copy cut with a clip-path exactly on the video's frame. On arrival the lines slide in from 100 pixels and the words pop in one by one like beats; scrolling, the frame shrinks travelling along an ellipse and the headline changes colour wherever the frame passes.

Rebuilt from scratch studying breakthroughenergy.org by Resn: the idea is theirs; code, copy and images are ours. Read how it’s made

The code

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>
<!--
  "Colour-shifting hero title" 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>Ignite Fund hero</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/inter-tight@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 opening of a made-up climate fund, Ignite Fund. A live heat field from a thermal storage test cell fills the
       screen and the headline is written twice: a dark copy on the cream page and a light copy cut with a clip-path
       exactly on the panel. Scrolling, the panel shrinks and travels along an ellipse; where it passes, the headline
       turns light. -->
  <main>
    <section class="hero" data-hero>
      <div class="stage" data-stage>
        <div class="page" aria-hidden="true">
          <div class="page__cols"></div>
          <div class="page__grain"></div>
        </div>
        <div class="spill" data-spill aria-hidden="true"></div>

        <div class="panel" data-panel aria-hidden="true">
          <div class="panel__in">
            <canvas class="panel__heat" data-heat></canvas>
            <div class="panel__scan"></div>
            <div class="panel__grain"></div>
            <div class="hud" data-hud>
              <svg class="hud__corner hud__corner--tl" viewBox="0 0 14 14"><path d="M.5 13.5V.5h13"/></svg>
              <svg class="hud__corner hud__corner--tr" viewBox="0 0 14 14"><path d="M.5 .5h13v13"/></svg>
              <svg class="hud__corner hud__corner--bl" viewBox="0 0 14 14"><path d="M.5 .5v13h13"/></svg>
              <svg class="hud__corner hud__corner--br" viewBox="0 0 14 14"><path d="M13.5 .5v13H.5"/></svg>
              <div class="scale">
                <span class="scale__label">1,300 &deg;C</span>
                <span class="scale__bar"></span>
                <span class="scale__label">400 &deg;C</span>
              </div>
              <div class="probe" data-probe>
                <svg class="probe__cross" viewBox="0 0 22 22"><path d="M11 0v8M11 14v8M0 11h8M14 11h8"/><rect x="7.5" y="7.5" width="7" height="7" rx="1"/></svg>
                <span class="probe__read"><b data-temp>1,184</b> &deg;C</span>
              </div>
              <p class="hud__tag">Thermal storage &middot; test cell</p>
            </div>
          </div>
          <span class="panel__rim"></span>
        </div>

        <!-- the copy: written once here, cloned by the script into the light copy over the panel -->
        <div class="layer layer--dark" data-layer>
          <header class="nav">
            <a class="brand" href="#" data-hov>
              <svg class="brand__mark" viewBox="0 0 24 24" aria-hidden="true">
                <rect x="1" y="1" width="22" height="22" rx="7"/>
                <path d="M12.4 5.2c2.9 3.3 4.6 5.6 4.6 8.4a5 5 0 0 1-10 0c0-1.9 1-3.4 2.4-4.8.3 1.5 1 2.4 2 2.8.2-2.4-.2-4.2 1-6.4z"/>
              </svg>
              <span>Ignite Fund</span>
            </a>
            <nav class="nav__links" aria-label="Main">
              <a href="#" data-hov>Portfolio</a>
              <a href="#" data-hov>Approach</a>
              <a href="#" data-hov>Founders</a>
              <a href="#" data-hov>Insights</a>
            </nav>
            <a class="nav__cta" href="#" data-hov><span>Get in touch</span></a>
          </header>

          <h1 class="title" data-title>
            <span class="line" data-line>Funding the founders</span>
            <span class="line" data-line>who rebuild</span>
            <span class="line line--end" data-line><em>energy</em></span>
          </h1>

          <footer class="foot">
            <p class="foot__hint">
              <svg class="foot__arrow" data-arrow viewBox="0 0 12 16" aria-hidden="true"><path d="M6 1v13M1.5 9.5 6 14l4.5-4.5"/></svg>
              <span>Scroll for more</span>
            </p>
            <p class="foot__meta"><b>$1.2B</b> committed across <b>64</b> companies</p>
          </footer>
        </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/lenis@1.3.26/dist/lenis.min.js"></script>
  <script src="script.js"></script>
</body>
</html>

Playground

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.

35 values to change

Or ask your AI assistant for it

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 “Colour-shifting hero title” from Animorio and fit it into my site
Platform licenseFree on your sites and your clients’ sites. Want it inside a website builder, a template platform or a client dashboard? There’s a license for agencies and platforms.

What it does

On arrival the screen is almost all a dark frame with round corners, a few pixels off the edges: inside, the thermal camera of a test cell lights up in two seconds, an orange ember breathing and drifting slowly, with the thin lines of the sheet, the grain, the four corners of the viewfinder, a temperature scale from 400 to 1,300 °C on the side and a crosshair following the hottest spot and reading its temperature, around 1,180 °C. Over it, in cream, the top bar comes down with Ignite Fund's flame mark, four links and the ‘Get in touch’ pill; then the headline ‘Funding the founders / who rebuild / energy’, with the last line on the right: every line slides in from 100 pixels while its words pop in one after the other, at once, like beats. At the bottom ‘Scroll for more’ with a swaying arrow and ‘$1.2B committed across 64 companies’. Scrolling, the frame leaves the edges and shrinks to a fifth, travelling along an ellipse from the middle towards the top: it takes a warm layered shadow and a 1px rim that catches the light at the top, and throws an orange glow on the cream paper with its twelve thin columns. Outside the frame the headline, the menu and the words are black and ‘energy’ is orange; inside they stay cream: the border runs exactly on the frame's edge and cuts the letters in half. At the end the small frame rests at the top, over the first line, with a piece of ‘the founders’ still light. Scrolling back it all goes back.

How it works

The copy written twice

The copy layer (bar, headline, footer) is written once in the HTML; the script clones it into a light copy, aria-hidden and without pointer, placed on top. The dark copy sits on the paper, the light one is cut with clip-path: inset(top right bottom left round r) worked out every frame from the frame's rectangle, so the border between the two colours is the video's edge.

Lines and words like beats

A paused timeline: every line starts at x 100 and arrives in 0.6 s with circ.out, the lines 0.6 s apart from 0.25 s; the words of a line pop in at once (0.001 s) spread over 80% of the line's time. The timeline does not play itself: a 3.4 s tween with sine.out takes its progress from 0 to 1.

The frame on an ellipse

Four numbers moved by a second paused timeline, all power2.inOut: rect down to 0.3 in 1.5 s, z down to 0.7 in 2 s, the turn from 0.5 to 0.75 in 2 s from 0.2, the radius from 0 to 1.02 in 1.7 s from 0.3. The scale is rect times z, the angle is the turn times 2π (from the left to the top), the radius is z times radius times the height, and x is multiplied by width over height, so the orbit is an ellipse as wide as the screen.

Scroll in screen heights

No ScrollTrigger: every frame the scroll divided by the screen's height gives the point, and between 0.2 and 2.5 heights it becomes the progress of the frame's timeline, chased with exponential damping. Lenis smooths the wheel with 0.8 s and an expo out.

The thermal camera on canvas

A field about 180 pixels wide worked out every frame and stretched by the browser, like a thermal camera: two hot cores drifting, warped by a noise, with the thin lines of the firebricks, and a colour table from black to oxide, ember, amber and cream. On top, scan lines, grain and the crosshair on the hottest core.

Values to change

NameFileDefaultWhat it changes
RIDEscript.js1How much scroll the frame's trip takes: 2 is twice as long.
ARRIVEscript.js3.4Seconds the headline takes to come in.
LINE_TIMEscript.js0.6Seconds each line takes to slide in.
SHIFTscript.js100How many pixels each line slides in from.
END_SCALEscript.js0.21How small the frame gets at the end.
ORBITscript.js0.3How far the frame travels along the ellipse.
RADIUSscript.js16How round the frame's corners are, in pixels.
HEATscript.js1How bright the heat glows in the cell.
FLOWscript.js1How fast the heat moves.

Try them in the Playground

When to use it

For the opening of a fund, a climate or energy startup, an agency or a product with a strong video: when the headline has to sit over the video and stay readable while the video gets small and makes way for the page.

On phones

The same animation with adapted sizes: the headline is sized on width and height, the bar keeps only the mark and the pill, the temperature scale and the cell label go away; the frame starts full screen, shrinks along the ellipse and always stays inside the edges.

With reduced motion

The headline is already in place, with no sliding lines or popping words, and the heat is still: scrolling past half way, the big frame fades out and comes back small at the top, with the headline already split in two colours; scrolling back it grows again the same way.

Pitfalls

  • The light copy's clip-path and the frame have to come from the same sum in the same frame: reading them with getBoundingClientRect after a CSS transition leaves a pixel of text in the wrong colour on the edge.
  • The frame changes width and height in pixels, it does not scale: so the corners stay equally round and the 1px rim stays one pixel, and the clip-path uses the same radius with round.
  • The words pop in on both copies with the same tween, otherwise for a frame a word exists on only one side of the edge.
  • The light copy is a clone: no duplicate ids, aria-hidden, tabindex -1 on the links, and the dark copy's hover is copied by hand onto the light one.

Libraries

GSAP 3.15.0, Lenis 1.3.26, Inter Tight (font variabile) 5.3.0, Geist Mono (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 9.4 KB; the libraries: GSAP 28 KB, Lenis 5.3 KB.

Testing

Tested on 4 November 2026

  • Desktop: Done
  • Phone: Done
  • Reduced motion: Done
  • Safari on iPhone: To do

License

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.

All animations