Skip to content
animorio
IT
All components

Week calendar

Calendars, HoverGSAP, CSS onlyMediumCompressed weight: Demo 6.4 KBGSAP 28 KBFreeDownload the zip

A work app’s week calendar: five days, six hours, events to pick up and move. The event lifts and tilts, the slot under it lights up and hops from cell to cell, red if taken; on release the event lands on a spring or goes home with a shake.

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>
<!--
  "Week calendar" 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>Week calendar</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">
    <!-- a work week: five days, six hours, a handful of events; pick one up and it lifts, the free slot
         under it lights up, and on release it springs into place or goes back if the slot is taken -->
    <section class="wk" data-wk aria-label="Week calendar">
      <header class="wk__head">
        <span class="wk__title">
          <b>This week</b>
          <span>16 to 20 November</span>
        </span>
        <span class="wk__note" aria-live="polite"><span class="wk__roll"><span data-note>Drag an event to move it</span></span></span>
      </header>

      <div class="wk__days" data-days aria-hidden="true"></div>

      <div class="wk__body">
        <div class="wk__hours" data-hours aria-hidden="true"></div>
        <div class="wk__grid" data-grid>
          <span class="wk__slot" data-slot aria-hidden="true"></span>
          <span class="wk__now" data-now aria-hidden="true"><i data-now-tag></i></span>
        </div>
      </div>
    </section>

    <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.

15 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 “Week calendar” 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, a card: at the top “This week” with its dates, and on the right a line saying what to do. Below, five days from Monday to Friday (today has its number in a black tile) and a grid of six hours, with the hours on the left. Inside, five events in different tints, each with its name and time, and a thin red line crossing today’s column at the current time, with the time in a small tag. Picking an event up, it lifts with a shadow and tilts slightly; under it a slot with a purple border marks where it would land and hops from cell to cell on a small spring as you carry it around, and the time written in the event follows. Over a taken place the slot turns red. Dropped on a free place the event lands with a bounce and the line at the top rolls to “Review moved to Thu 12:00”; dropped on a taken one it goes home shaking its head. With the keyboard, the arrows move the focused event by one cell.

How it works

Day and row, then pixels

Each event only knows its day, its first row and how long it lasts. Its x and y in pixels come from the grid’s width and height divided by five and by six, worked out again on resize.

The drag in three moves

Lift, carry, drop: three functions working in the grid’s own pixels. The real pointer and the demo’s pointer call the same ones, so what you see by itself is what happens by hand.

The slot before the event

While the event follows the finger, it is the slot that snaps to the nearest cell: you see at once where it will go and whether the place is free. Only on release does the event join it.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#5b5bf0The colour of the slot where the event lands.
TONESscript.js#5b5bf0, #0f9f8c, #d9822b, #c2419c, #3d6fd9The events’ colours, separated by a comma.
FIRST_HOURscript.js9The grid’s first hour.
TODAYscript.js2Today’s day (0 = Monday, 4 = Friday).
NOWscript.js1.65The current time, in rows from the first hour (1.65 = 10:39 when starting at 9).
SPRINGscript.js1.6How much the event bounces when it lands (0 = none).
LOOPscript.jstrueLeft alone, a pointer moves two events.

Try them in the Playground

When to use it

In a planner or work calendar app, on a studio’s booking page, in a dashboard with shifts; and wherever things are moved on a grid of days and hours: classes, meeting rooms, deliveries.

On phones

The same card: events are dragged with a finger without scrolling the page (touch-action: none on the grid). The rows are also sized on the window’s height.

With reduced motion

The event follows the finger without lifting or tilting and the slot goes from cell to cell with no spring; on release the event is already in place.

Pitfalls

  • Events, dates and the current time are made up and fixed: in a real app they come from the calendar, and a move must be saved and can fail (someone took the slot in the meantime).
  • Dragging alone shuts out keyboard users: here each event is a button whose label gives day and time, the arrows move it and the line at the top, in an aria-live region, says where it ended up.
  • touch-action: none on the grid stops the page scrolling while you drag: if the grid is as tall as the screen, leave a margin to scroll from.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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