lostpage 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +390 -2
- package/dist/catalog.d.ts +2 -0
- package/dist/catalog.js +1 -0
- package/dist/catalog.json +11438 -0
- package/dist/cdn/c/ascii-3d-LO5K5SPJ.js +3 -0
- package/dist/cdn/c/astronaut-LH5N45GT.js +2 -0
- package/dist/cdn/c/aurora-XF7DCQ7M.js +129 -0
- package/dist/cdn/c/autumn-V5GRVYCX.js +1 -0
- package/dist/cdn/c/balloon-404-KV6ISJWV.js +1 -0
- package/dist/cdn/c/beach-OGS53KAQ.js +95 -0
- package/dist/cdn/c/black-hole-635WWF67.js +124 -0
- package/dist/cdn/c/block-drop-QU7NYBNQ.js +1 -0
- package/dist/cdn/c/blue-screen-GKLGT7XD.js +70 -0
- package/dist/cdn/c/breakout-EGDE3QDC.js +1 -0
- package/dist/cdn/c/bricks-C6XPPQ64.js +1 -0
- package/dist/cdn/c/broken-link-U47D6LR2.js +11 -0
- package/dist/cdn/c/brutalist-QFXIHFAD.js +15 -0
- package/dist/cdn/c/bubble-wrap-45ZWIQMW.js +1 -0
- package/dist/cdn/c/campfire-TFG4DUUS.js +88 -0
- package/dist/cdn/c/card-GH5VVMRG.js +15 -0
- package/dist/cdn/c/cassette-33OUQ4CF.js +15 -0
- package/dist/cdn/c/chalkboard-NAPUHNER.js +3 -0
- package/dist/cdn/c/chrome-404-QVPFIQEF.js +1 -0
- package/dist/cdn/c/chunk-4ZBXB36L.js +1 -0
- package/dist/cdn/c/chunk-A44JMJWI.js +1 -0
- package/dist/cdn/c/chunk-HXSSPN2I.js +1 -0
- package/dist/cdn/c/chunk-IETNWEVK.js +1 -0
- package/dist/cdn/c/chunk-JLRXT2AZ.js +4 -0
- package/dist/cdn/c/chunk-LMRCHEWX.js +1 -0
- package/dist/cdn/c/chunk-NUQBEDA4.js +296 -0
- package/dist/cdn/c/chunk-QHXVYCR6.js +1 -0
- package/dist/cdn/c/chunk-QJZBGT2Q.js +75 -0
- package/dist/cdn/c/chunk-URWX3LLV.js +1 -0
- package/dist/cdn/c/chunk-YNREKTFR.js +70 -0
- package/dist/cdn/c/circuit-board-V6VT4OTX.js +1 -0
- package/dist/cdn/c/claw-machine-LLCPLZ6W.js +1 -0
- package/dist/cdn/c/clay-404-SMDVAQCV.js +1 -0
- package/dist/cdn/c/constellation-J5QMY7IB.js +1 -0
- package/dist/cdn/c/countdown-2TEFVO73.js +14 -0
- package/dist/cdn/c/cross-stitch-N5H5GLAG.js +2 -0
- package/dist/cdn/c/deep-sea-ILDVMW5M.js +85 -0
- package/dist/cdn/c/divider-PMT4UZEF.js +9 -0
- package/dist/cdn/c/dna-CAAKBMRK.js +2 -0
- package/dist/cdn/c/dominoes-VLA5MBXM.js +1 -0
- package/dist/cdn/c/dot-grid-O7LJO44U.js +11 -0
- package/dist/cdn/c/editorial-4C5Z33WO.js +11 -0
- package/dist/cdn/c/elevator-EFNB6FVO.js +36 -0
- package/dist/cdn/c/emoji-EHAJDQSM.js +8 -0
- package/dist/cdn/c/error-cascade-CIJCQLP3.js +18 -0
- package/dist/cdn/c/evidence-board-Z7DXMGNE.js +18 -0
- package/dist/cdn/c/eyes-VPOHW2CX.js +2 -0
- package/dist/cdn/c/fireworks-QLWJ3S43.js +1 -0
- package/dist/cdn/c/flashlight-QXI7QT74.js +57 -0
- package/dist/cdn/c/flatline-3GBK7IVS.js +1 -0
- package/dist/cdn/c/flock-RLSZ7EZQ.js +1 -0
- package/dist/cdn/c/foggy-glass-A56REA7E.js +1 -0
- package/dist/cdn/c/gears-4HJO7H74.js +5 -0
- package/dist/cdn/c/glass-404-WZRMDFTP.js +1 -0
- package/dist/cdn/c/glitch-Y4CIADF3.js +60 -0
- package/dist/cdn/c/gradient-404-YNSTOPNA.js +6 -0
- package/dist/cdn/c/halftone-XZ7F75B4.js +43 -0
- package/dist/cdn/c/hanging-letters-Y3VH7EVP.js +1 -0
- package/dist/cdn/c/hanging-sign-2KUXPLZE.js +1 -0
- package/dist/cdn/c/helpful-links-UFGTWTRQ.js +18 -0
- package/dist/cdn/c/hyperspace-R34QNI7J.js +57 -0
- package/dist/cdn/c/hypnosis-MK6AV3SC.js +26 -0
- package/dist/cdn/c/ink-S332BOPS.js +43 -0
- package/dist/cdn/c/invaders-ZSY3Z443.js +1 -0
- package/dist/cdn/c/kaleidoscope-BLGSIK4F.js +34 -0
- package/dist/cdn/c/lava-lamp-VYY5XFG5.js +55 -0
- package/dist/cdn/c/life-QBWZL5FY.js +1 -0
- package/dist/cdn/c/lighthouse-QX7QIIPX.js +60 -0
- package/dist/cdn/c/loading-LIS67QF7.js +34 -0
- package/dist/cdn/c/lost-at-sea-QNURIHBY.js +258 -0
- package/dist/cdn/c/magic-8-ball-W3TRJALZ.js +2 -0
- package/dist/cdn/c/matrix-rain-4V4SVGGG.js +3 -0
- package/dist/cdn/c/maze-QL5TRCE5.js +1 -0
- package/dist/cdn/c/mesh-gradient-UISGI62K.js +34 -0
- package/dist/cdn/c/metro-map-H64EHOZM.js +30 -0
- package/dist/cdn/c/milk-carton-3SDLA5AY.js +53 -0
- package/dist/cdn/c/minimal-SB6FU3DE.js +9 -0
- package/dist/cdn/c/mirage-IQ3IA3VB.js +70 -0
- package/dist/cdn/c/moon-landing-TKZE4Q6G.js +1 -0
- package/dist/cdn/c/neon-sign-XGMN75MH.js +1 -0
- package/dist/cdn/c/newspaper-YECAUY77.js +49 -0
- package/dist/cdn/c/nixie-CQBRCVDE.js +1 -0
- package/dist/cdn/c/no-signal-HL4A4CFZ.js +82 -0
- package/dist/cdn/c/one-bit-AFIZQPHK.js +49 -0
- package/dist/cdn/c/outline-404-REB5E5EN.js +9 -0
- package/dist/cdn/c/paint-splash-GZGPOURW.js +1 -0
- package/dist/cdn/c/paper-plane-KDCSE3RM.js +2 -0
- package/dist/cdn/c/particles-7UMRMT2M.js +1 -0
- package/dist/cdn/c/path-not-found-VUEXOVO7.js +14 -0
- package/dist/cdn/c/planet-H6QGPDVC.js +157 -0
- package/dist/cdn/c/pond-6DL43VUQ.js +106 -0
- package/dist/cdn/c/pong-B2ZGAY7T.js +1 -0
- package/dist/cdn/c/radar-22JCPGQZ.js +4 -0
- package/dist/cdn/c/rainy-window-DTGLJVAR.js +114 -0
- package/dist/cdn/c/receipt-ZOYUSMN3.js +32 -0
- package/dist/cdn/c/road-closed-3OS55UBX.js +1 -0
- package/dist/cdn/c/rpg-dialog-FV53YYNJ.js +14 -0
- package/dist/cdn/c/runner-NANXJTQG.js +1 -0
- package/dist/cdn/c/scratch-card-GC6U4ZZN.js +1 -0
- package/dist/cdn/c/screensaver-UXKJVQUU.js +1 -0
- package/dist/cdn/c/search-404-HFKZ4DUA.js +17 -0
- package/dist/cdn/c/server-default-RBMMRAHS.js +10 -0
- package/dist/cdn/c/server-room-QSKAUFUY.js +1 -0
- package/dist/cdn/c/skyline-OMZMF5R6.js +1 -0
- package/dist/cdn/c/skywriting-RYNQWJ6I.js +1 -0
- package/dist/cdn/c/slot-machine-XXCVI2HK.js +33 -0
- package/dist/cdn/c/snake-6Z5V3QA3.js +1 -0
- package/dist/cdn/c/snow-globe-RLDPNA2J.js +2 -0
- package/dist/cdn/c/soft-blobs-FYEFGINV.js +15 -0
- package/dist/cdn/c/solar-system-CQAP6WFU.js +2 -0
- package/dist/cdn/c/split-flap-O7JGD5Q4.js +37 -0
- package/dist/cdn/c/split-panel-QGXZ24E4.js +12 -0
- package/dist/cdn/c/stage-GBZR3JQS.js +2 -0
- package/dist/cdn/c/swiss-poster-OON4HBUG.js +20 -0
- package/dist/cdn/c/terminal-7BTUDZDB.js +41 -0
- package/dist/cdn/c/thunderstorm-FRCKHKXY.js +1 -0
- package/dist/cdn/c/topographic-3RIQXKIQ.js +38 -0
- package/dist/cdn/c/torn-page-6UT5ZQHG.js +16 -0
- package/dist/cdn/c/treasure-map-FALAEBL5.js +3 -0
- package/dist/cdn/c/typewriter-7TIO42MH.js +23 -0
- package/dist/cdn/c/ufo-6UW34TI3.js +1 -0
- package/dist/cdn/c/unplugged-QXKDDH4S.js +1 -0
- package/dist/cdn/c/vending-machine-SH3MNFMY.js +27 -0
- package/dist/cdn/c/vinyl-3FUP3LSO.js +2 -0
- package/dist/cdn/c/voxel-404-LMC43X4B.js +102 -0
- package/dist/cdn/c/wormhole-I2RWIMRW.js +113 -0
- package/dist/cdn/c/zen-garden-HMAMASJK.js +1 -0
- package/dist/cdn/element.js +1 -0
- package/dist/cdn/index.js +1 -0
- package/dist/chunks/chunk-3ISI6SOJ.js +1 -0
- package/dist/chunks/chunk-6HZC24J2.js +296 -0
- package/dist/chunks/chunk-7XMDQMDO.js +1 -0
- package/dist/chunks/chunk-B2NBRLO2.js +1 -0
- package/dist/chunks/chunk-B4TY5M55.js +1 -0
- package/dist/chunks/chunk-DAZOIOF7.js +1 -0
- package/dist/chunks/chunk-ES56TX4X.js +1 -0
- package/dist/chunks/chunk-FVGCB66F.js +1 -0
- package/dist/chunks/chunk-KIYSQVWX.js +1 -0
- package/dist/chunks/chunk-MNUNTC4L.js +4 -0
- package/dist/chunks/chunk-SH72TE6I.js +75 -0
- package/dist/chunks/chunk-URB3NNOB.js +70 -0
- package/dist/cli.js +97 -0
- package/dist/core/canvas2d.d.ts +18 -0
- package/dist/core/define.d.ts +16 -0
- package/dist/core/gl.d.ts +50 -0
- package/dist/core/glsl.d.ts +10 -0
- package/dist/core/overlay.d.ts +5 -0
- package/dist/core/runtime.d.ts +8 -0
- package/dist/core/shader.d.ts +22 -0
- package/dist/core/styles.d.ts +4 -0
- package/dist/core/text.d.ts +54 -0
- package/dist/core/types.d.ts +170 -0
- package/dist/core/util.d.ts +16 -0
- package/dist/core.d.ts +8 -0
- package/dist/core.js +1 -0
- package/dist/element.cdn.js +1 -0
- package/dist/element.d.ts +21 -0
- package/dist/element.js +1 -0
- package/dist/engines/arcade.d.ts +25 -0
- package/dist/engines/text3d.d.ts +37 -0
- package/dist/generated/all.d.ts +2 -0
- package/dist/generated/catalog.d.ts +2 -0
- package/dist/generated/registry.d.ts +5 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +1 -0
- package/dist/lostpage.global.js +3222 -0
- package/dist/react.d.ts +21 -0
- package/dist/react.js +2 -0
- package/dist/scenes/_simple.d.ts +10 -0
- package/dist/scenes/ascii-3d.d.ts +10 -0
- package/dist/scenes/ascii-3d.js +3 -0
- package/dist/scenes/astronaut.d.ts +10 -0
- package/dist/scenes/astronaut.js +2 -0
- package/dist/scenes/aurora.d.ts +14 -0
- package/dist/scenes/aurora.js +129 -0
- package/dist/scenes/autumn.d.ts +8 -0
- package/dist/scenes/autumn.js +1 -0
- package/dist/scenes/balloon-404.d.ts +9 -0
- package/dist/scenes/balloon-404.js +1 -0
- package/dist/scenes/beach.d.ts +14 -0
- package/dist/scenes/beach.js +95 -0
- package/dist/scenes/black-hole.d.ts +15 -0
- package/dist/scenes/black-hole.js +124 -0
- package/dist/scenes/block-drop.d.ts +9 -0
- package/dist/scenes/block-drop.js +1 -0
- package/dist/scenes/blue-screen.d.ts +5 -0
- package/dist/scenes/blue-screen.js +70 -0
- package/dist/scenes/breakout.d.ts +10 -0
- package/dist/scenes/breakout.js +1 -0
- package/dist/scenes/bricks.d.ts +7 -0
- package/dist/scenes/bricks.js +1 -0
- package/dist/scenes/broken-link.d.ts +8 -0
- package/dist/scenes/broken-link.js +11 -0
- package/dist/scenes/brutalist.d.ts +7 -0
- package/dist/scenes/brutalist.js +15 -0
- package/dist/scenes/bubble-wrap.d.ts +9 -0
- package/dist/scenes/bubble-wrap.js +1 -0
- package/dist/scenes/campfire.d.ts +11 -0
- package/dist/scenes/campfire.js +88 -0
- package/dist/scenes/card.d.ts +8 -0
- package/dist/scenes/card.js +15 -0
- package/dist/scenes/cassette.d.ts +9 -0
- package/dist/scenes/cassette.js +15 -0
- package/dist/scenes/chalkboard.d.ts +8 -0
- package/dist/scenes/chalkboard.js +3 -0
- package/dist/scenes/chrome-404.d.ts +13 -0
- package/dist/scenes/chrome-404.js +1 -0
- package/dist/scenes/circuit-board.d.ts +9 -0
- package/dist/scenes/circuit-board.js +1 -0
- package/dist/scenes/claw-machine.d.ts +8 -0
- package/dist/scenes/claw-machine.js +1 -0
- package/dist/scenes/clay-404.d.ts +11 -0
- package/dist/scenes/clay-404.js +1 -0
- package/dist/scenes/constellation.d.ts +10 -0
- package/dist/scenes/constellation.js +1 -0
- package/dist/scenes/countdown.d.ts +9 -0
- package/dist/scenes/countdown.js +14 -0
- package/dist/scenes/cross-stitch.d.ts +8 -0
- package/dist/scenes/cross-stitch.js +2 -0
- package/dist/scenes/deep-sea.d.ts +9 -0
- package/dist/scenes/deep-sea.js +85 -0
- package/dist/scenes/divider.d.ts +6 -0
- package/dist/scenes/divider.js +9 -0
- package/dist/scenes/dna.d.ts +9 -0
- package/dist/scenes/dna.js +2 -0
- package/dist/scenes/dominoes.d.ts +9 -0
- package/dist/scenes/dominoes.js +1 -0
- package/dist/scenes/dot-grid.d.ts +9 -0
- package/dist/scenes/dot-grid.js +11 -0
- package/dist/scenes/editorial.d.ts +6 -0
- package/dist/scenes/editorial.js +11 -0
- package/dist/scenes/elevator.d.ts +10 -0
- package/dist/scenes/elevator.js +36 -0
- package/dist/scenes/emoji.d.ts +7 -0
- package/dist/scenes/emoji.js +8 -0
- package/dist/scenes/error-cascade.d.ts +6 -0
- package/dist/scenes/error-cascade.js +18 -0
- package/dist/scenes/evidence-board.d.ts +7 -0
- package/dist/scenes/evidence-board.js +18 -0
- package/dist/scenes/eyes.d.ts +12 -0
- package/dist/scenes/eyes.js +2 -0
- package/dist/scenes/fireworks.d.ts +8 -0
- package/dist/scenes/fireworks.js +1 -0
- package/dist/scenes/flashlight.d.ts +12 -0
- package/dist/scenes/flashlight.js +57 -0
- package/dist/scenes/flatline.d.ts +9 -0
- package/dist/scenes/flatline.js +1 -0
- package/dist/scenes/flock.d.ts +13 -0
- package/dist/scenes/flock.js +1 -0
- package/dist/scenes/foggy-glass.d.ts +9 -0
- package/dist/scenes/foggy-glass.js +1 -0
- package/dist/scenes/gears.d.ts +10 -0
- package/dist/scenes/gears.js +5 -0
- package/dist/scenes/glass-404.d.ts +11 -0
- package/dist/scenes/glass-404.js +1 -0
- package/dist/scenes/glitch.d.ts +15 -0
- package/dist/scenes/glitch.js +60 -0
- package/dist/scenes/gradient-404.d.ts +9 -0
- package/dist/scenes/gradient-404.js +6 -0
- package/dist/scenes/halftone.d.ts +11 -0
- package/dist/scenes/halftone.js +43 -0
- package/dist/scenes/hanging-letters.d.ts +10 -0
- package/dist/scenes/hanging-letters.js +1 -0
- package/dist/scenes/hanging-sign.d.ts +9 -0
- package/dist/scenes/hanging-sign.js +1 -0
- package/dist/scenes/helpful-links.d.ts +6 -0
- package/dist/scenes/helpful-links.js +18 -0
- package/dist/scenes/hyperspace.d.ts +11 -0
- package/dist/scenes/hyperspace.js +57 -0
- package/dist/scenes/hypnosis.d.ts +10 -0
- package/dist/scenes/hypnosis.js +26 -0
- package/dist/scenes/ink.d.ts +10 -0
- package/dist/scenes/ink.js +43 -0
- package/dist/scenes/invaders.d.ts +10 -0
- package/dist/scenes/invaders.js +1 -0
- package/dist/scenes/kaleidoscope.d.ts +10 -0
- package/dist/scenes/kaleidoscope.js +34 -0
- package/dist/scenes/lava-lamp.d.ts +11 -0
- package/dist/scenes/lava-lamp.js +55 -0
- package/dist/scenes/life.d.ts +13 -0
- package/dist/scenes/life.js +1 -0
- package/dist/scenes/lighthouse.d.ts +11 -0
- package/dist/scenes/lighthouse.js +60 -0
- package/dist/scenes/loading.d.ts +6 -0
- package/dist/scenes/loading.js +34 -0
- package/dist/scenes/lost-at-sea.d.ts +35 -0
- package/dist/scenes/lost-at-sea.js +258 -0
- package/dist/scenes/magic-8-ball.d.ts +10 -0
- package/dist/scenes/magic-8-ball.js +2 -0
- package/dist/scenes/matrix-rain.d.ts +13 -0
- package/dist/scenes/matrix-rain.js +3 -0
- package/dist/scenes/maze.d.ts +9 -0
- package/dist/scenes/maze.js +1 -0
- package/dist/scenes/mesh-gradient.d.ts +13 -0
- package/dist/scenes/mesh-gradient.js +34 -0
- package/dist/scenes/metro-map.d.ts +8 -0
- package/dist/scenes/metro-map.js +30 -0
- package/dist/scenes/milk-carton.d.ts +9 -0
- package/dist/scenes/milk-carton.js +53 -0
- package/dist/scenes/minimal.d.ts +6 -0
- package/dist/scenes/minimal.js +9 -0
- package/dist/scenes/mirage.d.ts +10 -0
- package/dist/scenes/mirage.js +70 -0
- package/dist/scenes/moon-landing.d.ts +8 -0
- package/dist/scenes/moon-landing.js +1 -0
- package/dist/scenes/neon-sign.d.ts +15 -0
- package/dist/scenes/neon-sign.js +1 -0
- package/dist/scenes/newspaper.d.ts +10 -0
- package/dist/scenes/newspaper.js +49 -0
- package/dist/scenes/nixie.d.ts +11 -0
- package/dist/scenes/nixie.js +1 -0
- package/dist/scenes/no-signal.d.ts +11 -0
- package/dist/scenes/no-signal.js +82 -0
- package/dist/scenes/one-bit.d.ts +8 -0
- package/dist/scenes/one-bit.js +49 -0
- package/dist/scenes/outline-404.d.ts +8 -0
- package/dist/scenes/outline-404.js +9 -0
- package/dist/scenes/paint-splash.d.ts +6 -0
- package/dist/scenes/paint-splash.js +1 -0
- package/dist/scenes/paper-plane.d.ts +9 -0
- package/dist/scenes/paper-plane.js +2 -0
- package/dist/scenes/particles.d.ts +22 -0
- package/dist/scenes/particles.js +1 -0
- package/dist/scenes/path-not-found.d.ts +6 -0
- package/dist/scenes/path-not-found.js +14 -0
- package/dist/scenes/planet.d.ts +19 -0
- package/dist/scenes/planet.js +157 -0
- package/dist/scenes/pond.d.ts +11 -0
- package/dist/scenes/pond.js +106 -0
- package/dist/scenes/pong.d.ts +8 -0
- package/dist/scenes/pong.js +1 -0
- package/dist/scenes/radar.d.ts +9 -0
- package/dist/scenes/radar.js +4 -0
- package/dist/scenes/rainy-window.d.ts +11 -0
- package/dist/scenes/rainy-window.js +114 -0
- package/dist/scenes/receipt.d.ts +8 -0
- package/dist/scenes/receipt.js +32 -0
- package/dist/scenes/road-closed.d.ts +9 -0
- package/dist/scenes/road-closed.js +1 -0
- package/dist/scenes/rpg-dialog.d.ts +11 -0
- package/dist/scenes/rpg-dialog.js +14 -0
- package/dist/scenes/runner.d.ts +10 -0
- package/dist/scenes/runner.js +1 -0
- package/dist/scenes/scratch-card.d.ts +9 -0
- package/dist/scenes/scratch-card.js +1 -0
- package/dist/scenes/screensaver.d.ts +8 -0
- package/dist/scenes/screensaver.js +1 -0
- package/dist/scenes/search-404.d.ts +9 -0
- package/dist/scenes/search-404.js +17 -0
- package/dist/scenes/server-default.d.ts +6 -0
- package/dist/scenes/server-default.js +10 -0
- package/dist/scenes/server-room.d.ts +9 -0
- package/dist/scenes/server-room.js +1 -0
- package/dist/scenes/skyline.d.ts +10 -0
- package/dist/scenes/skyline.js +1 -0
- package/dist/scenes/skywriting.d.ts +8 -0
- package/dist/scenes/skywriting.js +1 -0
- package/dist/scenes/slot-machine.d.ts +10 -0
- package/dist/scenes/slot-machine.js +33 -0
- package/dist/scenes/snake.d.ts +13 -0
- package/dist/scenes/snake.js +1 -0
- package/dist/scenes/snow-globe.d.ts +10 -0
- package/dist/scenes/snow-globe.js +2 -0
- package/dist/scenes/soft-blobs.d.ts +9 -0
- package/dist/scenes/soft-blobs.js +15 -0
- package/dist/scenes/solar-system.d.ts +9 -0
- package/dist/scenes/solar-system.js +2 -0
- package/dist/scenes/split-flap.d.ts +15 -0
- package/dist/scenes/split-flap.js +37 -0
- package/dist/scenes/split-panel.d.ts +8 -0
- package/dist/scenes/split-panel.js +12 -0
- package/dist/scenes/stage.d.ts +10 -0
- package/dist/scenes/stage.js +2 -0
- package/dist/scenes/swiss-poster.d.ts +9 -0
- package/dist/scenes/swiss-poster.js +20 -0
- package/dist/scenes/terminal.d.ts +13 -0
- package/dist/scenes/terminal.js +41 -0
- package/dist/scenes/thunderstorm.d.ts +11 -0
- package/dist/scenes/thunderstorm.js +1 -0
- package/dist/scenes/topographic.d.ts +13 -0
- package/dist/scenes/topographic.js +38 -0
- package/dist/scenes/torn-page.d.ts +9 -0
- package/dist/scenes/torn-page.js +16 -0
- package/dist/scenes/treasure-map.d.ts +10 -0
- package/dist/scenes/treasure-map.js +3 -0
- package/dist/scenes/typewriter.d.ts +10 -0
- package/dist/scenes/typewriter.js +23 -0
- package/dist/scenes/ufo.d.ts +11 -0
- package/dist/scenes/ufo.js +1 -0
- package/dist/scenes/unplugged.d.ts +9 -0
- package/dist/scenes/unplugged.js +1 -0
- package/dist/scenes/vending-machine.d.ts +7 -0
- package/dist/scenes/vending-machine.js +27 -0
- package/dist/scenes/vinyl.d.ts +9 -0
- package/dist/scenes/vinyl.js +2 -0
- package/dist/scenes/voxel-404.d.ts +13 -0
- package/dist/scenes/voxel-404.js +102 -0
- package/dist/scenes/wormhole.d.ts +13 -0
- package/dist/scenes/wormhole.js +113 -0
- package/dist/scenes/zen-garden.d.ts +8 -0
- package/dist/scenes/zen-garden.js +1 -0
- package/dist/svelte.d.ts +17 -0
- package/dist/svelte.js +1 -0
- package/dist/vue.d.ts +66 -0
- package/dist/vue.js +1 -0
- package/package.json +114 -4
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SceneContext } from "./types";
|
|
2
|
+
export interface Canvas2D {
|
|
3
|
+
canvas: HTMLCanvasElement;
|
|
4
|
+
g: CanvasRenderingContext2D;
|
|
5
|
+
/** CSS-pixel size. */
|
|
6
|
+
w: number;
|
|
7
|
+
h: number;
|
|
8
|
+
/** Re-apply the DPR transform; call at the start of each frame if you reset transforms. */
|
|
9
|
+
reset(): void;
|
|
10
|
+
}
|
|
11
|
+
/** A 2D canvas whose drawing coordinates are CSS pixels regardless of DPR. */
|
|
12
|
+
export declare function canvas2d(ctx: SceneContext<any>, o?: {
|
|
13
|
+
z?: number;
|
|
14
|
+
scale?: number;
|
|
15
|
+
alpha?: boolean;
|
|
16
|
+
}): Canvas2D;
|
|
17
|
+
/** Pre-render a soft round sprite (for glows / particles). */
|
|
18
|
+
export declare function glowSprite(color: string, size?: number, hardness?: number): HTMLCanvasElement;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { LostAction, LostCopy, MountOptions, SceneDef, Theme } from "./types";
|
|
2
|
+
/** Identity helper that gives scene authors full type inference. */
|
|
3
|
+
export declare function defineScene<P>(def: SceneDef<P>): SceneDef<P>;
|
|
4
|
+
export declare const DEFAULT_COPY: Required<Omit<LostCopy, "actions">> & {
|
|
5
|
+
actions: LostAction[];
|
|
6
|
+
};
|
|
7
|
+
export interface Resolved<P> {
|
|
8
|
+
preset: string;
|
|
9
|
+
params: P;
|
|
10
|
+
copy: typeof DEFAULT_COPY;
|
|
11
|
+
theme: Theme;
|
|
12
|
+
}
|
|
13
|
+
/** Merge scene defaults ← preset ← user options. */
|
|
14
|
+
export declare function resolve<P>(def: SceneDef<P>, opts?: MountOptions<P>): Resolved<P>;
|
|
15
|
+
/** Preset ids including the implicit "default". */
|
|
16
|
+
export declare function presetIds(def: SceneDef): string[];
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** Tiny WebGL2 toolkit used by the shader scenes. No dependencies. */
|
|
2
|
+
export type GL = WebGL2RenderingContext;
|
|
3
|
+
export type UniformValue = number | boolean | number[] | Float32Array | WebGLTexture | Target | null;
|
|
4
|
+
export declare function getGL(canvas: HTMLCanvasElement, attrs?: WebGLContextAttributes): GL;
|
|
5
|
+
export declare const FULLSCREEN_VS = "#version 300 es\nin vec2 aPos;\nout vec2 vUv;\nvoid main(){ vUv = aPos * 0.5 + 0.5; gl_Position = vec4(aPos, 0.0, 1.0); }";
|
|
6
|
+
/** Prepended to every fragment shader passed to `pass()`. */
|
|
7
|
+
export declare const FS_PRELUDE = "#version 300 es\nprecision highp float;\nprecision highp int;\nin vec2 vUv;\nout vec4 fragColor;\nuniform vec2 uRes;\nuniform float uTime;\nuniform vec2 uMouse;\n";
|
|
8
|
+
export declare function program(gl: GL, vs: string, fs: string): WebGLProgram;
|
|
9
|
+
export interface Target {
|
|
10
|
+
fbo: WebGLFramebuffer;
|
|
11
|
+
tex: WebGLTexture;
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
resize(w: number, h: number): void;
|
|
15
|
+
}
|
|
16
|
+
export interface TargetOptions {
|
|
17
|
+
float?: boolean;
|
|
18
|
+
/** Use half floats (more widely renderable). Default true when float is set. */
|
|
19
|
+
half?: boolean;
|
|
20
|
+
filter?: "linear" | "nearest";
|
|
21
|
+
wrap?: "clamp" | "repeat";
|
|
22
|
+
channels?: 1 | 2 | 4;
|
|
23
|
+
}
|
|
24
|
+
export declare function target(gl: GL, w: number, h: number, o?: TargetOptions): Target;
|
|
25
|
+
/** Ping-pong pair for simulations. */
|
|
26
|
+
export declare function swapTargets(gl: GL, w: number, h: number, o?: TargetOptions): {
|
|
27
|
+
read: Target;
|
|
28
|
+
write: Target;
|
|
29
|
+
swap(): void;
|
|
30
|
+
resize(nw: number, nh: number): void;
|
|
31
|
+
};
|
|
32
|
+
export interface TextureOptions {
|
|
33
|
+
filter?: "linear" | "nearest" | "mipmap";
|
|
34
|
+
wrap?: "clamp" | "repeat";
|
|
35
|
+
flipY?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export declare function texture(gl: GL, source: TexImageSource | null, o?: TextureOptions): WebGLTexture;
|
|
38
|
+
export declare function updateTexture(gl: GL, tex: WebGLTexture, source: TexImageSource | null, o?: TextureOptions): void;
|
|
39
|
+
/** Float data texture (e.g. an SDF). */
|
|
40
|
+
export declare function dataTexture(gl: GL, data: Float32Array, w: number, h: number, channels?: 1 | 4, filter?: "linear" | "nearest"): WebGLTexture;
|
|
41
|
+
export interface Pass {
|
|
42
|
+
program: WebGLProgram;
|
|
43
|
+
/** Set uniforms (type inferred from the shader) and draw a fullscreen triangle into `to` (null = canvas). */
|
|
44
|
+
draw(uniforms?: Record<string, UniformValue>, to?: Target | null): void;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Fullscreen fragment pass. The source is appended to FS_PRELUDE unless it starts with `#version`.
|
|
48
|
+
* Uniform types are read from the linked program, so `{ uColor: [1,0,0] }` just works.
|
|
49
|
+
*/
|
|
50
|
+
export declare function pass(gl: GL, fs: string, vs?: string): Pass;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Reusable GLSL snippets. Concatenate the ones a shader needs. */
|
|
2
|
+
export declare const HASH = "\nfloat hash11(float p){ p = fract(p * .1031); p *= p + 33.33; p *= p + p; return fract(p); }\nfloat hash12(vec2 p){ vec3 p3 = fract(vec3(p.xyx) * .1031); p3 += dot(p3, p3.yzx + 33.33); return fract((p3.x + p3.y) * p3.z); }\nvec2 hash22(vec2 p){ vec3 p3 = fract(vec3(p.xyx) * vec3(.1031, .1030, .0973)); p3 += dot(p3, p3.yzx + 33.33); return fract((p3.xx + p3.yz) * p3.zy); }\nvec3 hash32(vec2 p){ vec3 p3 = fract(vec3(p.xyx) * vec3(.1031, .1030, .0973)); p3 += dot(p3, p3.yxz + 33.33); return fract((p3.xxy + p3.yzz) * p3.zyx); }\nfloat hash13(vec3 p3){ p3 = fract(p3 * .1031); p3 += dot(p3, p3.zyx + 31.32); return fract((p3.x + p3.y) * p3.z); }\n";
|
|
3
|
+
/** Value noise + fbm in 2D and 3D. Requires HASH. */
|
|
4
|
+
export declare const NOISE = "\nfloat vnoise(vec2 p){\n vec2 i = floor(p), f = fract(p);\n vec2 u = f * f * (3.0 - 2.0 * f);\n return mix(mix(hash12(i), hash12(i + vec2(1,0)), u.x), mix(hash12(i + vec2(0,1)), hash12(i + vec2(1,1)), u.x), u.y);\n}\nfloat vnoise3(vec3 p){\n vec3 i = floor(p), f = fract(p);\n vec3 u = f * f * (3.0 - 2.0 * f);\n return mix(mix(mix(hash13(i), hash13(i + vec3(1,0,0)), u.x), mix(hash13(i + vec3(0,1,0)), hash13(i + vec3(1,1,0)), u.x), u.y),\n mix(mix(hash13(i + vec3(0,0,1)), hash13(i + vec3(1,0,1)), u.x), mix(hash13(i + vec3(0,1,1)), hash13(i + vec3(1,1,1)), u.x), u.y), u.z);\n}\nfloat fbm(vec2 p){ float a = .5, s = 0.; mat2 r = mat2(.8, -.6, .6, .8); for(int i = 0; i < 6; i++){ s += a * vnoise(p); p = r * p * 2.03 + 11.7; a *= .5; } return s; }\nfloat fbm3(vec3 p){ float a = .5, s = 0.; for(int i = 0; i < 5; i++){ s += a * vnoise3(p); p = p * 2.02 + vec3(13.1, 7.7, 3.3); a *= .5; } return s; }\n";
|
|
5
|
+
/** 2D simplex noise (Ashima / Stefan Gustavson, MIT). */
|
|
6
|
+
export declare const SIMPLEX = "\nvec3 _sxp(vec3 x){ return mod(((x * 34.0) + 1.0) * x, 289.0); }\nfloat snoise(vec2 v){\n const vec4 C = vec4(0.211324865405187, 0.366025403784439, -0.577350269189626, 0.024390243902439);\n vec2 i = floor(v + dot(v, C.yy));\n vec2 x0 = v - i + dot(i, C.xx);\n vec2 i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n vec4 x12 = x0.xyxy + C.xxzz; x12.xy -= i1;\n i = mod(i, 289.0);\n vec3 p = _sxp(_sxp(i.y + vec3(0.0, i1.y, 1.0)) + i.x + vec3(0.0, i1.x, 1.0));\n vec3 m = max(0.5 - vec3(dot(x0, x0), dot(x12.xy, x12.xy), dot(x12.zw, x12.zw)), 0.0);\n m = m * m; m = m * m;\n vec3 x = 2.0 * fract(p * C.www) - 1.0;\n vec3 h = abs(x) - 0.5;\n vec3 ox = floor(x + 0.5);\n vec3 a0 = x - ox;\n m *= 1.79284291400159 - 0.85373472095314 * (a0 * a0 + h * h);\n vec3 g; g.x = a0.x * x0.x + h.x * x0.y; g.yz = a0.yz * x12.xz + h.yz * x12.yw;\n return 130.0 * dot(m, g);\n}\n";
|
|
7
|
+
/** Filmic tonemap + output helpers. */
|
|
8
|
+
export declare const POST = "\nvec3 aces(vec3 x){ return clamp((x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14), 0.0, 1.0); }\nvec3 toSRGB(vec3 c){ c = max(c, vec3(0.0)); return mix(c * 12.92, 1.055 * pow(max(c, vec3(1e-6)), vec3(1.0 / 2.4)) - 0.055, step(0.0031308, c)); }\nvec3 toLinear(vec3 c){ return pow(max(c, vec3(1e-6)), vec3(2.2)); }\nfloat grain(vec2 fc, float t){ return fract(sin(dot(fc + fract(t) * 91.7, vec2(12.9898, 78.233))) * 43758.5453) - 0.5; }\nfloat vignette(vec2 uv, float k){ uv = uv * (1.0 - uv.yx); return pow(max(uv.x * uv.y * 16.0, 1e-5), k); }\n";
|
|
9
|
+
/** 2D signed-distance helpers. */
|
|
10
|
+
export declare const SDF2 = "\nfloat sdBox(vec2 p, vec2 b){ vec2 d = abs(p) - b; return length(max(d, 0.0)) + min(max(d.x, d.y), 0.0); }\nfloat sdRoundBox(vec2 p, vec2 b, float r){ return sdBox(p, b - r) - r; }\nfloat sdSeg(vec2 p, vec2 a, vec2 b){ vec2 pa = p - a, ba = b - a; float h = clamp(dot(pa, ba) / dot(ba, ba), 0.0, 1.0); return length(pa - ba * h); }\nfloat sdCircle(vec2 p, float r){ return length(p) - r; }\nfloat sdTrap(vec2 p, float r1, float r2, float he){\n vec2 k1 = vec2(r2, he); vec2 k2 = vec2(r2 - r1, 2.0 * he);\n p.x = abs(p.x);\n vec2 ca = vec2(p.x - min(p.x, (p.y < 0.0) ? r1 : r2), abs(p.y) - he);\n vec2 cb = p - k1 + k2 * clamp(dot(k1 - p, k2) / dot(k2, k2), 0.0, 1.0);\n float s = (cb.x < 0.0 && ca.y < 0.0) ? -1.0 : 1.0;\n return s * sqrt(min(dot(ca, ca), dot(cb, cb)));\n}\nmat2 rot(float a){ float c = cos(a), s = sin(a); return mat2(c, -s, s, c); }\n";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { LostAction } from "./types";
|
|
2
|
+
import type { DEFAULT_COPY } from "./define";
|
|
3
|
+
export declare function buildAction(a: LostAction, onNavigate?: (href: string, e: MouseEvent) => void): HTMLAnchorElement | HTMLButtonElement;
|
|
4
|
+
/** Builds the accessible text layer: eyebrow, code, title, message, actions. */
|
|
5
|
+
export declare function buildOverlay(copy: typeof DEFAULT_COPY, layout: string, onNavigate?: (href: string, e: MouseEvent) => void): HTMLDivElement;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LostHandle, MountOptions, SceneDef } from "./types";
|
|
2
|
+
/** A scene object, or a function that loads one (used for lazy, code-split scenes). */
|
|
3
|
+
export type SceneSource<P> = SceneDef<P> | (() => Promise<SceneDef<P>>);
|
|
4
|
+
/**
|
|
5
|
+
* Mount a scene into `target`. Returns immediately; `handle.ready` resolves when drawing starts.
|
|
6
|
+
* `scene` can be a scene object (tree-shakeable) or a scene id (lazy-loaded from the registry).
|
|
7
|
+
*/
|
|
8
|
+
export declare function mount<P>(target: HTMLElement | string, scene: SceneSource<P> | string, options?: MountOptions<P>): LostHandle;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type GL, type Pass, type UniformValue } from "./gl";
|
|
2
|
+
import type { SceneContext, SceneInstance } from "./types";
|
|
3
|
+
export interface ShaderSceneOptions {
|
|
4
|
+
/** Fragment shader body (FS_PRELUDE is prepended): uRes, uTime, uMouse are provided. */
|
|
5
|
+
frag: string;
|
|
6
|
+
/** Extra uniforms per frame. */
|
|
7
|
+
uniforms?: (t: number, dt: number) => Record<string, UniformValue>;
|
|
8
|
+
/** Called once with the GL context, e.g. to create textures. */
|
|
9
|
+
init?: (gl: GL, p: Pass) => void;
|
|
10
|
+
/** Resolution multiplier on top of the device pixel ratio. */
|
|
11
|
+
scale?: number;
|
|
12
|
+
/** Let the runtime lower resolution when frames are slow. Default true. */
|
|
13
|
+
adaptive?: boolean;
|
|
14
|
+
z?: number;
|
|
15
|
+
/** Mouse follow speed; smaller = lazier parallax. */
|
|
16
|
+
mouseLag?: number;
|
|
17
|
+
}
|
|
18
|
+
/** One fullscreen fragment shader, kept in sync with the component size, time and pointer. */
|
|
19
|
+
export declare function shaderScene(ctx: SceneContext<any>, o: ShaderSceneOptions): SceneInstance & {
|
|
20
|
+
gl: GL;
|
|
21
|
+
pass: Pass;
|
|
22
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function injectBase(): void;
|
|
2
|
+
export declare function injectScene(id: string, css: string | undefined): void;
|
|
3
|
+
/** Raw base stylesheet, for SSR or shadow roots. */
|
|
4
|
+
export declare const baseCss = "\n.lp-root{\n --lp-bg:#0b0d12;--lp-fg:#f5f6f8;--lp-muted:color-mix(in srgb,var(--lp-fg) 64%,transparent);\n --lp-accent:var(--lp-fg);--lp-accent-fg:var(--lp-bg);\n --lp-font:\"Inter\",\"Manrope\",ui-sans-serif,system-ui,-apple-system,\"Segoe UI\",Roboto,\"Helvetica Neue\",Arial,sans-serif;\n --lp-font-display:var(--lp-font);\n --lp-font-mono:\"JetBrains Mono\",\"IBM Plex Mono\",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;\n --lp-font-serif:\"Fraunces\",\"Playfair Display\",ui-serif,Georgia,\"Times New Roman\",serif;\n --lp-code-color:color-mix(in srgb,var(--lp-fg) 22%,transparent);\n --lp-code-size:clamp(64px,23cqw,300px);--lp-code-weight:500;\n --lp-title-size:clamp(22px,4.6cqw,58px);--lp-title-weight:500;\n --lp-radius:999px;--lp-pad:clamp(14px,5cqw,72px);\n position:relative;box-sizing:border-box;overflow:hidden;width:100%;\n height:var(--lp-height,100vh);height:var(--lp-height,100dvh);\n background:var(--lp-bg);color:var(--lp-fg);font-family:var(--lp-font);\n isolation:isolate;container-type:size;container-name:lp;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;\n text-rendering:optimizeLegibility;touch-action:manipulation;\n}\n.lp-root *,.lp-root *::before,.lp-root *::after{box-sizing:border-box}\n.lp-root [hidden]{display:none!important}\n.lp-stage{position:absolute;inset:0;z-index:0;overflow:hidden}\n.lp-stage>canvas{position:absolute;inset:0;width:100%;height:100%;display:block}\n.lp-custom{position:absolute;inset:0;z-index:3}\n.lp-overlay{position:absolute;inset:0;z-index:2;display:flex;flex-direction:column;align-items:center;\n justify-content:center;gap:clamp(12px,3cqh,32px);padding:var(--lp-pad) max(16px,var(--lp-pad));pointer-events:none}\n.lp-overlay a,.lp-overlay button,.lp-overlay [data-lp-interactive]{pointer-events:auto}\n.lp-head,.lp-body{display:flex;flex-direction:column;align-items:center;text-align:center;max-width:100%}\n.lp-eyebrow{margin:0 0 6px;font-size:11px;font-weight:600;letter-spacing:.32em;text-transform:uppercase;color:var(--lp-muted)}\n.lp-code{margin:0;font-family:var(--lp-font-display);font-weight:var(--lp-code-weight);font-size:var(--lp-code-size);\n line-height:.86;letter-spacing:-.045em;color:var(--lp-code-color);user-select:none;white-space:nowrap}\n.lp-title{margin:0;font-family:var(--lp-font-display);font-size:var(--lp-title-size);font-weight:var(--lp-title-weight);\n letter-spacing:-.035em;line-height:1.04;text-wrap:balance}\n.lp-message{margin:14px 0 0;max-width:36ch;color:var(--lp-muted);font-size:clamp(12.5px,1.25cqw,16px);line-height:1.6;text-wrap:pretty}\n.lp-actions{margin-top:clamp(20px,3.2cqh,32px);display:flex;gap:10px 22px;flex-wrap:wrap;align-items:center;justify-content:center}\n.lp-btn{display:inline-flex;align-items:center;gap:10px;font:inherit;font-size:13px;font-weight:500;letter-spacing:.01em;\n text-decoration:none;cursor:pointer;border:0;transition:transform .25s cubic-bezier(.2,.8,.2,1),background .25s,color .25s,box-shadow .25s}\n.lp-btn--primary{padding:13px 22px;border-radius:var(--lp-radius);background:var(--lp-accent);color:var(--lp-accent-fg)}\n.lp-btn--primary:hover{transform:translateY(-1px);box-shadow:0 10px 30px -10px color-mix(in srgb,var(--lp-accent) 60%,transparent)}\n.lp-btn--secondary{padding:13px 4px;background:none;color:var(--lp-fg);border-bottom:1px solid color-mix(in srgb,var(--lp-fg) 30%,transparent);border-radius:0}\n.lp-btn--secondary:hover{border-bottom-color:var(--lp-fg)}\n.lp-btn svg{width:14px;height:14px;flex:none;transition:transform .25s cubic-bezier(.2,.8,.2,1)}\n.lp-btn:hover svg[data-dir=back]{transform:translateX(-3px)}\n.lp-btn:hover svg[data-dir=arrow]{transform:translate(2px,-2px)}\n.lp-btn:focus-visible{outline:2px solid var(--lp-accent);outline-offset:3px}\n.lp-sr{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}\n\n.lp-layout-split{justify-content:space-between}\n.lp-layout-split .lp-head{padding-top:clamp(8px,4cqh,48px)}\n.lp-layout-split .lp-body{padding-bottom:clamp(8px,3cqh,40px)}\n.lp-layout-bottom{justify-content:flex-end}\n.lp-layout-top{justify-content:flex-start}\n.lp-layout-bottom-left{justify-content:flex-end;align-items:flex-start}\n.lp-layout-bottom-left .lp-head,.lp-layout-bottom-left .lp-body,\n.lp-layout-left .lp-head,.lp-layout-left .lp-body{align-items:flex-start;text-align:left}\n.lp-layout-bottom-left .lp-actions,.lp-layout-left .lp-actions{justify-content:flex-start}\n.lp-layout-left{align-items:flex-start;padding-left:max(16px,calc(var(--lp-pad) * 1.4))}\n.lp-layout-right{align-items:flex-end}\n.lp-layout-right .lp-head,.lp-layout-right .lp-body{align-items:flex-end;text-align:right}\n.lp-layout-right .lp-actions{justify-content:flex-end}\n.lp-layout-none .lp-head,.lp-layout-none .lp-body{display:none}\n.lp-code-hidden .lp-code{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}\n\n.lp-fadein .lp-head,.lp-fadein .lp-body{animation:lp-rise 1.1s cubic-bezier(.2,.8,.2,1) both}\n.lp-fadein .lp-body{animation-delay:.18s}\n@keyframes lp-rise{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}\n@container (max-width:640px){.lp-layout-left,.lp-layout-right{align-items:center}\n .lp-layout-left .lp-head,.lp-layout-left .lp-body,.lp-layout-right .lp-head,.lp-layout-right .lp-body{align-items:center;text-align:center}\n .lp-layout-left .lp-actions,.lp-layout-right .lp-actions{justify-content:center}}\n@media (prefers-reduced-motion:reduce){.lp-fadein .lp-head,.lp-fadein .lp-body{animation:none}.lp-btn,.lp-btn svg{transition:none}}\n";
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/** Text → pixels / points / signed distance fields, for scenes that build "404" out of things. */
|
|
2
|
+
export declare const SANS = "\"Inter\",\"SF Pro Display\",ui-sans-serif,system-ui,-apple-system,\"Segoe UI\",Roboto,\"Helvetica Neue\",Arial,sans-serif";
|
|
3
|
+
export declare const MONO = "\"JetBrains Mono\",\"SF Mono\",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace";
|
|
4
|
+
export declare const SERIF = "\"Fraunces\",\"Playfair Display\",ui-serif,Georgia,\"Times New Roman\",serif";
|
|
5
|
+
export interface TextBoxOptions {
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
font?: string;
|
|
9
|
+
weight?: number | string;
|
|
10
|
+
style?: string;
|
|
11
|
+
/** Fraction of the box the text may fill (0..1). */
|
|
12
|
+
fit?: number;
|
|
13
|
+
/** Extra tracking in em. */
|
|
14
|
+
tracking?: number;
|
|
15
|
+
/** Vertical anchor of the text block centre, 0..1 of height. */
|
|
16
|
+
cy?: number;
|
|
17
|
+
/** Horizontal anchor of the text block centre, 0..1 of width. */
|
|
18
|
+
cx?: number;
|
|
19
|
+
}
|
|
20
|
+
/** Draw `text` as large as possible inside the box, white on transparent. */
|
|
21
|
+
export declare function textCanvas(text: string, o: TextBoxOptions): HTMLCanvasElement;
|
|
22
|
+
export declare function drawFittedText(g: CanvasRenderingContext2D, text: string, o: TextBoxOptions & {
|
|
23
|
+
color?: string;
|
|
24
|
+
}): {
|
|
25
|
+
size: number;
|
|
26
|
+
width: number;
|
|
27
|
+
height: number;
|
|
28
|
+
x: number;
|
|
29
|
+
y: number;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Points sampled on a grid inside the glyphs, in the box's pixel coordinates.
|
|
33
|
+
* Returns a flat [x0, y0, x1, y1, ...] array.
|
|
34
|
+
*/
|
|
35
|
+
export declare function textPoints(text: string, o: TextBoxOptions & {
|
|
36
|
+
step: number;
|
|
37
|
+
jitter?: number;
|
|
38
|
+
random?: () => number;
|
|
39
|
+
}): Float32Array<ArrayBuffer>;
|
|
40
|
+
/** Signed distance field of an alpha mask, in pixels (negative inside). Rows are top-to-bottom. */
|
|
41
|
+
export declare function sdfFromAlpha(alpha: Uint8ClampedArray | Uint8Array, w: number, h: number, stride?: number, offset?: number): Float32Array<ArrayBuffer>;
|
|
42
|
+
/** Separable gaussian blur of a float field, in place. Smooths the pixel staircase out of rasterised outlines. */
|
|
43
|
+
export declare function blurField(f: Float32Array, w: number, h: number, sigma?: number): Float32Array<ArrayBufferLike>;
|
|
44
|
+
/**
|
|
45
|
+
* SDF of `text` fitted into a w×h box. Values are in pixels, negative inside the glyphs.
|
|
46
|
+
* Rows are flipped bottom-to-top so the result can be uploaded straight to a GL texture.
|
|
47
|
+
*/
|
|
48
|
+
export declare function textSDF(text: string, o: TextBoxOptions & {
|
|
49
|
+
smooth?: number;
|
|
50
|
+
}): {
|
|
51
|
+
data: Float32Array<ArrayBuffer>;
|
|
52
|
+
width: number;
|
|
53
|
+
height: number;
|
|
54
|
+
};
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/** How a scene is drawn. */
|
|
2
|
+
export type Kind = "2d" | "3d";
|
|
3
|
+
/** How a scene behaves over time. */
|
|
4
|
+
export type Motion = "live" | "static" | "interactive" | "game";
|
|
5
|
+
export type LayoutName = "center" | "split" | "bottom" | "bottom-left" | "left" | "right" | "top" | "none";
|
|
6
|
+
export interface LostAction {
|
|
7
|
+
label: string;
|
|
8
|
+
href?: string;
|
|
9
|
+
onClick?: (e: MouseEvent) => void;
|
|
10
|
+
variant?: "primary" | "secondary";
|
|
11
|
+
/** Small leading/trailing glyph. */
|
|
12
|
+
icon?: "back" | "home" | "arrow" | "none";
|
|
13
|
+
}
|
|
14
|
+
/** The words on the page. Every field is optional and falls back to the scene / preset copy. */
|
|
15
|
+
export interface LostCopy {
|
|
16
|
+
/** The big status code, usually "404". */
|
|
17
|
+
code?: string;
|
|
18
|
+
eyebrow?: string;
|
|
19
|
+
title?: string;
|
|
20
|
+
message?: string;
|
|
21
|
+
actions?: LostAction[];
|
|
22
|
+
}
|
|
23
|
+
export type Theme = Record<string, string>;
|
|
24
|
+
export interface MountOptions<P = Record<string, unknown>> extends LostCopy {
|
|
25
|
+
/** Preset id from the scene's preset list. */
|
|
26
|
+
preset?: string;
|
|
27
|
+
/** Scene-specific parameters (colors, speeds, counts...). */
|
|
28
|
+
params?: Partial<P>;
|
|
29
|
+
/** CSS variable overrides without the `--lp-` prefix, e.g. `{ accent: "#ff4d00" }`. */
|
|
30
|
+
theme?: Theme;
|
|
31
|
+
/** Render the built-in text/buttons layer. Set false to bring your own content. */
|
|
32
|
+
overlay?: boolean;
|
|
33
|
+
/** "auto" follows prefers-reduced-motion; "reduce" draws a still frame; "full" always animates. */
|
|
34
|
+
motion?: "auto" | "reduce" | "full";
|
|
35
|
+
/** Pointer / keyboard interaction. */
|
|
36
|
+
interactive?: boolean;
|
|
37
|
+
/** CSS height of the component. Default `100dvh`. Use `100%` to fill a sized parent. */
|
|
38
|
+
height?: string;
|
|
39
|
+
/** Upper bound for devicePixelRatio. Default 2. */
|
|
40
|
+
maxDpr?: number;
|
|
41
|
+
/** Called instead of a full page load when an action with an href is clicked. */
|
|
42
|
+
onNavigate?: (href: string, e: MouseEvent) => void;
|
|
43
|
+
/** Seed for anything random in the scene. */
|
|
44
|
+
seed?: number;
|
|
45
|
+
/** Extra class on the root element. */
|
|
46
|
+
className?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface Pointer {
|
|
49
|
+
/** CSS pixels relative to the component. */
|
|
50
|
+
x: number;
|
|
51
|
+
y: number;
|
|
52
|
+
/** Normalised -1..1, y up. */
|
|
53
|
+
nx: number;
|
|
54
|
+
ny: number;
|
|
55
|
+
/** Smoothed versions of nx/ny for gentle parallax. */
|
|
56
|
+
sx: number;
|
|
57
|
+
sy: number;
|
|
58
|
+
down: boolean;
|
|
59
|
+
inside: boolean;
|
|
60
|
+
/** True once the pointer has moved over the component at least once. */
|
|
61
|
+
engaged: boolean;
|
|
62
|
+
}
|
|
63
|
+
export interface CanvasOptions {
|
|
64
|
+
/** Stacking order inside the stage. */
|
|
65
|
+
z?: number;
|
|
66
|
+
/** Multiplier on the device pixel ratio (e.g. 0.5 for a cheap blurred layer). */
|
|
67
|
+
scale?: number;
|
|
68
|
+
/** Let the runtime lower resolution when frames get slow. */
|
|
69
|
+
adaptive?: boolean;
|
|
70
|
+
}
|
|
71
|
+
export interface SceneContext<P = Record<string, unknown>> {
|
|
72
|
+
root: HTMLElement;
|
|
73
|
+
stage: HTMLElement;
|
|
74
|
+
overlay: HTMLElement | null;
|
|
75
|
+
params: P;
|
|
76
|
+
copy: Required<Omit<LostCopy, "actions">> & {
|
|
77
|
+
actions: LostAction[];
|
|
78
|
+
};
|
|
79
|
+
preset: string;
|
|
80
|
+
width: number;
|
|
81
|
+
height: number;
|
|
82
|
+
dpr: number;
|
|
83
|
+
pointer: Pointer;
|
|
84
|
+
reducedMotion: boolean;
|
|
85
|
+
interactive: boolean;
|
|
86
|
+
/** Deterministic random in [0,1). */
|
|
87
|
+
random: () => number;
|
|
88
|
+
/** Creates a canvas that the runtime keeps sized to the component. */
|
|
89
|
+
canvas(opts?: CanvasOptions): HTMLCanvasElement;
|
|
90
|
+
/** Listen on the component root; removed automatically on destroy. */
|
|
91
|
+
on<K extends keyof HTMLElementEventMap>(type: K, fn: (e: HTMLElementEventMap[K]) => void, opts?: AddEventListenerOptions): void;
|
|
92
|
+
/** Listen on window; removed automatically on destroy. */
|
|
93
|
+
onWindow<K extends keyof WindowEventMap>(type: K, fn: (e: WindowEventMap[K]) => void, opts?: AddEventListenerOptions): void;
|
|
94
|
+
/** Ask for one more frame (useful for static scenes that react to input). */
|
|
95
|
+
invalidate(): void;
|
|
96
|
+
/** Whether the component is on screen and the tab is visible. */
|
|
97
|
+
visible(): boolean;
|
|
98
|
+
/** Follow a link the way the host app wants (its onNavigate handler, or a normal page load). */
|
|
99
|
+
navigate(href: string, e?: MouseEvent): void;
|
|
100
|
+
/** Read a CSS variable from the root (e.g. "accent" → --lp-accent). */
|
|
101
|
+
cssVar(name: string): string;
|
|
102
|
+
}
|
|
103
|
+
export interface SceneInstance {
|
|
104
|
+
/** Called every animation frame with elapsed seconds and the frame delta. */
|
|
105
|
+
frame?(t: number, dt: number): void;
|
|
106
|
+
resize?(width: number, height: number, dpr: number): void;
|
|
107
|
+
destroy?(): void;
|
|
108
|
+
}
|
|
109
|
+
export interface PresetDef<P> extends LostCopy {
|
|
110
|
+
name: string;
|
|
111
|
+
description?: string;
|
|
112
|
+
params?: Partial<P>;
|
|
113
|
+
theme?: Theme;
|
|
114
|
+
}
|
|
115
|
+
export interface SceneDef<P = any> {
|
|
116
|
+
id: string;
|
|
117
|
+
name: string;
|
|
118
|
+
description: string;
|
|
119
|
+
category: Category;
|
|
120
|
+
kind: Kind;
|
|
121
|
+
motion: Motion;
|
|
122
|
+
tags: string[];
|
|
123
|
+
/** Layout of the built-in text layer. */
|
|
124
|
+
layout: LayoutName;
|
|
125
|
+
/** Copy used when neither preset nor user overrides it. */
|
|
126
|
+
copy: LostCopy;
|
|
127
|
+
params: P;
|
|
128
|
+
theme?: Theme;
|
|
129
|
+
/** Name of the implicit default preset. */
|
|
130
|
+
presetName?: string;
|
|
131
|
+
presets?: Record<string, PresetDef<P>>;
|
|
132
|
+
/** Scene CSS. `&` is replaced by the scene's root selector. */
|
|
133
|
+
css?: string;
|
|
134
|
+
/** Time (seconds) used to draw the still frame under reduced motion. */
|
|
135
|
+
stillTime?: number;
|
|
136
|
+
/** Scene draws the status code itself; the overlay keeps it for screen readers only. */
|
|
137
|
+
codeInScene?: boolean;
|
|
138
|
+
setup(ctx: SceneContext<P>): SceneInstance | void;
|
|
139
|
+
}
|
|
140
|
+
export interface LostHandle {
|
|
141
|
+
readonly root: HTMLElement | null;
|
|
142
|
+
/** Resolves once the scene is loaded and drawing. */
|
|
143
|
+
readonly ready: Promise<void>;
|
|
144
|
+
update(opts: MountOptions): void;
|
|
145
|
+
pause(): void;
|
|
146
|
+
resume(): void;
|
|
147
|
+
destroy(): void;
|
|
148
|
+
}
|
|
149
|
+
export type Category = "Simple" | "Nature" | "Space" | "Ocean" | "Retro Tech" | "Typography" | "Abstract" | "Games" | "Paper & Print" | "Signs & Displays" | "Playful" | "Physics" | "Spooky" | "Urban";
|
|
150
|
+
export interface CatalogPreset {
|
|
151
|
+
id: string;
|
|
152
|
+
name: string;
|
|
153
|
+
title: string;
|
|
154
|
+
background: string;
|
|
155
|
+
}
|
|
156
|
+
export interface CatalogEntry {
|
|
157
|
+
id: string;
|
|
158
|
+
name: string;
|
|
159
|
+
description: string;
|
|
160
|
+
category: Category;
|
|
161
|
+
kind: Kind;
|
|
162
|
+
motion: Motion;
|
|
163
|
+
tags: string[];
|
|
164
|
+
layout: LayoutName;
|
|
165
|
+
/** Default scene parameters. */
|
|
166
|
+
params: Record<string, unknown>;
|
|
167
|
+
/** Parameter overrides per preset id. */
|
|
168
|
+
presetParams: Record<string, Record<string, unknown>>;
|
|
169
|
+
presets: CatalogPreset[];
|
|
170
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const clamp: (x: number, a?: number, b?: number) => number;
|
|
2
|
+
export declare const lerp: (a: number, b: number, t: number) => number;
|
|
3
|
+
export declare const smoothstep: (a: number, b: number, x: number) => number;
|
|
4
|
+
export declare const fract: (x: number) => number;
|
|
5
|
+
export declare const TAU: number;
|
|
6
|
+
/** Frame-rate independent exponential approach. */
|
|
7
|
+
export declare const damp: (a: number, b: number, lambda: number, dt: number) => number;
|
|
8
|
+
/** Small fast seeded PRNG (mulberry32). */
|
|
9
|
+
export declare function rng(seed?: number): () => number;
|
|
10
|
+
/** "#rrggbb" / "#rgb" / "rgb(a)" → [r,g,b] in 0..1 (linear-ish sRGB values, not converted). */
|
|
11
|
+
export declare function rgb(input: string): [number, number, number];
|
|
12
|
+
/** Same as rgb() but returns sRGB → linear for shader lighting. */
|
|
13
|
+
export declare function linear(input: string): [number, number, number];
|
|
14
|
+
export declare function mixColor(a: string, b: string, t: number): string;
|
|
15
|
+
export declare function rgba(color: string, alpha: number): string;
|
|
16
|
+
export declare const isBrowser: () => boolean;
|
package/dist/core.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { mount } from "./core/runtime";
|
|
2
|
+
export { defineScene, resolve, presetIds, DEFAULT_COPY } from "./core/define";
|
|
3
|
+
export { shaderScene } from "./core/shader";
|
|
4
|
+
export * as gl from "./core/gl";
|
|
5
|
+
export * as glsl from "./core/glsl";
|
|
6
|
+
export * as text from "./core/text";
|
|
7
|
+
export * as util from "./core/util";
|
|
8
|
+
export type * from "./core/types";
|
package/dist/core.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mount}from"./chunks/chunk-URB3NNOB.js";import"./chunks/chunk-B2NBRLO2.js";import{shaderScene}from"./chunks/chunk-B4TY5M55.js";import{gl_exports,glsl_exports}from"./chunks/chunk-SH72TE6I.js";import{util_exports}from"./chunks/chunk-FVGCB66F.js";import{text_exports}from"./chunks/chunk-3ISI6SOJ.js";import{DEFAULT_COPY,defineScene,presetIds,resolve}from"./chunks/chunk-KIYSQVWX.js";import"./chunks/chunk-7XMDQMDO.js";export{DEFAULT_COPY,defineScene,gl_exports as gl,glsl_exports as glsl,mount,presetIds,resolve,shaderScene,text_exports as text,util_exports as util};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./cdn/element.js";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<lost-page scene="lost-at-sea" preset="storm" heading="Rough waters."></lost-page>`
|
|
3
|
+
*
|
|
4
|
+
* Works in plain HTML, Angular, Astro, Solid, Lit, Qwik… Child nodes become custom content above the scene.
|
|
5
|
+
*/
|
|
6
|
+
export declare class LostPageElement extends HTMLElement {
|
|
7
|
+
static observedAttributes: ("interactive" | "preset" | "params" | "theme" | "overlay" | "motion" | "height" | "seed" | "code" | "eyebrow" | "message" | "heading" | "scene" | "primary-label" | "primary-href" | "secondary-label" | "secondary-href")[];
|
|
8
|
+
private handle;
|
|
9
|
+
private sceneId;
|
|
10
|
+
private custom;
|
|
11
|
+
connectedCallback(): void;
|
|
12
|
+
disconnectedCallback(): void;
|
|
13
|
+
attributeChangedCallback(name: string, oldV: string | null, newV: string | null): void;
|
|
14
|
+
private options;
|
|
15
|
+
private start;
|
|
16
|
+
}
|
|
17
|
+
declare global {
|
|
18
|
+
interface HTMLElementTagNameMap {
|
|
19
|
+
"lost-page": LostPageElement;
|
|
20
|
+
}
|
|
21
|
+
}
|
package/dist/element.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __defProp=Object.defineProperty;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value;var __publicField=(obj,key,value)=>__defNormalProp(obj,typeof key!="symbol"?key+"":key,value);import{mount}from"lostpage";var ATTRS=["scene","preset","code","eyebrow","heading","message","height","motion","theme","params","primary-label","primary-href","secondary-label","secondary-href","overlay","interactive","seed"],LostPageElement=class extends HTMLElement{constructor(){super(...arguments);__publicField(this,"handle",null);__publicField(this,"sceneId",null);__publicField(this,"custom",null)}connectedCallback(){var _a;this.style.display||(this.style.display="block"),(_a=this.style).position||(_a.position="relative"),!this.custom&&this.childNodes.length&&[...this.childNodes].some(n=>n.nodeType===1||n.textContent?.trim())&&(this.custom=document.createElement("div"),this.custom.className="lp-custom",this.custom.append(...this.childNodes),this.append(this.custom)),this.start()}disconnectedCallback(){this.handle?.destroy(),this.handle=null,this.sceneId=null}attributeChangedCallback(name,oldV,newV){!this.isConnected||oldV===newV||(name==="scene"?this.start():this.handle?.update(this.options()))}options(){let a=n=>this.getAttribute(n)??void 0,json=n=>{let v=a(n);if(v)try{return JSON.parse(v)}catch{console.warn(`[lostpage] <lost-page ${n}> must be JSON`);return}},o={};a("preset")&&(o.preset=a("preset")),a("code")&&(o.code=a("code")),a("eyebrow")!==void 0&&(o.eyebrow=a("eyebrow")),a("heading")&&(o.title=a("heading")),a("message")&&(o.message=a("message")),a("height")&&(o.height=a("height")),a("motion")&&(o.motion=a("motion")),a("seed")&&(o.seed=Number(a("seed"))),this.hasAttribute("interactive")&&(o.interactive=a("interactive")!=="false"),this.hasAttribute("overlay")&&(o.overlay=a("overlay")!=="false"),this.custom&&(o.overlay=!1);let theme=json("theme"),params=json("params");theme&&(o.theme=theme),params&&(o.params=params);let actions=[];return a("primary-label")&&actions.push({label:a("primary-label"),href:a("primary-href")??"/",variant:"primary"}),a("secondary-label")&&actions.push({label:a("secondary-label"),href:a("secondary-href")??"/",variant:"secondary"}),actions.length&&(o.actions=actions),o.onNavigate=(href,e)=>{let ev=new CustomEvent("lostpage:navigate",{detail:{href},cancelable:!0,bubbles:!0});this.dispatchEvent(ev)&&(e.target?.closest?location.assign(href):location.href=href)},o}start(){let id=this.getAttribute("scene");!id||id===this.sceneId||(this.handle?.destroy(),this.sceneId=id,this.handle=mount(this,id,this.options()))}};__publicField(LostPageElement,"observedAttributes",[...ATTRS]);typeof window<"u"&&!customElements.get("lost-page")&&customElements.define("lost-page",LostPageElement);export{LostPageElement};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { SceneContext } from "../core/types";
|
|
2
|
+
export interface Input {
|
|
3
|
+
left: boolean;
|
|
4
|
+
right: boolean;
|
|
5
|
+
up: boolean;
|
|
6
|
+
down: boolean;
|
|
7
|
+
action: boolean;
|
|
8
|
+
/** Set when the visitor has taken control (key press, pointer, touch). */
|
|
9
|
+
playing: boolean;
|
|
10
|
+
/** Called once per frame by the game; returns true on the frame action was pressed. */
|
|
11
|
+
pressed(): boolean;
|
|
12
|
+
/** Last swipe direction on touch screens. */
|
|
13
|
+
swipe: "left" | "right" | "up" | "down" | null;
|
|
14
|
+
}
|
|
15
|
+
export declare function input(ctx: SceneContext<any>, opts?: {
|
|
16
|
+
pointerPlays?: boolean;
|
|
17
|
+
}): Input;
|
|
18
|
+
/** A boolean grid of the code text, `cols` wide. Row-major, true = filled. */
|
|
19
|
+
export declare function codeBitmap(code: string, cols: number, rows: number, weight?: number | string): boolean[];
|
|
20
|
+
export declare const PIXEL_FONT = "\"Press Start 2P\",\"Silkscreen\",\"VT323\",ui-monospace,SFMono-Regular,Menlo,monospace";
|
|
21
|
+
export declare function hud(g: CanvasRenderingContext2D, text: string, x: number, y: number, size: number, color: string, align?: CanvasTextAlign): void;
|
|
22
|
+
export declare function loadHigh(key: string): number;
|
|
23
|
+
export declare function saveHigh(key: string, v: number): void;
|
|
24
|
+
/** Shared CSS for game scenes: compact copy block under the playfield. */
|
|
25
|
+
export declare const GAME_CSS = "& .lp-title{--lp-title-size:clamp(22px,2.6vw,34px)}\n& .lp-message{margin-top:8px}\n& .lp-actions{margin-top:16px}\n& .lp-eyebrow{font-family:var(--lp-font-mono);letter-spacing:.2em}";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { SceneContext, SceneInstance } from "../core/types";
|
|
2
|
+
export type Text3DMaterial = "chrome" | "glass" | "clay" | "foil";
|
|
3
|
+
export interface Text3DOptions {
|
|
4
|
+
material: Text3DMaterial;
|
|
5
|
+
/** Colours, all CSS strings. */
|
|
6
|
+
colors: {
|
|
7
|
+
a: string;
|
|
8
|
+
b: string;
|
|
9
|
+
c?: string;
|
|
10
|
+
bg0: string;
|
|
11
|
+
bg1: string;
|
|
12
|
+
light?: string;
|
|
13
|
+
};
|
|
14
|
+
depth?: number;
|
|
15
|
+
round?: number;
|
|
16
|
+
spin?: number;
|
|
17
|
+
float?: number;
|
|
18
|
+
font?: string;
|
|
19
|
+
weight?: number | string;
|
|
20
|
+
/** Gloss 0..1 for clay. */
|
|
21
|
+
gloss?: number;
|
|
22
|
+
/** Environment rotation speed for chrome/foil. */
|
|
23
|
+
envSpeed?: number;
|
|
24
|
+
/** Pillow-shaped inflation width (world units); 0 = hard extrusion. */
|
|
25
|
+
inflate?: number;
|
|
26
|
+
/** Strings under foil balloons. */
|
|
27
|
+
strings?: boolean;
|
|
28
|
+
/** Dispersion strength for glass. */
|
|
29
|
+
dispersion?: number;
|
|
30
|
+
/** Floor plane with soft shadows (clay/foil). */
|
|
31
|
+
floor?: boolean;
|
|
32
|
+
/** Fraction of screen width the text spans. */
|
|
33
|
+
scale?: number;
|
|
34
|
+
/** Vertical placement of the text centre, -0.5..0.5 of screen height. */
|
|
35
|
+
y?: number;
|
|
36
|
+
}
|
|
37
|
+
export declare function text3dScene(ctx: SceneContext<any>, o: Text3DOptions): SceneInstance;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { SceneDef } from "../core/types";
|
|
2
|
+
export declare const loaders: Record<string, () => Promise<{
|
|
3
|
+
default: SceneDef;
|
|
4
|
+
}>>;
|
|
5
|
+
export declare const sceneIds: readonly ["ascii-3d", "astronaut", "aurora", "autumn", "balloon-404", "beach", "black-hole", "block-drop", "blue-screen", "breakout", "bricks", "broken-link", "brutalist", "bubble-wrap", "campfire", "card", "cassette", "chalkboard", "chrome-404", "circuit-board", "claw-machine", "clay-404", "constellation", "countdown", "cross-stitch", "deep-sea", "divider", "dna", "dominoes", "dot-grid", "editorial", "elevator", "emoji", "error-cascade", "evidence-board", "eyes", "fireworks", "flashlight", "flatline", "flock", "foggy-glass", "gears", "glass-404", "glitch", "gradient-404", "halftone", "hanging-letters", "hanging-sign", "helpful-links", "hyperspace", "hypnosis", "ink", "invaders", "kaleidoscope", "lava-lamp", "life", "lighthouse", "loading", "lost-at-sea", "magic-8-ball", "matrix-rain", "maze", "mesh-gradient", "metro-map", "milk-carton", "minimal", "mirage", "moon-landing", "neon-sign", "newspaper", "nixie", "no-signal", "one-bit", "outline-404", "paint-splash", "paper-plane", "particles", "path-not-found", "planet", "pond", "pong", "radar", "rainy-window", "receipt", "road-closed", "rpg-dialog", "runner", "scratch-card", "screensaver", "search-404", "server-default", "server-room", "skyline", "skywriting", "slot-machine", "snake", "snow-globe", "soft-blobs", "solar-system", "split-flap", "split-panel", "stage", "swiss-poster", "terminal", "thunderstorm", "topographic", "torn-page", "treasure-map", "typewriter", "ufo", "unplugged", "vending-machine", "vinyl", "voxel-404", "wormhole", "zen-garden"];
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type SceneSource } from "./core/runtime";
|
|
2
|
+
import type { LostHandle, MountOptions, SceneDef } from "./core/types";
|
|
3
|
+
import { sceneIds } from "./generated/registry";
|
|
4
|
+
export type SceneId = (typeof sceneIds)[number];
|
|
5
|
+
/** Load a scene definition by id (code-split; only the scene you use is downloaded). */
|
|
6
|
+
export declare function loadScene(id: string): Promise<SceneDef>;
|
|
7
|
+
/**
|
|
8
|
+
* Mount a 404 scene into an element.
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* mount(document.body, "lost-at-sea", { preset: "storm", title: "Rough waters." });
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare function mount<P = Record<string, unknown>>(target: HTMLElement | string, scene: SceneId | (string & {}) | SceneSource<P>, options?: MountOptions<P>): LostHandle;
|
|
15
|
+
export { sceneIds };
|
|
16
|
+
export { defineScene, resolve, presetIds, DEFAULT_COPY } from "./core/define";
|
|
17
|
+
export { shaderScene } from "./core/shader";
|
|
18
|
+
export * as gl from "./core/gl";
|
|
19
|
+
export * as glsl from "./core/glsl";
|
|
20
|
+
export * as text from "./core/text";
|
|
21
|
+
export * as util from "./core/util";
|
|
22
|
+
export type * from "./core/types";
|
|
23
|
+
export type { SceneSource } from "./core/runtime";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mount}from"./chunks/chunk-URB3NNOB.js";import"./chunks/chunk-B2NBRLO2.js";import{shaderScene}from"./chunks/chunk-B4TY5M55.js";import{gl_exports,glsl_exports}from"./chunks/chunk-SH72TE6I.js";import{util_exports}from"./chunks/chunk-FVGCB66F.js";import{text_exports}from"./chunks/chunk-3ISI6SOJ.js";import{DEFAULT_COPY,defineScene,presetIds,resolve}from"./chunks/chunk-KIYSQVWX.js";import"./chunks/chunk-7XMDQMDO.js";var loaders={"ascii-3d":()=>import("./scenes/ascii-3d.js"),astronaut:()=>import("./scenes/astronaut.js"),aurora:()=>import("./scenes/aurora.js"),autumn:()=>import("./scenes/autumn.js"),"balloon-404":()=>import("./scenes/balloon-404.js"),beach:()=>import("./scenes/beach.js"),"black-hole":()=>import("./scenes/black-hole.js"),"block-drop":()=>import("./scenes/block-drop.js"),"blue-screen":()=>import("./scenes/blue-screen.js"),breakout:()=>import("./scenes/breakout.js"),bricks:()=>import("./scenes/bricks.js"),"broken-link":()=>import("./scenes/broken-link.js"),brutalist:()=>import("./scenes/brutalist.js"),"bubble-wrap":()=>import("./scenes/bubble-wrap.js"),campfire:()=>import("./scenes/campfire.js"),card:()=>import("./scenes/card.js"),cassette:()=>import("./scenes/cassette.js"),chalkboard:()=>import("./scenes/chalkboard.js"),"chrome-404":()=>import("./scenes/chrome-404.js"),"circuit-board":()=>import("./scenes/circuit-board.js"),"claw-machine":()=>import("./scenes/claw-machine.js"),"clay-404":()=>import("./scenes/clay-404.js"),constellation:()=>import("./scenes/constellation.js"),countdown:()=>import("./scenes/countdown.js"),"cross-stitch":()=>import("./scenes/cross-stitch.js"),"deep-sea":()=>import("./scenes/deep-sea.js"),divider:()=>import("./scenes/divider.js"),dna:()=>import("./scenes/dna.js"),dominoes:()=>import("./scenes/dominoes.js"),"dot-grid":()=>import("./scenes/dot-grid.js"),editorial:()=>import("./scenes/editorial.js"),elevator:()=>import("./scenes/elevator.js"),emoji:()=>import("./scenes/emoji.js"),"error-cascade":()=>import("./scenes/error-cascade.js"),"evidence-board":()=>import("./scenes/evidence-board.js"),eyes:()=>import("./scenes/eyes.js"),fireworks:()=>import("./scenes/fireworks.js"),flashlight:()=>import("./scenes/flashlight.js"),flatline:()=>import("./scenes/flatline.js"),flock:()=>import("./scenes/flock.js"),"foggy-glass":()=>import("./scenes/foggy-glass.js"),gears:()=>import("./scenes/gears.js"),"glass-404":()=>import("./scenes/glass-404.js"),glitch:()=>import("./scenes/glitch.js"),"gradient-404":()=>import("./scenes/gradient-404.js"),halftone:()=>import("./scenes/halftone.js"),"hanging-letters":()=>import("./scenes/hanging-letters.js"),"hanging-sign":()=>import("./scenes/hanging-sign.js"),"helpful-links":()=>import("./scenes/helpful-links.js"),hyperspace:()=>import("./scenes/hyperspace.js"),hypnosis:()=>import("./scenes/hypnosis.js"),ink:()=>import("./scenes/ink.js"),invaders:()=>import("./scenes/invaders.js"),kaleidoscope:()=>import("./scenes/kaleidoscope.js"),"lava-lamp":()=>import("./scenes/lava-lamp.js"),life:()=>import("./scenes/life.js"),lighthouse:()=>import("./scenes/lighthouse.js"),loading:()=>import("./scenes/loading.js"),"lost-at-sea":()=>import("./scenes/lost-at-sea.js"),"magic-8-ball":()=>import("./scenes/magic-8-ball.js"),"matrix-rain":()=>import("./scenes/matrix-rain.js"),maze:()=>import("./scenes/maze.js"),"mesh-gradient":()=>import("./scenes/mesh-gradient.js"),"metro-map":()=>import("./scenes/metro-map.js"),"milk-carton":()=>import("./scenes/milk-carton.js"),minimal:()=>import("./scenes/minimal.js"),mirage:()=>import("./scenes/mirage.js"),"moon-landing":()=>import("./scenes/moon-landing.js"),"neon-sign":()=>import("./scenes/neon-sign.js"),newspaper:()=>import("./scenes/newspaper.js"),nixie:()=>import("./scenes/nixie.js"),"no-signal":()=>import("./scenes/no-signal.js"),"one-bit":()=>import("./scenes/one-bit.js"),"outline-404":()=>import("./scenes/outline-404.js"),"paint-splash":()=>import("./scenes/paint-splash.js"),"paper-plane":()=>import("./scenes/paper-plane.js"),particles:()=>import("./scenes/particles.js"),"path-not-found":()=>import("./scenes/path-not-found.js"),planet:()=>import("./scenes/planet.js"),pond:()=>import("./scenes/pond.js"),pong:()=>import("./scenes/pong.js"),radar:()=>import("./scenes/radar.js"),"rainy-window":()=>import("./scenes/rainy-window.js"),receipt:()=>import("./scenes/receipt.js"),"road-closed":()=>import("./scenes/road-closed.js"),"rpg-dialog":()=>import("./scenes/rpg-dialog.js"),runner:()=>import("./scenes/runner.js"),"scratch-card":()=>import("./scenes/scratch-card.js"),screensaver:()=>import("./scenes/screensaver.js"),"search-404":()=>import("./scenes/search-404.js"),"server-default":()=>import("./scenes/server-default.js"),"server-room":()=>import("./scenes/server-room.js"),skyline:()=>import("./scenes/skyline.js"),skywriting:()=>import("./scenes/skywriting.js"),"slot-machine":()=>import("./scenes/slot-machine.js"),snake:()=>import("./scenes/snake.js"),"snow-globe":()=>import("./scenes/snow-globe.js"),"soft-blobs":()=>import("./scenes/soft-blobs.js"),"solar-system":()=>import("./scenes/solar-system.js"),"split-flap":()=>import("./scenes/split-flap.js"),"split-panel":()=>import("./scenes/split-panel.js"),stage:()=>import("./scenes/stage.js"),"swiss-poster":()=>import("./scenes/swiss-poster.js"),terminal:()=>import("./scenes/terminal.js"),thunderstorm:()=>import("./scenes/thunderstorm.js"),topographic:()=>import("./scenes/topographic.js"),"torn-page":()=>import("./scenes/torn-page.js"),"treasure-map":()=>import("./scenes/treasure-map.js"),typewriter:()=>import("./scenes/typewriter.js"),ufo:()=>import("./scenes/ufo.js"),unplugged:()=>import("./scenes/unplugged.js"),"vending-machine":()=>import("./scenes/vending-machine.js"),vinyl:()=>import("./scenes/vinyl.js"),"voxel-404":()=>import("./scenes/voxel-404.js"),wormhole:()=>import("./scenes/wormhole.js"),"zen-garden":()=>import("./scenes/zen-garden.js")},sceneIds=["ascii-3d","astronaut","aurora","autumn","balloon-404","beach","black-hole","block-drop","blue-screen","breakout","bricks","broken-link","brutalist","bubble-wrap","campfire","card","cassette","chalkboard","chrome-404","circuit-board","claw-machine","clay-404","constellation","countdown","cross-stitch","deep-sea","divider","dna","dominoes","dot-grid","editorial","elevator","emoji","error-cascade","evidence-board","eyes","fireworks","flashlight","flatline","flock","foggy-glass","gears","glass-404","glitch","gradient-404","halftone","hanging-letters","hanging-sign","helpful-links","hyperspace","hypnosis","ink","invaders","kaleidoscope","lava-lamp","life","lighthouse","loading","lost-at-sea","magic-8-ball","matrix-rain","maze","mesh-gradient","metro-map","milk-carton","minimal","mirage","moon-landing","neon-sign","newspaper","nixie","no-signal","one-bit","outline-404","paint-splash","paper-plane","particles","path-not-found","planet","pond","pong","radar","rainy-window","receipt","road-closed","rpg-dialog","runner","scratch-card","screensaver","search-404","server-default","server-room","skyline","skywriting","slot-machine","snake","snow-globe","soft-blobs","solar-system","split-flap","split-panel","stage","swiss-poster","terminal","thunderstorm","topographic","torn-page","treasure-map","typewriter","ufo","unplugged","vending-machine","vinyl","voxel-404","wormhole","zen-garden"];async function loadScene(id){let load=loaders[id];if(!load)throw new Error(`[lostpage] unknown scene "${id}". Available: ${sceneIds.join(", ")}`);return(await load()).default}function mount2(target,scene,options){return mount(target,typeof scene=="string"?()=>loadScene(scene):scene,options)}export{DEFAULT_COPY,defineScene,gl_exports as gl,glsl_exports as glsl,loadScene,mount2 as mount,presetIds,resolve,sceneIds,shaderScene,text_exports as text,util_exports as util};
|