Seat view
Seat picker with a view
A cinema seat map that turns into the view from the seats you picked: the room in perspective, lit slats down the walls, a dusk frame on the screen, the seat backs in front. Drag to look around; the edges give like rubber.
What it is for
Give a booking screen (a cinema, a theatre, a stadium block, a lecture hall) a map where the choice is shown to the visitor before they pay for it: seats are raised keys under one lamp, a picked seat latches with a lamp lit in it, and picking the party's last seat turns the picture window into the room as seen from those seats.
Everything you set here is what the Code and Prompt tabs give you.
Where it fits
- A cinema booking pagethe view from the seats before the visitor pays
- A stadium or lecture-hall pickerthe same map to view move for any block of seating
- A venue seat planhow many tickets, which seats and what they see
Datasheet
- Mechanism
- Pinhole camera, Near plane clipping, Painters order room, Camera from pick, Map to view dolly, Soft limit rubber band, Drag and key look, Roving seat grid, Token driven materials, Sleeping loop
- Stack
- Vanilla ES modules, CSS, Canvas 2D
- Needs
- Nothing, no dependencies
- States
- 10 documented
- Version
- 0.1.0
- Licence
- With a Pass
States
- MapRows A to H in two blocks of five either side of an aisle, a curved screen line above them. Free seats are raised keys; taken seats are sunk and dark and say so to a screen reader; yours are latched with the blue lamp lit and the seat number printed in them. The loop is asleep and costs nothing.
- PickingClick, or arrow to a seat and press Enter. The strip names the seats and the total. A new pick beyond the ticket count lets the oldest go. The last seat of the party turns the window into the view after about 300 ms; the See view key does it earlier.
- Map to viewThe camera dollies down and forward from above to the seat's own eye over about half a second while the map fades and shrinks 5% and the room fades in. Leaving is faster. No bounce.
- ViewThe room as seen from the picked seats: slat walls lit from behind, downlights, the screen showing a dusk frame in the lamp colours, the treads with amber aisle lights, the seat backs in front with heads over the taken ones. The row strip stays at the bottom.
- Looking aroundDrag (mouse, pen or finger) or use the arrow keys. The room follows the hand. Past the limit the view gives like rubber, no more than a third of the limit, and settles back on the limit when let go, with no overshoot. Home centres it; Escape goes back to the map.
- TicketsThe stepper at the top right sets 1 to 4 tickets. Fewer tickets than picked seats lets the oldest picks go.
- BookedBook shows a green lamp and the word Booked, and fires the seat-view-book event with the seats and the total. Nothing is sent anywhere. Changing a seat or the ticket count clears it.
- Off screen or hiddenThe loop stops; a returning tab cannot jump the settle because the first frame gap is clamped.
- PhoneWorks at 320 px wide: the seats keep a pitch of 24 px, the keys stay in one row, nothing scrolls sideways. A drag in the view looks around instead of scrolling the page.
- Reduced motionThe dolly is replaced by a 150 ms cross-fade between map and view. The view is still draggable. No loop runs at all: a change is drawn once, where it happens.
Notes
The camera comes from the picked row and column, so a front aisle seat and a seat in the middle at the back give different rooms. A row strip stays at the bottom with where you are sitting, the key back to the map and a Book key with the total.
Original. One 2D canvas, no WebGL and no image or font: the room is polygons clipped to a near plane and drawn far to near. It needs the Tactile UI Kit's stylesheet on the page (the keys and the stepper); the Code tab's example links it from ./kit/. The picture window is a dark display in aluminium and graphite alike (a cinema is dark); the panel, strip and keys follow the finish.
Anatomy
Pinhole camera, Near plane clipping, Painters order room, Camera from pick, Map to view dolly, Soft limit rubber band, Drag and key look, Roving seat grid, Token driven materials, Sleeping loop
Usage notes
Give a booking screen (a cinema, a theatre, a stadium block, a lecture hall) a map where the choice is shown to the visitor before they pay for it: seats are raised keys under one lamp, a picked seat latches with a lamp lit in it, and picking the party's last seat turns the picture window into the room as seen from those seats. The camera comes from the picked row and column, so a front aisle seat and a seat in the middle at the back give different rooms. A row strip stays at the bottom with where you are sitting, the key back to the map and a Book key with the total.
Options
| Option | Type | Description |
|---|---|---|
| tickets | number | How many seats the party picks. Picking more than this drops the oldest pick; the stepper on the panel changes it too. |
| crowd | number | The share of seats already taken, drawn as sunk dark keys on the map and as heads over the seat backs in the room. The same number is always the same crowd. |
| start | enum | The map, or the view from the best free seats together near the middle of the hall. |
| label | text | Read by a screen reader for the whole panel. Empty uses the default. |
Methods
- isTaken
- pick
- enter
- leave
- camera
- look
- state
- stats
- update
- destroy
How it works
Original. One 2D canvas, no WebGL and no image or font: the room is polygons clipped to a near plane and drawn far to near. It needs the Tactile UI Kit's stylesheet on the page (the keys and the stepper); the Code tab's example links it from ./kit/. The picture window is a dark display in aluminium and graphite alike (a cinema is dark); the panel, strip and keys follow the finish.