Skip to content
animorio
IT
All components

Driving licence upload form

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

The licence step of the sign up of Northlane, a made-up car rental, alone on white in the premium product style: two dashed zones for the front and the back. A photo dragged in settles on a spring, a band of blue light scans it while four corners close on its edges; if it finds glare it circles it in red, the zone shakes and asks for another photo. When both sides are sharp, Continue wakes up, checks and turns green.

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>
<!--
  "Driving licence upload form" 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 driving licence upload with front and back and the scan that catches the glare</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 licence step of a car rental sign up: two drop zones, front and back. A photo dropped in settles on a
         spring, a band of light scans it while four corners close on its edges; if the scan finds glare it circles
         it in red, the zone shakes and asks for another photo; when both sides are sharp, Continue wakes up -->
    <form class="kyc" data-kyc novalidate>
      <span class="kyc__sheen" aria-hidden="true"></span>
      <div class="kyc__brand">
        <svg class="mark" viewBox="0 0 24 24" aria-hidden="true">
          <rect x="1" y="1" width="22" height="22" rx="7"></rect>
          <path d="M7 17.5 11.2 6.5M12.8 17.5 17 6.5"></path>
        </svg>
        <span class="kyc__name" data-brand>Northlane</span>
        <span class="kyc__chip">Identity check</span>
      </div>
      <h1 class="kyc__title">Add your driving licence</h1>
      <p class="kyc__sub">Both sides, flat and in good light.</p>

      <div class="slots">
        <div class="col">
          <label class="slot" data-slot="front">
            <input class="slot__input" type="file" accept="image/*" data-input aria-describedby="msg-front">
            <svg class="slot__dash" aria-hidden="true"><rect></rect></svg>
            <span class="slot__focus" aria-hidden="true"></span>
            <span class="slot__empty" aria-hidden="true">
              <svg class="slot__icon" viewBox="0 0 28 20"><rect x="1" y="1" width="26" height="18" rx="3.2"></rect><path d="M5.5 6.5h5.5v7H5.5zM14 7.5h8.5M14 11h6M14 14h7"></path></svg>
              <span class="slot__name">Front</span>
              <span class="slot__hint">Drop or browse</span>
            </span>
            <span class="slot__docbox" aria-hidden="true">
              <span class="doc" data-doc>
                <span class="card card--front" data-card>
                  <span class="c-band"></span><span class="c-photo"></span>
                  <span class="c-lines"><i></i><i></i><i></i><i></i></span>
                  <svg class="c-sign" viewBox="0 0 40 10"><path d="M1 7c3-5 5-5 6-1s3 3 5-1 4-3 5 0 3 2 6-2 5 0 7 1 5-1 8-2"></path></svg>
                  <span class="c-holo"></span><span class="c-code"></span>
                  <span class="glare" data-glare></span>
                  <span class="scan" data-scan></span>
                </span>
                <svg class="ring" viewBox="0 0 60 40" data-ring><ellipse cx="30" cy="20" rx="27" ry="17" pathLength="1"></ellipse></svg>
                <span class="corners" data-corners><i></i><i></i><i></i><i></i></span>
              </span>
            </span>
          </label>
          <p class="msg" id="msg-front" data-msg aria-live="polite">
            <svg class="msg__icon" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="6.4"></circle><path data-icon d=""></path></svg>
            <span class="msg__text" data-text>JPG or PNG, up to 10 MB</span>
            <button class="msg__act" type="button" data-act>Replace</button>
          </p>
        </div>

        <div class="col">
          <label class="slot" data-slot="back">
            <input class="slot__input" type="file" accept="image/*" data-input aria-describedby="msg-back">
            <svg class="slot__dash" aria-hidden="true"><rect></rect></svg>
            <span class="slot__focus" aria-hidden="true"></span>
            <span class="slot__empty" aria-hidden="true">
              <svg class="slot__icon" viewBox="0 0 28 20"><rect x="1" y="1" width="26" height="18" rx="3.2"></rect><path d="M5 6h18M5 9.5h11M6 13.5v2.5M8.5 13.5v2.5M10 13.5v2.5M12.5 13.5v2.5M15 13.5v2.5M16.5 13.5v2.5M19 13.5v2.5M21.5 13.5v2.5"></path></svg>
              <span class="slot__name">Back</span>
              <span class="slot__hint">Drop or browse</span>
            </span>
            <span class="slot__docbox" aria-hidden="true">
              <span class="doc" data-doc>
                <span class="card card--back" data-card>
                  <span class="c-grid"><i></i><i></i><i></i><i></i><i></i><i></i></span>
                  <span class="c-bar"></span>
                  <span class="glare" data-glare></span>
                  <span class="scan" data-scan></span>
                </span>
                <svg class="ring" viewBox="0 0 60 40" data-ring><ellipse cx="30" cy="20" rx="27" ry="17" pathLength="1"></ellipse></svg>
                <span class="corners" data-corners><i></i><i></i><i></i><i></i></span>
              </span>
            </span>
          </label>
          <p class="msg" id="msg-back" data-msg aria-live="polite">
            <svg class="msg__icon" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="6.4"></circle><path data-icon d=""></path></svg>
            <span class="msg__text" data-text>JPG or PNG, up to 10 MB</span>
            <button class="msg__act" type="button" data-act>Replace</button>
          </p>
        </div>
      </div>

      <button class="go" type="submit" data-go disabled>
        <span class="go__fill" aria-hidden="true"></span>
        <svg class="go__spin" viewBox="0 0 20 20" aria-hidden="true"><circle cx="10" cy="10" r="7.5" pathLength="1"></circle></svg>
        <svg class="go__tick" viewBox="0 0 20 20" aria-hidden="true"><path d="M5 10.4 8.6 14 15.2 6.6" pathLength="1"></path></svg>
        <span class="go__label" data-go-label>Add both sides</span>
      </button>
      <p class="kyc__foot">
        <svg viewBox="0 0 16 16" aria-hidden="true"><rect x="3.2" y="7" width="9.6" height="7" rx="2"></rect><path d="M5.4 7V5.2a2.6 2.6 0 0 1 5.2 0V7"></path></svg>
        Encrypted, and deleted after the check
      </p>
    </form>

    <span class="drag" data-drag aria-hidden="true">
      <span class="card card--front">
        <span class="c-band"></span><span class="c-photo"></span>
        <span class="c-lines"><i></i><i></i><i></i><i></i></span>
        <svg class="c-sign" viewBox="0 0 40 10"><path d="M1 7c3-5 5-5 6-1s3 3 5-1 4-3 5 0 3 2 6-2 5 0 7 1 5-1 8-2"></path></svg>
        <span class="c-holo"></span><span class="c-code"></span>
        <span class="glare"></span>
      </span>
    </span>
    <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.

