Skip to content
animorio
IT
All components

Task field with date

Forms, Hover, TextGSAP, CSS onlyMediumCompressed weight: Demo 10 KBGSAP 28 KBFreeDownload the zip

The field for adding a task in a to-do app, on white: as you type, words like “tomorrow 5pm” or “fri” are tinted under the text and become a pill with the real date, and “#studio” becomes the project pill in its own colour. Press Return and the task drops in at the top of the list while the pills fly to their place in the row; a pill’s x keeps the words as plain text. Ticking a task fills the circle, strikes the row through and lets it go.

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>
<!--
  "Task field with date" 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 new task field that recognises the date as you type it</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>
    <!-- a to-do field that reads the task as you type: a day or a time becomes a date pill,
         a #word becomes a project pill, and Return files the task in the list with its pills -->
    <section class="card" data-card aria-label="Add a task">
      <div class="field" data-field>
        <span class="field__plus" aria-hidden="true">
          <svg viewBox="0 0 20 20"><path d="M10 5.5v9M5.5 10h9"/></svg>
        </span>
        <span class="field__box" data-box>
          <span class="field__mirror" data-mirror aria-hidden="true"></span>
          <input class="field__input" data-input type="text" autocomplete="off" autocapitalize="sentences" spellcheck="false"
                 aria-label="New task. Write a day, a time or a #project" placeholder="Add a task, like “lunch fri #home”">
        </span>
        <span class="field__enter" data-enter aria-hidden="true">
          <svg viewBox="0 0 20 20"><path d="M15 5.5v4.2a2.3 2.3 0 0 1-2.3 2.3H5.5"/><path d="M8.4 9.1 5.5 12l2.9 2.9"/></svg>
        </span>
      </div>

      <div class="pills" data-pills>
        <p class="pills__hint" data-hint>Write a day, a time or a <b>#project</b></p>
        <div class="pills__row" data-pillrow aria-live="polite"></div>
      </div>

      <div class="list__head">
        <span>Upcoming</span>
        <span class="list__count" data-count><span data-countnum>2 tasks</span></span>
      </div>
      <ul class="list" data-list></ul>
    </section>

    <svg class="pointer" data-pointer viewBox="0 0 24 24" aria-hidden="true">
      <path d="M5 3.2v15.6l4.3-4.1 2.7 6.1 2.6-1.1-2.7-6h5.9z"/>
    </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 “Task field with date” 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

In the middle, on white, a white card with a rounded field: on the left a dashed circle with a plus, the grey text Add a task, like “lunch fri #home” and on the right a Return key drawn like a real key. Below, in grey, Write a day, a time or a #project; then the Upcoming row with the task count and two tasks already in the list, each with its circle to tick and its pills. A drawn pointer comes in, taps the field, which lights up with a blue halo, and types Call framer tomorrow 5pm #studio. As soon as the word tomorrow is complete, a light blue tint grows from the left under the text and the grey hint under the field leaves: in its place the blue pill with the calendar and Tomorrow pops up on a spring. Once 5pm is typed the pill’s label leaves upwards and comes back from below as Tomorrow · 17:00, and the pill swells by a breath. Then #studio turns terracotta and the project pill arrives, with its drawn hash. The Return key goes down: the text rises and fades, the new row Call framer grows at the top of the list, lightly blue, and the two pills fly from the field to the row in a small arc. The count rolls from 2 tasks to 3 tasks. The same with Pick up prints mon #errands, with Monday’s date and the project in green. At the end the pointer ticks off the two new tasks: the circle fills with blue on a bounce, the white tick draws itself, a line strikes the text, which turns grey, and the row closes.

How it works

The text behind the field

The real field is an input with transparent text and a blue caret; behind it, in the same place and with the same type, an element redraws the text at every letter, with the recognised words wrapped in a coloured span. The input’s horizontal scroll is copied onto the element behind, so the tints stay under the right letters.

Reading the date

A regular expression looks for today, tonight, tomorrow, next week, full or short day names and an optional time with am or pm; a time on its own means today. Short forms only count when a space follows, so typing money doesn’t make the mon pill flash in and out. The day is worked out from today’s date and 5pm becomes 17:00.

Pills that never overlap

Each pill has its own key: when the key is new, the tint under the text grows with a CSS animation that runs only that once; when only the label changes, the old one leaves upwards and only then the new one comes in. The grey hint leaves before the first pill arrives and returns only when there are none left.

The flight to the row

On Return the new row comes in at the top with its pills invisible. For each pill in the field we measure where it is and where it must land, put a position fixed copy in its place and move it with x on power3 and y on back, so it makes a small arc; once it lands the copy goes and the row’s real pill appears.

Ticking off

The filled circle grows with scale and svgOrigin at its centre, the tick draws with stroke-dashoffset, a line as wide as the text stretches with scaleX and the row closes by taking height and opacity to zero. The task count changes by leaving upwards and coming back from below.

Values to change

NameFileDefaultWhat it changes
TYPE_SPEEDscript.js14How many letters per second the autopilot types.
POPscript.js1.7How much the pills bounce when they appear: 0 none, 3 a lot.
ACCENTscript.js#3d5afeThe colour of the recognised date, the active field and the tick.
TASK_ONEscript.jsCall framer tomorrow 5pm #studioThe first task the autopilot types.
TASK_TWOscript.jsPick up prints mon #errandsThe second task the autopilot types.
MAX_ROWSscript.js4How many tasks the list holds before the oldest one leaves.

Try them in the Playground

When to use it

In to-do apps, calendars, reminders and any field where people type in a hurry: instead of opening a date picker you write the way you talk, and the field shows straight away what it understood, with a way to say no.

On phones

The card is at most as wide as the screen minus the margins and a little over 300 pixels tall, so it fits whole in the frame; long text scrolls inside the field and the tints follow it. On a phone you tap the pills’ x and the tasks’ circles, which are big enough for a finger.

With reduced motion

No movement: the pills, rows and count appear and disappear with a fade, the pills don’t fly but appear already in the row, the tints under the text arrive without growing and the drawn pointer is hidden.

Pitfalls

  • Recognising mon, fri or sun as soon as they were typed made the pill flash in and out while typing money or friendly: short forms only count when a space follows, full words count at the end too.
  • The text behind the input is redrawn at every letter, so a CSS animation on the tint would restart every time: the class that makes it grow is added only when the recognised word’s key is new.
  • The pill in the new row has to be measured with the row already at its full height: measured while the row was growing from zero, the flying copy landed too high.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 29 October 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