@vysmo/transitions 0.1.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.
Files changed (384) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +618 -0
  3. package/dist/index.d.ts +6 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +3 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/inputs/normalize.d.ts +2 -0
  8. package/dist/inputs/normalize.d.ts.map +1 -0
  9. package/dist/inputs/normalize.js +2 -0
  10. package/dist/inputs/normalize.js.map +1 -0
  11. package/dist/runner/gl.d.ts +7 -0
  12. package/dist/runner/gl.d.ts.map +1 -0
  13. package/dist/runner/gl.js +59 -0
  14. package/dist/runner/gl.js.map +1 -0
  15. package/dist/runner/mesh.d.ts +28 -0
  16. package/dist/runner/mesh.d.ts.map +1 -0
  17. package/dist/runner/mesh.js +96 -0
  18. package/dist/runner/mesh.js.map +1 -0
  19. package/dist/runner/runner.d.ts +107 -0
  20. package/dist/runner/runner.d.ts.map +1 -0
  21. package/dist/runner/runner.js +410 -0
  22. package/dist/runner/runner.js.map +1 -0
  23. package/dist/transitions/all.d.ts +9 -0
  24. package/dist/transitions/all.d.ts.map +1 -0
  25. package/dist/transitions/all.js +129 -0
  26. package/dist/transitions/all.js.map +1 -0
  27. package/dist/transitions/bloom-reveal.d.ts +27 -0
  28. package/dist/transitions/bloom-reveal.d.ts.map +1 -0
  29. package/dist/transitions/bloom-reveal.js +106 -0
  30. package/dist/transitions/bloom-reveal.js.map +1 -0
  31. package/dist/transitions/chromatic-pulse.d.ts +4 -0
  32. package/dist/transitions/chromatic-pulse.d.ts.map +1 -0
  33. package/dist/transitions/chromatic-pulse.js +40 -0
  34. package/dist/transitions/chromatic-pulse.js.map +1 -0
  35. package/dist/transitions/clock-wipe.d.ts +6 -0
  36. package/dist/transitions/clock-wipe.d.ts.map +1 -0
  37. package/dist/transitions/clock-wipe.js +33 -0
  38. package/dist/transitions/clock-wipe.js.map +1 -0
  39. package/dist/transitions/color-phase.d.ts +10 -0
  40. package/dist/transitions/color-phase.d.ts.map +1 -0
  41. package/dist/transitions/color-phase.js +24 -0
  42. package/dist/transitions/color-phase.js.map +1 -0
  43. package/dist/transitions/colour-distance.d.ts.map +1 -0
  44. package/dist/transitions/cross-warp.d.ts.map +1 -0
  45. package/dist/transitions/cross-zoom.d.ts +5 -0
  46. package/dist/transitions/cross-zoom.d.ts.map +1 -0
  47. package/dist/transitions/cross-zoom.js +59 -0
  48. package/dist/transitions/cross-zoom.js.map +1 -0
  49. package/dist/transitions/crosshatch.d.ts +12 -0
  50. package/dist/transitions/crosshatch.d.ts.map +1 -0
  51. package/dist/transitions/crosshatch.js +49 -0
  52. package/dist/transitions/crosshatch.js.map +1 -0
  53. package/dist/transitions/define.d.ts +35 -0
  54. package/dist/transitions/define.d.ts.map +1 -0
  55. package/dist/transitions/define.js +37 -0
  56. package/dist/transitions/define.js.map +1 -0
  57. package/dist/transitions/directional-burn.d.ts +14 -0
  58. package/dist/transitions/directional-burn.d.ts.map +1 -0
  59. package/dist/transitions/directional-burn.js +67 -0
  60. package/dist/transitions/directional-burn.js.map +1 -0
  61. package/dist/transitions/directional-warp.d.ts +12 -0
  62. package/dist/transitions/directional-warp.d.ts.map +1 -0
  63. package/dist/transitions/directional-warp.js +46 -0
  64. package/dist/transitions/directional-warp.js.map +1 -0
  65. package/dist/transitions/dissolve.d.ts +2 -0
  66. package/dist/transitions/dissolve.d.ts.map +1 -0
  67. package/dist/transitions/dissolve.js +16 -0
  68. package/dist/transitions/dissolve.js.map +1 -0
  69. package/dist/transitions/dreamy-zoom.d.ts +25 -0
  70. package/dist/transitions/dreamy-zoom.d.ts.map +1 -0
  71. package/dist/transitions/dreamy-zoom.js +66 -0
  72. package/dist/transitions/dreamy-zoom.js.map +1 -0
  73. package/dist/transitions/dreamy.d.ts +8 -0
  74. package/dist/transitions/dreamy.d.ts.map +1 -0
  75. package/dist/transitions/dreamy.js +26 -0
  76. package/dist/transitions/dreamy.js.map +1 -0
  77. package/dist/transitions/drip-wipe.d.ts +22 -0
  78. package/dist/transitions/drip-wipe.d.ts.map +1 -0
  79. package/dist/transitions/drip-wipe.js +109 -0
  80. package/dist/transitions/drip-wipe.js.map +1 -0
  81. package/dist/transitions/ember-scatter.d.ts +22 -0
  82. package/dist/transitions/ember-scatter.d.ts.map +1 -0
  83. package/dist/transitions/ember-scatter.js +94 -0
  84. package/dist/transitions/ember-scatter.js.map +1 -0
  85. package/dist/transitions/film-burn.d.ts +17 -0
  86. package/dist/transitions/film-burn.d.ts.map +1 -0
  87. package/dist/transitions/film-burn.js +101 -0
  88. package/dist/transitions/film-burn.js.map +1 -0
  89. package/dist/transitions/film-grain.d.ts +24 -0
  90. package/dist/transitions/film-grain.d.ts.map +1 -0
  91. package/dist/transitions/film-grain.js +78 -0
  92. package/dist/transitions/film-grain.js.map +1 -0
  93. package/dist/transitions/flow-warp.d.ts +20 -0
  94. package/dist/transitions/flow-warp.d.ts.map +1 -0
  95. package/dist/transitions/flow-warp.js +51 -0
  96. package/dist/transitions/flow-warp.js.map +1 -0
  97. package/dist/transitions/fluid-flow.d.ts +26 -0
  98. package/dist/transitions/fluid-flow.d.ts.map +1 -0
  99. package/dist/transitions/fluid-flow.js +94 -0
  100. package/dist/transitions/fluid-flow.js.map +1 -0
  101. package/dist/transitions/fly-eye.d.ts.map +1 -0
  102. package/dist/transitions/fly-eye.js +58 -0
  103. package/dist/transitions/fly-eye.js.map +1 -0
  104. package/dist/transitions/glass-shatter.d.ts +25 -0
  105. package/dist/transitions/glass-shatter.d.ts.map +1 -0
  106. package/dist/transitions/glass-shatter.js +86 -0
  107. package/dist/transitions/glass-shatter.js.map +1 -0
  108. package/dist/transitions/glitch.d.ts +6 -0
  109. package/dist/transitions/glitch.d.ts.map +1 -0
  110. package/dist/transitions/glitch.js +59 -0
  111. package/dist/transitions/glitch.js.map +1 -0
  112. package/dist/transitions/god-rays-reveal.d.ts +32 -0
  113. package/dist/transitions/god-rays-reveal.d.ts.map +1 -0
  114. package/dist/transitions/god-rays-reveal.js +110 -0
  115. package/dist/transitions/god-rays-reveal.js.map +1 -0
  116. package/dist/transitions/gravity-pull.d.ts +16 -0
  117. package/dist/transitions/gravity-pull.d.ts.map +1 -0
  118. package/dist/transitions/gravity-pull.js +65 -0
  119. package/dist/transitions/gravity-pull.js.map +1 -0
  120. package/dist/transitions/grid-reveal.d.ts +12 -0
  121. package/dist/transitions/grid-reveal.d.ts.map +1 -0
  122. package/dist/transitions/grid-reveal.js +53 -0
  123. package/dist/transitions/grid-reveal.js.map +1 -0
  124. package/dist/transitions/heat-haze.d.ts +13 -0
  125. package/dist/transitions/heat-haze.d.ts.map +1 -0
  126. package/dist/transitions/heat-haze.js +51 -0
  127. package/dist/transitions/heat-haze.js.map +1 -0
  128. package/dist/transitions/index.d.ts +64 -0
  129. package/dist/transitions/index.d.ts.map +1 -0
  130. package/dist/transitions/index.js +63 -0
  131. package/dist/transitions/index.js.map +1 -0
  132. package/dist/transitions/ink-bloom.d.ts +15 -0
  133. package/dist/transitions/ink-bloom.d.ts.map +1 -0
  134. package/dist/transitions/ink-bloom.js +76 -0
  135. package/dist/transitions/ink-bloom.js.map +1 -0
  136. package/dist/transitions/ink-diffuse.d.ts +26 -0
  137. package/dist/transitions/ink-diffuse.d.ts.map +1 -0
  138. package/dist/transitions/ink-diffuse.js +90 -0
  139. package/dist/transitions/ink-diffuse.js.map +1 -0
  140. package/dist/transitions/iris-zoom.d.ts +13 -0
  141. package/dist/transitions/iris-zoom.d.ts.map +1 -0
  142. package/dist/transitions/iris-zoom.js +67 -0
  143. package/dist/transitions/iris-zoom.js.map +1 -0
  144. package/dist/transitions/kinetic-bands.d.ts +7 -0
  145. package/dist/transitions/kinetic-bands.d.ts.map +1 -0
  146. package/dist/transitions/kinetic-bands.js +58 -0
  147. package/dist/transitions/kinetic-bands.js.map +1 -0
  148. package/dist/transitions/lenticular-flip.d.ts +22 -0
  149. package/dist/transitions/lenticular-flip.d.ts.map +1 -0
  150. package/dist/transitions/lenticular-flip.js +73 -0
  151. package/dist/transitions/lenticular-flip.js.map +1 -0
  152. package/dist/transitions/light-leak.d.ts +7 -0
  153. package/dist/transitions/light-leak.d.ts.map +1 -0
  154. package/dist/transitions/light-leak.js +43 -0
  155. package/dist/transitions/light-leak.js.map +1 -0
  156. package/dist/transitions/lightning-strike.d.ts +22 -0
  157. package/dist/transitions/lightning-strike.d.ts.map +1 -0
  158. package/dist/transitions/lightning-strike.js +90 -0
  159. package/dist/transitions/lightning-strike.js.map +1 -0
  160. package/dist/transitions/linear-blur.d.ts +11 -0
  161. package/dist/transitions/linear-blur.d.ts.map +1 -0
  162. package/dist/transitions/linear-blur.js +40 -0
  163. package/dist/transitions/linear-blur.js.map +1 -0
  164. package/dist/transitions/liquid-chrome.d.ts +22 -0
  165. package/dist/transitions/liquid-chrome.d.ts.map +1 -0
  166. package/dist/transitions/liquid-chrome.js +114 -0
  167. package/dist/transitions/liquid-chrome.js.map +1 -0
  168. package/dist/transitions/liquid-morph.d.ts +6 -0
  169. package/dist/transitions/liquid-morph.d.ts.map +1 -0
  170. package/dist/transitions/liquid-morph.js +50 -0
  171. package/dist/transitions/liquid-morph.js.map +1 -0
  172. package/dist/transitions/lumina-melt.d.ts +11 -0
  173. package/dist/transitions/lumina-melt.d.ts.map +1 -0
  174. package/dist/transitions/lumina-melt.js +36 -0
  175. package/dist/transitions/lumina-melt.js.map +1 -0
  176. package/dist/transitions/mosaic.d.ts +13 -0
  177. package/dist/transitions/mosaic.d.ts.map +1 -0
  178. package/dist/transitions/mosaic.js +58 -0
  179. package/dist/transitions/mosaic.js.map +1 -0
  180. package/dist/transitions/noise-dissolve.d.ts +5 -0
  181. package/dist/transitions/noise-dissolve.d.ts.map +1 -0
  182. package/dist/transitions/noise-dissolve.js +41 -0
  183. package/dist/transitions/noise-dissolve.js.map +1 -0
  184. package/dist/transitions/page-curl.d.ts +32 -0
  185. package/dist/transitions/page-curl.d.ts.map +1 -0
  186. package/dist/transitions/page-curl.js +165 -0
  187. package/dist/transitions/page-curl.js.map +1 -0
  188. package/dist/transitions/paint-bleed.d.ts +12 -0
  189. package/dist/transitions/paint-bleed.d.ts.map +1 -0
  190. package/dist/transitions/paint-bleed.js +59 -0
  191. package/dist/transitions/paint-bleed.js.map +1 -0
  192. package/dist/transitions/particle-assemble.d.ts +23 -0
  193. package/dist/transitions/particle-assemble.d.ts.map +1 -0
  194. package/dist/transitions/particle-assemble.js +65 -0
  195. package/dist/transitions/particle-assemble.js.map +1 -0
  196. package/dist/transitions/pinwheel.d.ts +11 -0
  197. package/dist/transitions/pinwheel.d.ts.map +1 -0
  198. package/dist/transitions/pinwheel.js +40 -0
  199. package/dist/transitions/pinwheel.js.map +1 -0
  200. package/dist/transitions/pixelate.d.ts +4 -0
  201. package/dist/transitions/pixelate.d.ts.map +1 -0
  202. package/dist/transitions/pixelate.js +26 -0
  203. package/dist/transitions/pixelate.js.map +1 -0
  204. package/dist/transitions/plasma-pulse.d.ts.map +1 -0
  205. package/dist/transitions/plasma-pulse.js +92 -0
  206. package/dist/transitions/plasma-pulse.js.map +1 -0
  207. package/dist/transitions/polka-dots-curtain.d.ts +13 -0
  208. package/dist/transitions/polka-dots-curtain.d.ts.map +1 -0
  209. package/dist/transitions/polka-dots-curtain.js +46 -0
  210. package/dist/transitions/polka-dots-curtain.js.map +1 -0
  211. package/dist/transitions/polygon-flip.d.ts +27 -0
  212. package/dist/transitions/polygon-flip.d.ts.map +1 -0
  213. package/dist/transitions/polygon-flip.js +97 -0
  214. package/dist/transitions/polygon-flip.js.map +1 -0
  215. package/dist/transitions/portal-dive.d.ts +18 -0
  216. package/dist/transitions/portal-dive.d.ts.map +1 -0
  217. package/dist/transitions/portal-dive.js +83 -0
  218. package/dist/transitions/portal-dive.js.map +1 -0
  219. package/dist/transitions/prism-split.d.ts +12 -0
  220. package/dist/transitions/prism-split.d.ts.map +1 -0
  221. package/dist/transitions/prism-split.js +52 -0
  222. package/dist/transitions/prism-split.js.map +1 -0
  223. package/dist/transitions/push.d.ts +4 -0
  224. package/dist/transitions/push.d.ts.map +1 -0
  225. package/dist/transitions/push.js +34 -0
  226. package/dist/transitions/push.js.map +1 -0
  227. package/dist/transitions/radial-reveal.d.ts +5 -0
  228. package/dist/transitions/radial-reveal.d.ts.map +1 -0
  229. package/dist/transitions/radial-reveal.js +31 -0
  230. package/dist/transitions/radial-reveal.js.map +1 -0
  231. package/dist/transitions/ripple-wave.d.ts +24 -0
  232. package/dist/transitions/ripple-wave.d.ts.map +1 -0
  233. package/dist/transitions/ripple-wave.js +135 -0
  234. package/dist/transitions/ripple-wave.js.map +1 -0
  235. package/dist/transitions/ripple.d.ts +7 -0
  236. package/dist/transitions/ripple.d.ts.map +1 -0
  237. package/dist/transitions/ripple.js +43 -0
  238. package/dist/transitions/ripple.js.map +1 -0
  239. package/dist/transitions/shape-reveal.d.ts +12 -0
  240. package/dist/transitions/shape-reveal.d.ts.map +1 -0
  241. package/dist/transitions/shape-reveal.js +53 -0
  242. package/dist/transitions/shape-reveal.js.map +1 -0
  243. package/dist/transitions/shockwave.d.ts +10 -0
  244. package/dist/transitions/shockwave.d.ts.map +1 -0
  245. package/dist/transitions/shockwave.js +56 -0
  246. package/dist/transitions/shockwave.js.map +1 -0
  247. package/dist/transitions/singularity.d.ts +22 -0
  248. package/dist/transitions/singularity.d.ts.map +1 -0
  249. package/dist/transitions/singularity.js +59 -0
  250. package/dist/transitions/singularity.js.map +1 -0
  251. package/dist/transitions/slide.d.ts +10 -0
  252. package/dist/transitions/slide.d.ts.map +1 -0
  253. package/dist/transitions/slide.js +76 -0
  254. package/dist/transitions/slide.js.map +1 -0
  255. package/dist/transitions/smoldering-edge.d.ts +15 -0
  256. package/dist/transitions/smoldering-edge.d.ts.map +1 -0
  257. package/dist/transitions/smoldering-edge.js +74 -0
  258. package/dist/transitions/smoldering-edge.js.map +1 -0
  259. package/dist/transitions/split.d.ts +14 -0
  260. package/dist/transitions/split.d.ts.map +1 -0
  261. package/dist/transitions/split.js +53 -0
  262. package/dist/transitions/split.js.map +1 -0
  263. package/dist/transitions/swirl.d.ts +12 -0
  264. package/dist/transitions/swirl.d.ts.map +1 -0
  265. package/dist/transitions/swirl.js +42 -0
  266. package/dist/transitions/swirl.js.map +1 -0
  267. package/dist/transitions/tangent-motion-blur.d.ts +13 -0
  268. package/dist/transitions/tangent-motion-blur.d.ts.map +1 -0
  269. package/dist/transitions/tangent-motion-blur.js +58 -0
  270. package/dist/transitions/tangent-motion-blur.js.map +1 -0
  271. package/dist/transitions/tile-scatter.d.ts +22 -0
  272. package/dist/transitions/tile-scatter.d.ts.map +1 -0
  273. package/dist/transitions/tile-scatter.js +122 -0
  274. package/dist/transitions/tile-scatter.js.map +1 -0
  275. package/dist/transitions/tilt-sweep.d.ts +11 -0
  276. package/dist/transitions/tilt-sweep.d.ts.map +1 -0
  277. package/dist/transitions/tilt-sweep.js +31 -0
  278. package/dist/transitions/tilt-sweep.js.map +1 -0
  279. package/dist/transitions/warp-zoom.d.ts +7 -0
  280. package/dist/transitions/warp-zoom.d.ts.map +1 -0
  281. package/dist/transitions/warp-zoom.js +70 -0
  282. package/dist/transitions/warp-zoom.js.map +1 -0
  283. package/dist/transitions/wave-stripes.d.ts +16 -0
  284. package/dist/transitions/wave-stripes.d.ts.map +1 -0
  285. package/dist/transitions/wave-stripes.js +55 -0
  286. package/dist/transitions/wave-stripes.js.map +1 -0
  287. package/dist/transitions/wave-wipe.d.ts +23 -0
  288. package/dist/transitions/wave-wipe.d.ts.map +1 -0
  289. package/dist/transitions/wave-wipe.js +84 -0
  290. package/dist/transitions/wave-wipe.js.map +1 -0
  291. package/dist/transitions/wind.d.ts +9 -0
  292. package/dist/transitions/wind.d.ts.map +1 -0
  293. package/dist/transitions/wind.js +48 -0
  294. package/dist/transitions/wind.js.map +1 -0
  295. package/dist/transitions/window-slice.d.ts +11 -0
  296. package/dist/transitions/window-slice.d.ts.map +1 -0
  297. package/dist/transitions/window-slice.js +34 -0
  298. package/dist/transitions/window-slice.js.map +1 -0
  299. package/dist/transitions/wipe-directional.d.ts +5 -0
  300. package/dist/transitions/wipe-directional.d.ts.map +1 -0
  301. package/dist/transitions/wipe-directional.js +26 -0
  302. package/dist/transitions/wipe-directional.js.map +1 -0
  303. package/dist/types.d.ts +78 -0
  304. package/dist/types.d.ts.map +1 -0
  305. package/dist/types.js +2 -0
  306. package/dist/types.js.map +1 -0
  307. package/package.json +56 -0
  308. package/src/__tests__/__screenshots__/endpoint-correctness.test.ts/endpoint-correctness---every-transition-must-be-pixel-pure-from-to-at-progress-0-1-rippleWave-at-progress-0-is-pure--from--1.png +0 -0
  309. package/src/__tests__/__screenshots__/endpoint-correctness.test.ts/endpoint-correctness---every-transition-must-be-pixel-pure-from-to-at-progress-0-1-rippleWave-at-progress-1-is-pure--to--1.png +0 -0
  310. package/src/__tests__/endpoint-correctness.test.ts +161 -0
  311. package/src/__tests__/readme.test.ts +39 -0
  312. package/src/__tests__/ssr.test.ts +45 -0
  313. package/src/index.ts +75 -0
  314. package/src/inputs/normalize.ts +1 -0
  315. package/src/runner/__tests__/__screenshots__/mesh.test.ts/buildSubdividedPlane-centroid-is-shared-across-a-face-and-equals-mean-of-its-3-positions-1.png +0 -0
  316. package/src/runner/__tests__/__screenshots__/mesh.test.ts/buildSubdividedPlane-uv-matches-aPosition---0-5---0-5-1.png +0 -0
  317. package/src/runner/__tests__/mesh.test.ts +128 -0
  318. package/src/runner/gl.ts +69 -0
  319. package/src/runner/mesh.ts +135 -0
  320. package/src/runner/runner.ts +528 -0
  321. package/src/transitions/all.ts +131 -0
  322. package/src/transitions/bloom-reveal.ts +106 -0
  323. package/src/transitions/chromatic-pulse.ts +40 -0
  324. package/src/transitions/clock-wipe.ts +33 -0
  325. package/src/transitions/color-phase.ts +24 -0
  326. package/src/transitions/cross-zoom.ts +59 -0
  327. package/src/transitions/crosshatch.ts +49 -0
  328. package/src/transitions/define.ts +56 -0
  329. package/src/transitions/directional-burn.ts +67 -0
  330. package/src/transitions/directional-warp.ts +46 -0
  331. package/src/transitions/dissolve.ts +16 -0
  332. package/src/transitions/dreamy-zoom.ts +66 -0
  333. package/src/transitions/dreamy.ts +26 -0
  334. package/src/transitions/drip-wipe.ts +109 -0
  335. package/src/transitions/ember-scatter.ts +94 -0
  336. package/src/transitions/film-burn.ts +101 -0
  337. package/src/transitions/film-grain.ts +78 -0
  338. package/src/transitions/flow-warp.ts +51 -0
  339. package/src/transitions/fluid-flow.ts +94 -0
  340. package/src/transitions/glass-shatter.ts +86 -0
  341. package/src/transitions/glitch.ts +59 -0
  342. package/src/transitions/god-rays-reveal.ts +110 -0
  343. package/src/transitions/gravity-pull.ts +65 -0
  344. package/src/transitions/grid-reveal.ts +53 -0
  345. package/src/transitions/heat-haze.ts +51 -0
  346. package/src/transitions/index.ts +63 -0
  347. package/src/transitions/ink-bloom.ts +76 -0
  348. package/src/transitions/ink-diffuse.ts +90 -0
  349. package/src/transitions/iris-zoom.ts +67 -0
  350. package/src/transitions/kinetic-bands.ts +58 -0
  351. package/src/transitions/lenticular-flip.ts +73 -0
  352. package/src/transitions/light-leak.ts +43 -0
  353. package/src/transitions/linear-blur.ts +40 -0
  354. package/src/transitions/liquid-chrome.ts +114 -0
  355. package/src/transitions/liquid-morph.ts +50 -0
  356. package/src/transitions/lumina-melt.ts +36 -0
  357. package/src/transitions/mosaic.ts +58 -0
  358. package/src/transitions/noise-dissolve.ts +41 -0
  359. package/src/transitions/page-curl.ts +165 -0
  360. package/src/transitions/paint-bleed.ts +59 -0
  361. package/src/transitions/pinwheel.ts +40 -0
  362. package/src/transitions/pixelate.ts +26 -0
  363. package/src/transitions/polka-dots-curtain.ts +46 -0
  364. package/src/transitions/polygon-flip.ts +97 -0
  365. package/src/transitions/portal-dive.ts +83 -0
  366. package/src/transitions/prism-split.ts +52 -0
  367. package/src/transitions/push.ts +34 -0
  368. package/src/transitions/radial-reveal.ts +31 -0
  369. package/src/transitions/ripple-wave.ts +135 -0
  370. package/src/transitions/ripple.ts +43 -0
  371. package/src/transitions/shape-reveal.ts +53 -0
  372. package/src/transitions/shockwave.ts +56 -0
  373. package/src/transitions/singularity.ts +59 -0
  374. package/src/transitions/slide.ts +76 -0
  375. package/src/transitions/smoldering-edge.ts +74 -0
  376. package/src/transitions/split.ts +53 -0
  377. package/src/transitions/swirl.ts +42 -0
  378. package/src/transitions/tangent-motion-blur.ts +58 -0
  379. package/src/transitions/tile-scatter.ts +122 -0
  380. package/src/transitions/warp-zoom.ts +70 -0
  381. package/src/transitions/wave-stripes.ts +55 -0
  382. package/src/transitions/wind.ts +48 -0
  383. package/src/transitions/wipe-directional.ts +26 -0
  384. package/src/types.ts +87 -0
