Skip to content
animorio
IT
All components

Timesheet table

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

The hours of a small team, four people by four months, in a clean table on white that works like a spreadsheet: dragging across the cells a soft blue frame springs over them, goes a pixel past and settles, the figures inside take weight one after the other from where the gesture began, the months and names it covers light up and at the bottom the sum rolls digit by digit, with the average and the cell count beside it. A month picks its column, a name its row, a tap outside clears it.

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>
<!--
  "Timesheet 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>The timesheet table that sums the selected cells</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 hours of a small team in a table, like a spreadsheet: drag across the cells and one soft frame springs
         over them, the months and the names it covers light up, and the footer rolls to their sum.
         A month or a name picks its whole column or row; a tap outside the frame clears it -->
    <section class="sheet" data-sheet aria-label="Hours logged">
      <header class="sheet__head">
        <span class="sheet__title" data-title>Hours logged</span>
        <span class="sheet__sub" data-sub></span>
      </header>

      <div class="grid" data-grid tabindex="0" role="grid" aria-label="Hours by person and month. Arrow keys move, Shift and the arrows select, Escape clears.">
        <div class="sel" data-sel aria-hidden="true"><span class="sel__fill" data-fill></span><span class="sel__grip" data-grip></span></div>
      </div>

      <footer class="sheet__foot">
        <div class="sum" data-sum>
          <span class="sum__label">Sum</span>
          <span class="num" data-num aria-hidden="true"></span>
          <span class="sum__unit">h</span>
        </div>
        <span class="hint" data-hint>Drag across the cells</span>
        <span class="meta" data-meta></span>
      </footer>
      <p class="sr" aria-live="polite" data-live></p>
    </section>

    <svg class="fake" data-fake viewBox="0 0 20 24" aria-hidden="true"><path d="M3 2.2v17.4l4.6-4.4 3 6.6 2.9-1.3-3-6.5h6.3Z"></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.

22 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 “Timesheet 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 a white background a table up to 400 pixels wide, with 18 pixel corners, a thin grey border and a wide light shadow. At the top Hours logged and the months Jul – Oct 2026 in grey; below four columns of months and four rows of people, with the hours in tabular digits lined up on the right and hairlines between the rows. Pressing a cell and dragging, a blue frame with rounded corners and a small white square in its lower right corner covers the chosen cells: at every new cell it stretches on a short spring, goes a pixel past and settles. The figures inside turn blue and fuller on the weight axis, one after the other starting from the cell where the gesture began; the month and the name of every covered cell light up too. At the bottom, in place of Drag across the cells, Sum appears with the hours rolling digit by digit from the right, and beside it the average and how many cells. Pressing, the frame gives a little, letting go it comes back on a spring, the square swells and the sum makes a hop of a pixel and a half. A month picks its whole column, a name its whole row, the empty corner the whole table; a tap outside clears it. When nobody touches it, a pretend pointer uses it: it picks a block, a month, another block, a person, and clears.

How it works

One frame

The cells are not coloured one by one: there is a single absolute element above the grid, and GSAP takes its x, y, width and height to the rectangle from the corner of the first cell to the corner of the last, read with offsetLeft and offsetTop. With back.out(OVERSHOOT) the frame goes a pixel past the new cell and comes back: that is what makes it feel elastic. The fill and the border live in the child, which GSAP scales on its own for the press.

Figures taking weight in a wave

Every cell inside gets the is-in class, which takes the variable font's wght axis from 420 to 580 with a CSS transition. Each one's delay is its distance in cells from the starting cell times WAVE seconds, so the weight spreads from where the gesture began. Covered months and names light up by the same rule.

The rolling sum

The sum is a row of slots lined up from the right, one per character: every digit is a column from 0 to 9 that GSAP moves by -10% per unit, with back.out and a delay of ROLL_STAGGER from the right; extra slots come in widening, missing ones shrink away on the left. The digits are tabular, so nothing jiggles.

From pointer to cell

While dragging, the cell under the finger is worked out from the first and the last cell, not with elementFromPoint: outside the table the count stops at the edge and the selection stays whole. The pretend pointer calls the same functions as the real one, with positions read at the start of every stretch; at the first real gesture it stops, and comes back after IDLE seconds.

Accessible

The grid takes focus: the arrows move the cell, Shift and the arrows widen the selection, Escape clears it, and an aria-live line says how many cells and the sum. With reduced motion the frame goes to its place without sliding, the digits change with a fade and there is no pretend pointer.

Values to change

NameFileDefaultWhat it changes
TITLEscript.jsHours loggedThe name of the table, top left.
UNITscript.jshThe unit after the sum.
SPRINGscript.js0.42The seconds the frame takes to reach the new cells.
OVERSHOOTscript.js1.6How far the frame goes past the cells before it settles (0 = not at all).
WAVEscript.js0.03The seconds between one cell taking weight and the next, from the starting cell.
ROLLscript.js0.55The seconds a digit of the sum takes to roll to its new value.
ROLL_STAGGERscript.js0.03The seconds between one digit and the next, from the right.
IDLEscript.js3.5The quiet seconds before the pointer that shows it comes back.

Try them in the Playground

When to use it

For the tables of a work app or a dashboard where you want to know at once what a part adds up to: a team's hours, a month's expenses, sales by shop, seats sold per night, nights booked per room.

On phones

The table takes the screen's width minus 16 pixels a side and the rows are measured on the height too (clamp with vh), so everything fits in the box. With a finger you drag across the cells as with the mouse: inside the grid the touch does not scroll the page, outside it does.

With reduced motion

The frame goes to its place without sliding or bouncing, the figures change weight and value with a fade, and there is no pretend pointer: the selections change on their own, still.

Pitfalls

  • The frame has two elements: GSAP takes the parent's position and size and the press scale on the child. On the same element the press tween and the spring tween wiped each other's transform.
  • On the phone the full names wrapped onto two lines and the table grew taller: under 440 pixels the surname sits in a span that hides, and only the first name stays.
  • The weight transition's delay has to be set back to zero when a cell leaves, otherwise in large selections the last cells stayed blue for a moment after the frame had gone.
  • The frame's measures are read again on every resize and once the font has loaded: the preview box changes height while you look at it and the rows are in vh.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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