Skip to the page
TACTILE UI

06.1Block 06.1 · Pricing sections

Pricing Drums

A price printed on brass drums. Switch the period or the currency and the figure rolls to its new value with the period engraved beneath; a tally shows the founder seats actually left.

Version
0.1.0
Size
132.2 KB gzipped
Access
With a Pass
Needs
pricing-drums.mjs + pricing-drums.css · Odometer
Tests
11 tests · 9 states
On this page
  1. Use it
  2. Options
  3. Methods
  4. States
  5. How it works
  6. Built with
01

Use it

Make the one number a pricing page exists for into the thing a visitor plays with: toggling the plan is how they compare, and the price rolling like a register makes the change legible and memorable. Ships as a finished catalogue-style section for a software product, ready to re-word.

Copy the pricing-drums folder and the odometer folder from its package next to your page, link the stylesheets and mount 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="odometer/odometer.css">
<link rel="stylesheet" href="pricing-drums/pricing-drums.css">
<div id="pricing-drums"></div>

<script type="module">
  import Odometer from './odometer/odometer.mjs';
  import { mount } from './pricing-drums/pricing-drums.mjs';

  const pricingDrums = mount(document.getElementById('pricing-drums'), {
    brand: 'Halden Tape Works',
    product: 'HT-7 Tape Machine',
    headline: 'Pay once.',
  }, { Odometer });

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

Options

OptionTypeDefaultWhat it does
brandtext'Halden Tape Works'Set small above the headline.
producttext'HT-7 Tape Machine'Product
headlinetext'Pay once.'Headline
accenttext'Keep the hiss.'The second half of the headline, in the accent colour.
ledetext'A two-track tape machine for your DAW, modelled from a 1971 deck we rebuilt by hand. One licence covers every computer you make music on.'Lede
periodmonthly · yearly · lifetime'lifetime'The period the switch starts on. Visitors roll the price by switching it.
currencyUSD · EUR · GBP · CAD · AUD'USD'List prices per currency, priced to end in 9 above 20.
monthlynumber, 1 to 9912Monthly price (USD)
yearlynumber, 1 to 99989Yearly price (USD)
lifetimenumber, 1 to 999249Lifetime price (USD)
seatsnumber, 0 to 999214The small counter: set it from your real sales, and call setSeats(n) when one goes.
pressingnumber, 1 to 999500Founders’ seats in all
ctaTrialtext'Start 14 days free'Button, monthly and yearly
ctaOncetext'Buy it for life'Button, lifetime
palettepaper · night'paper'Warm paper, or the same catalogue on walnut-dark stock.
finishbrass · steel · ink · bone'brass'The Odometer’s finish, and the housing that comes with it.
lightnumber, 0 to 345315The drums’ lamp: 0 from above, clockwise.
03

Methods

mount(element, options, { Odometer })
Builds the block inside the element and returns its handle. Hand it the Odometer it is built with.
handle.odometers
handle.setSeats(n)
The real count from your store: the tally rolls to it.
handle.update(next = {})
Change options in place.
handle.destroy()
Stops it and cleans up after it.
04

States

  1. At restThe configured period and currency show; the drums stand on the price with the period engraved on the plate; nothing runs.
  2. Period switchA radio change slides the ink thumb, changes badge, terms and button, re-engraves the plate and rolls the price with its carries.
  3. Currency switchA select change swaps the symbol on the plate and rolls to that currency’s list price (priced to end in 9 above 20).
  4. Seat soldsetSeats(n) with the real count rolls the founders’ tally to it; it is never announced. Nothing is simulated unless a preview asks for demo.
  5. PalettePaper (warm catalogue stock, oxblood accent) or night (walnut-dark stock, brass accent); tokens written from one table.
  6. TabletOne column; the reel drawing is dropped; the features run in two columns under the founders row.
  7. PhoneControls stack full width, the price instrument fills the column, features in one column, the button full width.
  8. Reduced motionEvery roll and slide becomes an instant change; prices, terms and the seat count still update.
  9. Off screenThe drums sleep; nothing runs until the section returns.
05

How it works

Made of: Rolling price, Engraved period plate, List price per currency, Visibility gated scarcity tally, Native radio segmented control, Palette tokens from one table.

Read more: How the Odometer carries · Odometer, odometer.js, NumberFlow.

Original composition; the product (Halden Tape Works, HT-7) and all copy are invented. The reel drawing is hand-built SVG. Faces: Instrument Serif and Work Sans (SIL OFL 1.1), Latin subsets as WOFF2. The canvas-fonts source had no licence file for Instrument Serif, so InstrumentSerif-OFL.txt is the standard OFL 1.1 text under the copyright line from the font’s own name table.

06

Built with

More blocks on the same object:

Docs
Finish
Volume