Hover✨ Premium

Live Typing

Each keystroke makes its letter spring up with a rotation in a unique colour — the last 15 typed characters are shown left to right and older ones are pushed off the edge, blinking cursor included. Under reduced motion, the word "effect" is shown statically at load time.

JSKeyboardAnimation

Updated

This effect is part of Effect.Labs — 840 vanilla effects, some free, some premium. Hover has 48 effects, including 5 free. Explore the category →

3 usage examples

Live display on a stage screen — full-frame projection for a tech event or meetup — Live Typing example 1

① Live display on a stage screen — full-frame projection for a tech event or meetup

WhenThe presenter types on their keyboard and each letter appears large (4.5 rem) with the pop animation on the projection screen. The audience sees words form in real time.
WhyA full-screen live display turns typing into a visual spectacle: each animated letter captures the audience's attention and brings a simple projection to life.
SettingsFont-size 4.5 rem, weight 900; gradient colours from blue to violet by position; very dark background with event bar and LIVE badge. Pre-loaded via scene script for capture (stated in the description).
PIN code entry in a secure login form — styled field inside an authentication page — Live Typing example 2

② PIN code entry in a secure login form — styled field inside an authentication page

WhenIn a login form, the user must enter a 6-character code. Each keypress triggers the pop animation; the code is pre-filled with neutral blocks for the demo.
WhyThe pop animation on each character gives immediate visual feedback without revealing the code content: more engaging than a masked field, without sacrificing discretion.
SettingsFont-size 1.6 rem; wide letter-spacing (.12em); characters displayed as coloured blocks (▪); indigo border on the container; '6 max' hint overlaid.
Typing area in a word sprint — timed typing challenge with live stats — Live Typing example 3

③ Typing area in a word sprint — timed typing challenge with live stats

WhenIn a timed typing challenge, each typed word appears in the live area with the pop animation. Stats (words, characters, accuracy) update on every keystroke.
WhyThe per-letter animation strengthens the sense of progress and urgency in a timed challenge: each pop is a micro-reward that encourages the user to keep going.
SettingsFont-size 2.4 rem; position-based colours (blue → violet); zone outlined with an indigo border; stats below with a progress bar.

How it works

The .fx-0377-root frame listens to keydown events on the entire document: any single-character key (e.key.length === 1) adds an entry to a 15-slot array; Backspace removes the last one. On every keystroke the renderer clears the .lt377-display area and recreates one <span> per character with a colour computed from its position (hsl(220 + i × 10, 70%, 60%)), from blue at the first letter to violet at the fifteenth, and a staggered animation delay of 50 ms between letters.

The lt377-pop animation scales each letter to 1.3 then back to 1 in 0.4 s. The cursor (div.lt377-cursor) blinks in a loop (lt377-blink, 0.7 s). No initial state is needed: the area is empty until the first keystroke, with the cursor only. The effect uses no requestAnimationFrame loop, so there is nothing to stop when off screen.

Accessibility

  • Screen reader: the display area has role="status" and aria-live="polite"; each keystroke announces the added character without interrupting what the reader was saying. The aria-label describes the area on first focus.
  • Reduced motion: under prefers-reduced-motion: reduce, no animation starts, the per-letter delay is removed and the word "effect" is shown immediately at load with a static cursor — the state of the effect is readable without a single letter having to move.
  • Keyboard only: the effect responds to a physical keyboard. On mobile, no touch equivalent is provided: there is no text field triggered on tap. If your users are on mobile, add a hidden <input type="text"> that receives focus on tap and fires the input event.
  • Focus and isolation: each copy only listens to the keyboard when it has focus. Click the area (or Tab to it) to activate it — an indigo outline appears. On the same page, two copies work independently: only the active area receives keystrokes.

Browser compatibility

Pure DOM and CSS, no dependency. Works in all modern browsers as soon as keydown, CSS animations and querySelectorAll are available, meaning since Chrome 4, Firefox 3.5 and Safari 4. window.matchMedia exists since Chrome 9, Firefox 6 and Safari 5.1. No experimental or prefixed API.

Chrome 9+✓ Full
Firefox 6+✓ Full
Safari 5.1+✓ Full
Edge 12+✓ Full
Mobile iOS✓ Partial — no physical keyboard, effect not triggered without an input field
Android Chrome✓ Partial — same reason

Without JavaScript, the display area stays empty. Without CSS animations, letters appear without the bounce effect.

The code

HTML structure to paste into your page (the CSS + JS come with your purchase):

index.html — structure
<div class="fx-0377-root">
  <div class="lt377-display" role="status" aria-live="polite" aria-label="Display of typed keys"></div>
  <span class="lt377-label" aria-hidden="true">Type on your keyboard</span>
</div>

One-time payment, no subscription — the code is yours forever

Customize

Options passed to the API or data-* attributes:

Option / propertyDefaultEffect
Maximum character count (JS — 15-slot array) 15 Replace if(chars.length > 15) chars.shift() with the value you want. 8 gives a compact result; 20 overflows on small screens without adjusting the font.
Letter size (CSS — .lt377-display span { font-size }) 2 rem Increase for a monumental hero display; go down to 1.2 rem for inline use in a paragraph.
Colour palette (JS — hsl(220 + i × 10, 70%, 60%)) blue to violet, base hue 220, step 10° 220 → 0 gives red to blue; base 0, step 15 gives red to orange. For a fixed colour, replace with a constant hex code.
Pop animation duration (CSS — @keyframes lt377-pop) 0.4 s 0.15 s gives a very snappy spring; 0.8 s a lazy bounce.
Background (CSS — background of .fx-0377-root) #0a0a0f Set to transparent to integrate the effect into your page's own backdrop.

FAQ

No, and that is expected. On mobile, the system keyboard does not fire keydown events until a field has focus. To trigger the effect on touch, add a hidden <input type="text" style="opacity:0;position:absolute"> inside the root, focus it on tap, and listen to the input event instead of keydown.
Yes. The keydown listener is attached to each instance's .fx-0377-root. Each copy only reacts to keystrokes received while it has focus (click or Tab). On the same page, two areas work independently — only the active one updates.
Not directly. keydown does not fire for a paste (Ctrl+V fires keydown for "v" but not for each pasted letter). For dictation or paste, listen to the input event on a hidden field and read event.data to get the new characters.