Skip to content
Blog Post
Ten to Four Cars: A Taxi Website Built Around a Split-Flap Board

Ten to Four Cars: A Taxi Website Built Around a Split-Flap Board

Ten to Four Cars is one of my website templates, made for a taxi and airport-transfer firm. The firm and its town, Marlowick, are made up for the demo. The airports are real.

Most people booking an airport run want three answers: when will you pick me up, what will it cost, and can I book it now? The design puts those answers on an airport departure board. Pick an airport and the letters tumble into place: where from, where to, the pick-up time for a 6am flight, and the fare. Then one button takes you to the booking page with that trip already filled in.

On the booking page you can use any UK postcode or one of the listed airports, choose from three sizes of car, and either pay online with Stripe or pay the driver on the day.

The stack

  • Framework: Next.js 15 (App Router), React 19 and TypeScript
  • Styling: one plain CSS file, no framework
  • Postcodes: looked up with postcodes.io from the server
  • Payments: Stripe Checkout, called through its REST API with no Stripe package

How the split-flap board works

A real split-flap board has a reel of cards for each letter. To get from A to D, the reel flips past B and C on the way. The board in components/Board.tsx does the same thing. Each cell knows the reel and steps through it, one flap every 70 milliseconds, until it reaches the letter it wants:

const REEL = " ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789£:-";
const STEP = 70, MAX_STEPS = 16;

// A long way round? Skip ahead, so every cell lands within about a second.
let i = REEL.indexOf(at.current);
const gap = (end - i + len) % len;
if (gap > MAX_STEPS) i = (end - MAX_STEPS + len) % len;

That skip-ahead matters. Going from "A" to "9" the long way would take over two seconds, so a cell never flips more than 16 times.

Each cell is drawn as two halves: the top half shows the new letter and the bottom half shows the old one. On every step, two extra halves are added on top. One falls forward, using a CSS rotateX(-90deg) with a bit of darkening, and the other lands from the opposite angle 35 milliseconds later. Because those extra halves get a new React key each step, the browser starts a fresh animation every time.

The cells also start with a small delay that grows along each row and down the board, so the letters ripple from left to right rather than all changing at once.

Two details I'm pleased with:

  • Screen readers get plain text. The flaps are hidden from assistive technology, and the board carries a sentence such as "For a 6am flight from Manchester Airport: pick-up in Marlowick at…" instead. Nobody has to listen to a reel of single letters.
  • Reduced motion is respected. If someone has asked their device for less motion, the letters change in place and the home board doesn't cycle by itself.

On the home page, the board moves on to the next airport every few seconds, but only while the tab is visible. There's a pause button, and picking an airport stops it.

Fare quotes

Fares are worked out in lib/fares.ts, and the same file is used by the home page, the booking form and the server. The sums are simple, the kind a firm would put on a price card:

  • A starting charge plus a price per mile, which drops after 20 miles
  • A minimum fare
  • Estate and eight-seater cars cost a set percentage more than a saloon
  • A night rate from 11pm to 6am
  • A fixed charge for airport parking or drop-off, and an optional "meet you inside" with a name board

Distance is the straight line between the two points multiplied by 1.25, a usual rule of thumb for British roads. It isn't a route planner, and the code says so. Trips over 400 miles get a "please ring us" instead of a price.

If you enter a flight time, the form suggests a pick-up time: two hours at the airport, the estimated drive, and ten minutes spare, rounded down to the nearest five minutes. All the date sums are done on UK wall-clock time, so the visitor's own time zone never shifts a pick-up.

Booking with Stripe

The price the browser shows is never trusted. When someone books, /api/book checks the details, looks the postcodes up again, and works the fare out from scratch before anything is charged. It also asks for two hours' notice online and gives the firm's phone number for anything sooner.

For online payment it opens a Stripe Checkout page for that exact total. When Stripe confirms the payment, a webhook sends the paid booking on to the office. The webhook checks Stripe's signature itself with Node's built-in crypto, so the site needs no Stripe library at all.

Pay-the-driver bookings skip Stripe and go straight to the office. With no Stripe key set, the site runs in demo mode and the thank-you page says plainly that nothing was charged.

Why it suits a taxi firm

  • The phone number is always in the header. Plenty of customers would rather ring, and the booking form points them to the phone when a trip is too soon or too far.
  • The price comes before the form. People can see roughly what a trip costs before typing their name.
  • The firm's details live in one file. The phone number, address, places and questions are all in lib/site.ts, and the fares in lib/fares.ts.
  • Light spam checks. A hidden field, a minimum time on the page and a per-address limit keep bots out of the booking form.

See it for yourself

You can try the live demo of Ten to Four Cars. It's a template, so the firm, the town and the prices are examples. The design page has the details. It starts at £149.

If you run a taxi or transfer firm and want something like this, get in touch.

Thanks for reading! Got a question or an idea for a build? Get in touch.