@@ -0,0 +1,52 @@
1
+ import { defineTransition } from "./define.js";
2
+ /**
3
+ * Directional RGB chromatic split. Like looking through a prism along a
4
+ * fixed axis: red and blue channels separate along `direction` while
5
+ * green stays put, then recombine on the to-image. Distinct from
6
+ * chromatic-pulse (which is radial outward from center).
7
+ */
8
+ export const prismSplit = defineTransition({
9
+ name: "prism-split",
10
+ defaults: {
11
+ direction: [1, 0],
12
+ intensity: 0.04,
13
+ softness: 0.2,
14
+ },
15
+ glsl: `
16
+ uniform vec2 uDirection;
17
+ uniform float uIntensity;
18
+ uniform float uSoftness;
19
+
20
+ vec4 transition(vec2 uv) {
21
+ vec2 d = normalize(uDirection);
22
+ float env = 4.0 * uProgress * (1.0 - uProgress);
23
+ // Cap the per-channel split. Past ~0.07 the R/B samples come from
24
+ // unrelated parts of the scene and edge clamping turns the offsets into
25
+ // colored stripes — no longer reads as chromatic aberration. Hard-clamp
26
+ // here so the transition is reliable regardless of caller input.
27
+ float split = env * min(uIntensity, 0.07);
28
+
29
+ vec2 offR = clamp(uv + d * split, 0.0, 1.0);
30
+ vec2 offB = clamp(uv - d * split, 0.0, 1.0);
31
+
32
+ vec3 fromRGB = vec3(
33
+ getFromColor(offR).r,
34
+ getFromColor(uv).g,
35
+ getFromColor(offB).b
36
+ );
37
+ vec3 toRGB = vec3(
38
+ getToColor(offR).r,
39
+ getToColor(uv).g,
40
+ getToColor(offB).b
41
+ );
42
+
43
+ // Crossfade width controlled by softness: 0.7 → fade across middle 70%
44
+ // of progress (range [0.15, 0.85]); higher = gentler, lower = punchier.
45
+ float fadeHalf = clamp(uSoftness, 0.05, 0.95) * 0.5;
46
+ float mixW = smoothstep(0.5 - fadeHalf, 0.5 + fadeHalf, uProgress);
47
+ vec3 rgb = mix(fromRGB, toRGB, mixW);
48
+ return vec4(rgb, 1.0);
49
+ }
50
+ `,
51
+ });
52
+ //# sourceMappingURL=prism-split.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prism-split.js","sourceRoot":"","sources":["../../src/transitions/prism-split.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC;IACzC,IAAI,EAAE,aAAa;IACnB,QAAQ,EAAE;QACR,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QACjB,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,GAAG;KACd;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCP;CACA,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const push: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
2
+ readonly direction: readonly [1, 0];
3
+ }>>;
4
+ //# sourceMappingURL=push.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../src/transitions/push.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI;;GA+Bf,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { defineTransition } from "./define.js";
2
+ export const push = defineTransition({
3
+ name: "push",
4
+ defaults: {
5
+ direction: [1, 0],
6
+ },
7
+ glsl: `
8
+ uniform vec2 uDirection;
9
+
10
+ // Snap a direction vector to the nearest axis-aligned unit (Right/Left/Down/Up).
11
+ // Translation transitions only look right axis-aligned; diagonal inputs leave
12
+ // triangular gaps at corners. Snapping in-shader keeps the visual reliable
13
+ // regardless of caller input, so the UI's axis-only picker matches.
14
+ vec2 snapAxis(vec2 v) {
15
+ vec2 d = normalize(v);
16
+ return abs(d.x) > abs(d.y) ? vec2(sign(d.x), 0.0) : vec2(0.0, sign(d.y));
17
+ }
18
+
19
+ vec4 transition(vec2 uv) {
20
+ vec2 d = snapAxis(uDirection);
21
+ // Both images scroll together in direction -d over time.
22
+ // At progress=0: from fills the frame; to is at +d offset (off-screen).
23
+ // At progress=1: to fills the frame; from is at -d offset (off-screen).
24
+ vec2 fromUv = uv + d * uProgress;
25
+ vec2 toUv = uv - d * (1.0 - uProgress);
26
+
27
+ bool fromVisible = fromUv.x >= 0.0 && fromUv.x <= 1.0
28
+ && fromUv.y >= 0.0 && fromUv.y <= 1.0;
29
+ if (fromVisible) return getFromColor(fromUv);
30
+ return getToColor(toUv);
31
+ }
32
+ `,
33
+ });
34
+ //# sourceMappingURL=push.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push.js","sourceRoot":"","sources":["../../src/transitions/push.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,CAAC,MAAM,IAAI,GAAG,gBAAgB,CAAC;IACnC,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE;QACR,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;KAClB;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;CAyBP;CACA,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const radialReveal: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
2
+ readonly center: readonly [0.5, 0.5];
3
+ readonly softness: 0.05;
4
+ }>>;
5
+ //# sourceMappingURL=radial-reveal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radial-reveal.d.ts","sourceRoot":"","sources":["../../src/transitions/radial-reveal.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY;;;GA4BvB,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { defineTransition } from "./define.js";
2
+ export const radialReveal = defineTransition({
3
+ name: "radial-reveal",
4
+ defaults: {
5
+ center: [0.5, 0.5],
6
+ softness: 0.05,
7
+ },
8
+ glsl: `
9
+ uniform vec2 uCenter;
10
+ uniform float uSoftness;
11
+
12
+ vec4 transition(vec2 uv) {
13
+ // Measure distance in screen (pixel) space so the reveal stays a true circle
14
+ // on non-square canvases.
15
+ vec2 pixel = uv * uResolution;
16
+ vec2 pixelCenter = uCenter * uResolution;
17
+
18
+ float maxDist = max(
19
+ max(length(pixelCenter), length(pixelCenter - vec2(uResolution.x, 0.0))),
20
+ max(length(pixelCenter - vec2(0.0, uResolution.y)), length(pixelCenter - uResolution))
21
+ );
22
+ float dist = length(pixel - pixelCenter) / maxDist;
23
+
24
+ float radius = uProgress * (1.0 + 2.0 * uSoftness) - uSoftness;
25
+ float w = smoothstep(radius - uSoftness, radius + uSoftness, dist);
26
+
27
+ return mix(getToColor(uv), getFromColor(uv), w);
28
+ }
29
+ `,
30
+ });
31
+ //# sourceMappingURL=radial-reveal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radial-reveal.js","sourceRoot":"","sources":["../../src/transitions/radial-reveal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,CAAC,MAAM,YAAY,GAAG,gBAAgB,CAAC;IAC3C,IAAI,EAAE,eAAe;IACrB,QAAQ,EAAE;QACR,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;QAClB,QAAQ,EAAE,IAAI;KACf;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;CAqBP;CACA,CAAC,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * A water-like ripple emanates from a source point. The mesh deforms
3
+ * in z so the wave has real geometric presence (depth, lighting), but
4
+ * the wave shape, surface normal, and refraction are all recomputed
5
+ * per-fragment — so the refraction stays smooth even at high amplitude
6
+ * regardless of mesh subdivision. No faceting, no interpolation
7
+ * crystalline artifacts.
8
+ *
9
+ * Wave profile is asymmetric around the travelling front: sharp cut-
10
+ * off ahead (no pre-wave ripple) and moderate Gaussian decay behind
11
+ * (one dominant leading ring followed by a fading secondary ring).
12
+ * Refraction shifts the sample uv along the in-plane surface normal,
13
+ * so the image visibly bends through the water. A tight specular
14
+ * highlight adds a crest sparkle.
15
+ *
16
+ * Endpoints: envelope = 4·p·(1-p) gates z, refraction, lighting and
17
+ * specular all to zero at progress 0 and 1. The mask is pinned to
18
+ * saturated 0 and 1 respectively — pixel-pure endpoints.
19
+ */
20
+ export declare const rippleWave: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
21
+ readonly amplitude: 0.1;
22
+ readonly source: readonly [0.5, 0.5];
23
+ }>>;
24
+ //# sourceMappingURL=ripple-wave.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ripple-wave.d.ts","sourceRoot":"","sources":["../../src/transitions/ripple-wave.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,UAAU;;;GAiHrB,CAAC"}
@@ -0,0 +1,135 @@
1
+ import { defineTransition } from "./define.js";
2
+ /**
3
+ * A water-like ripple emanates from a source point. The mesh deforms
4
+ * in z so the wave has real geometric presence (depth, lighting), but
5
+ * the wave shape, surface normal, and refraction are all recomputed
6
+ * per-fragment — so the refraction stays smooth even at high amplitude
7
+ * regardless of mesh subdivision. No faceting, no interpolation
8
+ * crystalline artifacts.
9
+ *
10
+ * Wave profile is asymmetric around the travelling front: sharp cut-
11
+ * off ahead (no pre-wave ripple) and moderate Gaussian decay behind
12
+ * (one dominant leading ring followed by a fading secondary ring).
13
+ * Refraction shifts the sample uv along the in-plane surface normal,
14
+ * so the image visibly bends through the water. A tight specular
15
+ * highlight adds a crest sparkle.
16
+ *
17
+ * Endpoints: envelope = 4·p·(1-p) gates z, refraction, lighting and
18
+ * specular all to zero at progress 0 and 1. The mask is pinned to
19
+ * saturated 0 and 1 respectively — pixel-pure endpoints.
20
+ */
21
+ export const rippleWave = defineTransition({
22
+ name: "ripple-wave",
23
+ mesh: { subdivisions: [48, 48], instances: 1 },
24
+ defaults: {
25
+ amplitude: 0.1,
26
+ source: [0.5, 0.5],
27
+ },
28
+ vertex: `
29
+ uniform float uAmplitude;
30
+ uniform vec2 uSource;
31
+
32
+ out vec2 vClipPos;
33
+
34
+ #define PI 3.14159265359
35
+ #define WAVELENGTH 0.35
36
+ #define MAX_R 3.0
37
+ #define TRANSITION_WIDTH 0.03
38
+
39
+ void main() {
40
+ vUv = aUv;
41
+ vClipPos = aPosition;
42
+
43
+ // Mesh still deforms in z for real 3D presence; fragment will do
44
+ // the smooth per-pixel wave. Both use the same analytic wave.
45
+ vec2 sourceClip = uSource * 2.0 - 1.0;
46
+ float r = distance(aPosition, sourceClip);
47
+ float frontR = mix(
48
+ -TRANSITION_WIDTH,
49
+ MAX_R + TRANSITION_WIDTH,
50
+ uProgress
51
+ );
52
+ float phase = (r - frontR) / WAVELENGTH;
53
+ float k = mix(0.5, 4.0, step(0.0, phase));
54
+ float decay = exp(-phase * phase * k);
55
+ float envelope = 4.0 * uProgress * (1.0 - uProgress);
56
+ float wave = sin(phase * 2.0 * PI) * decay;
57
+ float z = uAmplitude * envelope * wave;
58
+
59
+ gl_Position = vec4(aPosition, -z, 1.0);
60
+ }
61
+ `,
62
+ glsl: `
63
+ uniform float uAmplitude;
64
+ uniform vec2 uSource;
65
+
66
+ in vec2 vClipPos;
67
+
68
+ #define PI 3.14159265359
69
+ #define WAVELENGTH 0.35
70
+ #define MAX_R 3.0
71
+ #define TRANSITION_WIDTH 0.03
72
+
73
+ vec4 transition(vec2 uv) {
74
+ vec2 sourceClip = uSource * 2.0 - 1.0;
75
+ vec2 toSource = vClipPos - sourceClip;
76
+ float r = length(toSource);
77
+ vec2 radialDir = r > 1e-5 ? toSource / r : vec2(0.0);
78
+
79
+ float frontR = mix(
80
+ -TRANSITION_WIDTH,
81
+ MAX_R + TRANSITION_WIDTH,
82
+ uProgress
83
+ );
84
+ float phase = (r - frontR) / WAVELENGTH;
85
+
86
+ // Asymmetric decay: sharp ahead of front (k=4, no pre-wave), moderate
87
+ // behind (k=0.5, one dominant ring + soft fading second ring).
88
+ float k = mix(0.5, 4.0, step(0.0, phase));
89
+ float decay = exp(-phase * phase * k);
90
+ float envelope = 4.0 * uProgress * (1.0 - uProgress);
91
+ float sinP = sin(phase * 2.0 * PI);
92
+ float cosP = cos(phase * 2.0 * PI);
93
+
94
+ // d(wave)/d(phase) = 2π·cos·decay − 2·phase·k·sin·decay
95
+ float dWave = decay * (2.0 * PI * cosP - 2.0 * phase * k * sinP);
96
+ float dzdr = uAmplitude * envelope * dWave / WAVELENGTH;
97
+
98
+ vec3 normal = normalize(vec3(-dzdr * radialDir, 1.0));
99
+
100
+ float mask = smoothstep(
101
+ -TRANSITION_WIDTH,
102
+ TRANSITION_WIDTH,
103
+ frontR - r
104
+ );
105
+
106
+ // Refraction: gentle in-plane offset, clamped so high amplitudes
107
+ // don't generate wild UV jumps that would moire through even mipmapped
108
+ // trilinear sampling.
109
+ vec2 refractOffset = normal.xy * 0.22;
110
+ refractOffset = clamp(refractOffset, vec2(-0.08), vec2(0.08));
111
+ vec2 sampleUv = clamp(uv + refractOffset, 0.0, 1.0);
112
+
113
+ // Diffuse lighting referenced so flat = 1.0 exactly.
114
+ vec3 lightDir = normalize(vec3(0.3, 0.5, -1.0));
115
+ float directional = dot(normal, -lightDir);
116
+ float flatDot = -lightDir.z;
117
+ float rippleGain = (directional - flatDot) * 0.6;
118
+ float vLight = clamp(1.0 + rippleGain * envelope, 0.6, 1.35);
119
+
120
+ // Tight specular highlight on the crest — zero at endpoints (envelope),
121
+ // zero on flat water (normal parallel to z).
122
+ vec3 refl = reflect(lightDir, normal);
123
+ vec3 viewDir = vec3(0.0, 0.0, 1.0);
124
+ float spec = pow(max(dot(refl, viewDir), 0.0), 48.0);
125
+ float specBase = pow(max(dot(vec3(0, 0, 1), -lightDir), 0.0), 48.0);
126
+ float specGain = max(spec - specBase, 0.0) * envelope * 0.7;
127
+
128
+ vec3 fromCol = getFromColor(sampleUv).rgb;
129
+ vec3 toCol = getToColor(sampleUv).rgb;
130
+ vec3 col = mix(fromCol, toCol, mask) * vLight + vec3(specGain);
131
+ return vec4(col, 1.0);
132
+ }
133
+ `,
134
+ });
135
+ //# sourceMappingURL=ripple-wave.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ripple-wave.js","sourceRoot":"","sources":["../../src/transitions/ripple-wave.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC;IACzC,IAAI,EAAE,aAAa;IACnB,IAAI,EAAE,EAAE,YAAY,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE;IAC9C,QAAQ,EAAE;QACR,SAAS,EAAE,GAAG;QACd,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,CAAU;KAC5B;IACD,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCT;IACC,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuEP;CACA,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare const ripple: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
2
+ readonly center: readonly [0.5, 0.5];
3
+ readonly amplitude: 0.03;
4
+ readonly frequency: 6;
5
+ readonly speed: 8;
6
+ }>>;
7
+ //# sourceMappingURL=ripple.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ripple.d.ts","sourceRoot":"","sources":["../../src/transitions/ripple.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM;;;;;GAwCjB,CAAC"}
@@ -0,0 +1,43 @@
1
+ import { defineTransition } from "./define.js";
2
+ export const ripple = defineTransition({
3
+ name: "ripple",
4
+ defaults: {
5
+ center: [0.5, 0.5],
6
+ amplitude: 0.03,
7
+ frequency: 6,
8
+ speed: 8,
9
+ },
10
+ glsl: `
11
+ uniform vec2 uCenter;
12
+ uniform float uAmplitude;
13
+ uniform float uFrequency;
14
+ uniform float uSpeed;
15
+
16
+ const float TWO_PI = 6.2831853;
17
+
18
+ vec4 transition(vec2 uv) {
19
+ vec2 delta = uv - uCenter;
20
+ float dist = length(delta);
21
+ vec2 dir = dist > 0.0001 ? delta / dist : vec2(1.0, 0.0);
22
+
23
+ // Velocity-scaled envelope: zero at endpoints, peak at midpoint.
24
+ float env = 4.0 * uProgress * (1.0 - uProgress);
25
+
26
+ // Radial sinusoid traveling outward as progress grows.
27
+ float phase = dist * uFrequency * TWO_PI - uProgress * uSpeed;
28
+ float wave = sin(phase);
29
+
30
+ // From pushes outward with the wave; to pulls inward (opposite sign).
31
+ vec2 displacement = dir * wave * uAmplitude * env;
32
+
33
+ vec4 fromColor = getFromColor(clamp(uv + displacement, 0.0, 1.0));
34
+ vec4 toColor = getToColor(clamp(uv - displacement, 0.0, 1.0));
35
+
36
+ // Crossfade concentrated in the middle 40%, so both images are ripple-warped
37
+ // throughout the overlap region.
38
+ float mixW = smoothstep(0.3, 0.7, uProgress);
39
+ return mix(fromColor, toColor, mixW);
40
+ }
41
+ `,
42
+ });
43
+ //# sourceMappingURL=ripple.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ripple.js","sourceRoot":"","sources":["../../src/transitions/ripple.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,CAAC,MAAM,MAAM,GAAG,gBAAgB,CAAC;IACrC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE;QACR,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;QAClB,SAAS,EAAE,IAAI;QACf,SAAS,EAAE,CAAC;QACZ,KAAK,EAAE,CAAC;KACT;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BP;CACA,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Geometric shape reveal from a center point. `sides` controls the shape:
3
+ * 3 = triangle, 4 = diamond (with rotation 45°), 5 = pentagon, 6 = hexagon,
4
+ * 8 = octagon, 12 = dodecagon, 20+ approaches a circle.
5
+ */
6
+ export declare const shapeReveal: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
7
+ readonly center: readonly [0.5, 0.5];
8
+ readonly sides: 6;
9
+ readonly rotation: 0;
10
+ readonly softness: 0.05;
11
+ }>>;
12
+ //# sourceMappingURL=shape-reveal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shape-reveal.d.ts","sourceRoot":"","sources":["../../src/transitions/shape-reveal.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,WAAW;;;;;GA6CtB,CAAC"}
@@ -0,0 +1,53 @@
1
+ import { defineTransition } from "./define.js";
2
+ /**
3
+ * Geometric shape reveal from a center point. `sides` controls the shape:
4
+ * 3 = triangle, 4 = diamond (with rotation 45°), 5 = pentagon, 6 = hexagon,
5
+ * 8 = octagon, 12 = dodecagon, 20+ approaches a circle.
6
+ */
7
+ export const shapeReveal = defineTransition({
8
+ name: "shape-reveal",
9
+ defaults: {
10
+ center: [0.5, 0.5],
11
+ sides: 6,
12
+ rotation: 0,
13
+ softness: 0.05,
14
+ },
15
+ glsl: `
16
+ uniform vec2 uCenter;
17
+ uniform float uSides;
18
+ uniform float uRotation;
19
+ uniform float uSoftness;
20
+
21
+ const float TWO_PI = 6.2831853;
22
+
23
+ vec4 transition(vec2 uv) {
24
+ // Work in screen pixel space so the polygon is geometrically regular
25
+ // regardless of canvas aspect ratio.
26
+ vec2 pixel = uv * uResolution;
27
+ vec2 pixelCenter = uCenter * uResolution;
28
+ vec2 delta = pixel - pixelCenter;
29
+
30
+ float slice = TWO_PI / max(uSides, 3.0);
31
+ float halfSlice = slice * 0.5;
32
+
33
+ // Fold the pixel's angle into one polygon sector; distance to the sector's
34
+ // edge midpoint direction gives the regular-polygon distance from center.
35
+ float angle = atan(delta.y, delta.x) - uRotation;
36
+ float folded = mod(angle + halfSlice, slice) - halfSlice;
37
+
38
+ // Normalize so canvas corners map to ≤ 1 (guaranteed by the max-corner
39
+ // division, since cos(folded) ≤ 1).
40
+ float maxDist = max(
41
+ max(length(pixelCenter), length(pixelCenter - vec2(uResolution.x, 0.0))),
42
+ max(length(pixelCenter - vec2(0.0, uResolution.y)), length(pixelCenter - uResolution))
43
+ );
44
+ float dist = length(delta) * cos(folded) / max(maxDist, 0.0001);
45
+
46
+ float radius = uProgress * (1.0 + 2.0 * uSoftness) - uSoftness;
47
+ float w = smoothstep(radius - uSoftness, radius + uSoftness, dist);
48
+
49
+ return mix(getToColor(uv), getFromColor(uv), w);
50
+ }
51
+ `,
52
+ });
53
+ //# sourceMappingURL=shape-reveal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shape-reveal.js","sourceRoot":"","sources":["../../src/transitions/shape-reveal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,gBAAgB,CAAC;IAC1C,IAAI,EAAE,cAAc;IACpB,QAAQ,EAAE;QACR,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;QAClB,KAAK,EAAE,CAAC;QACR,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,IAAI;KACf;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCP;CACA,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * A concentric wavefront expands from a center point, distorting pixels
3
+ * radially at the wavefront's crest. Behind the wave: `to`. Ahead: `from`.
4
+ */
5
+ export declare const shockwave: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
6
+ readonly center: readonly [0.5, 0.5];
7
+ readonly thickness: 0.15;
8
+ readonly strength: 0.04;
9
+ }>>;
10
+ //# sourceMappingURL=shockwave.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shockwave.d.ts","sourceRoot":"","sources":["../../src/transitions/shockwave.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,SAAS;;;;GAiDpB,CAAC"}
@@ -0,0 +1,56 @@
1
+ import { defineTransition } from "./define.js";
2
+ /**
3
+ * A concentric wavefront expands from a center point, distorting pixels
4
+ * radially at the wavefront's crest. Behind the wave: `to`. Ahead: `from`.
5
+ */
6
+ export const shockwave = defineTransition({
7
+ name: "shockwave",
8
+ defaults: {
9
+ center: [0.5, 0.5],
10
+ thickness: 0.15,
11
+ strength: 0.04,
12
+ },
13
+ glsl: `
14
+ uniform vec2 uCenter;
15
+ uniform float uThickness;
16
+ uniform float uStrength;
17
+
18
+ vec4 transition(vec2 uv) {
19
+ vec2 pixel = uv * uResolution;
20
+ vec2 pixelCenter = uCenter * uResolution;
21
+ vec2 delta = pixel - pixelCenter;
22
+ float r = length(delta);
23
+ vec2 dir = r > 0.5 ? delta / r : vec2(1.0, 0.0);
24
+
25
+ float maxR = max(
26
+ max(length(pixelCenter), length(pixelCenter - vec2(uResolution.x, 0.0))),
27
+ max(length(pixelCenter - vec2(0.0, uResolution.y)), length(pixelCenter - uResolution))
28
+ );
29
+ float normalizedR = r / max(maxR, 0.0001);
30
+
31
+ // Wavefront position sweeps from outside-at-center (-thickness) to
32
+ // outside-at-corner (1+thickness) so distortion & seam fully exit the frame
33
+ // at the endpoints.
34
+ float wavePos = uProgress * (1.0 + 2.0 * uThickness) - uThickness;
35
+ float distToWave = normalizedR - wavePos;
36
+
37
+ // Distortion magnitude peaks at the wavefront and zeroes at endpoints.
38
+ float env = 4.0 * uProgress * (1.0 - uProgress);
39
+ float waveX = distToWave / max(uThickness, 0.001);
40
+ float waveMag = exp(-waveX * waveX * 4.0) * env * uStrength;
41
+
42
+ // Displace each image radially away from center by the wave magnitude.
43
+ vec2 disp = dir * waveMag;
44
+
45
+ // Behind the wavefront (distToWave < 0): show "to". Ahead: show "from".
46
+ // 1 - smoothstep form (smoothstep(high, low) is GLSL UB).
47
+ float sweep = 1.0 - smoothstep(-uThickness, uThickness, distToWave);
48
+
49
+ vec4 fromColor = getFromColor(clamp(uv + disp, 0.0, 1.0));
50
+ vec4 toColor = getToColor(clamp(uv - disp, 0.0, 1.0));
51
+
52
+ return mix(fromColor, toColor, sweep);
53
+ }
54
+ `,
55
+ });
56
+ //# sourceMappingURL=shockwave.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shockwave.js","sourceRoot":"","sources":["../../src/transitions/shockwave.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,gBAAgB,CAAC;IACxC,IAAI,EAAE,WAAW;IACjB,QAAQ,EAAE;QACR,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;QAClB,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,IAAI;KACf;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyCP;CACA,CAAC,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The image collapses to a single point and re-expands as the other.
3
+ * A scale factor runs from 1 at progress 0 to 0 at progress 0.5 to 1
4
+ * again at progress 1. Sampling from / to at
5
+ *
6
+ * sampleUv = center + (uv - center) · scale
7
+ *
8
+ * means that as scale approaches 0 the whole frame converges on
9
+ * whatever from/to looks like at the centre pixel — so the image
10
+ * visibly shrinks to a dot, flashes, and re-expands as the other
11
+ * content. A content-derived whitening pulse at progress ≈ 0.5
12
+ * sells the event-horizon moment without injecting synthetic
13
+ * colour. Crossfade happens in a narrow window around progress 0.5
14
+ * so from and to don't visibly coexist except at the flash instant.
15
+ *
16
+ * Endpoints: scale = 1 at progress 0/1, so the sample UV is identity
17
+ * and we render pure from / to. The flash envelope is zero there too.
18
+ */
19
+ export declare const singularity: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
20
+ readonly center: readonly [0.5, 0.5];
21
+ }>>;
22
+ //# sourceMappingURL=singularity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"singularity.d.ts","sourceRoot":"","sources":["../../src/transitions/singularity.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,WAAW;;GAsCtB,CAAC"}
@@ -0,0 +1,59 @@
1
+ import { defineTransition } from "./define.js";
2
+ /**
3
+ * The image collapses to a single point and re-expands as the other.
4
+ * A scale factor runs from 1 at progress 0 to 0 at progress 0.5 to 1
5
+ * again at progress 1. Sampling from / to at
6
+ *
7
+ * sampleUv = center + (uv - center) · scale
8
+ *
9
+ * means that as scale approaches 0 the whole frame converges on
10
+ * whatever from/to looks like at the centre pixel — so the image
11
+ * visibly shrinks to a dot, flashes, and re-expands as the other
12
+ * content. A content-derived whitening pulse at progress ≈ 0.5
13
+ * sells the event-horizon moment without injecting synthetic
14
+ * colour. Crossfade happens in a narrow window around progress 0.5
15
+ * so from and to don't visibly coexist except at the flash instant.
16
+ *
17
+ * Endpoints: scale = 1 at progress 0/1, so the sample UV is identity
18
+ * and we render pure from / to. The flash envelope is zero there too.
19
+ */
20
+ export const singularity = defineTransition({
21
+ name: "singularity",
22
+ defaults: {
23
+ center: [0.5, 0.5],
24
+ },
25
+ glsl: `
26
+ uniform vec2 uCenter;
27
+
28
+ vec4 transition(vec2 uv) {
29
+ // Scale: 1 at endpoints, 0 at progress 0.5. Clamped above epsilon so
30
+ // the flash frame still samples a real texel instead of hitting the
31
+ // exact centre pixel (and to give the collapse a tiny residual
32
+ // chromatic core rather than a hard dot).
33
+ float raw = abs(uProgress - 0.5) * 2.0;
34
+ float scale = max(raw, 1e-3);
35
+
36
+ vec2 sampleUv = clamp(uCenter + (uv - uCenter) * scale, 0.0, 1.0);
37
+
38
+ vec4 fromC = getFromColor(sampleUv);
39
+ vec4 toC = getToColor(sampleUv);
40
+
41
+ // Tight crossfade around the collapse — from dominates until almost
42
+ // progress 0.5, to takes over just after. This keeps the geometry
43
+ // (shrinking → dot → growing) as the dominant narrative, not a
44
+ // mushy overlap.
45
+ float blend = smoothstep(0.48, 0.52, uProgress);
46
+ vec3 result = mix(fromC.rgb, toC.rgb, blend);
47
+
48
+ // Event-horizon whitening: content-derived gain that peaks at the
49
+ // instant of collapse. Smooth falloff to zero by progress 0.3/0.7
50
+ // so there's no residual brightness outside the flash.
51
+ float flash = 1.0 - smoothstep(0.0, 0.2, raw);
52
+ float lum = dot(result, vec3(0.299, 0.587, 0.114));
53
+ result += (1.0 - result) * lum * flash;
54
+
55
+ return vec4(result, 1.0);
56
+ }
57
+ `,
58
+ });
59
+ //# sourceMappingURL=singularity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"singularity.js","sourceRoot":"","sources":["../../src/transitions/singularity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,gBAAgB,CAAC;IAC1C,IAAI,EAAE,aAAa;IACnB,QAAQ,EAAE;QACR,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;KACnB;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCP;CACA,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Cover slide: the "to" image slides in and covers the stationary "from".
3
+ * Distinct from `push` (which scrolls both images together as a unit).
4
+ */
5
+ export declare const slide: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
6
+ readonly direction: readonly [-1, 0];
7
+ readonly feather: 0.015;
8
+ readonly blur: 0;
9
+ }>>;
10
+ //# sourceMappingURL=slide.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slide.d.ts","sourceRoot":"","sources":["../../src/transitions/slide.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,KAAK;;;;GAqEhB,CAAC"}