Cinema Seat Map

The actual curved SVG seat map, independently mounted with taken and best-view seats, roving keyboard focus, ticket state and price callbacks. Loads no auditorium, film or GPU context.

Exact preview of Cinema Seat Map
Type
Component
Category
Navigation
Source license
MIT
Collection
Open Source Experiences

View source in the repository

Usage

<!doctype html>
<html lang="en">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Frontfield component</title>
<style>html,body{margin:0;background:#121418;color:#eee;font:14px system-ui}canvas{display:block}button{padding:10px 16px}</style>
<!-- Serve the included public/experiences/cinema/ directory alongside this file. -->
<main style="max-width:420px;margin:32px auto;padding:20px"><div id="seats"></div><p id="total">Choose a seat</p></main>
<script type="importmap">{
  "imports": {
    "three": "/experiences/cinema/js/lib/three.webgpu.js",
    "three/webgpu": "/experiences/cinema/js/lib/three.webgpu.js",
    "three/tsl": "/experiences/cinema/js/lib/three.tsl.js",
    "three/addons/": "/experiences/cinema/js/lib/addons/"
  }
}</script>
<script type="module">
import {mountSeatMap} from '/experiences/cinema/parts/seat-map.js';
const map=mountSeatMap(document.querySelector('#seats'),{
 onChange({seats,total}) { document.querySelector('#total').textContent=seats.length+' seats · €'+total.toFixed(2); },
 onPreview(seat) { console.log('Preview',seat?.label); }
});
// map.setTickets([132,133]); map.getTickets(); map.destroy();
</script>
</html>

License and credits

Cinema Seat Preview by Codrops. Original upstream source

Read the original MIT license

Credits and asset notices

Third-party assets and dependencies

vendor/experiences/cinema/ASSET-NOTICES.md

Keep the original source and media notices with your copy.

Explore more

  • Liquid FormExact preview of Liquid Form

    A centered silver ray-marched liquid form with authored studio reflections and pointer-responsive camera drift.

  • Boarding PassExact preview of Boarding Pass

    A live flight pass whose changed gate and times roll over like a departures board.

  • Aurora TextExact preview of Aurora Text

    Multi-colour aurora motion within a large type specimen.

Frontfield homepage