32 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 “Driving licence upload form” 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 ground there is only the panel of the licence step: at the top the Northlane mark with the Identity check label, the title Add your driving licence and the line asking for both sides, flat and in good light. Below, two dashed zones side by side, Front and Back, with the small card icon that lifts on hover, and under each one the line with the formats. The drawn pointer drags a licence into the first zone: the dashes turn blue and march, the card let go settles in its place with a small bounce and the zone gives a little. Four corners close on its edges and a band of light runs through it from top to bottom; finding the white glare, it circles it with a red ellipse that draws itself, the zone turns red and shakes, the line says Glare on the photo with Retake. With a new photo the scan passes, the corners turn green on an elastic and the line says Looks sharp. The same for the back, with its barcode. The button, which meanwhile said what was missing, becomes Continue; pressed, it spins the Checking wheel and turns green with the tick of Licence verified. Then everything empties and starts again.

How it works

Real zones

Each zone is a label with a hidden file input inside: a click or Enter opens the photo picker, and the dragenter, dragover and drop events take a dragged file. Keyboard focus lights a ring with :has(:focus-visible).

Dashes in pixels

The edge is an SVG rect measured on the zone with a ResizeObserver, so the dashes stay fine at any size; while a file hovers the dasharray marches with a small CSS animation of stroke-dashoffset, and turns solid once the photo is in.

The licence settling

Where the dragged photo is let go its rectangle is measured, then the one of its place in the zone: GSAP starts from the difference (offset, scale and a little rotation) and goes back to zero with a back.out, the FLIP. The zone gives by 1.5% and comes back on an elastic.

The scan and the glare

The corners start 20% wider and close on the card; a band with a gradient and a white line goes down with yPercent. If there is glare an SVG ellipse with pathLength 1 draws around it, the zone takes the is-bad class and shakes with five x steps ending in an elastic.

The button that says what is missing

The state of both zones decides the label, which rolls up and down: Add both sides, Add the back, Add the front, Continue. Pressed, the wheel spins, then the is-done class turns it green and the tick draws itself.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js"#2f5bff"The colour of the scan, the corners and the licence band.
SCANscript.js0.95How many seconds the scan light takes to cross the licence.
SPRINGscript.js1How lively the springs are when the licence settles (0 no bounce).
SHAKEscript.js1How much the zone shakes when the photo has glare (0 still).
BRANDscript.js"Northlane"The name of the car rental.
MAX_MBscript.js10The largest photo allowed, in megabytes: above it, the zone refuses it.
LOOPscript.jstrueLeft alone, the drawn pointer uploads the licence by itself.

Try them in the Playground

When to use it

In the sign up of a car rental, a car sharing service, an online bank or any app that verifies identity; in the online check-in of a hotel or a holiday home; anywhere a visitor has to upload a two sided document and wants to know at once whether the photo is good.

On phones

The panel narrows to 24 pixels from the edges, the zones are sized in clamp with vh and so are the gaps, so it fits the phone box; below 470 pixels of height the line under the title and the encryption line disappear. On touch the zone opens the photo picker or the camera.

With reduced motion

No flight, no bounces, no shake: the licence fades in, the corners and the ellipse appear already in place, the labels change with fades. The drawn pointer is not shown, the demo still repeats.

Pitfalls

  • A dashed edge made with border: dashed changes its rhythm from browser to browser and cannot be animated: it is an SVG rect measured in pixels and measured again on resize, because the zone changes height with the window.
  • The FLIP must be measured with the licence already in its place: first x, y and scale go back to zero, then the rectangle is read, otherwise the second time it starts from the wrong point.
  • The Retake button sits outside the zone's label: inside, a click on it would open the file picker twice.

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