Skip to content
animorio
IT
Back to the library

Fund return chart

Scroll, SVGGSAP, CSS onlyMediumCompressed weight: Demo 11 KBGSAP + ScrollTrigger 45 KBLenis 5.3 KBFreeDownload the zip

Scroll inside the preview

A scroll animation in the minimal premium style of product pieces: the ten-year page of a made-up investment fund, Velmora Global Equity, on a dark glass card. Scrolling down the gold line of the value draws itself in SVG from 2016 to 2025 with the value riding on its tip, the year ticks light up as it passes and the area under it fills with a gradient. Every time the tip gets near the edge the scale widens on a spring: the gridlines slide down and the new one comes in gold. The 2020 fall and the recovery come in as notes beside the line, and at the record the tip turns into a gold tag.

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>
<!--
  "Fund return chart" 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>Velmora Global Equity, ten years</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <!-- the ten-year page of a made-up fund, Velmora Global Equity, on a dark glass card. The stage sticks while you
       scroll and the scroll is the calendar of the fund: the line of its value draws itself from 2016 to 2025, the
       value rides on its tip, the years light up as it passes, the area under it fills, the scale of the chart widens
       every time the fund sets a new high, and three moments of its story (the fall, the recovery, the record) come
       in as notes beside the line when the tip reaches them. -->
  <main>
    <section class="years" data-years>
      <div class="stage" data-stage>
        <div class="light light--a" data-light-a aria-hidden="true"></div>
        <div class="light light--b" data-light-b aria-hidden="true"></div>
        <div class="grain" aria-hidden="true"></div>

        <div class="frame" data-frame>
          <article class="card" data-card>
            <span class="card__glow" aria-hidden="true"></span>
            <span class="card__rim" aria-hidden="true"></span>

            <header class="head">
              <span class="head__mark" aria-hidden="true">
                <svg viewBox="0 0 16 16"><path d="M3 4.2l5 8.3 5-8.3"/><path d="M5.6 4.2h4.8" class="thin"/></svg>
              </span>
              <div class="head__text">
                <p class="head__title">Velmora Global Equity</p>
                <p class="muted">Fund &middot; Class A &middot; USD</p>
              </div>
              <span class="chip" data-chip>10Y</span>
            </header>

            <div class="value">
              <p class="value__label muted">Growth of $10,000</p>
              <p class="value__row">
                <span class="value__num" data-value>$10,000</span>
                <span class="delta" data-delta>+0.0%</span>
              </p>
            </div>

            <div class="chart" data-chart>
              <div class="chart__plot" data-plot>
                <span class="gl gl--start" data-gl="100"><em>$10k</em></span>
                <span class="gl" data-gl="150"><em>$15k</em></span>
                <span class="gl" data-gl="200"><em>$20k</em></span>
                <span class="gl" data-gl="250"><em>$25k</em></span>
                <span class="gl" data-gl="300"><em>$30k</em></span>
                <span class="gl" data-gl="350"><em>$35k</em></span>

                <svg class="chart__svg" data-svg aria-hidden="true">
                  <defs>
                    <linearGradient id="fill" x1="0" y1="0" x2="0" y2="1">
                      <stop offset="0" stop-color="var(--gold)" stop-opacity="0.34"/>
                      <stop offset="0.55" stop-color="var(--gold)" stop-opacity="0.08"/>
                      <stop offset="1" stop-color="var(--gold)" stop-opacity="0"/>
                    </linearGradient>
                    <pattern id="hatch" width="5" height="5" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
                      <rect width="1" height="5" fill="var(--ink)" fill-opacity="0.16"/>
                    </pattern>
                  </defs>
                  <path class="area" data-area d=""/>
                  <path class="under" data-under d=""/>
                  <path class="peak" data-peak d=""/>
                  <path class="ln" data-ln d=""/>
                </svg>

                <span class="lead" data-lead="0" aria-hidden="true"></span>
                <span class="lead lead--v" data-lead="1" aria-hidden="true"></span>
                <div class="note" data-note="0">
                  <p class="note__when muted" data-note-when>Mar 2020</p>
                  <p class="note__what">Drawdown <b data-note-fig>&minus;24.3%</b></p>
                </div>
                <div class="note note--up" data-note="1">
                  <p class="note__when muted" data-note-when>Nov 2020</p>
                  <p class="note__what">Recovered <b data-note-fig>8 months</b></p>
                </div>

                <span class="pt" data-pt aria-hidden="true"><span class="pt__ring" data-ring></span></span>
                <div class="tip" data-tip>
                  <span class="tip__fill" data-tip-fill aria-hidden="true"></span>
                  <span class="tip__rec" data-rec>
                    <svg viewBox="0 0 12 12" aria-hidden="true"><path d="M2.5 7.6L6 4.1l3.5 3.5"/></svg>All-time high
                  </span>
                  <span class="tip__val" data-tip-val>$10,000</span>
                </div>
              </div>
              <div class="axis" data-axis aria-hidden="true"></div>
            </div>

            <footer class="foot">
              <div class="stat">
                <p class="muted">Annualised</p>
                <b data-ann>+0.0%</b>
              </div>
              <div class="stat">
                <p class="muted">Max drawdown</p>
                <b data-mdd>0.0%</b>
              </div>
              <button class="btn" type="button" data-btn>
                <span class="btn__face">Factsheet
                  <svg class="btn__icon" viewBox="0 0 16 16" aria-hidden="true"><path d="M3.5 8h8.6M8.6 4.4L12.2 8l-3.6 3.6"/></svg>
                </span>
              </button>
            </footer>
          </article>
        </div>
      </div>
    </section>
    <p class="sr" aria-live="polite" data-live></p>
  </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>

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.

