Skip to content
animorio
IT
All components

Submit assignment button

Buttons, Hover, SVGGSAP, CSS onlyMediumCompressed weight: Demo 5.7 KBGSAP 28 KBFreeDownload the zip

The button that hands in an assignment in an online school. On the right it says how long is left before the deadline; pressed, the sheet lifts off the tray, the ring around the icon fills while the file goes up with the percentage in place of the time, then the sheet drops into the tray, the tick draws itself and the tag becomes “On time”.

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>
<!--
  "Submit assignment 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>Submit assignment button with the sheet that drops into the tray and the deadline that turns on time</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">
    <!-- the button that hands in an assignment in an online school: pressed, the ring around the icon fills while
         the file goes up, the sheet drops into the tray, a tick draws itself and the time left becomes "On time" -->
    <button class="asg" type="button" data-asg>
      <span class="asg__body" aria-hidden="true"><span class="asg__wash" data-wash></span><span class="asg__light"></span></span>
      <span class="asg__edge" aria-hidden="true"></span>

      <span class="seat" data-seat aria-hidden="true">
        <svg viewBox="0 0 24 24">
          <circle class="seat__track" cx="12" cy="12" r="10.2"></circle>
          <circle class="seat__ring" data-ring cx="12" cy="12" r="10.2" pathLength="1" transform="rotate(-90 12 12)"></circle>
          <g data-sheet><path class="seat__sheet" d="M9.200 5.200h4.100l1.900 1.900v6.100a.8.8 0 0 1-.8.8H9.200a.8.8 0 0 1-.8-.8V6a.8.8 0 0 1 .8-.8Z"></path><path class="seat__lines" data-lines d="M10.200 9h3.600M10.200 11.200h2.600"></path></g>
          <path class="seat__tray" d="M6.600 14.200v2.300a1.300 1.300 0 0 0 1.300 1.300h8.200a1.300 1.300 0 0 0 1.300-1.300v-2.300"></path>
          <path class="seat__tick" data-tick pathLength="1" d="M8.2 12.4 10.9 15 15.9 9.400"></path>
        </svg>
      </span>

      <span class="label">
        <span class="label__main"><span data-word>Submit assignment</span></span>
        <span class="label__sub"><span data-sub>Essay draft</span></span>
      </span>
      <span class="tag" aria-hidden="true"><span data-left>2h left</span></span>
    </button>
    <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.

16 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 “Submit assignment 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 black, a light pill 60 pixels high: on the left a white disc with a sheet over a tray, in the middle “Submit assignment” and below it the assignment’s name, on the right a grey tag with “2h left”. On hover the light follows the pointer and the sheet peeks out by a pixel. Pressed: a purple tint leaves the disc and floods the pill, the sheet lifts and sways, the texts roll to “Uploading” and the file name, the purple ring around the icon fills and the tag counts the percentage. At the end the sheet drops into the tray, the disc bounces, the green tick draws itself, everything turns green and the tag says “On time”. After a few seconds it goes back.

How it works

One number for the upload

An object with a value from 0 to 1: the ring (stroke-dashoffset on a circle with pathLength 1) and the percentage in the tag come from the same number, moved with power1.inOut, no spring.

The sheet

The sheet is an SVG group: it lifts by 1.6 units and rotates by minus 5 degrees, then sways with sine.inOut for the whole upload; at the end it drops by 2.4 with power2.in into the tray, which stays still in front.

The confirmation

The three texts roll staggered by 0.05 seconds, the tick draws itself in 0.36 seconds, the disc goes to 1.14 and comes back with elastic.out. If HOURS_LEFT is zero or less the tag says “Overdue” and then “Late”.

Values to change

NameFileDefaultWhat it changes
TASKscript.js"Essay draft"The assignment to hand in (made up).
FILEscript.js"essay-draft.pdf · 1.2 MB"The file being sent (made up).
HOURS_LEFTscript.js2How many hours are left before the deadline; 0 or less means late.
UPLOADscript.js1.3How many seconds the upload lasts.
ACCENTscript.js#7a4bffThe colour of the upload.
OKscript.js#12a868The colour once the assignment is in.
HOLDscript.js2.6Alone: how many seconds the confirmation stays before going back.
LOOPscript.jstrueLeft alone, a pointer tries it by itself.

Try them in the Playground

When to use it

On an assignment page of a school or an online course, in a student portal, in any form where a file is handed in before a deadline (an application, a tender, a filing). In a real product the ring follows the real upload.

On phones

The same pill, at most as wide as the screen minus the margins; there is no hover, the tap does the same job.

With reduced motion

No swaying sheet, flooding tint or bounces: the ring and the percentage still rise (they are the information), the texts change without rolling and the tick appears.

Pitfalls

  • GSAP rounds pixels: with pathLength 1 the ring would be all empty or all full. At the top of the script gsap.defaults turns autoRound off.
  • During the upload the button has aria-busy and ignores clicks; the state is also said in words in a line for screen readers.
  • The tick has opacity 0 at rest: a zero-length stroke with round caps would leave a dot.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 5.7 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