Skip to the page
TACTILE UI

15Object 15 · Reveals

Ring-bound Notebook

A flip book of cards on two rings, seen from above. Lift the lower card over the rings and the page turns: your finger holds the card where it took it, and let go, gravity decides which way it falls.

Version
0.1.0
Size
10.4 KB gzipped
Access
With a Pass
Needs
notebook.mjs + notebook.css
Tests
8 tests · 11 states
On this page
  1. Use it
  2. Options
  3. Methods
  4. States
  5. How it works
01

Use it

A changelog people actually turn through: the version and date on the upper card, what changed on the lower. Also a day calendar, on-call handovers, onboarding steps, a run's stages: anything read one page at a time. The pages are real text: two buttons (previous and next) with the page they lead to in their names, arrow and Page keys, and a polite announcement of each page turned to.

Copy the notebook folder from its package next to your page, link its stylesheet and construct it on an element. Every option has a default; the lab’s Code tab writes the same example at any settings, and for React, Vue, Svelte or a custom element (Using a framework).

<link rel="stylesheet" href="notebook/notebook.css">
<div id="notebook" style="width: min(90vw, 440px)"></div>

<script type="module">
  import Notebook from './notebook/notebook.mjs';

  const notebook = new Notebook(document.getElementById('notebook'), {
    preset: 'changelog',
    page: 0,
    finish: 'auto',
  });

  // notebook.update({ … });   change any option in place
  // notebook.destroy();        and take it away again
</script>
02

Options

OptionTypeDefaultWhat it does
presetchangelog · calendar'changelog'A changelog (version and date above, notes below) or a day calendar. In code, pass your own pages.
pagenumber, 1 to 51Where the book is open when the page loads.
finishauto · aluminium · graphite'auto'Aluminium: bookcloth and warm card. Graphite: black leather and black card, as in the pin.
readonlybooleanfalsePages turn from code only.
soundbooleanfalseSynthesised, no audio file: a flick as a card leaves its stack, a slap as it lands. Only after a page is turned.
labeltext'Changelog'Accessible name
03

Methods

new Notebook(element, options)
Builds it inside the element with these options.
pages
page
update(opts = {})
Change options in place.
turn(dir = 1)
Turn to the next page (a push that carries the card over the rings) or back.
goTo(page)
destroy()
Stops it and cleans up after it.

Events it fires, which bubble from the element: change, input.

04

States

  1. OpenTwo halves of one page either side of the rings: the upper card's back, the lower card's front; nothing runs.
  2. LiftingDrag the lower card up: it rotates about the rings under your finger, darkening as it turns from the lamp, its shadow lengthening down the page beneath.
  3. Let goShort of upright it falls back; past it, it falls over onto the flipped pile and slaps down with a small bounce.
  4. A tap or a keyA push that carries the card over in about half a second; the upper card turns the page back the same way.
  5. At an endThe first page cannot go back and the last cannot go on; those buttons are disabled.
  6. KeyboardArrows and Page keys turn pages, Home and End go to the ends; the page turned to is announced.
  7. AluminiumGrey bookcloth, warm white card, steel rings.
  8. GraphiteBlack leather, black card with light print, dark rings, as in the pin.
  9. Read-onlyPages turn from code only.
  10. Off screenA turning card lands where it was going.
  11. Reduced motionPages turn at once.
05

How it works

Made of: Two sided card pages, Finger held hinge, Gravity decides, Css 3d hinge, Computed clip outline, Lamp shaded faces, Sleeping loop.

Original, after the owner's pin. CSS 3D for the cards, one small loop while a card moves; the outline is an SVG path computed in px on resize.

Docs
Finish
Volume