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
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>Options
| Option | Type | Default | What it does |
|---|---|---|---|
| brand | text | 'Halden Tape Works' | Set small above the headline. |
| product | text | 'HT-7 Tape Machine' | Product |
| headline | text | 'Pay once.' | Headline |
| accent | text | 'Keep the hiss.' | The second half of the headline, in the accent colour. |
| lede | text | '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 |
| period | monthly · yearly · lifetime | 'lifetime' | The period the switch starts on. Visitors roll the price by switching it. |
| currency | USD · EUR · GBP · CAD · AUD | 'USD' | List prices per currency, priced to end in 9 above 20. |
| monthly | number, 1 to 99 | 12 | Monthly price (USD) |
| yearly | number, 1 to 999 | 89 | Yearly price (USD) |
| lifetime | number, 1 to 999 | 249 | Lifetime price (USD) |
| seats | number, 0 to 999 | 214 | The small counter: set it from your real sales, and call setSeats(n) when one goes. |
| pressing | number, 1 to 999 | 500 | Founders’ seats in all |
| ctaTrial | text | 'Start 14 days free' | Button, monthly and yearly |
| ctaOnce | text | 'Buy it for life' | Button, lifetime |
| palette | paper · night | 'paper' | Warm paper, or the same catalogue on walnut-dark stock. |
| finish | brass · steel · ink · bone | 'brass' | The Odometer’s finish, and the housing that comes with it. |
| light | number, 0 to 345 | 315 | The drums’ lamp: 0 from above, clockwise. |
Methods
mount(element, options, { Odometer })- Builds the block inside the element and returns its handle. Hand it the Odometer it is built with.
handle.odometershandle.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.
States
- At restThe configured period and currency show; the drums stand on the price with the period engraved on the plate; nothing runs.
- Period switchA radio change slides the ink thumb, changes badge, terms and button, re-engraves the plate and rolls the price with its carries.
- 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).
- 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.
- PalettePaper (warm catalogue stock, oxblood accent) or night (walnut-dark stock, brass accent); tokens written from one table.
- TabletOne column; the reel drawing is dropped; the features run in two columns under the founders row.
- PhoneControls stack full width, the price instrument fills the column, features in one column, the button full width.
- Reduced motionEvery roll and slide becomes an instant change; prices, terms and the seat count still update.
- Off screenThe drums sleep; nothing runs until the section returns.
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.
Built with
More blocks on the same object:
- 06.2Goal TallyA fundraiser’s total on big printed drums.
- 06.3Trip ComputerAn instrument cluster as a stats band.
- 06.4Specimen CaseA bento of glass-topped compartments in a machined case, each holding one real Tactile object running small (the Odometer, the Flip-Dot, the Detent Dial, the Vessel) with an engraved label card under the glass.