Skip to content
animorio
IT
All components

Make slides button

Buttons, Hover, TransitionsGSAP, CSS onlyMediumCompressed weight: Demo 9.2 KBGSAP 28 KBFreeDownload the zip

The Turn into slides button of a made-up AI docs app, Quire. On the tap a violet and amber light starts running round the pill’s edge, the lines of the doc icon read themselves one after the other and the label rolls from Reading 1,240 words to Outlining 6 sections to Designing slide 1 of 8. Out of the pill’s top edge come five slides, one at a time, in a fan that makes room for each new one: the dark cover, the points, the chart with growing bars, the page with the picture, the big number. At the end the fan squares into a deck with the slide count, the icon turns into the presentation screen and the pill says Open deck.

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>
<!--
  "Make slides button" 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>The Make slides button with the doc that deals itself into a deck</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>
  <main class="stage" data-stage>
    <!-- the Turn into slides button of a made-up docs app, Quire: press it and the doc is read,
         outlined and dealt out of the pill as a fan of slides, which then squares into a deck -->
    <div class="fit" data-fit>
      <div class="wrap" data-wrap>
        <div class="deck" data-deck aria-hidden="true">
          <div class="slide" data-slide>
            <div class="slide__face slide__face--title">
              <span class="s-brand">Quire</span>
              <span class="s-h1">Q4 Roadmap</span>
              <span class="s-sub"></span>
              <span class="s-orb"></span>
            </div>
            <span class="slide__sheen" data-sheen></span>
          </div>
          <div class="slide" data-slide>
            <div class="slide__face">
              <span class="s-h">Where we are</span>
              <span class="s-line" style="--w: 86%"></span>
              <span class="s-line" style="--w: 72%"></span>
              <span class="s-line" style="--w: 80%"></span>
              <span class="s-line" style="--w: 54%"></span>
            </div>
            <span class="slide__sheen" data-sheen></span>
          </div>
          <div class="slide" data-slide>
            <div class="slide__face">
              <span class="s-h">Weekly actives</span>
              <span class="s-bars">
                <span class="s-bar" data-bar style="--h: 38%"></span>
                <span class="s-bar" data-bar style="--h: 52%"></span>
                <span class="s-bar" data-bar style="--h: 61%"></span>
                <span class="s-bar" data-bar style="--h: 74%"></span>
                <span class="s-bar s-bar--hi" data-bar style="--h: 96%"></span>
              </span>
            </div>
            <span class="slide__sheen" data-sheen></span>
          </div>
          <div class="slide" data-slide>
            <div class="slide__face slide__face--split">
              <span class="s-pic"></span>
              <span class="s-col">
                <span class="s-h">Launch plan</span>
                <span class="s-line" style="--w: 92%"></span>
                <span class="s-line" style="--w: 70%"></span>
                <span class="s-line" style="--w: 84%"></span>
              </span>
            </div>
            <span class="slide__sheen" data-sheen></span>
          </div>
          <div class="slide" data-slide>
            <div class="slide__face slide__face--stat">
              <span class="s-big">+38%</span>
              <span class="s-cap">retention since June</span>
            </div>
            <span class="slide__sheen" data-sheen></span>
          </div>
          <span class="deck__count" data-badge></span>
        </div>

        <button class="btn" type="button" data-btn data-autoclic aria-label="Turn the Quire doc into slides">
          <span class="btn__glow" aria-hidden="true"></span>
          <span class="btn__ring" aria-hidden="true"></span>
          <span class="btn__face" aria-hidden="true"><span class="btn__shine"></span></span>

          <span class="btn__icon" aria-hidden="true">
            <svg class="ico ico--doc" data-ico-doc viewBox="0 0 24 24">
              <path class="ico__page" d="M6.2 3.4h7.6l4 4v13.2H6.2Z"></path>
              <path class="ico__ear" data-ear d="M13.8 3.4L13.8 7.4L17.8 7.4"></path>
              <path class="ico__ln" data-ln d="M8.9 11.2h6.2"></path>
              <path class="ico__ln" data-ln d="M8.9 14.1h6.2"></path>
              <path class="ico__ln" data-ln d="M8.9 17h3.9"></path>
            </svg>
            <svg class="ico ico--deck" data-ico-deck viewBox="0 0 24 24">
              <rect class="ico__back" x="5.6" y="4.2" width="14.6" height="9.6" rx="2"></rect>
              <rect class="ico__front" x="3.4" y="7.4" width="14.6" height="9.6" rx="2"></rect>
              <path class="ico__play" d="M9.4 9.7v4.9l4.1-2.45Z"></path>
              <path class="ico__stand" d="M10.7 17v3.2M7.6 20.4h6.2"></path>
            </svg>
          </span>

          <span class="btn__label" data-label><span class="btn__txt" data-txt></span></span>
          <kbd class="btn__key" data-key aria-hidden="true">S</kbd>
        </button>
      </div>
    </div>
    <p class="sr" data-live aria-live="polite"></p>

    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2 19.2 11l-6.3 1.6-3.3 5.9Z"></path></svg>
  </main>

  <script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.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.

