Skip to content
OwnlyPlans

Plan

Sleeper night train hero seen through a window

A booking hero for overnight trains: a cabin window looks out on a landscape that turns from moonlit night to sunrise over the sea, with a search panel beside it.

Live preview Remix

Use it with Claude or any AI tool. Copy the prompt and paste it in. The link inside gives the AI the whole page as Markdown.

Markdown
Preview of Sleeper night train hero seen through a window

Preview of the result built from this prompt.

Overview

A single-file hero for an overnight train booking site. Copy and a search panel sit on a dark cabin wall; on the right a wooden train window shows the journey. The whole view is drawn on one canvas and slowly turns from a moonlit night to sunrise over the sea: stars fade, the sun climbs, the water turns peach and glitters. Hills, villages, trees and palms slide past at different speeds, with telegraph poles flashing by in front. A roller blind rises when the page loads and can be pulled back down. A small label under the glass follows the journey (Night run across the Deccan, Crossing the Godavari, First light near Vijayawada, Sunrise by the Bay of Bengal). Everything is inline, so it works in the live preview.

Build it step by step

Sign in to tick steps off
  1. 1

    Build the cabin wall, the copy and the search panel

    Put the words on a dark cabin wall at the left and keep the right side free for the window. Warm lamp yellow is only used for actions.

    Prompt
    Create a single-file HTML hero for Sleeper, an overnight train booking site. Page: a dark plum cabin wall (#15121f to #191529) with a soft warm lamp glow in the top left. Colours: lamp yellow #ffcf6b only for buttons and focus, mist #cfcbe8 for secondary text. Fonts: Young Serif for the headline and Hanken Grotesk for everything else, loaded from Google Fonts with Georgia and system-ui fallbacks. Top bar: name Sleeper, three links, a yellow Sign in pill. Two columns below it: the left column has the headline "Go to sleep in Delhi. Wake up by the sea.", one short paragraph, a search panel and a small line "Tonight: 14 routes leave after 8 pm". The panel is a form with three labelled fields (From, To, Berth with 2 tier AC, 3 tier AC, 1st class) and a yellow button "Find night trains"; stop real submission with onsubmit="return false". The right column is empty for now. Left-align everything.

    Done when A dark page with the bar, headline, paragraph and search panel on the left and an empty space on the right.

  2. 2

    Make the window and the sky, sun and sea

    Build a wooden window frame with a glass area, then draw the sky, a moon, a sun and the sea on a canvas inside it.

    Prompt
    In the right column add a train window: a rounded box about 74vh tall (max 660px) with a dark wood gradient frame, 12 to 16px thick, and a deep shadow. Inside it put a glass area with rounded corners, an inner shadow, a soft diagonal reflection overlay and a canvas that fills it. On the canvas draw a horizon at 54% of the height. Above it a vertical sky gradient. Below it a sea gradient. Add 70 twinkling stars, a cream moon with a glow at the upper left, and a sun that sits below the horizon and rises. Define one number p from 0 (night) to 1 (sunrise) and blend every colour between a night palette (#080a20, #1b1a45, #43346a sky; #16254f sea) and a sunrise palette (#3a4a86, #a8708f, #ffc58a sky; #f7b98e, #d9959f, #6f86bd sea). Stars and moon fade out as p rises; the sun and its glow fade in. Add a column of short horizontal glitter lines on the sea under the sun (or moon) that shimmer.

    Done when The window shows a moonlit sky and dark sea at p = 0 and a peach sunrise with a glittering sea at p = 1.

  3. 3

    Add the moving landscape

    Layers slide sideways at different speeds, so the window feels like a train. The sea must still show between the hills.

    Prompt
    Move a single offset forward every frame (about 0.06px per millisecond) and draw layers from far to near, each shifted by a different fraction of it: far headlands (0.12) that only appear in some stretches so the sea shows between them; a mid land strip (0.3) with villages of tiny houses that have lamp-yellow windows (dimmer at sunrise); mid trees (0.55); a near dark ground and big near trees and coconut palms (1.5); and last, dark telegraph poles with two sagging wires, drawn quadratically, passing at about 3x speed. Make the trees and houses from a seeded random list on a repeating strip so they loop without a seam. Land silhouettes get lighter and more purple at sunrise (blend the same way as the sky), and the nearest ones stay almost black. Draw a soft dark vignette over the whole canvas.

    Done when Headlands, villages, trees and palms slide past at different speeds, poles flash by in front, and the sea is visible between the headlands.

  4. 4

    Run the night-to-sunrise cycle, the blind and the phone layout

    p changes slowly by itself. A label tells the story, a roller blind adds one reveal, and the page rearranges for phones.

    Prompt
    Drive p with (1 - cos(2*PI*t/52s)) / 2 so night turns to sunrise and back every 52 seconds. Under the glass add a small frosted label with a bold line and a smaller line that changes with p: under 0.28 "Night run across the Deccan / 01:20 - 12723 Telangana Express", up to 0.56 "Crossing the Godavari / 04:55 - 310 km to go", up to 0.82 "First light near Vijayawada / 05:50 - 120 km to go", above that "Sunrise by the Bay of Bengal / 06:35 - arriving soon". Add a striped roller blind covering the top 46% of the glass with a pull tab (a real button with aria-label and aria-expanded): it rises on its own 0.9 seconds after load, and the tab lowers or raises it again. At 860px and below put the window above the headline (height about 46svh), hide the text links and stack the form. If prefers-reduced-motion is set, draw one still frame at p = 0.55 and skip the blind animation. Check there is no sideways scrolling at 390px wide.

    Done when The scene cycles from night to sunrise, the label updates, the blind rises on load, and on a phone the window sits on top with nothing scrolling sideways.

Files and links

What people built

Show yours

Nobody has shared a build yet. Yours could be the first.

Show what you built

Built this plan? Sign in to share your demo video, live app and screenshots.

Your AI tool
Starter prompt

		

Download the plan