Text Effects · Component Template
Split-Flap Display
A mechanical departures board whose hinged flaps clatter through the alphabet until each lands on the right character. The board turns over as each train leaves.
Live demo
Wait for the next train to leave, or turn on Sound to hear the flaps.
The Prompt
Build a split-flap departures board, the mechanical kind from old railway stations: rows of small hinged flaps that clatter through the alphabet until each lands on the right character. Seven rows of night-train departures, built forward from the real current time, turn over every few seconds as trains leave. Each flap must behave like a drum that only turns one way, and each flip must be a true two-part fold, not a fade. Match my project's existing stack, conventions, and design tokens. If there are none, output a single HTML file with inline CSS and JavaScript and zero dependencies. LOOK - Page (station wall) #1B1A18. Board #0C0C0C. Flap faces #232323 (upper half) and #1C1C1C (lower half). Characters #F2EFE6. Amber #FFB000 for the clock and for delays. Secondary text #99948A. - Font everywhere: Bahnschrift, "DIN Alternate", "Franklin Gothic Medium", "Arial Narrow", sans-serif-condensed, system-ui, sans-serif. - Header above the board: h1 "Departures" at clamp(30px, 5vw, 52px) weight 700 with "Kestrel Night Rail, Central Station" under it in secondary color; on the right a live clock (HH:MM:SS, amber, clamp(24px, 4vw, 40px), tabular numerals). - Board frame: 10px radius, a 1px black line, then a 5px #2B2927 metal frame with a 1px lighter edge, and a deep shadow. - Everything on the board is sized from one unit, the cell width: --cw = min(26px, (100vw - 96px) / 39.5). A cell is 1 x 1.5 units; characters are 1.02 units, weight 600. Cells sit 2px apart inside a column and columns are 0.62 units apart. - Columns and their widths in cells: TIME 5, DESTINATION 14, TRAIN 6, PL 2, STATUS 8. Small secondary-color labels sit above each column. - Seven rows, 0.28 units apart. - Under the board: "The board turns over as each train leaves." on the left and a pill "Sound" toggle on the right (off by default; on = light fill with a red dot). - Under 720px: hide the TRAIN and STATUS columns and the subtitle, and use --cw = min(22px, (100vw - 74px) / 24). ONE FLAP UNIT - Each cell has four half-height layers, all clipping a double-height character so only one half shows: a static top half, a static bottom half, a top flap hinged on its bottom edge, and a bottom flap hinged on its top edge. A 1px black line across the middle sits above all four. Give the cell perspective of 6 units and the flaps backface-visibility hidden. - To flip from character A to B: set the static top to B, the top flap to A, the bottom flap to B (the static bottom still shows A). Rotate the top flap from 0 to -90 degrees around X with ease-in over the first half of the step; then rotate the bottom flap from 90 to 0 degrees with ease-out over the second half. When it lands, set the static bottom and the top flap to B and clear the animations. - Use the Web Animations API for the two rotations. THE DRUM RULE - Every cell carries the same ordered set: space, A to Z, 0 to 9, colon, plus, minus, full stop. A cell can only step forward through that order, wrapping at the end. To change from one character to another it performs every flip in between. - Step time depends on how far there is still to go: 46ms normally, 70ms for the last six, 95ms for the last three, so each cell slows down as it arrives. - When a row is given new text, cells start with a stagger: row index x 90ms plus column index x 22ms. - A cell that is already turning just gets a new target and keeps going. THE TIMETABLE - Build departures forward from the real clock: the first is a few minutes from now, and each one after is 6 to 19 minutes later. Use a seeded generator so a given moment always produces the same board. - Destinations cycle through sixteen upper-case station names of at most 14 characters (WIEN HBF, ROMA TERMINI, PARIS EST, PRAHA HL N, ZURICH HB, AMSTERDAM C, KOBENHAVN H, and so on). Trains are "NJ" or "EN" plus a three-digit number. Platforms are 1 to 12, right-aligned. Status is ON TIME about 70% of the time, otherwise +10 MIN or +25 MIN. - The top row shows BOARDING if it was on time. - Rows whose status starts with "+" show their status cells in amber. - Every 8 seconds the top train leaves: every row takes the next row's content and a new departure appears at the bottom, so the whole board turns over. Half the time one of the middle rows also slips to +10 MIN. SOUND - Off until the visitor presses Sound (browsers require a gesture). Create one 30ms buffer of white noise with a cubic decay. Each time a flap lands, play it through a band-pass filter (1.9 to 2.8 kHz, Q 1.2) at a random playback rate of 0.8 to 1.3, but no more often than every 28ms. Gain rises slightly with the number of cells still turning, capped at 0.5. BEHAVIOR - The clock ticks every second. The 8-second timer pauses while the tab is hidden. - The board never needs layout work on resize; it scales from --cw. ACCESSIBILITY - The flap board is aria-hidden. Next to it, keep a visually hidden real table (caption "Next departures", proper headers) with the same data, rewritten whenever the board changes. - The sound button uses aria-pressed. Focus rings are 2px amber. - prefers-reduced-motion: no flipping. Characters are set directly and the board still updates every 8 seconds. DEPTH - The board hangs in space. Its parent has perspective 1400px and the board leans toward the pointer: up to 4.5 degrees left and right and 3 degrees up and down, eased at 8% a frame, returning to level when the pointer leaves. - A soft diagonal band of light lies across the board's glass and slides sideways with the lean. - A lamp above: the wall is a radial gradient lit from the top center (#3a342b falling to the wall color at 52% and #100f0e at the edges), and the board carries a faint warm glow on its top edge and a deep 90px shadow below. - prefers-reduced-motion: no lean. NEVER - No fading, sliding or scrambling to random characters. Flaps fold, in drum order. - No lower-case, no characters outside the drum's set. - No color beyond off-white and amber on the board. - No sound without a user gesture. - No canvas; each flap is DOM so the text stays crisp at any size.
- CopyThe full prompt, one click.
- PasteInto Cursor, Claude Code, or any agent.
- CompareAgainst the live demo above.