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,49 @@
|
|
|
1
|
+
import{shaderScene}from"../chunks/chunk-B4TY5M55.js";import{HASH,NOISE,texture}from"../chunks/chunk-SH72TE6I.js";import{rgb}from"../chunks/chunk-FVGCB66F.js";import{SANS,drawFittedText}from"../chunks/chunk-3ISI6SOJ.js";import"../chunks/chunk-KIYSQVWX.js";import"../chunks/chunk-7XMDQMDO.js";var FRAG=`
|
|
2
|
+
uniform sampler2D uText;
|
|
3
|
+
uniform vec3 uDark, uLight;
|
|
4
|
+
uniform float uPix;
|
|
5
|
+
${HASH}
|
|
6
|
+
${NOISE}
|
|
7
|
+
float bayer(vec2 p) {
|
|
8
|
+
ivec2 q = ivec2(mod(p, 8.0));
|
|
9
|
+
int m[64] = int[64](0,32,8,40,2,34,10,42,48,16,56,24,50,18,58,26,12,44,4,36,14,46,6,38,60,28,52,20,62,30,54,22,3,35,11,43,1,33,9,41,51,19,59,27,49,17,57,25,15,47,7,39,13,45,5,37,63,31,55,23,61,29,53,21);
|
|
10
|
+
return (float(m[q.y * 8 + q.x]) + 0.5) / 64.0;
|
|
11
|
+
}
|
|
12
|
+
void main() {
|
|
13
|
+
vec2 cell = floor(gl_FragCoord.xy / uPix);
|
|
14
|
+
vec2 fc = cell * uPix + uPix * 0.5;
|
|
15
|
+
vec2 uv = fc / uRes;
|
|
16
|
+
vec2 p = (fc - 0.5 * uRes) / uRes.y;
|
|
17
|
+
float t = uTime;
|
|
18
|
+
vec3 L = normalize(vec3(-0.5 + uMouse.x * 0.8, 0.5 + uMouse.y * 0.5, 0.7));
|
|
19
|
+
// background: a soft vertical gradient
|
|
20
|
+
float lum = 0.03 + 0.09 * (p.y + 0.5);
|
|
21
|
+
// a globe with continents, lit from the pointer side
|
|
22
|
+
vec2 gc = vec2(0.5 * uRes.x / uRes.y - 0.3, 0.1);
|
|
23
|
+
vec2 d = p - gc;
|
|
24
|
+
float R = 0.24;
|
|
25
|
+
if (length(d) < R) {
|
|
26
|
+
vec3 n = vec3(d / R, sqrt(max(1.0 - dot(d, d) / (R * R), 0.0)));
|
|
27
|
+
float a = t * 0.15;
|
|
28
|
+
vec3 q = vec3(n.x * cos(a) - n.z * sin(a), n.y, n.x * sin(a) + n.z * cos(a));
|
|
29
|
+
float land = step(0.52, fbm3(q * 2.2 + 3.0));
|
|
30
|
+
float dif = max(dot(n, L), 0.0);
|
|
31
|
+
lum = dif * (land > 0.5 ? 0.95 : 0.55) + 0.04;
|
|
32
|
+
}
|
|
33
|
+
// orbit ring
|
|
34
|
+
vec2 od = d / vec2(1.0, 0.22);
|
|
35
|
+
float ring = smoothstep(0.012, 0.0, abs(length(od) - R * 1.45)) * step(0.0, -d.y + (length(d) < R ? -1.0 : 1.0) * 0.0);
|
|
36
|
+
if (length(d) > R || d.y < 0.0) lum = max(lum, ring * 0.9);
|
|
37
|
+
// satellite
|
|
38
|
+
float sa = t * 0.6;
|
|
39
|
+
vec2 sp = gc + vec2(cos(sa) * R * 1.45, sin(sa) * R * 1.45 * 0.22);
|
|
40
|
+
lum = max(lum, step(length(p - sp), 0.012) * (sin(sa) < 0.0 || length(p - gc) > R ? 1.0 : 0.0));
|
|
41
|
+
// the code, shaded with a vertical gradient
|
|
42
|
+
float txt = texture(uText, uv).a;
|
|
43
|
+
if (txt > 0.5) lum = 0.35 + 0.6 * smoothstep(0.1, 0.9, uv.y + 0.2 * sin(t + uv.x * 3.0));
|
|
44
|
+
// stars
|
|
45
|
+
lum = max(lum, step(0.996, hash12(cell)) * 0.9);
|
|
46
|
+
float on = step(bayer(cell), lum);
|
|
47
|
+
fragColor = vec4(mix(uDark, uLight, on), 1.0);
|
|
48
|
+
}
|
|
49
|
+
`,one_bit_default={id:"one-bit",name:"One Bit",description:"Everything in two colours with ordered dithering, like an early Mac or a pocket console. A little globe turns and the light follows your pointer.",category:"Retro Tech",kind:"3d",motion:"live",tags:["webgl","dither","1-bit","retro","pixel","monochrome","mac"],layout:"bottom-left",codeInScene:!0,copy:{eyebrow:"Error 404",title:"The page could not be found.",message:"It may have been moved, renamed, or ejected along with the disk.",actions:[{label:"Restart at home",href:"/",variant:"primary"}]},params:{dark:"#1b1b1b",light:"#f2efe6",pixel:3},theme:{bg:"#1b1b1b",fg:"#f2efe6",accent:"#f2efe6","accent-fg":"#1b1b1b","font-display":'"Chicago","ChicagoFLF","Geneva",var(--lp-font-mono)',radius:"0"},presetName:"Classic",presets:{pocket:{name:"Pocket Console",params:{dark:"#0f380f",light:"#9bbc0f",pixel:4},theme:{bg:"#0f380f",fg:"#9bbc0f",accent:"#9bbc0f","accent-fg":"#0f380f"}},amber:{name:"Amber Terminal",params:{dark:"#120a00",light:"#ffb000",pixel:3},theme:{bg:"#120a00",fg:"#ffb000",accent:"#ffb000","accent-fg":"#120a00"}},paper:{name:"Paper",params:{dark:"#f2efe6",light:"#1b1b1b",pixel:2},theme:{bg:"#f2efe6",fg:"#1b1b1b",accent:"#1b1b1b","accent-fg":"#f2efe6"}},ice:{name:"Ice Blue",params:{dark:"#0a1a3a",light:"#bfe7ff",pixel:3},theme:{bg:"#0a1a3a",fg:"#bfe7ff",accent:"#bfe7ff","accent-fg":"#0a1a3a"}}},setup(ctx){let p=ctx.params,cv=document.createElement("canvas"),tex=null,gl,draw=()=>{cv.width=1024,cv.height=Math.max(64,Math.round(1024*ctx.height/Math.max(1,ctx.width)));let g=cv.getContext("2d");g.clearRect(0,0,cv.width,cv.height),g.save(),g.translate(cv.width*.05,cv.height*.12),drawFittedText(g,ctx.copy.code||"404",{width:cv.width*.5,height:cv.height*.4,font:SANS,weight:900,fit:.9,cx:.4}),g.restore(),tex&&(gl.bindTexture(gl.TEXTURE_2D,tex),gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL,!0),gl.texImage2D(gl.TEXTURE_2D,0,gl.RGBA,gl.RGBA,gl.UNSIGNED_BYTE,cv),gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL,!1))};return{...shaderScene(ctx,{frag:FRAG,adaptive:!1,init(g){gl=g,draw(),tex=texture(gl,cv,{filter:"nearest"})},uniforms:()=>({uText:tex,uDark:rgb(p.dark),uLight:rgb(p.light),uPix:Math.round(p.pixel*Math.min(2,ctx.dpr))})}),resize:draw}}};export{one_bit_default as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{esc}from"../chunks/chunk-ES56TX4X.js";import"../chunks/chunk-B2NBRLO2.js";import"../chunks/chunk-KIYSQVWX.js";import"../chunks/chunk-7XMDQMDO.js";var outline_404_default={id:"outline-404",name:"Outline",description:"A giant outlined 404 sits behind a short, bold headline. One of the most common agency and portfolio looks, done with pure CSS.",category:"Simple",kind:"2d",motion:"static",tags:["simple","outline","stroke","typography","static","fast","portfolio"],layout:"center",copy:{eyebrow:"Error 404",title:"Oops! Nothing here.",message:"The page you\u2019re after has moved, been renamed or never existed.",actions:[{label:"Back to homepage",href:"/"}]},params:{stroke:2,fade:.7},theme:{bg:"#0d0d0f",fg:"#f4f4f5",accent:"#f4f4f5","accent-fg":"#0d0d0f"},presetName:"Night",presets:{paper:{name:"Paper",theme:{bg:"#f5f3ee",fg:"#141414",accent:"#141414","accent-fg":"#f5f3ee"}},lime:{name:"Lime",params:{stroke:3},theme:{bg:"#101010",fg:"#d9f99d",accent:"#bef264","accent-fg":"#101010"}},blue:{name:"Cobalt",theme:{bg:"#1d3bd8",fg:"#ffffff",accent:"#ffffff","accent-fg":"#1d3bd8"}}},css:`
|
|
2
|
+
& .ol{position:absolute;inset:0;display:grid;place-items:center;pointer-events:none;overflow:hidden}
|
|
3
|
+
& .ol span{font-family:var(--lp-font-display);font-weight:900;font-size:clamp(170px,42cqw,620px);line-height:1;letter-spacing:-.04em;white-space:nowrap;
|
|
4
|
+
color:transparent;-webkit-text-stroke:var(--sw) color-mix(in srgb,var(--lp-fg) 32%,transparent);
|
|
5
|
+
-webkit-mask-image:linear-gradient(180deg,#000 20%,rgba(0,0,0,calc(1 - var(--fade))));mask-image:linear-gradient(180deg,#000 20%,rgba(0,0,0,calc(1 - var(--fade))))}
|
|
6
|
+
& .lp-code{display:none}
|
|
7
|
+
& .lp-title{font-weight:800;font-size:clamp(30px,5.4cqw,68px)}
|
|
8
|
+
& .lp-eyebrow{color:var(--lp-fg);opacity:.7}
|
|
9
|
+
`,setup(ctx){let el=document.createElement("div");return el.className="ol",el.setAttribute("aria-hidden","true"),el.style.setProperty("--sw",ctx.params.stroke+"px"),el.style.setProperty("--fade",String(ctx.params.fade)),el.innerHTML=`<span>${esc(ctx.copy.code)}</span>`,ctx.stage.append(el),{destroy:()=>el.remove()}}};export{outline_404_default as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{canvas2d}from"../chunks/chunk-DAZOIOF7.js";import{SANS,textPoints}from"../chunks/chunk-3ISI6SOJ.js";import"../chunks/chunk-KIYSQVWX.js";import"../chunks/chunk-7XMDQMDO.js";var paint_splash_default={id:"paint-splash",name:"Paint Splash",description:"Splats of paint fly at a white wall until the error is painted in drips and spatter. Click to throw a splat of your own.",category:"Playful",kind:"2d",motion:"live",tags:["canvas","paint","splatter","art","colorful","interactive","light"],layout:"bottom",codeInScene:!0,copy:{eyebrow:"Wet paint",title:"We painted over this page.",message:"Someone redecorated and the page didn't survive. Throw some paint if it helps.",actions:[{label:"Back to the gallery",href:"/",variant:"primary"}]},params:{wall:"#f7f5f0",paints:["#ff3b5c","#ffb000","#1fb5ff","#7a3dff","#16c47f"]},theme:{bg:"#f7f5f0",fg:"#1a1a1a",accent:"#1a1a1a","accent-fg":"#fff"},presetName:"Primary",presets:{mono:{name:"Black Ink",params:{paints:["#111111","#2a2a2a","#444444"]}},neon:{name:"Neon on Black",params:{wall:"#0b0b0d",paints:["#ff00e6","#00f0ff","#ffe600","#00ff85"]},theme:{bg:"#0b0b0d",fg:"#f2f2f2",accent:"#f2f2f2","accent-fg":"#0b0b0d"}},pastel:{name:"Pastel",params:{paints:["#ffb3c7","#a8d8ff","#ffe08a","#b8f0c8","#d6c2ff"]}},gold:{name:"Gold Leaf",params:{wall:"#14110d",paints:["#d4af37","#f5d76e","#b8860b"]},theme:{bg:"#14110d",fg:"#f7ecd0",accent:"#d4af37","accent-fg":"#14110d"}}},setup(ctx){let p=ctx.params,c=canvas2d(ctx),rnd=ctx.random,layer,lg,targets=[],ti=0,drips=[],build=()=>{let s=Math.min(2,ctx.dpr);layer=document.createElement("canvas"),layer.width=c.w*s,layer.height=c.h*s,lg=layer.getContext("2d"),lg.scale(s,s),lg.fillStyle=p.wall,lg.fillRect(0,0,c.w,c.h);for(let i=0;i<c.w*c.h/40;i++)lg.fillStyle=`rgba(0,0,0,${rnd()*.03})`,lg.fillRect(rnd()*c.w,rnd()*c.h,2,2);let boxW=Math.min(c.w*.8,1e3),boxH=Math.min(boxW*.4,c.h*.42),pts=textPoints(ctx.copy.code||"404",{width:boxW,height:boxH,font:SANS,weight:900,fit:.95,step:Math.max(14,boxW/50),random:rnd});targets=[];for(let i=0;i<pts.length;i+=2)targets.push([pts[i]+(c.w-boxW)/2,pts[i+1]+c.h*.38-boxH/2]);if(targets.sort(()=>rnd()-.5),ti=0,drips=[],ctx.reducedMotion)for(;ti<targets.length;)splat(targets[ti][0],targets[ti++][1],16,!0)},splat=(x,y,size,quiet=!1)=>{let col=p.paints[Math.floor(rnd()*p.paints.length)];lg.fillStyle=col,lg.beginPath();let n=18;for(let k=0;k<=n;k++){let a=k/n*Math.PI*2,r=size*(.75+rnd()*.5);k?lg.lineTo(x+Math.cos(a)*r,y+Math.sin(a)*r):lg.moveTo(x+Math.cos(a)*r,y+Math.sin(a)*r)}lg.fill();for(let k=0;k<(quiet?4:14);k++){let a=rnd()*Math.PI*2,d=size*(1.2+rnd()*2.5);lg.beginPath(),lg.arc(x+Math.cos(a)*d,y+Math.sin(a)*d,size*(.05+rnd()*.18),0,Math.PI*2),lg.fill()}rnd()<.5&&drips.push({x:x+(rnd()-.5)*size,y:y+size*.6,len:0,max:size*(1+rnd()*5),w:size*(.12+rnd()*.15),col})};build(),ctx.on("pointerdown",e=>{e.target.closest("a,button")||splat(ctx.pointer.x,ctx.pointer.y,40+rnd()*30)});let acc=0;return{resize(){c.reset(),build()},frame(t,dt){let g=c.g;if(c.reset(),dt>0){for(acc+=dt;acc>.025&&ti<targets.length;){acc-=.025;let[x,y]=targets[ti++];splat(x,y,Math.max(10,c.w/90)*(.8+rnd()*.6))}for(let d of drips){if(d.len>=d.max)continue;let step=30*dt*(.5+rnd());lg.fillStyle=d.col,lg.fillRect(d.x-d.w/2,d.y+d.len,d.w,step+1),d.len+=step,d.len>=d.max&&(lg.beginPath(),lg.arc(d.x,d.y+d.len,d.w*.8,0,Math.PI*2),lg.fill())}}g.drawImage(layer,0,0,c.w,c.h)}}}};export{paint_splash_default as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{canvas2d}from"../chunks/chunk-DAZOIOF7.js";import{rgba}from"../chunks/chunk-FVGCB66F.js";import"../chunks/chunk-KIYSQVWX.js";import"../chunks/chunk-7XMDQMDO.js";var paper_plane_default={id:"paper-plane",name:"Paper Plane",description:"Your page was folded into a paper plane and is now looping lazily through the clouds. Steer it with the pointer.",category:"Playful",kind:"2d",motion:"live",tags:["canvas","paper","sky","clouds","light","calm","interactive"],layout:"bottom",codeInScene:!1,copy:{eyebrow:"Took off",title:"This page flew away.",message:"Someone folded it into a plane and let it go. It's somewhere above the clouds now.",actions:[{label:"Land at home",href:"/",variant:"primary"}]},params:{skyTop:"#8fc9ff",skyBottom:"#e8f5ff",plane:"#ffffff",cloud:"#ffffff",trail:"#ffffff"},theme:{bg:"#cbe6ff",fg:"#0d2238",accent:"#0d2238","accent-fg":"#fff","code-color":"rgba(13,34,56,.14)"},presetName:"Blue Sky",presets:{mint:{name:"Mint Sky",params:{skyTop:"#7fe3c0",skyBottom:"#e6fff6",cloud:"#ffffff",trail:"#ffffff"},theme:{bg:"#bdf2df",fg:"#06302a",accent:"#06302a","code-color":"rgba(6,48,42,.14)"}},sunset:{name:"Sunset",params:{skyTop:"#3a3a8a",skyBottom:"#ffb38a",cloud:"#ffd9c7",trail:"#ffe6d6"},theme:{bg:"#d98a8a",fg:"#2a0f1a",accent:"#2a0f1a","code-color":"rgba(42,15,26,.14)"}},night:{name:"Night Flight",params:{skyTop:"#050a1f",skyBottom:"#1d2a55",plane:"#f2f6ff",cloud:"#2a3a66",trail:"#9fb4ff"},theme:{bg:"#0d1530",fg:"#eef2ff",accent:"#eef2ff","accent-fg":"#0d1530","code-color":"rgba(238,242,255,.1)"}},notebook:{name:"Notebook",params:{skyTop:"#f7f4ec",skyBottom:"#f7f4ec",plane:"#ffffff",cloud:"#e3ecf7",trail:"#4a6fa5"},theme:{bg:"#f7f4ec",fg:"#1f2a3a",accent:"#1f2a3a","code-color":"rgba(31,42,58,.1)"}}},css:`& .lp-code{--lp-code-size:clamp(120px,20cqw,300px);font-weight:900;letter-spacing:-.06em}
|
|
2
|
+
& .lp-overlay{justify-content:center}`,setup(ctx){let p=ctx.params,c=canvas2d(ctx),rnd=ctx.random,clouds=[],trail=[],x=0,y=0,ang=0,build=()=>{clouds=Array.from({length:9},()=>({x:rnd()*c.w,y:rnd()*c.h*.8,s:.5+rnd()*1.2,v:.3+rnd()*.7})),x=c.w*.3,y=c.h*.3};build();let cloud=(g,cx,cy,s)=>{g.fillStyle=p.cloud;for(let[dx,dy,r]of[[0,0,40],[36,-14,46],[80,0,38],[40,12,40],[-30,10,30]])g.beginPath(),g.arc(cx+dx*s,cy+dy*s,r*s,0,Math.PI*2),g.fill()};return{resize(){c.reset(),build()},frame(t,dt){let g=c.g;c.reset();let sky=g.createLinearGradient(0,0,0,c.h);if(sky.addColorStop(0,p.skyTop),sky.addColorStop(1,p.skyBottom),g.fillStyle=sky,g.fillRect(0,0,c.w,c.h),p.skyTop===p.skyBottom){g.strokeStyle="rgba(74,111,165,.18)";for(let ly=40;ly<c.h;ly+=32)g.beginPath(),g.moveTo(0,ly),g.lineTo(c.w,ly),g.stroke();g.strokeStyle="rgba(220,60,60,.3)",g.beginPath(),g.moveTo(80,0),g.lineTo(80,c.h),g.stroke()}for(let cl of clouds)cl.x-=cl.v*22*dt,cl.x<-200&&(cl.x=c.w+200),g.globalAlpha=.55+.35*cl.v,cloud(g,cl.x,cl.y,cl.s);g.globalAlpha=1;let tx=ctx.pointer.engaged?ctx.pointer.x:c.w*(.5+.3*Math.sin(t*.35)),ty=ctx.pointer.engaged?ctx.pointer.y:c.h*(.35+.15*Math.sin(t*.7)+.08*Math.sin(t*1.9)),da=Math.atan2(ty-y,tx-x)-ang;for(;da>Math.PI;)da-=Math.PI*2;for(;da<-Math.PI;)da+=Math.PI*2;ang+=da*Math.min(1,dt*2.2);let sp=Math.min(c.w,c.h)*.32;dt>0&&(x+=Math.cos(ang)*sp*dt,y+=Math.sin(ang)*sp*dt,trail.push({x,y}),trail.length>70&&trail.shift()),g.strokeStyle=rgba(p.trail,.8),g.lineWidth=2,g.setLineDash([6,8]),g.beginPath(),trail.forEach((q,i)=>i?g.lineTo(q.x,q.y):g.moveTo(q.x,q.y)),g.stroke(),g.setLineDash([]);let bank=Math.max(-1,Math.min(1,da*2)),S=Math.max(28,Math.min(c.w,c.h)*.06);g.save(),g.translate(x,y),g.rotate(ang),g.fillStyle="rgba(0,0,0,.08)",g.beginPath(),g.moveTo(S*1.1,18),g.lineTo(-S*.9,-S*.5+18),g.lineTo(-S*.6,18),g.lineTo(-S*.9,S*.5+18),g.closePath(),g.fill();let wing=(dir,shade)=>{g.fillStyle=`rgb(${shade},${shade},${Math.min(255,shade+6)})`,g.beginPath(),g.moveTo(S*1.1,0),g.lineTo(-S*.9,dir*S*(.55-bank*dir*.2)),g.lineTo(-S*.6,0),g.closePath(),g.fill()};wing(-1,Math.round(255-30*(1+bank))),wing(1,Math.round(255-30*(1-bank))),g.strokeStyle="rgba(0,0,0,.18)",g.lineWidth=1,g.beginPath(),g.moveTo(S*1.1,0),g.lineTo(-S*.6,0),g.stroke(),g.fillStyle="rgba(0,0,0,.12)",g.beginPath(),g.moveTo(S*1.1,0),g.lineTo(-S*.75,S*.12),g.lineTo(-S*.6,0),g.closePath(),g.fill(),g.restore(),p.plane}}}};export{paper_plane_default as default};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
type Mode = "glow" | "square" | "confetti";
|
|
2
|
+
interface Params {
|
|
3
|
+
mode: Mode;
|
|
4
|
+
colors: string[];
|
|
5
|
+
bg: string;
|
|
6
|
+
/** Particle count target on a 1440×900 screen. */
|
|
7
|
+
count: number;
|
|
8
|
+
size: number;
|
|
9
|
+
/** Spring back strength. */
|
|
10
|
+
spring: number;
|
|
11
|
+
/** Pointer push radius (px). */
|
|
12
|
+
radius: number;
|
|
13
|
+
/** Ambient drift: 0 none, >0 rising (embers), <0 falling (snow). */
|
|
14
|
+
drift: number;
|
|
15
|
+
trail: number;
|
|
16
|
+
twinkle: number;
|
|
17
|
+
/** Constant sideways wind that blows disturbed particles away (sand). */
|
|
18
|
+
wind: number;
|
|
19
|
+
ambient: number;
|
|
20
|
+
}
|
|
21
|
+
declare const _default: import("..").SceneDef<Params>;
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{canvas2d,glowSprite}from"../chunks/chunk-DAZOIOF7.js";import{rgba}from"../chunks/chunk-FVGCB66F.js";import{SANS,textPoints}from"../chunks/chunk-3ISI6SOJ.js";import"../chunks/chunk-KIYSQVWX.js";import"../chunks/chunk-7XMDQMDO.js";var particles_default={id:"particles",name:"Particle Field",description:"Thousands of particles hold the shape of the code. Push them with the pointer, click to scatter them, and watch them find their way back.",category:"Abstract",kind:"2d",motion:"interactive",tags:["canvas","particles","interactive","physics","mouse"],layout:"bottom",codeInScene:!0,copy:{eyebrow:"Error 404",title:"This page scattered into stardust.",message:"Move your cursor through it. It always pulls itself back together. The page you wanted won't.",actions:[{label:"Back to home",href:"/",variant:"primary"}]},params:{mode:"glow",colors:["#cfe0ff","#ffffff","#8fb5ff"],bg:"#050816",count:2600,size:2.2,spring:7,radius:120,drift:0,trail:0,twinkle:1,wind:0,ambient:140},theme:{bg:"#050816",accent:"#e8efff","accent-fg":"#050816"},presetName:"Stardust",presets:{neon:{name:"Neon",params:{colors:["#00f0ff","#ff00e6","#7a5cff"],bg:"#05000d",size:2.4,ambient:180},theme:{bg:"#05000d",accent:"#00f0ff","accent-fg":"#05000d"}},gold:{name:"Gold Dust",eyebrow:"Glittering",title:"All that glitters is not found.",params:{colors:["#ffd36b","#fff2c9","#e8a83b"],bg:"#0d0903",size:2,ambient:260},theme:{bg:"#0d0903",accent:"#ffd36b","accent-fg":"#0d0903"}},sakura:{name:"Sakura",eyebrow:"Spring",title:"Carried off by the blossoms.",params:{mode:"confetti",colors:["#ffb7c5","#ffd1dc","#ff8fab","#ffffff"],bg:"#fff5f7",count:1300,size:5,spring:4,twinkle:0,drift:-.3,ambient:90},theme:{bg:"#fff5f7",fg:"#4a1a2a",accent:"#4a1a2a","accent-fg":"#fff"}},smoke:{name:"Smoke",eyebrow:"Up in smoke",title:"This page went up in smoke.",params:{colors:["#9aa0a6","#c9ccd1","#6b7076"],bg:"#0d0e10",drift:1.2,trail:.12,size:3.2,twinkle:0,ambient:200,spring:5},theme:{bg:"#0d0e10",accent:"#e6e8eb","accent-fg":"#0d0e10"}},ocean:{name:"Sea Foam",params:{colors:["#bff7ff","#7fe3ff","#ffffff"],bg:"#03243a",size:2.4,drift:-.2,ambient:220},theme:{bg:"#03243a",accent:"#bff7ff","accent-fg":"#03243a"}},embers:{name:"Embers",eyebrow:"Still warm",title:"This page burned down.",message:"Only embers left. Stir them if you like, but home is the safer bet.",params:{colors:["#ff8a3d","#ffcf6b","#ff4d1f"],bg:"#0d0503",drift:1,trail:.22,size:2.4,ambient:220},theme:{bg:"#0d0503",accent:"#ffb066","accent-fg":"#1a0802"}},snow:{name:"Snowfall",eyebrow:"Snowed in",title:"This page is buried in snow.",message:"We'll dig it out by spring. Until then, there's a warm fire back home.",params:{colors:["#ffffff","#e4f1ff","#cfe3ff"],bg:"#1b2a40",drift:-1,size:2.6,ambient:260,twinkle:0},theme:{bg:"#1b2a40",accent:"#ffffff","accent-fg":"#1b2a40"}},confetti:{name:"Confetti",eyebrow:"Surprise",title:"We threw a party. The page didn't come.",message:"Click anywhere to pop the confetti again.",params:{mode:"confetti",colors:["#ff4f79","#ffb627","#2ec4b6","#5b5ff5","#ff7b3d"],bg:"#fff8ef",count:1500,size:4.2,spring:5,twinkle:0,ambient:60},theme:{bg:"#fff8ef",fg:"#1b1530",accent:"#1b1530","accent-fg":"#fff8ef"}},sand:{name:"Sand",eyebrow:"Shifting sands",title:"Blown away.",message:"The wind took this page. Brush past the letters and see.",params:{mode:"square",colors:["#b8925c","#9c7443","#cfa871"],bg:"#f4e7d3",count:5200,size:1.8,spring:3,wind:1,twinkle:0,ambient:0,radius:110},theme:{bg:"#f4e7d3",fg:"#3a2a17",accent:"#3a2a17","accent-fg":"#f4e7d3"}},pixels:{name:"Arcade Pixels",eyebrow:"Player 1",title:"Level not found.",message:"Insert coin to continue. Or just go back home.",params:{mode:"square",colors:["#39ff14","#00e5ff","#ff2bd6","#fff700"],bg:"#07010d",count:1400,size:5,spring:9,twinkle:0,ambient:0},theme:{bg:"#07010d",accent:"#39ff14","accent-fg":"#07010d","font-display":"var(--lp-font-mono)"}},ink:{name:"Ink",eyebrow:"Error 404",title:"Smudged out of existence.",params:{mode:"square",colors:["#141414","#2b2b2b","#4a4a4a"],bg:"#f3f0ea",count:3600,size:1.8,twinkle:0,ambient:0,spring:6},theme:{bg:"#f3f0ea",fg:"#141414",accent:"#141414","accent-fg":"#f3f0ea","font-display":"var(--lp-font-serif)"}},fireflies:{name:"Fireflies",eyebrow:"Summer night",title:"Even the fireflies can't find it.",params:{colors:["#d9ff6b","#f6ff9e","#b8ff3d"],bg:"#03100a",count:900,size:3.4,spring:2.5,twinkle:1,ambient:120,drift:.2},theme:{bg:"#03100a",accent:"#e6ff9a","accent-fg":"#03100a"}}},setup(ctx){let p=ctx.params,c=canvas2d(ctx),rnd=ctx.random,sprites=p.colors.map(col=>glowSprite(col,48,.12)),STRIDE=10,parts=new Float32Array(0),n=0,amb=new Float32Array(0),lastBurst=0;function build(){let w=c.w,h=c.h,boxW=Math.min(w*.82,1150),boxH=Math.min(boxW*.42,h*.42),scale=Math.min(1,w*h/(1440*900))**.5,target=Math.max(400,Math.round(p.count*scale)),step=Math.max(2,Math.round(Math.sqrt(boxW*boxH*.32/target))),pts=textPoints(ctx.copy.code||"404",{width:boxW,height:boxH,font:SANS,weight:800,fit:.95,step,jitter:.9,random:rnd}),ox=(w-boxW)/2,oy=h*.4-boxH/2,old=parts;n=pts.length/2,parts=new Float32Array(n*STRIDE);for(let i=0;i<n;i++){let o=i*STRIDE,hx=pts[i*2]+ox,hy=pts[i*2+1]+oy,k=i*STRIDE<old.length?i*STRIDE:-1;parts[o]=k>=0?old[k]:ctx.reducedMotion?hx:rnd()*w,parts[o+1]=k>=0?old[k+1]:ctx.reducedMotion?hy:rnd()*h,parts[o+2]=hx,parts[o+3]=hy,parts[o+6]=p.size*(.6+rnd()*.8),parts[o+7]=Math.floor(rnd()*p.colors.length),parts[o+8]=rnd()*100}let an=Math.round(p.ambient*scale);amb=new Float32Array(an*4);for(let i=0;i<an;i++)amb[i*4]=rnd()*w,amb[i*4+1]=rnd()*h,amb[i*4+2]=.3+rnd()*.9,amb[i*4+3]=rnd()*100}function burst(x,y,power){for(let i=0;i<n;i++){let o=i*STRIDE,dx=parts[o]-x,dy=parts[o+1]-y,d=Math.hypot(dx,dy)+1,f=power*(.4+rnd())/Math.sqrt(d);parts[o+4]+=dx/d*f*60,parts[o+5]+=dy/d*f*60-(p.mode==="confetti"?200*rnd():0)}}if(ctx.on("pointerdown",e=>{let r=ctx.root.getBoundingClientRect();burst(e.clientX-r.left,e.clientY-r.top,9)}),build(),!ctx.reducedMotion)for(let i=0;i<n;i++)parts[i*STRIDE]=c.w/2+(rnd()-.5)*c.w*1.2,parts[i*STRIDE+1]=c.h*.4+(rnd()-.5)*c.h*1.2;return{resize(){c.reset(),build()},frame(t,dt){let g=c.g,w=c.w,h=c.h;c.reset(),g.globalCompositeOperation="source-over",p.trail>0&&dt>0?(g.fillStyle=rgba(p.bg,p.trail),g.fillRect(0,0,w,h)):(g.fillStyle=p.bg,g.fillRect(0,0,w,h)),!ctx.pointer.engaged&&t-lastBurst>7&&t>3&&dt>0&&(lastBurst=t,burst(w/2+(rnd()-.5)*w*.3,h*.42,4));let glow=p.mode==="glow";glow&&(g.globalCompositeOperation="lighter");for(let i=0;i<amb.length/4;i++){let o=i*4;amb[o+1]-=p.drift*22*amb[o+2]*dt,amb[o]+=Math.sin(t*.5+amb[o+3])*8*dt+p.wind*30*dt,amb[o+1]<-10&&(amb[o+1]=h+10),amb[o+1]>h+10&&(amb[o+1]=-10),amb[o]>w+10&&(amb[o]=-10);let tw=p.twinkle?.4+.6*Math.abs(Math.sin(t*1.3+amb[o+3])):.7,s=p.size*amb[o+2]*1.4;g.globalAlpha=tw*.55,glow?g.drawImage(sprites[i%sprites.length],amb[o]-s*3,amb[o+1]-s*3,s*6,s*6):(g.fillStyle=p.colors[i%p.colors.length],g.fillRect(amb[o],amb[o+1],s,s))}let px=ctx.pointer.x,py=ctx.pointer.y,R=p.radius,R2=R*R,active=ctx.pointer.inside&&ctx.interactive,k=p.spring,damp=Math.exp(-3.2*dt);for(let i=0;i<n;i++){let o=i*STRIDE,x=parts[o],y=parts[o+1],vx=parts[o+4],vy=parts[o+5],dx=parts[o+2]-x,dy=parts[o+3]-y,disp=Math.abs(dx)+Math.abs(dy);if(vx+=dx*k*dt,vy+=dy*k*dt,active){let ex=x-px,ey=y-py,d2=ex*ex+ey*ey;if(d2<R2){let d=Math.sqrt(d2)+.01,f=(1-d/R)*2600*dt;vx+=ex/d*f,vy+=ey/d*f,p.wind&&(vx+=900*dt*(1-d/R),parts[o+9]=1.6+rnd()*1.4)}}p.drift&&disp>4&&(vy-=p.drift*60*dt),p.wind&&parts[o+9]>0&&(vx+=p.wind*140*dt*Math.min(1,parts[o+9]),vy+=Math.sin(t*3+parts[o+8])*30*dt,parts[o+9]-=dt),vx*=damp,vy*=damp,x+=vx*dt,y+=vy*dt;let ph=parts[o+8];x+=Math.sin(t*1.1+ph)*.08,y+=Math.cos(t*.9+ph*1.3)*.08,parts[o]=x,parts[o+1]=y,parts[o+4]=vx,parts[o+5]=vy;let s=parts[o+6],ci=parts[o+7]|0,tw=p.twinkle?.55+.45*Math.sin(t*2.2+ph):1;if(glow)g.globalAlpha=tw,g.drawImage(sprites[ci],x-s*2.5,y-s*2.5,s*5,s*5);else if(p.mode==="confetti"){let a=ph+t*(1.5+ph%3)+vx*.004,sx=s*Math.abs(Math.cos(a));g.globalAlpha=1,g.fillStyle=p.colors[ci],g.fillRect(x-sx/2,y-s*.35,sx||.5,s*.7)}else g.globalAlpha=1,g.fillStyle=p.colors[ci],g.fillRect(x-s/2,y-s/2,s,s)}g.globalAlpha=1,g.globalCompositeOperation="source-over"}}}};export{particles_default as default};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{actions,esc,layer,path,sr}from"../chunks/chunk-ES56TX4X.js";import"../chunks/chunk-B2NBRLO2.js";import"../chunks/chunk-KIYSQVWX.js";import"../chunks/chunk-7XMDQMDO.js";var path_not_found_default={id:"path-not-found",name:"Path Not Found",description:"Shows people exactly what went wrong: the address they asked for, in a code chip or a request line, so a typo is easy to spot.",category:"Simple",kind:"2d",motion:"static",tags:["simple","url","path","developer","docs","useful","static","fast"],layout:"none",copy:{title:"Nothing lives at this address",message:"Double-check the spelling, or go back to where you came from.",actions:[{label:"Go home",href:"/"},{label:"Report a broken link",href:"/contact",variant:"secondary",icon:"arrow"}]},params:{request:!1},theme:{bg:"#fafafa",fg:"#18181b",accent:"#18181b","accent-fg":"#fafafa",radius:"8px"},presetName:"Chip",presets:{request:{name:"Request line",params:{request:!0},theme:{bg:"#0b0b0e",fg:"#e4e4e7",accent:"#e4e4e7","accent-fg":"#0b0b0e"}},soft:{name:"Soft",theme:{bg:"#eef2ff",fg:"#1e1b4b",accent:"#4338ca","accent-fg":"#fff",radius:"999px"}}},css:`
|
|
2
|
+
& .pnf{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:24px 16px}
|
|
3
|
+
& .pnf h1{margin:0;font-size:clamp(26px,4.2cqw,46px);font-weight:700;letter-spacing:-.03em;line-height:1.1;text-wrap:balance}
|
|
4
|
+
& .pnf code{font-family:var(--lp-font-mono);font-size:14px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
5
|
+
& .pnf .chip{display:inline-flex;gap:10px;align-items:center;max-width:min(560px,100%);margin-bottom:22px;padding:8px 14px;border-radius:8px;
|
|
6
|
+
background:color-mix(in srgb,var(--lp-fg) 6%,transparent);border:1px dashed color-mix(in srgb,var(--lp-fg) 22%,transparent)}
|
|
7
|
+
& .pnf .chip b{flex:none;color:#e11d48;font-family:var(--lp-font-mono);font-size:13px}
|
|
8
|
+
& .pnf .req{width:min(560px,100%);margin-bottom:26px;text-align:left;border-radius:10px;overflow:hidden;border:1px solid color-mix(in srgb,var(--lp-fg) 14%,transparent)}
|
|
9
|
+
& .pnf .req div{display:flex;gap:12px;padding:12px 16px;font-family:var(--lp-font-mono);font-size:13.5px;min-width:0}
|
|
10
|
+
& .pnf .req div+div{border-top:1px solid color-mix(in srgb,var(--lp-fg) 10%,transparent);color:var(--lp-muted)}
|
|
11
|
+
& .pnf .req em{font-style:normal;color:#22c55e;flex:none}
|
|
12
|
+
& .pnf .req strong{color:#f43f5e;flex:none}
|
|
13
|
+
& .pnf p{margin:14px 0 0;color:var(--lp-muted);font-size:15px;max-width:44ch}
|
|
14
|
+
`,setup(ctx){let c=ctx.copy,where=path(),head=ctx.params.request?`<div class="req" aria-hidden="true"><div><em>GET</em><code>${esc(where)}</code></div><div><strong>${esc(c.code)}</strong><span>Not Found</span></div></div>`:`<div class="chip"><b>${esc(c.code)}</b><code>${esc(where)}</code></div>`,el=layer(ctx,"pnf",`${head}<h1>${sr(c.code)}${esc(c.title)}</h1><p>${esc(c.message)}</p>`);return el.append(actions(ctx)),{destroy:()=>el.remove()}}};export{path_not_found_default as default};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
interface Params {
|
|
2
|
+
deep: string;
|
|
3
|
+
shallow: string;
|
|
4
|
+
land: string;
|
|
5
|
+
high: string;
|
|
6
|
+
ice: string;
|
|
7
|
+
atmosphere: string;
|
|
8
|
+
/** 0 terrestrial · 1 gas giant · 2 lava */
|
|
9
|
+
type: number;
|
|
10
|
+
seaLevel: number;
|
|
11
|
+
clouds: number;
|
|
12
|
+
rings: number;
|
|
13
|
+
ringColor: string;
|
|
14
|
+
cityLights: number;
|
|
15
|
+
moon: boolean;
|
|
16
|
+
spin: number;
|
|
17
|
+
}
|
|
18
|
+
declare const _default: import("..").SceneDef<Params>;
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import{shaderScene}from"../chunks/chunk-B4TY5M55.js";import{HASH,NOISE,POST}from"../chunks/chunk-SH72TE6I.js";import{linear}from"../chunks/chunk-FVGCB66F.js";import"../chunks/chunk-KIYSQVWX.js";import"../chunks/chunk-7XMDQMDO.js";var FRAG=`
|
|
2
|
+
uniform vec3 uDeep, uShallow, uLand, uHigh, uIce, uAtmo, uRingCol;
|
|
3
|
+
uniform float uType, uSea, uClouds, uRings, uCity, uMoon, uSpin;
|
|
4
|
+
${HASH}
|
|
5
|
+
${NOISE}
|
|
6
|
+
${POST}
|
|
7
|
+
|
|
8
|
+
const vec3 SUN = normalize(vec3(-0.8, 0.35, 0.55));
|
|
9
|
+
|
|
10
|
+
mat3 rotY(float a){ float c = cos(a), s = sin(a); return mat3(c,0,-s, 0,1,0, s,0,c); }
|
|
11
|
+
mat3 rotX(float a){ float c = cos(a), s = sin(a); return mat3(1,0,0, 0,c,s, 0,-s,c); }
|
|
12
|
+
|
|
13
|
+
float sphere(vec3 ro, vec3 rd, vec3 c, float r) {
|
|
14
|
+
vec3 oc = ro - c;
|
|
15
|
+
float b = dot(oc, rd), h = b * b - dot(oc, oc) + r * r;
|
|
16
|
+
if (h < 0.0) return -1.0;
|
|
17
|
+
return -b - sqrt(h);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
vec3 stars(vec3 d) {
|
|
21
|
+
vec3 p = d * 220.0;
|
|
22
|
+
vec3 id = floor(p);
|
|
23
|
+
float h = hash13(id);
|
|
24
|
+
vec3 c = id + 0.5 + (vec3(hash13(id + 1.0), hash13(id + 2.0), hash13(id + 3.0)) - 0.5) * 0.7;
|
|
25
|
+
float s = smoothstep(0.32, 0.0, length(p - c)) * step(0.987, h) * (h - 0.987) * 70.0;
|
|
26
|
+
return vec3(0.8, 0.88, 1.0) * s;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
vec3 surface(vec3 q, out float spec, out float night) {
|
|
30
|
+
spec = 0.0; night = 0.0;
|
|
31
|
+
if (uType > 0.5 && uType < 1.5) {
|
|
32
|
+
// gas giant bands
|
|
33
|
+
float lat = q.y;
|
|
34
|
+
float w = fbm(vec2(lat * 6.0, 0.0) + vec2(fbm(q.xz * 2.5 + uTime * 0.01), 0.0)) ;
|
|
35
|
+
float bands = sin(lat * 22.0 + w * 6.0) * 0.5 + 0.5;
|
|
36
|
+
vec3 c = mix(uLand, uHigh, bands);
|
|
37
|
+
c = mix(c, uShallow, smoothstep(0.55, 0.8, fbm(vec2(lat * 30.0, atan(q.z, q.x) * 2.0))) * 0.4);
|
|
38
|
+
// storm eye
|
|
39
|
+
float storm = smoothstep(0.16, 0.0, length(vec2(atan(q.z, q.x) - 0.8, (q.y + 0.35) * 2.2)));
|
|
40
|
+
return mix(c, uIce, storm * 0.8);
|
|
41
|
+
}
|
|
42
|
+
float h = fbm3(q * 1.6) * 0.65 + fbm3(q * 4.5 + 7.0) * 0.35;
|
|
43
|
+
float lat = abs(q.y);
|
|
44
|
+
if (uType > 1.5) {
|
|
45
|
+
// lava world: dark crust, glowing cracks
|
|
46
|
+
float cr = abs(fbm3(q * 3.0) - 0.5);
|
|
47
|
+
vec3 c = mix(uLand, uHigh, smoothstep(0.4, 0.7, h));
|
|
48
|
+
night = smoothstep(0.05, 0.0, cr) * 2.5 + smoothstep(uSea, uSea - 0.05, h) * 1.5;
|
|
49
|
+
return c;
|
|
50
|
+
}
|
|
51
|
+
if (h < uSea) {
|
|
52
|
+
spec = 1.0;
|
|
53
|
+
return mix(uDeep, uShallow, smoothstep(uSea - 0.12, uSea, h));
|
|
54
|
+
}
|
|
55
|
+
vec3 c = mix(uLand, uHigh, smoothstep(uSea + 0.04, uSea + 0.22, h));
|
|
56
|
+
c = mix(c, uIce, smoothstep(0.72, 0.86, lat + (h - uSea) * 0.4));
|
|
57
|
+
night = uCity * step(0.62, vnoise(q.xz * 40.0 + q.y * 20.0)) * smoothstep(0.7, 0.3, lat) * smoothstep(uSea, uSea + 0.05, h);
|
|
58
|
+
return c;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
void main() {
|
|
62
|
+
vec2 fc = gl_FragCoord.xy;
|
|
63
|
+
vec2 uv = (fc - 0.5 * uRes) / uRes.y;
|
|
64
|
+
float aspect = uRes.x / uRes.y;
|
|
65
|
+
float t = uTime;
|
|
66
|
+
|
|
67
|
+
// planet sits right of centre on wide screens, above the copy on narrow ones
|
|
68
|
+
vec3 pc = aspect > 1.15 ? vec3(0.95, 0.02, 0.0) : vec3(0.0, 0.55, 0.0);
|
|
69
|
+
float pr = aspect > 1.15 ? 1.0 : 0.82;
|
|
70
|
+
vec3 ro = vec3(uMouse.x * 0.25, uMouse.y * 0.15, 4.2);
|
|
71
|
+
vec3 rd = normalize(vec3(uv * 1.0 - (ro.xy * 0.24), -1.6));
|
|
72
|
+
|
|
73
|
+
vec3 col = stars(rd);
|
|
74
|
+
// ring plane, tilted
|
|
75
|
+
mat3 tilt = rotX(0.42) * rotY(0.3);
|
|
76
|
+
vec3 rn = tilt * vec3(0.0, 1.0, 0.0);
|
|
77
|
+
|
|
78
|
+
float tp = sphere(ro, rd, pc, pr);
|
|
79
|
+
// moon
|
|
80
|
+
float ma = t * 0.12;
|
|
81
|
+
vec3 mc = pc + vec3(cos(ma) * 2.0, sin(ma) * 0.35, sin(ma) * 2.0) * pr;
|
|
82
|
+
float tm = uMoon > 0.5 ? sphere(ro, rd, mc, 0.12 * pr) : -1.0;
|
|
83
|
+
|
|
84
|
+
// atmosphere halo (outside the disc)
|
|
85
|
+
vec3 oc = ro - pc;
|
|
86
|
+
float b = dot(oc, rd);
|
|
87
|
+
float closest = sqrt(max(dot(oc, oc) - b * b, 0.0));
|
|
88
|
+
float halo = exp(-max(closest - pr, 0.0) / (0.06 * pr)) * step(pr, closest);
|
|
89
|
+
vec3 toP = normalize(pc - ro);
|
|
90
|
+
float lit = clamp(dot(normalize(cross(cross(toP, rd), toP) + 1e-5), SUN) * 0.5 + 0.6, 0.0, 1.0);
|
|
91
|
+
col += uAtmo * halo * lit * 0.9;
|
|
92
|
+
|
|
93
|
+
if (tp > 0.0) {
|
|
94
|
+
vec3 p = ro + rd * tp;
|
|
95
|
+
vec3 n = normalize(p - pc);
|
|
96
|
+
vec3 q = rotY(t * 0.04 * uSpin) * rotX(0.25) * n;
|
|
97
|
+
float spec, night;
|
|
98
|
+
vec3 albedo = surface(q, spec, night);
|
|
99
|
+
float dif = max(dot(n, SUN), 0.0);
|
|
100
|
+
float term = smoothstep(-0.12, 0.2, dot(n, SUN));
|
|
101
|
+
vec3 c = albedo * (dif * 1.4 + 0.015);
|
|
102
|
+
vec3 h = normalize(SUN - rd);
|
|
103
|
+
c += vec3(1.0, 0.95, 0.85) * pow(max(dot(n, h), 0.0), 60.0) * spec * 0.6 * dif;
|
|
104
|
+
// clouds and their shadows
|
|
105
|
+
if (uClouds > 0.0) {
|
|
106
|
+
vec3 cq = rotY(t * 0.055 * uSpin) * rotX(0.25) * n;
|
|
107
|
+
float cl = smoothstep(1.0 - uClouds, 1.0 - uClouds + 0.3, fbm3(cq * 2.4 + 3.0));
|
|
108
|
+
c = mix(c, vec3(1.0) * (dif * 1.3 + 0.02), cl * 0.9);
|
|
109
|
+
}
|
|
110
|
+
c += vec3(1.0, 0.62, 0.25) * night * (1.0 - term) * 0.9;
|
|
111
|
+
if (uType > 1.5) c += vec3(1.0, 0.35, 0.08) * night * 0.7;
|
|
112
|
+
// rim atmosphere
|
|
113
|
+
float fres = pow(1.0 - max(dot(n, -rd), 0.0), 3.0);
|
|
114
|
+
c += uAtmo * fres * (0.25 + term) * 1.2;
|
|
115
|
+
col = c;
|
|
116
|
+
// ring shadow on the planet
|
|
117
|
+
if (uRings > 0.0) {
|
|
118
|
+
float s = dot(pc - p, rn) / dot(SUN, rn);
|
|
119
|
+
vec3 rp = p + SUN * s - pc;
|
|
120
|
+
float rr = length(rp) / pr;
|
|
121
|
+
if (s > 0.0 && rr > 1.35 && rr < 2.3) col *= 1.0 - 0.6 * uRings;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
if (tm > 0.0 && (tp < 0.0 || tm < tp)) {
|
|
125
|
+
vec3 p = ro + rd * tm;
|
|
126
|
+
vec3 n = normalize(p - mc);
|
|
127
|
+
float crater = vnoise(n.xy * 9.0 + n.z * 4.0) * 0.4 + vnoise(n.yz * 25.0) * 0.2;
|
|
128
|
+
col = vec3(0.6, 0.58, 0.55) * (0.7 + crater) * max(dot(n, SUN), 0.0) + 0.005;
|
|
129
|
+
}
|
|
130
|
+
// rings
|
|
131
|
+
if (uRings > 0.0) {
|
|
132
|
+
float tr = dot(pc - ro, rn) / dot(rd, rn);
|
|
133
|
+
if (tr > 0.0) {
|
|
134
|
+
vec3 rp = ro + rd * tr - pc;
|
|
135
|
+
float rr = length(rp) / pr;
|
|
136
|
+
if (rr > 1.35 && rr < 2.3 && (tp < 0.0 || tr < tp)) {
|
|
137
|
+
float band = fbm(vec2(rr * 40.0, 0.0)) * 0.7 + 0.3 * sin(rr * 120.0);
|
|
138
|
+
float a = smoothstep(1.35, 1.45, rr) * smoothstep(2.3, 2.15, rr) * (0.35 + 0.65 * band) * step(abs(rr - 1.9), 0.4 - 0.01) ;
|
|
139
|
+
a *= 1.0 - 0.75 * smoothstep(0.02, 0.0, abs(rr - 1.82));
|
|
140
|
+
// planet shadow on rings
|
|
141
|
+
vec3 w = ro + rd * tr;
|
|
142
|
+
float sh = sphere(w, SUN, pc, pr) > 0.0 ? 0.15 : 1.0;
|
|
143
|
+
vec3 rc = uRingCol * (0.25 + 0.9 * abs(dot(rn, SUN))) * sh;
|
|
144
|
+
col = mix(col, rc, a * uRings);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
col = aces(col * 1.1);
|
|
150
|
+
col = toSRGB(col);
|
|
151
|
+
col += grain(fc, t) * 0.012;
|
|
152
|
+
fragColor = vec4(col, 1.0);
|
|
153
|
+
}
|
|
154
|
+
`,planet_default={id:"planet",name:"Lonely Planet",description:"A small procedural world turning slowly in the dark, with clouds, oceans, night lights, rings and a moon.",category:"Space",kind:"3d",motion:"live",tags:["webgl","space","planet","procedural","calm","dark"],layout:"left",copy:{eyebrow:"Planet 404",title:"No signs of this page.",message:"We scanned the whole planet: oceans, clouds and city lights. Your page isn't on it.",actions:[{label:"Fly home",href:"/",variant:"primary"},{label:"Mission control",href:"/contact",variant:"secondary"}]},params:{deep:"#03142e",shallow:"#0b4d78",land:"#3e5a2c",high:"#8a7a58",ice:"#f2f5f7",atmosphere:"#4f8dff",type:0,seaLevel:.5,clouds:.45,rings:0,ringColor:"#d9c7a4",cityLights:1,moon:!0,spin:1},theme:{bg:"#000207",accent:"#e8f0ff","accent-fg":"#000207"},presetName:"Terra",presets:{jungle:{name:"Jungle World",eyebrow:"Planet 404 \xB7 Overgrown",title:"Lost in the canopy.",params:{deep:"#04202a",shallow:"#0b6b6b",land:"#1f6b2a",high:"#3a8a2a",ice:"#e9f7e9",atmosphere:"#7fffb0",seaLevel:.42,clouds:.6,cityLights:0},theme:{accent:"#c9ffd9","accent-fg":"#021a0a"}},candy:{name:"Candy Planet",eyebrow:"Planet 404 \xB7 Sweet",params:{deep:"#5a1a6b",shallow:"#c25cd6",land:"#ff9ec7",high:"#ffd6e8",ice:"#ffffff",atmosphere:"#ffb3e6",seaLevel:.48,clouds:.4,cityLights:0},theme:{accent:"#ffd6ef","accent-fg":"#2a0a33"}},"ice-giant":{name:"Ice Giant",eyebrow:"Planet 404 \xB7 Cold and far",params:{type:1,land:"#6fb3e6",high:"#cfeaff",shallow:"#3a7ab8",ice:"#ffffff",atmosphere:"#9fd8ff",rings:.7,ringColor:"#bcd8f0",clouds:0,cityLights:0},theme:{accent:"#dff2ff","accent-fg":"#04122a"}},toxic:{name:"Sulphur",eyebrow:"Planet 404 \xB7 Toxic",title:"Do not land here.",params:{type:1,land:"#c9b33a",high:"#f2e88a",shallow:"#8a7a1a",ice:"#fff6c9",atmosphere:"#e6ff6b",rings:0,clouds:0,cityLights:0},theme:{accent:"#f2ff9e","accent-fg":"#1a1a02"}},dune:{name:"Dune",eyebrow:"Planet 404 \xB7 Arid",title:"Nothing out here but sand.",params:{deep:"#5a2a14",shallow:"#8a4423",land:"#c46a3a",high:"#e7b07a",ice:"#f4e3d0",atmosphere:"#ff9a5c",seaLevel:.2,clouds:.1,cityLights:0},theme:{accent:"#ffd2b0","accent-fg":"#1a0a03"}},glacier:{name:"Glacier",eyebrow:"Planet 404 \xB7 Frozen",title:"This page froze over.",params:{deep:"#0a2a44",shallow:"#3f88b5",land:"#b9d5e6",high:"#ffffff",ice:"#ffffff",atmosphere:"#9fd3ff",seaLevel:.42,clouds:.35,cityLights:0},theme:{accent:"#e6f6ff","accent-fg":"#071a2a"}},giant:{name:"Ringed Giant",eyebrow:"Planet 404 \xB7 Gas giant",title:"No solid ground for this page.",message:"It's all gas and rings out here. Let's head back to something solid.",params:{type:1,land:"#c9a273",high:"#f1dcb8",shallow:"#a86b3c",ice:"#fff2dc",atmosphere:"#f0c48a",rings:1,clouds:0,cityLights:0,moon:!0},theme:{accent:"#f4dfbd","accent-fg":"#1f1405"}},inferno:{name:"Inferno",eyebrow:"Planet 404 \xB7 Volcanic",title:"This page burned up on entry.",params:{type:2,land:"#140a08",high:"#3a2a24",atmosphere:"#ff5a1f",seaLevel:.36,clouds:0,cityLights:0},theme:{accent:"#ff8a4c","accent-fg":"#1a0500"}},ocean:{name:"Ocean World",eyebrow:"Planet 404 \xB7 Water",title:"Lost at sea, planet-wide.",params:{seaLevel:.78,deep:"#021a3a",shallow:"#0e6aa0",clouds:.55,cityLights:0,atmosphere:"#5fb2ff"}}},css:`&{--lp-code-size:clamp(84px,11cqw,170px)}
|
|
155
|
+
& .lp-overlay{padding-left:max(16px,calc(var(--lp-pad) * 1.6))}
|
|
156
|
+
& .lp-title{max-width:12ch}
|
|
157
|
+
@container (max-width:820px){& .lp-overlay{justify-content:flex-end;align-items:center}& .lp-head,& .lp-body{align-items:center;text-align:center}& .lp-actions{justify-content:center}& .lp-title{max-width:none}}`,setup(ctx){let p=ctx.params;return shaderScene(ctx,{frag:FRAG,uniforms:()=>({uDeep:linear(p.deep),uShallow:linear(p.shallow),uLand:linear(p.land),uHigh:linear(p.high),uIce:linear(p.ice),uAtmo:linear(p.atmosphere),uRingCol:linear(p.ringColor),uType:p.type,uSea:p.seaLevel,uClouds:p.clouds,uRings:p.rings,uCity:p.cityLights,uMoon:p.moon?1:0,uSpin:p.spin})})}};export{planet_default as default};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import{HASH,NOISE,POST,getGL,pass,swapTargets,texture}from"../chunks/chunk-SH72TE6I.js";import{linear}from"../chunks/chunk-FVGCB66F.js";import"../chunks/chunk-KIYSQVWX.js";import"../chunks/chunk-7XMDQMDO.js";var SIM=`
|
|
2
|
+
uniform sampler2D uPrev;
|
|
3
|
+
uniform vec2 uTexel;
|
|
4
|
+
uniform vec4 uDrop; // x, y (0..1), radius, strength
|
|
5
|
+
void main() {
|
|
6
|
+
vec2 uv = vUv;
|
|
7
|
+
vec4 s = texture(uPrev, uv);
|
|
8
|
+
float h = s.r, v = s.g;
|
|
9
|
+
float avg = (texture(uPrev, uv + vec2(uTexel.x, 0.0)).r + texture(uPrev, uv - vec2(uTexel.x, 0.0)).r +
|
|
10
|
+
texture(uPrev, uv + vec2(0.0, uTexel.y)).r + texture(uPrev, uv - vec2(0.0, uTexel.y)).r) * 0.25;
|
|
11
|
+
v += (avg - h) * 2.0;
|
|
12
|
+
v *= 0.992;
|
|
13
|
+
h += v;
|
|
14
|
+
h *= 0.998;
|
|
15
|
+
vec2 d = (uv - uDrop.xy) * vec2(uTexel.y / uTexel.x, 1.0);
|
|
16
|
+
float r = length(d);
|
|
17
|
+
if (uDrop.z > 0.0) h -= uDrop.w * smoothstep(uDrop.z, 0.0, r);
|
|
18
|
+
fragColor = vec4(h, v, 0.0, 1.0);
|
|
19
|
+
}
|
|
20
|
+
`,RENDER=`
|
|
21
|
+
uniform sampler2D uH;
|
|
22
|
+
uniform sampler2D uFloor;
|
|
23
|
+
uniform vec2 uTexel;
|
|
24
|
+
uniform vec3 uWater, uDeep, uSky;
|
|
25
|
+
uniform float uKoi, uLilies;
|
|
26
|
+
${HASH}
|
|
27
|
+
${NOISE}
|
|
28
|
+
${POST}
|
|
29
|
+
|
|
30
|
+
vec2 koiPos(float i, float t) {
|
|
31
|
+
float a = t * (0.13 + i * 0.05) + i * 2.4;
|
|
32
|
+
return vec2(0.5 + cos(a) * (0.28 - i * 0.05), 0.5 + sin(a * 1.3) * (0.22 + i * 0.04));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
vec4 koi(vec2 uv, float t, float aspect) {
|
|
36
|
+
vec4 acc = vec4(0.0);
|
|
37
|
+
for (int k = 0; k < 3; k++) {
|
|
38
|
+
float i = float(k);
|
|
39
|
+
vec2 c = koiPos(i, t);
|
|
40
|
+
vec2 dir = normalize(koiPos(i, t + 0.05) - c);
|
|
41
|
+
vec2 q = (uv - c) * vec2(aspect, 1.0);
|
|
42
|
+
q = vec2(dot(q, dir), dot(q, vec2(-dir.y, dir.x)));
|
|
43
|
+
float wig = sin(q.x * 40.0 - t * 8.0) * 0.012 * smoothstep(0.0, -0.08, q.x);
|
|
44
|
+
q.y += wig;
|
|
45
|
+
float body = length(q / vec2(0.075, 0.022)) - 1.0;
|
|
46
|
+
float tail = length((q - vec2(-0.085, 0.0)) / vec2(0.025, 0.02)) - 1.0;
|
|
47
|
+
float d = min(body, tail);
|
|
48
|
+
float m = smoothstep(0.15, -0.1, d);
|
|
49
|
+
float spots = step(0.5, vnoise(q * 60.0 + i * 7.0));
|
|
50
|
+
vec3 col = mix(vec3(1.0, 0.95, 0.9), i == 1.0 ? vec3(0.05) : vec3(1.0, 0.35, 0.05), spots);
|
|
51
|
+
acc = mix(acc, vec4(col, 1.0), m * (1.0 - acc.a));
|
|
52
|
+
}
|
|
53
|
+
return acc;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
void main() {
|
|
57
|
+
vec2 uv = vUv;
|
|
58
|
+
float aspect = uRes.x / uRes.y;
|
|
59
|
+
float t = uTime;
|
|
60
|
+
float hx = texture(uH, uv + vec2(uTexel.x, 0.0)).r - texture(uH, uv - vec2(uTexel.x, 0.0)).r;
|
|
61
|
+
float hy = texture(uH, uv + vec2(0.0, uTexel.y)).r - texture(uH, uv - vec2(0.0, uTexel.y)).r;
|
|
62
|
+
vec3 n = normalize(vec3(-hx * 6.0, -hy * 6.0, 1.0));
|
|
63
|
+
// the pond floor, refracted
|
|
64
|
+
vec2 ruv = uv + n.xy * 0.05;
|
|
65
|
+
vec3 floorCol = texture(uFloor, ruv).rgb;
|
|
66
|
+
// koi swim between floor and surface, refracted too
|
|
67
|
+
if (uKoi > 0.5) {
|
|
68
|
+
vec4 k = koi(uv + n.xy * 0.035, t, aspect);
|
|
69
|
+
// shadow of the koi on the floor
|
|
70
|
+
vec4 ks = koi(uv + n.xy * 0.035 - vec2(0.012, -0.018), t, aspect);
|
|
71
|
+
floorCol *= 1.0 - ks.a * 0.35;
|
|
72
|
+
floorCol = mix(floorCol, k.rgb, k.a * 0.92);
|
|
73
|
+
}
|
|
74
|
+
vec3 col = floorCol * uWater;
|
|
75
|
+
// depth tint toward the edges
|
|
76
|
+
col = mix(col, uDeep, 0.25 + 0.45 * smoothstep(0.2, 0.75, length((uv - 0.5) * vec2(aspect, 1.0))));
|
|
77
|
+
// caustics
|
|
78
|
+
float caus = pow(abs(sin(fbm(uv * vec2(aspect, 1.0) * 8.0 + n.xy * 3.0 + t * 0.2) * 10.0)), 8.0);
|
|
79
|
+
col += uSky * caus * 0.06;
|
|
80
|
+
// sky reflection and sun glint
|
|
81
|
+
float fres = 0.04 + 0.5 * pow(1.0 - n.z, 2.0);
|
|
82
|
+
col = mix(col, uSky, fres * 0.5);
|
|
83
|
+
vec3 L = normalize(vec3(-0.4, 0.5, 0.75));
|
|
84
|
+
col += vec3(1.0) * pow(max(dot(reflect(-L, n), vec3(0, 0, 1)), 0.0), 120.0) * 1.2;
|
|
85
|
+
// lily pads float on top
|
|
86
|
+
if (uLilies > 0.5) {
|
|
87
|
+
for (int i = 0; i < 5; i++) {
|
|
88
|
+
float fi = float(i);
|
|
89
|
+
vec2 c = vec2(hash11(fi * 3.3), hash11(fi * 7.1)) * 0.9 + 0.05 + vec2(sin(t * 0.1 + fi), cos(t * 0.08 + fi)) * 0.01;
|
|
90
|
+
vec2 q = (uv - c) * vec2(aspect, 1.0) + n.xy * 0.004;
|
|
91
|
+
float r = 0.05 + hash11(fi) * 0.035;
|
|
92
|
+
float a = atan(q.y, q.x) + fi;
|
|
93
|
+
float notch = smoothstep(0.0, 0.25, abs(mod(a, 6.28318) - 0.2));
|
|
94
|
+
float pad = smoothstep(r, r * 0.97, length(q)) * notch;
|
|
95
|
+
vec3 pc = vec3(0.18, 0.45, 0.16) * (0.85 + 0.15 * sin(a * 9.0)) + vec3(0.1) * smoothstep(r * 0.2, 0.0, length(q));
|
|
96
|
+
col = mix(col * (1.0 - smoothstep(r * 1.15, r * 0.9, length(q - vec2(0.006, -0.008))) * 0.25), pc, pad);
|
|
97
|
+
if (fi < 2.0) {
|
|
98
|
+
float fl = smoothstep(r * 0.32, r * 0.25, length(q - vec2(r * 0.2, 0.0)));
|
|
99
|
+
col = mix(col, vec3(1.0, 0.75, 0.85), fl);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
col = toSRGB(aces(col * 1.2));
|
|
104
|
+
fragColor = vec4(col, 1.0);
|
|
105
|
+
}
|
|
106
|
+
`,pond_default={id:"pond",name:"Koi Pond",description:"A real-time water simulation. Koi glide under the surface, the 404 is laid in stones on the bottom, and the water ripples wherever you touch it.",category:"Nature",kind:"2d",motion:"live",tags:["webgl","water","simulation","ripples","zen","calm","interactive","nature"],layout:"bottom",codeInScene:!0,copy:{eyebrow:"Still water",title:"Only ripples here.",message:"Touch the water if you like. The page you're looking for isn't at the bottom of this pond.",actions:[{label:"Back to the garden",href:"/",variant:"primary"}]},params:{water:"#bfe6dc",deep:"#0f3b3a",sky:"#cfe8ff",stone:"#e9e4da",koi:!0,lilies:!0,rain:.4},theme:{bg:"#1d4a45",fg:"#f0fbf8",accent:"#f0fbf8","accent-fg":"#123430"},presetName:"Garden",presets:{sakura:{name:"Sakura",params:{water:"#f2d6e0",deep:"#3a1a2a",sky:"#ffe6ef",lilies:!0,rain:.3},theme:{bg:"#4a2a3a",accent:"#ffe6ef","accent-fg":"#3a1a2a"}},jade:{name:"Jade",params:{water:"#9fe6c9",deep:"#063a2a",sky:"#d9fff2",koi:!0},theme:{bg:"#0a3a2a",accent:"#d9fff2","accent-fg":"#063a2a"}},night:{name:"Moonlit",params:{water:"#6f8fb3",deep:"#050c1a",sky:"#7f93c9",koi:!0,lilies:!0,rain:.2},theme:{bg:"#0a1426",accent:"#e8eeff","accent-fg":"#0a1426"}},autumn:{name:"Autumn",params:{water:"#d9c79b",deep:"#2a2410",sky:"#ffe2b8",lilies:!1,rain:.5},theme:{bg:"#3a2f12",accent:"#ffd28a","accent-fg":"#2a1e05"}},rain:{name:"Rain Shower",eyebrow:"Raining",params:{rain:3,lilies:!0}}},css:"& .lp-body{text-shadow:0 2px 16px rgba(0,0,0,.45)}",setup(ctx){let p=ctx.params,rnd=ctx.random,canvas=ctx.canvas({adaptive:!0}),gl=getGL(canvas),sim=pass(gl,SIM),render=pass(gl,RENDER),simW=256,simH=160,st=swapTargets(gl,simW,simH,{float:!0,channels:2}),floor=document.createElement("canvas"),floorTex=null;function drawFloor(){let H=Math.round(1024*ctx.height/Math.max(1,ctx.width));floor.width=1024,floor.height=H;let g=floor.getContext("2d");g.fillStyle="#5b6b52",g.fillRect(0,0,1024,H);for(let i=0;i<2600;i++){let r=1+rnd()*3.5,v=60+rnd()*80;g.fillStyle=`rgb(${v+10},${v+12},${v})`,g.beginPath(),g.ellipse(rnd()*1024,rnd()*H,r,r*(.6+rnd()*.4),rnd()*3,0,Math.PI*2),g.fill()}let tc=document.createElement("canvas");tc.width=200,tc.height=Math.round(200*(H/1024));let tg=tc.getContext("2d");tg.fillStyle="#fff",tg.font=`900 ${tc.height*.5}px "Inter",ui-sans-serif,system-ui,sans-serif`,tg.textAlign="center",tg.textBaseline="middle",tg.fillText(ctx.copy.code||"404",tc.width/2,tc.height*.4);let data=tg.getImageData(0,0,tc.width,tc.height).data,sx=1024/tc.width;for(let y=0;y<tc.height;y+=2)for(let x=0;x<tc.width;x+=2){if(data[(y*tc.width+x)*4+3]<128)continue;let cx=x*sx+(rnd()-.5)*sx,cy=y*sx+(rnd()-.5)*sx,r=sx*(.75+rnd()*.45);g.fillStyle="rgba(0,0,0,.25)",g.beginPath(),g.ellipse(cx+2,cy+3,r,r*.8,0,0,Math.PI*2),g.fill();let grd=g.createRadialGradient(cx-r*.3,cy-r*.3,0,cx,cy,r);grd.addColorStop(0,"#ffffff"),grd.addColorStop(1,p.stone),g.fillStyle=grd,g.beginPath(),g.ellipse(cx,cy,r,r*(.75+rnd()*.2),rnd()*3,0,Math.PI*2),g.fill()}for(let i=0;i<18;i++)g.save(),g.translate(rnd()*1024,rnd()*H),g.rotate(rnd()*6),g.fillStyle=`rgba(${120+rnd()*80},${70+rnd()*40},20,.8)`,g.beginPath(),g.ellipse(0,0,10,4,0,0,Math.PI*2),g.fill(),g.restore();floorTex?(gl.bindTexture(gl.TEXTURE_2D,floorTex),gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL,!0),gl.texImage2D(gl.TEXTURE_2D,0,gl.RGBA,gl.RGBA,gl.UNSIGNED_BYTE,floor),gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL,!1)):floorTex=texture(gl,floor,{filter:"linear"})}let resize=()=>{simW=320,simH=Math.max(80,Math.round(320*ctx.height/Math.max(1,ctx.width))),st.resize(simW,simH),drawFloor()};resize();let drops=[],lastPX=-1,lastPY=-1;ctx.on("pointerdown",()=>drops.push([ctx.pointer.x/ctx.width,1-ctx.pointer.y/ctx.height,.03,.9]));let rainAcc=0;return{resize,frame(t,dt){if(ctx.pointer.inside){let x=ctx.pointer.x/ctx.width,y=1-ctx.pointer.y/ctx.height;Math.hypot(x-lastPX,y-lastPY)>.004&&drops.push([x,y,.012,.25]),lastPX=x,lastPY=y}for(rainAcc+=dt*p.rain*2;rainAcc>1;)rainAcc-=1,drops.push([rnd(),rnd(),.008+rnd()*.01,.4+rnd()*.4]);let iters=dt===0?0:2;for(let i=0;i<iters;i++){let d=drops.shift()??[0,0,0,0];sim.draw({uPrev:st.read,uTexel:[1/simW,1/simH],uDrop:d},st.write),st.swap()}drops.length=Math.min(drops.length,8),render.draw({uTime:t,uH:st.read,uFloor:floorTex,uTexel:[1/simW,1/simH],uWater:linear(p.water),uDeep:linear(p.deep),uSky:linear(p.sky),uKoi:p.koi?1:0,uLilies:p.lilies?1:0})}}}};export{pond_default as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{GAME_CSS,PIXEL_FONT,hud,input}from"../chunks/chunk-MNUNTC4L.js";import{canvas2d}from"../chunks/chunk-DAZOIOF7.js";import{rgba}from"../chunks/chunk-FVGCB66F.js";import"../chunks/chunk-3ISI6SOJ.js";import"../chunks/chunk-KIYSQVWX.js";import"../chunks/chunk-7XMDQMDO.js";var pong_default={id:"pong",name:"Table Tennis",description:"The original video game, playing itself while the error code glows behind the net. Move your mouse or press W and S to take the left paddle.",category:"Games",kind:"2d",motion:"game",tags:["canvas","game","playable","pong","retro","minimal"],layout:"bottom",codeInScene:!0,copy:{eyebrow:"Player 1, ready",title:"This link bounced.",message:"The page you were after was returned to sender. Grab the paddle or go back to the homepage.",actions:[{label:"Back to home",href:"/",variant:"primary"}]},params:{bg:"#0b0b0b",fg:"#f2f2f2",dim:"#262626",trail:!0},theme:{bg:"#0b0b0b",fg:"#f2f2f2",accent:"#f2f2f2","accent-fg":"#0b0b0b","font-display":"var(--lp-font-mono)","title-weight":"700"},presetName:"Classic",presets:{synth:{name:"Synthwave",params:{bg:"#12002a",fg:"#ff3bd4",dim:"#24064a",trail:!0},theme:{bg:"#12002a",fg:"#ffd6f7",accent:"#ff3bd4","accent-fg":"#fff"}},amber:{name:"Amber",params:{bg:"#0a0600",fg:"#ffb000",dim:"#1f1400",trail:!0},theme:{bg:"#0a0600",fg:"#ffe1a3",accent:"#ffb000","accent-fg":"#0a0600"}},ice:{name:"Ice Hockey",params:{bg:"#eaf6ff",fg:"#0b3a6b",dim:"#d4e8f8",trail:!1},theme:{bg:"#eaf6ff",fg:"#0b3a6b",accent:"#d6281a","accent-fg":"#fff"}},tennis:{name:"Clay Court",params:{bg:"#c4562a",fg:"#ffffff",dim:"#d46a3c",trail:!1},theme:{bg:"#c4562a",fg:"#fff",accent:"#fff","accent-fg":"#c4562a"}},table:{name:"Ping Pong Table",params:{bg:"#155e3b",fg:"#ffffff",dim:"#1c7149",trail:!1},theme:{bg:"#155e3b",accent:"#fff","accent-fg":"#155e3b"}},paper:{name:"Paper",params:{bg:"#f2efe8",fg:"#121212",dim:"#e2ddd2",trail:!1},theme:{bg:"#f2efe8",fg:"#121212",accent:"#121212","accent-fg":"#f2efe8"}},neon:{name:"Neon",params:{bg:"#08001a",fg:"#00f0ff",dim:"#1a0b3d",trail:!0},theme:{bg:"#08001a",fg:"#c9fbff",accent:"#00f0ff","accent-fg":"#08001a"}}},css:GAME_CSS,setup(ctx){let p=ctx.params,c=canvas2d(ctx),inp=input(ctx,{pointerPlays:!0}),rnd=ctx.random,f={x:0,y:0,w:0,h:0},L=0,R=0,pw=10,ph=80,ball={x:0,y:0,vx:0,vy:0},trail=[],sl=0,sr=0,serve=.8;function layout(){f={x:Math.max(20,c.w*.06),y:Math.max(16,c.h*.05),w:c.w-2*Math.max(20,c.w*.06),h:c.h*.58},pw=Math.max(8,f.w*.009),ph=f.h*.18,L=R=f.y+f.h/2,reset(1)}function reset(dir){ball={x:f.x+f.w/2,y:f.y+f.h/2,vx:0,vy:0},serve=.7;let sp=f.w*.55,a=(rnd()-.5)*.9;ball.vx=Math.cos(a)*sp*dir,ball.vy=Math.sin(a)*sp}return layout(),{resize(){c.reset(),layout()},frame(t,dt){let g=c.g;if(c.reset(),(!ctx.reducedMotion||inp.playing)&&dt>0){let aiSpeed=f.h*1.5,track=(cur,target)=>cur+Math.sign(target-cur)*Math.min(Math.abs(target-cur),aiSpeed*dt);inp.playing?(inp.up&&(L-=f.h*1.6*dt),inp.down&&(L+=f.h*1.6*dt),ctx.pointer.inside&&!(inp.up||inp.down)&&(L+=(ctx.pointer.y-L)*Math.min(1,dt*16))):L=track(L,ball.vx<0?ball.y+Math.sin(t)*ph*.3:f.y+f.h/2),R=track(R,ball.vx>0?ball.y+Math.sin(t*1.3)*ph*.35:f.y+f.h/2),L=Math.max(f.y+ph/2,Math.min(f.y+f.h-ph/2,L)),R=Math.max(f.y+ph/2,Math.min(f.y+f.h-ph/2,R)),serve>0?serve-=dt:(ball.x+=ball.vx*dt,ball.y+=ball.vy*dt),(ball.y<f.y+pw/2||ball.y>f.y+f.h-pw/2)&&(ball.vy*=-1,ball.y=Math.max(f.y+pw/2,Math.min(f.y+f.h-pw/2,ball.y)));let hit=(px,py,dir)=>{if(Math.abs(ball.x-px)<pw&&Math.abs(ball.y-py)<ph/2+pw/2&&Math.sign(ball.vx)===-dir){let off=(ball.y-py)/(ph/2),sp=Math.min(f.w*1.3,Math.hypot(ball.vx,ball.vy)*1.05),a=off*.85;ball.vx=Math.cos(a)*sp*dir,ball.vy=Math.sin(a)*sp}};hit(f.x+pw*2,L,1),hit(f.x+f.w-pw*2,R,-1),ball.x<f.x-20&&(sr++,reset(1)),ball.x>f.x+f.w+20&&(sl++,reset(-1)),trail.push({x:ball.x,y:ball.y}),trail.length>14&&trail.shift()}g.fillStyle=p.bg,g.fillRect(0,0,c.w,c.h),g.fillStyle=p.dim,g.font=`900 ${f.h*.62}px ${PIXEL_FONT}`,g.textAlign="center",g.textBaseline="middle",g.fillText(ctx.copy.code,f.x+f.w/2,f.y+f.h/2),g.fillStyle=p.fg;for(let y=f.y;y<f.y+f.h;y+=pw*2.4)g.fillRect(f.x+f.w/2-pw/4,y,pw/2,pw*1.2);g.fillRect(f.x,f.y-pw/2,f.w,pw/2),g.fillRect(f.x,f.y+f.h,f.w,pw/2),g.fillRect(f.x+pw*1.5,L-ph/2,pw,ph),g.fillRect(f.x+f.w-pw*2.5,R-ph/2,pw,ph),p.trail&&trail.forEach((q,i)=>{g.fillStyle=rgba(p.fg,i/trail.length*.35),g.fillRect(q.x-pw/2,q.y-pw/2,pw,pw)}),g.fillStyle=p.fg,g.fillRect(ball.x-pw/2,ball.y-pw/2,pw,pw);let fs=Math.max(18,Math.min(42,f.w/22));hud(g,String(sl),f.x+f.w/2-fs*2,f.y+14,fs,p.fg,"center"),hud(g,String(sr),f.x+f.w/2+fs*2,f.y+14,fs,p.fg,"center"),!inp.playing&&Math.floor(t*1.6)%2===0&&hud(g,"DEMO \xB7 MOVE TO PLAY",f.x+f.w/2,f.y+f.h+16,Math.max(10,Math.min(14,c.w/90)),rgba(p.fg,.7),"center")}}}};export{pong_default as default};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{canvas2d}from"../chunks/chunk-DAZOIOF7.js";import{rgba}from"../chunks/chunk-FVGCB66F.js";import"../chunks/chunk-KIYSQVWX.js";import"../chunks/chunk-7XMDQMDO.js";var radar_default={id:"radar",name:"Radar Sweep",description:"A phosphor radar scope sweeps for the missing page. Blips flare up and fade, and the target never shows.",category:"Retro Tech",kind:"2d",motion:"live",tags:["canvas","radar","military","scope","green","search","dark"],layout:"right",codeInScene:!1,copy:{eyebrow:"Scanning\u2026",title:"No contact.",message:"We swept every sector for this page and got nothing back. Returning to base is advised.",actions:[{label:"Return to base",href:"/",variant:"primary"},{label:"Request support",href:"/contact",variant:"secondary"}]},params:{bg:"#020a05",phosphor:"#3dff8a",period:4,mode:"radar"},theme:{bg:"#020a05",fg:"#c9ffdc",accent:"#3dff8a","accent-fg":"#02140a","font-display":"var(--lp-font-mono)","title-weight":"600","code-color":"rgba(61,255,138,.85)"},presetName:"Air Defence",presets:{red:{name:"Red Alert",eyebrow:"Threat level: 404",params:{bg:"#0a0202",phosphor:"#ff3b3b"},theme:{bg:"#0a0202",fg:"#ffd6d6",accent:"#ff3b3b","accent-fg":"#0a0202","code-color":"rgba(255,59,59,.85)"}},weather:{name:"Weather Radar",eyebrow:"Doppler scan",title:"Clear skies. No page.",params:{bg:"#06121f",phosphor:"#5aff9a",period:6,mode:"radar"},theme:{bg:"#06121f",accent:"#5aff9a","accent-fg":"#06121f"}},sonar:{name:"Sonar",eyebrow:"Pinging\u2026",title:"Nothing in these waters.",params:{bg:"#010814",phosphor:"#3bd6ff",period:5,mode:"sonar"},theme:{bg:"#010814",fg:"#cdf3ff",accent:"#3bd6ff","accent-fg":"#011221","code-color":"rgba(59,214,255,.85)"}},amber:{name:"Air Traffic",eyebrow:"Tower to page\u2026",title:"Lost on approach.",params:{bg:"#0a0600",phosphor:"#ffb000",period:5},theme:{bg:"#0a0600",fg:"#ffe1a3",accent:"#ffb000","accent-fg":"#0a0600","code-color":"rgba(255,176,0,.85)"}}},css:`& .lp-overlay{padding-right:clamp(24px,8cqw,140px)}
|
|
2
|
+
& .lp-code{--lp-code-size:clamp(70px,9cqw,130px);font-family:var(--lp-font-mono);letter-spacing:-.02em;text-shadow:0 0 22px currentColor}
|
|
3
|
+
& .lp-head,& .lp-body{max-width:min(440px,40cqw)}
|
|
4
|
+
@container (max-width:760px){& .lp-head,& .lp-body{max-width:none}& .lp-overlay{justify-content:flex-end}}`,setup(ctx){let p=ctx.params,c=canvas2d(ctx),rnd=ctx.random,blips=[],last=0;return{resize(){c.reset()},frame(t,dt){let g=c.g;c.reset();let narrow=c.w<760,R=narrow?Math.min(c.w*.42,c.h*.3):Math.min(c.h*.42,c.w*.3),cx=narrow?c.w/2:c.w*.33,cy=narrow?c.h*.32:c.h/2,ang=t/p.period*Math.PI*2%(Math.PI*2);g.fillStyle=p.bg,g.fillRect(0,0,c.w,c.h);let glass=g.createRadialGradient(cx,cy,0,cx,cy,R);glass.addColorStop(0,rgba(p.phosphor,.08)),glass.addColorStop(1,rgba(p.phosphor,.02)),g.fillStyle=glass,g.beginPath(),g.arc(cx,cy,R,0,Math.PI*2),g.fill(),g.strokeStyle=rgba(p.phosphor,.28),g.lineWidth=1;for(let i=1;i<=4;i++)g.beginPath(),g.arc(cx,cy,R*i/4,0,Math.PI*2),g.stroke();for(let i=0;i<12;i++){let a=i/12*Math.PI*2;g.beginPath(),g.moveTo(cx+Math.cos(a)*R*.08,cy+Math.sin(a)*R*.08),g.lineTo(cx+Math.cos(a)*R,cy+Math.sin(a)*R),g.stroke()}for(let i=0;i<72;i++){let a=i/72*Math.PI*2,l=i%6===0?.94:.97;g.beginPath(),g.moveTo(cx+Math.cos(a)*R*l,cy+Math.sin(a)*R*l),g.lineTo(cx+Math.cos(a)*R,cy+Math.sin(a)*R),g.stroke()}if(p.mode==="radar"){for(let k=0;k<40;k++){let a0=ang-k/40*1.2;g.fillStyle=rgba(p.phosphor,(1-k/40)*.14),g.beginPath(),g.moveTo(cx,cy),g.arc(cx,cy,R,a0-.03,a0),g.closePath(),g.fill()}g.strokeStyle=rgba(p.phosphor,.95),g.lineWidth=2,g.beginPath(),g.moveTo(cx,cy),g.lineTo(cx+Math.cos(ang)*R,cy+Math.sin(ang)*R),g.stroke()}else{let ph=t%p.period/p.period;for(let k=0;k<3;k++){let q=(ph+k/3)%1;g.strokeStyle=rgba(p.phosphor,(1-q)*.8),g.lineWidth=2,g.beginPath(),g.arc(cx,cy,R*q,0,Math.PI*2),g.stroke()}}dt>0&&t-last>.35&&(last=t,rnd()<.55&&blips.push({a:ang+(p.mode==="radar"?-.05:rnd()*6.28),r:.2+rnd()*.75,life:1,label:rnd()<.18?["/page?","unknown",ctx.copy.code,"no IFF"][Math.floor(rnd()*4)]:void 0}));for(let b of blips){if(b.life-=dt/(p.period*.9),b.life<=0)continue;let x=cx+Math.cos(b.a)*b.r*R,y=cy+Math.sin(b.a)*b.r*R;g.fillStyle=rgba(p.phosphor,b.life),g.shadowColor=p.phosphor,g.shadowBlur=10*b.life,g.beginPath(),g.arc(x,y,3.2,0,Math.PI*2),g.fill(),g.shadowBlur=0,b.label&&(g.font="600 11px ui-monospace,Menlo,monospace",g.fillText(b.label,x+8,y-6))}for(;blips.length&&blips[0].life<=0;)blips.shift();g.fillStyle=p.phosphor,g.beginPath(),g.arc(cx,cy,3,0,Math.PI*2),g.fill(),g.font="600 12px ui-monospace,Menlo,monospace",g.fillStyle=rgba(p.phosphor,.8),g.textAlign="left",g.fillText(`BRG ${String(Math.floor((ang*180/Math.PI+90)%360)).padStart(3,"0")}\xB0`,cx-R,cy+R+26),g.textAlign="right",g.fillText(`TARGET: ${ctx.copy.code} \xB7 NOT ACQUIRED`,cx+R,cy+R+26),g.fillStyle="rgba(0,0,0,.18)";for(let y=0;y<c.h;y+=3)g.fillRect(0,y,c.w,1)}}}};export{radar_default as default};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface Params {
|
|
2
|
+
skyTop: string;
|
|
3
|
+
skyBottom: string;
|
|
4
|
+
neon: string;
|
|
5
|
+
lights: string[];
|
|
6
|
+
/** 0..1 how fogged the glass is between drops. */
|
|
7
|
+
fog: number;
|
|
8
|
+
rain: number;
|
|
9
|
+
}
|
|
10
|
+
declare const _default: import("..").SceneDef<Params>;
|
|
11
|
+
export default _default;
|