40 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 “Fund return chart” 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 a near black page, with a soft gold light at the top right and a cool one at the bottom left, a dark glass card rises with layered shadows and an edge that catches the light. At the top the Velmora mark, a V in a small gold square, ‘Velmora Global Equity’, ‘Fund · Class A · USD’ and the ‘10Y’ label; under it, ‘Growth of $10,000’ with the value in large type and the change in gold. On arrival the rules of the chart draw one after the other, the years rise and the point with the value tag comes in on a spring. Scrolling down the months go by from 2016 to 2025: the gold line draws itself with a glow, the area under it fills with a fading gold gradient, the point and the tag ride the tip and the value counts in the tag and at the top of the card. The year ticks light up gold as the tip passes, with a small snap. While the fund is below its last high a dashed line marks the level it had and a fine hatch fills the space down to the line, and the change turns dusty pink. Every time the tip gets near the top edge the scale widens on a spring that lands a hair past the mark: the gridlines slide down, those too high fade out and the new one stretches in with its label in gold. In March 2020, beside the bottom of the fall, the note ‘Drawdown −24.3%’ pops up, tied to the point by a hairline; when the line gets back to its old high the note ‘Recovered 8 months’ pops above it. At the record of late 2025 the tag on the tip fills with gold from the left, bounces and shows ‘All-time high’, a ring spreads from the point and the two notes dim a little. At the bottom the yearly return and the maximum drawdown update along. Scrolling back everything comes apart and the scale narrows again. With the pointer a soft light follows it on the card and the ‘Factsheet’ button gives under the finger and springs back.

How it works

The month of the fund

The scroll drives a single GSAP timeline with ScrollTrigger and scrub: it carries a number from 0 to 120, the months from 2016 to 2025. The fund's series is worked out once at the start from a few key months joined with a cosine and a small wobble that is zero on the key months; on every update the month is read even halfway, by interpolating.

The scale that widens

The top of the scale is the highest value so far plus a margin, rounded up to 5,000 dollars: when it changes, a back.out tween carries the new top and on every step redraws the line, the area, the gridlines and the notes. So the scale does not widen every month but in steps, like a real chart, and lands a hair past the mark.

An SVG in real pixels

The SVG viewBox is reset to the size of the chart by a ResizeObserver: the coordinates are pixels, the lines never stretch, and the point, the tag and the notes, HTML elements on top, sit at the same coordinates.

The level it had

Along with the series the highest value so far is kept month by month. The hatch is a path that goes forward along the high and back along the value: where the two match the area is empty, during a fall it becomes the space under the old level, filled with a 45 degree line pattern.

Notes found in the data

The deepest fall, the month of the recovery and their words are looked up in the series, not written by hand: change the numbers and the notes move on their own. The fall note sits below and left of the bottom, where the line was higher, the recovery note above the point, and both stay inside the chart.

Values to change

NameFileDefaultWhat it changes
RIDEscript.js1How much scroll the ten years take: 2 is twice as long.
HEADROOMscript.js1.12How much room the chart keeps above the highest value before it widens its scale.
WIDENscript.js0.9The seconds the scale takes to widen.
POPscript.js2How far a note passes its size before it settles: 0 none.
HATCHscript.jstrueThe dashed line and the hatch while the fund is below its last high.
GLOWscript.js1How strong the two lights behind the card are.

Try them in the Playground

When to use it

For the page of an investment fund, an ETF, a wealth manager or an investing app: the section that tells, as you scroll, ten years of returns with the hard moments and the record, before the button to the fund factsheet.

On phones

The same animation with adapted sizes: the value, the chart and the foot are sized on the height too and the whole card fits in the box; under 440 pixels the years are written short, under 340 the maximum drawdown leaves the foot.

With reduced motion

No long scroll and no movement: the card fades in with the ten years already drawn, the scale already wide, the two notes in place and the record in gold.

Pitfalls

  • If the scale followed the high every month the chart would never stand still and could not be read: rounded to steps of 5,000 dollars it widens only now and then, with a gesture you can see.
  • The gridlines are HTML elements moved with top: GSAP stretches them with scaleX on arrival and when a new one comes in, so its transform never fights the position.
  • Near the right edge the tag on the tip would leave the card: over the last 40 pixels it moves smoothly from the right of the point to above and to its left, with no jump.

Libraries

GSAP 3.15.0, ScrollTrigger 3.15.0, Lenis 1.3.26, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 11 KB; the libraries: GSAP + ScrollTrigger 45 KB, Lenis 5.3 KB.

Testing

Tested on 12 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