Skip to content
animorio
IT
All components

Keyboard shortcuts window

Dialogs, HoverGSAP, CSS onlyMediumCompressed weight: Demo 7.7 KBGSAP 28 KBFreeDownload the zip

The keyboard shortcuts window of a writing app, in the clean style of product pieces: it springs out of the small ? key in the corner and goes back into it with Esc, the drawn keycaps go down when a shortcut is used and the search folds away the rows that do not match.

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>
<!--
  "Keyboard shortcuts window" 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 keyboard shortcuts window that opens with the question mark</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 writing app with a small ? key in its corner: pressed, the shortcuts window springs out of the key itself, its
         keycaps go down when a shortcut is used, the search folds away the rows that do not match, and Esc sends the
         window back into the key it came from -->
    <div class="fit" data-fit>
      <div class="app" data-frame>
        <header class="app__bar">
          <svg class="app__mark" viewBox="0 0 24 24" aria-hidden="true"><path d="M5 19c3-1 5-3.5 6.5-7.5L14 5l3.5 2.5L15 13c-2.5 3-5.5 5-10 6Z"></path><path d="M11.5 11.5 15 13"></path></svg>
          <p class="app__brand"><span data-brand>Quillmark</span> <span class="app__path">/ Launch notes</span></p>
          <span class="app__saved">Saved</span>
        </header>
        <article class="doc" aria-hidden="true">
          <p class="doc__title">Spring launch notes</p>
          <p class="doc__line"><span>We ship the new editor on</span> <b class="doc__word" data-word>Thursday</b><span>, with comments and</span></p>
          <p class="doc__line"><span>a cleaner sidebar. The beta list gets it a week earlier.</span></p>
          <span class="doc__bar" style="width:92%"></span>
          <span class="doc__bar" style="width:78%"></span>
          <span class="doc__bar" style="width:86%"></span>
          <span class="doc__bar" style="width:54%"></span>
        </article>

        <button class="help" type="button" aria-haspopup="dialog" aria-expanded="false" aria-label="Keyboard shortcuts" data-help>
          <span class="help__cap" data-help-cap>?</span>
        </button>

        <section class="sheet" role="dialog" aria-modal="false" aria-labelledby="sheet-title" hidden data-sheet>
          <header class="sheet__head">
            <h2 class="sheet__title" id="sheet-title">Keyboard shortcuts</h2>
            <button class="sheet__close" type="button" aria-label="Close" data-close><kbd class="k" data-esc><span class="k__face">Esc</span></kbd></button>
          </header>
          <label class="search">
            <svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="10.5" cy="10.5" r="6"></circle><path d="m15 15 4.5 4.5"></path></svg>
            <input type="text" placeholder="Search shortcuts" autocomplete="off" spellcheck="false" aria-label="Search shortcuts" data-search>
            <span class="search__count" data-count></span>
          </label>
          <div class="groups" data-groups></div>
          <p class="sheet__foot" data-foot>Press <kbd class="k k--mini"><span class="k__face">?</span></kbd> anytime to open this</p>
        </section>
      </div>
    </div>

    <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 “Keyboard shortcuts window” 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 sits the window of Quillmark, an invented writing app: the bar with the mark, the «Launch notes» path and Saved, and below it the «Spring launch notes» note with its lines. In the bottom right corner there is a small ? key drawn like a real key, with its darker edge underneath. Pressed, the key goes down two pixels and the Keyboard shortcuts window springs out of its tip, growing until it covers the note and rounding its corners as it grows; inside, the title, the search and the rows arrive one after another. The shortcuts are split into Navigation, Editing and View: each row has its name on the left and the keycaps on the right, with the Command, Option and Shift symbols drawn, not typed. When a shortcut is used its row lights up in pale blue and its keycaps go down one after another as if really pressed, and «Bold used» appears at the bottom. Typing in the search folds away the rows that do not match, the letters found turn blue, groups left empty disappear and the count says how many remain; deleting brings the rows back with a small bounce. Esc, the keycap at the top, goes down and the window goes back into the ? key, which gives a small elastic bounce. A drawn pointer does it all by itself; it also really works with mouse, touch and keyboard: ? opens, Esc closes, Command or Ctrl with B, K, Z, M light up their rows.

How it works

An app drawn in pixels

The app has two fixed sizes, wide with two columns and narrow with one column for tall boxes, and a wrapper scales it to fit the window, height included. This way the keycaps and the rows always stay in proportion.

The window out of the key

On opening, the centre of the ? key is measured inside the window and used as the transformOrigin: the window starts at 0.07 with a large radius and reaches 1 with back.out, then the inner pieces rise staggered. Closing travels the same way back with power3.in.

The keycap going down

Every keycap is a white face over a darker edge: pressing means moving the face two pixels down and bringing it back with back.out, one after another, with a longer pause for shortcuts made of two keys in a row.

A search that folds

At every letter each row checks whether its name contains the text: the ones that do not match go to zero height, the ones coming back go from zero to auto with a bounce; the letters found go into a blue mark and empty groups hide.

The autopilot

A timeline with repeatRefresh takes the drawn pointer to the ? key, opens, uses two shortcuts, types in the search and erases it, then presses Esc. At the first real touch or key it stops, and starts again from the top after nine quiet seconds.

Values to change

NameFileDefaultWhat it changes
APPscript.jsQuillmarkThe name of the invented writing app, top left.
ACCENTscript.js#3b5bfdThe colour of the search, the letters found and the row of the shortcut in use.
OPENscript.js0.6The seconds the window takes to spring out of the ? key.
PRESSscript.js0.14The seconds a keycap takes to go down and come back up.
TYPE_SPEEDscript.js0.12The seconds between letters when the autopilot types in the search.
PAUSEscript.js1The seconds the autopilot waits between one gesture and the next.

Try them in the Playground

When to use it

For a writing app, an editor, a dashboard or any tool used from the keyboard: the help window that opens with ? and shows the shortcuts, searchable.

On phones

In a tall box the app switches to its narrow size, one column only, and is scaled to fit whole; the ? key and Esc stay big enough for a finger and a tap does what a click does.

With reduced motion

No springs and no keycaps going down: the window fades in and out, the keycaps brighten for a moment, the search rows change without folding and the drawn pointer stays hidden.

Pitfalls

  • The transformOrigin is measured with the window already visible and at scale 1: measured while hidden it would be zero and the window would come out of the top left corner.
  • Key symbols typed as characters change from one system to another and some turn into emoji: they are SVG, with their name in aria-label.
  • The preview frames the whole app, always visible, not the window, which is hidden at rest.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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