29 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 “Make slides button” 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 black ground sits a graphite pill with a doc icon drawn in line, three amber lines, the label Turn into slides and the S key. On hover the pill rises a pixel, a warm light follows the pointer, the folded corner of the page lifts; pressed, it squashes. On the tap a violet, white and amber light starts running round the edge, with a soft glow under it, the icon’s lines shorten and come back one after another as if read, and the label rolls to Reading 1,240 words and then Outlining 6 sections, with the pill following the text’s width on a spring. Then Designing slide 1 of 8, with the number going up on its own, and the slides come out of the pill’s top edge one at a time: each rises, passes its place by a hair and settles into the fan, a light crosses it and the ones already out lean away for a moment to make room. In the chart the bars grow on a spring. When it is done, the fan squares into a neat deck from the outside in, with the cover on top, the edge light slows and goes out, the number 8 pops onto the deck, a light passes over the top slide, the doc icon turns and gives way to a screen with a play key, and the label rolls to Open deck · 8 slides. On the second tap the top slide comes towards you and goes, the others sink back into the pill and Turn into slides returns.

How it works

The edge light

A violet, white and amber conic-gradient covers the pill, but a mask with content-box and exclude only lets a ring one and a half pixels wide show; a copy blurred by 12 pixels sits underneath as the glow. The start angle is a CSS variable that GSAP’s ticker turns while the pill works, with a speed that eases up and down.

The slides coming out of the pill

The five slides wait behind the pill, scaled down and lower. Each rises to its place in the fan with back.out (the bounce is the SPRING knob); the place comes from a parabola: linear x, squared y, linear rotation. The slides already out make a small sidestep with elastic.out, as if moving over to make room.

The rolling label and the pill that follows it

Each state is a new text in a one-line window: it comes in from below while the old one leaves at the top and is removed. The new text’s width is measured first, hidden, and the window reaches it on a spring, so the pill changes size without jumps. The slide number changes on its own, without rolling the whole line.

From fan to deck

When the count is done, each slide goes to a deck position, a little smaller and higher the lower it sits, starting from the outer ones. Then the number pops onto the deck, a soft-light sheen crosses the top slide and the doc icon turns, giving way to the presentation one.

Values to change

NameFileDefaultWhat it changes
LABELscript.jsTurn into slidesThe label of the resting button.
DONE_LABELscript.jsOpen deckThe label when the deck is ready.
SLIDESscript.js8How many slides come out of the doc: the rising count and the number on the deck.
WORDSscript.js1,240The words of the doc it reads.
SECTIONSscript.js6The sections of the outline.
READscript.js1.1The seconds it spends reading the doc.
DESIGNscript.js3The seconds it spends designing the slides, one after another.
LAPscript.js1.3The seconds of one lap of the edge light.
FANscript.js7The degrees between one slide and the next in the fan.
SPREADscript.js46The pixels between one slide and the next in the fan.
SPRINGscript.js1How much the slides bounce as they land.
PRESS_SCALEscript.js0.965How far the pressed button sinks.
--ambrastyle.css#ffb36bThe warm accent: the icon’s lines, the bars, the deck count and part of the light.
--violastyle.css#a596ffThe cool accent: the cover and the other part of the edge light.

Try them in the Playground

When to use it

In the editor of an AI docs, notes or writing app, next to the title or in the toolbar: turning a doc into a presentation in one tap, showing clearly what it is doing while it works and what came out.

On phones

The fan sits above the pill in under 300 pixels; on a narrower or shorter screen the whole piece scales down together, never past the sides. The finger taps like the mouse; without hover the pointer light stays off.

With reduced motion

No springs or flying slides: the label crossfades, the edge light turns slowly, the slides appear already in place in the fan and then in the deck with a fade, the icon changes without turning and on the second tap everything fades away.

Pitfalls

  • The folded corner path started as «v4h4» and the lifted one as a «q» curve: GSAP cannot move between two paths with different commands and jumped. Written both with the same three L points, it interpolates number by number.
  • The label’s width must be measured first, in a hidden text in the same window: measured after it came in, the pill widened in jumps while the text was already there.
  • The rising slide count must not roll the whole line at every step, or the label shakes: only the number changes, with a three pixel hop.
  • On the phone the piece is shrunk with a scale, and the width measured with getBoundingClientRect came out already shrunk: the label was cut at «slide 7 of». It is measured with offsetWidth, which ignores the scale.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 15 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 components