demo_gsap API
Luna-Flow/geometry3d/demo_gsap is a browser executable for the js target. It exports no MoonBit items; its interface is the HTML page it expects and the player it builds with the GSAP SVG backend.
Build and serve
just gsap-build # moon build src/demo_gsap --target js, then copy files
just gsap-serve # build, then serve target/gsap-demo on http://localhost:8081
gsap-build copies src/demo_gsap/index.html and the compiled demo_gsap.js (as demo.js) into target/gsap-demo/. The page loads GSAP 3.13.0 from jsDelivr, sets globalThis.gsap, and then imports demo.js.
Page contract
geometry3d-svg
The <svg id="geometry3d-svg"> element receives the rendered polygons, 640 × 480.
play-toggle, reverse, restart
These buttons pause or resume, reverse, and restart the timeline. The program sets the text of play-toggle to PLAY or PAUSE.
progress, time-readout
The range input progress (0 to 1) shows and seeks the timeline position; the element time-readout shows the time as t / 8.00s.
demo-select
The selector chooses the scene: the value dolly selects the dolly zoom, any other value the torus.
speed, loop
The speed selector sets the playback speed factor, and the loop checkbox switches between endless repetition and a single run.
The program aborts at start-up if one of these elements is missing.
Timeline
The timeline is 8 seconds long and repeats forever by default. Every update renders the selected scene for the current time .
Torus
The torus scene turns the torus of the Canvas demo by radians about (with and of that about and ), from 6.2 units away with a 35 mm lens.
Dolly zoom
The dolly scene uses the camera distance , so it completes two dolly cycles per 8-second loop. The focal length is mm, and the cube turns at , and rad/s.