Skip to content
animorio
IT
All components

Gradebook table

Tables, HoverGSAP, CSS onlyMediumCompressed weight: Demo 5.8 KBGSAP 28 KBFreeDownload the zip

A class gradebook in a school app: four students, three assignments and each one’s average with its bar. Tapping a grade lands a ring on the cell on a spring, and with the minus and plus keys the grade rolls, the row’s average rolls with it, the bar moves and changes colour below the pass mark, and the class average updates at the top.

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>
<!--
  "Gradebook table" 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>Gradebook table</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 gradebook of a class in a school app: pick a cell, correct the grade with minus and plus,
         and the row's average rolls while its bar moves; the class average follows -->
    <section class="gb" data-gb aria-label="Gradebook">
      <header class="gb__head"><span class="gb__title"><strong>Biology, class 3B</strong><span>Autumn term</span></span><span class="gb__class">Class average <span class="gb__roll"><b data-outclass>0</b></span></span></header>
      <div class="gb__table" role="grid" aria-label="Grades" data-table>
        <i class="gb__ring" data-ring aria-hidden="true"></i>
        <div class="gb__row gb__row--head" role="row"><span role="columnheader">Student</span><span role="columnheader">Essay</span><span role="columnheader">Quiz</span><span role="columnheader">Lab</span><span role="columnheader">Average</span></div>
        <div class="gb__row" role="row" data-row data-name="Ada Lindqvist" data-grades="88,92,85"></div>
        <div class="gb__row" role="row" data-row data-name="Mira Okafor" data-grades="74,62,81"></div>
        <div class="gb__row" role="row" data-row data-name="Tomas Reyes" data-grades="91,84,96"></div>
        <div class="gb__row" role="row" data-row data-name="Jun Hayashi" data-grades="67,79,58"></div>
      </div>
      <footer class="gb__edit" data-edit>
        <span class="gb__who"><span data-outwho>Pick a grade to correct it</span></span>
        <span class="gb__step"><button type="button" data-step="-1" aria-label="Lower the grade" disabled><svg viewBox="0 0 12 12" aria-hidden="true"><path d="M2.500 6h7"></path></svg></button><button type="button" data-step="1" aria-label="Raise the grade" disabled><svg viewBox="0 0 12 12" aria-hidden="true"><path d="M2.500 6h7M6 2.500v7"></path></svg></button></span>
      </footer>
    </section>
    <span class="live" aria-live="polite" data-live></span>

    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.200 19.200 11l-6.300 1.600-3.300 5.900Z"></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.

20 values to change

Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI

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 “Gradebook table” 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 white: “Biology, class 3B”, the term and on the right “Class average 80”. Below, a rounded table with the columns Student, Essay, Quiz, Lab and Average: four rows with names, three grades each and, at the end of the row, a small purple bar with the average next to it; the last row, below the pass mark, has an orange bar and average. On opening the rows come in staggered, the bars grow and the averages roll to their value. Under the table sits the sentence “Pick a grade to correct it” and two round keys, minus and plus, still off. Tapping a grade lands a purple ring with a white ground on that cell with a small bounce, the sentence rolls into “Mira Okafor, Quiz” and the keys light up. On every tap of plus the grade climbs four points, rolling, the row’s average rolls along, the bar lengthens on a spring and the class average at the top updates. Picking another cell slides the ring over to it. When an average passes the pass mark, bar and number go from orange to purple.

How it works

Rows from the script

Every row has only the name and the grades in the HTML. The script writes the cells as buttons, the bar and the average: changing the class takes changing two attributes.

A single ring

The ring of the chosen cell is one element inside the table. Its place is read from the cell itself and GSAP takes it there on a spring; when the window changes size it is put back in place.

Averages in a cascade

On every change the row’s average and the class average are worked out again. Only the numbers that really change roll, up or down according to direction, and the bar follows on a spring.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#5b5bf0The colour of the chosen cell and of the average bars.
LOWscript.js#e2623fThe colour of an average below the pass mark.
PASSscript.js70The pass mark: below this average the row changes colour.
STEPscript.js4How many points the grade changes on every tap of plus and minus.
SPRINGscript.js1How much the cell ring and the bars bounce.

Try them in the Playground

When to use it

On the site or in the app of a school gradebook, a course platform or a tool for teachers; the same table with its cell to correct carries a team’s scores, a project’s hours, an order’s quantities or a price list.

On phones

The table is at most 352 pixels wide and narrows with the screen: names shorten with an ellipsis, the three grade columns stay 42 pixels wide. Row height is sized on the screen’s height too. The minus and plus keys are 40 pixel circles, under the table, within thumb reach.

With reduced motion

The rows are already in place with their bars and averages complete; the ring appears on the cell without moving, grades and averages change without rolling and the bars take their length at once. The demo’s pointer does not start.

Pitfalls

  • The cells are real buttons in a grid with rows and headers: with focus on a cell, arrow up and arrow down change the grade, and every change is read out in an aria-live region with both averages.
  • The ring sits under the cells and takes no taps: its place is that of the measured cell, so it stays centred at every width.
  • A low average is not told by colour alone: the number is there. The threshold is a value to change.
  • Students and grades are invented; in a real product every correction is saved and has to be undoable.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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