Somna Night Rail
Rail travel booking website template · Travel and outdoors
Station wayfinding signage: navy sign plates on white enamel, one signal yellow, drawn pictograms, platform numbers in rounded squares and a split-flap departures board.
The page is a station concourse. The first screen is a split-flap departures board that runs on the visitor's clock: the eight services of the night sorted from now, each character a flap that steps through the drum to its new letter, with Boarding thirty minutes before departure, one train Delayed 10 and departed trains rolling off to tomorrow. With reduced motion the board updates in place; without JavaScript it is a static timetable board.
Below it, a line map of the four routes (Amsterdam to Wien, Bruxelles to Praha, Hamburg to Zürich, München to Roma) with real interchanges at Köln and Frankfurt. Choosing a line lights it and its stations and draws a timeline of the night (café, quiet hours, breakfast) with a You are here marker you drag or step with the keyboard; the marker moves along the line on the map. Then the four cabins as cutaway cross-sections, the café menu and the hours of the night, a station directory with platforms, and the questions asked at the coach door.
Booking runs on one page: line and direction, a calendar grid with busy nights marked, adults, children and bikes, cabin, and a coach plan where you pick exact berths (some taken, the same every time for that night). The summary adds up as you go; the lead traveller form validates inline, then shows loading, an error that keeps your choices, or a ticket with a drawn scan code. Everything is drawn in SVG and CSS; there are no photographs.
The brand is fictional: Somna Night Rail, a fictional night train operator with four lines across Europe. Names, people and figures on the page are invented.
What works
- Split-flap departures board: statuses, due times and order follow the clock, characters flip on change
- Line picker and map: highlight a line and its stations, click a line on the map
- Night timeline slider: drag, arrows (Shift for 30 minutes), Page Up/Down between stations, Home/End; marker moves on the map
- Cabin tabs with cutaway drawings, arrow-key navigation
- Booking: line, direction, calendar with keyboard grid navigation, traveller steppers with limits, cabin choice with live fares
- Coach berth plan: choose exactly one berth per traveller, taken berths disabled
- Summary with line items and total; inline validation; loading, error and ticket states
- Station filter by line, questions accordion, mobile menu with Escape
States you can link to
script.js reads these from the URL, so you can open the page in a given state to review it, screenshot it or show it to an agent.
| Parameter | What it does |
|---|---|
?time=20:05 | sets the station clock (any HH:MM) for the board and the timeline marker. Open ?time=20:05 |
?state=boarding | 19:40: two trains boarding, one departed. Open ?state=boarding |
?state=delayed | 20:02: the München train shows Delayed 10. Open ?state=delayed |
?line=n4 | picks N4 on the map and in the booking form. Open ?line=n4 |
?cabin=sl | opens the sleeper cutaway and selects it in the booking form. Open ?cabin=sl |
?book=demo | a filled booking: two adults, a child and a bike, berths chosen. Open ?book=demo |
?state=invalid | the demo booking with inline errors on the traveller details. Open ?state=invalid |
?state=loading | the demo booking held in the sending state. Open ?state=loading |
?state=error | the demo booking after a failed send, choices kept. Open ?state=error |
?state=success | the issued ticket with its drawn code. Open ?state=success |
?menu=open | opens the menu on narrow screens. Open ?menu=open |
Use it
Copy templates/nighttrain/ into your project, or download the zip, which has the Screenery badge script already removed. Colours, type, spacing and radii are custom properties at the top of style.css. This template loads no libraries: only its own files and web fonts.
The docs explain the token pattern and how to move a template into React, Vue, Svelte or Astro. The guide has prompts for handing it to a coding agent.
Inspection
Loaded in Chromium 156.0.8078.4 (Playwright, headless) on 27 November 2026 at 1440, 1024, 768, 390 pixels wide and once more with reduced motion requested. Every check passed at every width.
- 1440 px
- Pass
- 1024 px
- Pass
- 768 px
- Pass
- 390 px
- Pass
- Reduced motion
- Pass
- Page weight
- 221 KB, 7 requests
Requests and transferred size were measured at 1440 pixels on a cold cache and include web fonts and any CDN library. The full result is in the viewer: open the Checks panel. How templates are checked.