@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,106 @@
1
+ import { defineTransition } from "./define.js";
2
+ /**
3
+ * Multi-pass transition. As a noise-masked reveal of to emerges, its
4
+ * bright highlights bloom outward with big cinematic halos impossible
5
+ * in a single pass — the blur radius grows to ~32 pixels via five
6
+ * doubling-step iterations (1, 2, 4, 8, 16 px), which would need
7
+ * ~65² samples single-pass.
8
+ *
9
+ * pass 0 — extract to-highlights gated by the reveal
10
+ * mask AND a 4·p·(1-p) envelope that zeroes
11
+ * at both endpoints.
12
+ * pass 1..passCount-2 — expanding-step 9-tap box blur, doubling
13
+ * radius each iteration.
14
+ * final pass — composite: base = mix(from, to, mask), then
15
+ * add the blurred bloom scaled by intensity.
16
+ *
17
+ * Endpoints: the bloom envelope is zero at progress 0 and 1, so all
18
+ * intermediate passes carry zeros and the composite is pure from/to.
19
+ * Noise is remapped to [softness+safety, 1-softness-safety] so the
20
+ * reveal-mask smoothstep saturates cleanly at progress 0 and 1.
21
+ */
22
+ export const bloomReveal = defineTransition({
23
+ name: "bloom-reveal",
24
+ passes: 7,
25
+ defaults: {
26
+ scale: 5,
27
+ softness: 0.08,
28
+ threshold: 0.55,
29
+ intensity: 3.0,
30
+ },
31
+ glsl: `
32
+ uniform float uScale;
33
+ uniform float uSoftness;
34
+ uniform float uThreshold;
35
+ uniform float uIntensity;
36
+
37
+ float hash21(vec2 p) {
38
+ return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453);
39
+ }
40
+
41
+ float valNoise(vec2 p) {
42
+ vec2 i = floor(p);
43
+ vec2 f = fract(p);
44
+ f = f * f * (3.0 - 2.0 * f);
45
+ float a = hash21(i);
46
+ float b = hash21(i + vec2(1.0, 0.0));
47
+ float c = hash21(i + vec2(0.0, 1.0));
48
+ float d = hash21(i + vec2(1.0, 1.0));
49
+ return mix(mix(a, b, f.x), mix(c, d, f.x), f.y);
50
+ }
51
+
52
+ float fbm(vec2 p) {
53
+ return valNoise(p) * 0.55 +
54
+ valNoise(p * 2.1) * 0.28 +
55
+ valNoise(p * 4.3) * 0.17;
56
+ }
57
+
58
+ float revealMask(vec2 uv) {
59
+ // Safe noise bounds guarantee the mask smoothstep saturates to 0 at
60
+ // progress=0 and 1 at progress=1 regardless of where the noise lands.
61
+ float safeLow = uSoftness + 0.005;
62
+ float safeHigh = 1.0 - uSoftness - 0.005;
63
+ float n = mix(safeLow, safeHigh, clamp(fbm(uv * uScale), 0.0, 1.0));
64
+ return smoothstep(n - uSoftness, n + uSoftness, uProgress);
65
+ }
66
+
67
+ vec4 transition(vec2 uv) {
68
+ // Final pass: composite bloom on top of the from→to reveal.
69
+ if (uPass == uPassCount - 1) {
70
+ vec3 bloom = getPrevious(uv).rgb;
71
+ float mask = revealMask(uv);
72
+ vec3 base = mix(getFromColor(uv).rgb, getToColor(uv).rgb, mask);
73
+ return vec4(base + bloom * uIntensity, 1.0);
74
+ }
75
+
76
+ // Seed: bloom contribution = to_color * (brightness_mask) * reveal
77
+ // * envelope. Envelope vanishes at progress 0/1 → clean endpoints.
78
+ if (uPass == 0) {
79
+ float mask = revealMask(uv);
80
+ vec3 toColor = getToColor(uv).rgb;
81
+ float lum = dot(toColor, vec3(0.299, 0.587, 0.114));
82
+ float brightness = smoothstep(uThreshold - 0.1, uThreshold + 0.1, lum);
83
+ float envelope = 4.0 * uProgress * (1.0 - uProgress);
84
+ vec3 bloom = toColor * brightness * mask * envelope;
85
+ return vec4(bloom, 1.0);
86
+ }
87
+
88
+ // Blur: 9-tap box blur with an expanding step so the effective
89
+ // radius doubles each pass. After 5 blur passes, reach is ~32 px.
90
+ float step = pow(2.0, float(uPass - 1));
91
+ vec2 px = vec2(step) / uResolution;
92
+ vec3 sum = vec3(0.0);
93
+ sum += getPrevious(uv + vec2(-px.x, -px.y)).rgb;
94
+ sum += getPrevious(uv + vec2(0.0, -px.y)).rgb;
95
+ sum += getPrevious(uv + vec2(px.x, -px.y)).rgb;
96
+ sum += getPrevious(uv + vec2(-px.x, 0.0)).rgb;
97
+ sum += getPrevious(uv).rgb;
98
+ sum += getPrevious(uv + vec2(px.x, 0.0)).rgb;
99
+ sum += getPrevious(uv + vec2(-px.x, px.y)).rgb;
100
+ sum += getPrevious(uv + vec2(0.0, px.y)).rgb;
101
+ sum += getPrevious(uv + vec2(px.x, px.y)).rgb;
102
+ return vec4(sum / 9.0, 1.0);
103
+ }
104
+ `,
105
+ });
106
+ //# sourceMappingURL=bloom-reveal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bloom-reveal.js","sourceRoot":"","sources":["../../src/transitions/bloom-reveal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,gBAAgB,CAAC;IAC1C,IAAI,EAAE,cAAc;IACpB,MAAM,EAAE,CAAC;IACT,QAAQ,EAAE;QACR,KAAK,EAAE,CAAC;QACR,QAAQ,EAAE,IAAI;QACd,SAAS,EAAE,IAAI;QACf,SAAS,EAAE,GAAG;KACf;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyEP;CACA,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const chromaticPulse: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
2
+ readonly intensity: 0.6;
3
+ }>>;
4
+ //# sourceMappingURL=chromatic-pulse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chromatic-pulse.d.ts","sourceRoot":"","sources":["../../src/transitions/chromatic-pulse.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc;;GAqCzB,CAAC"}
@@ -0,0 +1,40 @@
1
+ import { defineTransition } from "./define.js";
2
+ export const chromaticPulse = defineTransition({
3
+ name: "chromatic-pulse",
4
+ defaults: {
5
+ intensity: 0.6,
6
+ },
7
+ glsl: `
8
+ uniform float uIntensity;
9
+
10
+ vec4 transition(vec2 uv) {
11
+ // Envelope peaks at midpoint, zero at endpoints.
12
+ float env = 4.0 * uProgress * (1.0 - uProgress);
13
+ float aberration = env * uIntensity * 0.03;
14
+
15
+ // Radial direction from center → outward chromatic shift feels lens-like.
16
+ vec2 toCenter = uv - 0.5;
17
+ float r = length(toCenter);
18
+ vec2 dir = r > 0.0001 ? toCenter / r : vec2(1.0, 0.0);
19
+
20
+ vec2 offR = clamp(uv + dir * aberration, 0.0, 1.0);
21
+ vec2 offG = uv;
22
+ vec2 offB = clamp(uv - dir * aberration, 0.0, 1.0);
23
+
24
+ vec3 fromRGB = vec3(
25
+ getFromColor(offR).r,
26
+ getFromColor(offG).g,
27
+ getFromColor(offB).b
28
+ );
29
+ vec3 toRGB = vec3(
30
+ getToColor(offR).r,
31
+ getToColor(offG).g,
32
+ getToColor(offB).b
33
+ );
34
+
35
+ float mixW = smoothstep(0.3, 0.7, uProgress);
36
+ return vec4(mix(fromRGB, toRGB, mixW), 1.0);
37
+ }
38
+ `,
39
+ });
40
+ //# sourceMappingURL=chromatic-pulse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chromatic-pulse.js","sourceRoot":"","sources":["../../src/transitions/chromatic-pulse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAgB,CAAC;IAC7C,IAAI,EAAE,iBAAiB;IACvB,QAAQ,EAAE;QACR,SAAS,EAAE,GAAG;KACf;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BP;CACA,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare const clockWipe: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
2
+ readonly startAngle: -1.5707963;
3
+ readonly direction: 1;
4
+ readonly softness: 0.02;
5
+ }>>;
6
+ //# sourceMappingURL=clock-wipe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clock-wipe.d.ts","sourceRoot":"","sources":["../../src/transitions/clock-wipe.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;GA8BpB,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { defineTransition } from "./define.js";
2
+ export const clockWipe = defineTransition({
3
+ name: "clock-wipe",
4
+ defaults: {
5
+ startAngle: -1.5707963, // -π/2 (12 o'clock)
6
+ direction: 1, // +1 clockwise, -1 counter-clockwise
7
+ softness: 0.02,
8
+ },
9
+ glsl: `
10
+ uniform float uStartAngle;
11
+ uniform float uDirection;
12
+ uniform float uSoftness;
13
+
14
+ const float TWO_PI = 6.2831853;
15
+
16
+ vec4 transition(vec2 uv) {
17
+ vec2 delta = uv - vec2(0.5);
18
+ // Aspect-correct so the sweep stays angularly uniform on non-square canvases.
19
+ vec2 aspectDelta = delta * vec2(uResolution.x / uResolution.y, 1.0);
20
+
21
+ float angle = atan(aspectDelta.y, aspectDelta.x);
22
+ float sweep = mod(uDirection * (angle - uStartAngle), TWO_PI);
23
+
24
+ // Threshold extends beyond [0, 2π] by the softness on each side so the
25
+ // feather zone is outside the visible sweep range at the endpoints.
26
+ float threshold = uProgress * (TWO_PI + 2.0 * uSoftness) - uSoftness;
27
+ float w = smoothstep(threshold - uSoftness, threshold + uSoftness, sweep);
28
+
29
+ return mix(getToColor(uv), getFromColor(uv), w);
30
+ }
31
+ `,
32
+ });
33
+ //# sourceMappingURL=clock-wipe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clock-wipe.js","sourceRoot":"","sources":["../../src/transitions/clock-wipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,CAAC,MAAM,SAAS,GAAG,gBAAgB,CAAC;IACxC,IAAI,EAAE,YAAY;IAClB,QAAQ,EAAE;QACR,UAAU,EAAE,CAAC,SAAS,EAAE,oBAAoB;QAC5C,SAAS,EAAE,CAAC,EAAE,qCAAqC;QACnD,QAAQ,EAAE,IAAI;KACf;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;CAsBP;CACA,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Port of gl-transitions' ColorPhase. Each color channel transitions on its
3
+ * own sub-range of progress via smoothstep, giving a phased spectrum-shift
4
+ * reveal (red fades early, green middle, blue late, for the defaults).
5
+ */
6
+ export declare const colorPhase: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
7
+ readonly fromStep: readonly [0, 0.2, 0.4, 0];
8
+ readonly toStep: readonly [0.6, 0.8, 1, 1];
9
+ }>>;
10
+ //# sourceMappingURL=color-phase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color-phase.d.ts","sourceRoot":"","sources":["../../src/transitions/color-phase.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,UAAU;;;GAgBrB,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { defineTransition } from "./define.js";
2
+ /**
3
+ * Port of gl-transitions' ColorPhase. Each color channel transitions on its
4
+ * own sub-range of progress via smoothstep, giving a phased spectrum-shift
5
+ * reveal (red fades early, green middle, blue late, for the defaults).
6
+ */
7
+ export const colorPhase = defineTransition({
8
+ name: "color-phase",
9
+ defaults: {
10
+ fromStep: [0.0, 0.2, 0.4, 0.0],
11
+ toStep: [0.6, 0.8, 1.0, 1.0],
12
+ },
13
+ glsl: `
14
+ uniform vec4 uFromStep;
15
+ uniform vec4 uToStep;
16
+
17
+ vec4 transition(vec2 uv) {
18
+ vec4 a = getFromColor(uv);
19
+ vec4 b = getToColor(uv);
20
+ return mix(a, b, smoothstep(uFromStep, uToStep, vec4(uProgress)));
21
+ }
22
+ `,
23
+ });
24
+ //# sourceMappingURL=color-phase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color-phase.js","sourceRoot":"","sources":["../../src/transitions/color-phase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC;IACzC,IAAI,EAAE,aAAa;IACnB,QAAQ,EAAE;QACR,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;QAC9B,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;KAC7B;IACD,IAAI,EAAE;;;;;;;;;CASP;CACA,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colour-distance.d.ts","sourceRoot":"","sources":["../../src/transitions/colour-distance.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,cAAc;;;GAyBzB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cross-warp.d.ts","sourceRoot":"","sources":["../../src/transitions/cross-warp.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,SAAS;;;GAyBpB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const crossZoom: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
2
+ readonly strength: 1.2;
3
+ readonly blur: 0.04;
4
+ }>>;
5
+ //# sourceMappingURL=cross-zoom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cross-zoom.d.ts","sourceRoot":"","sources":["../../src/transitions/cross-zoom.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;GAwDpB,CAAC"}
@@ -0,0 +1,59 @@
1
+ import { defineTransition } from "./define.js";
2
+ export const crossZoom = defineTransition({
3
+ name: "cross-zoom",
4
+ defaults: {
5
+ strength: 1.2,
6
+ blur: 0.04,
7
+ },
8
+ glsl: `
9
+ uniform float uStrength;
10
+ uniform float uBlur;
11
+
12
+ vec2 zoomUv(vec2 uv, float scale) {
13
+ return (uv - 0.5) / scale + 0.5;
14
+ }
15
+
16
+ vec4 sampleFromBlurred(vec2 uv, float amount) {
17
+ if (amount < 0.001) return getFromColor(uv);
18
+ const int N = 5;
19
+ vec4 sum = vec4(0.0);
20
+ for (int i = 0; i < N; i++) {
21
+ float t = (float(i) - 2.0) / 4.0;
22
+ vec2 offset = (uv - 0.5) * amount * t;
23
+ sum += getFromColor(uv + offset);
24
+ }
25
+ return sum / float(N);
26
+ }
27
+
28
+ vec4 sampleToBlurred(vec2 uv, float amount) {
29
+ if (amount < 0.001) return getToColor(uv);
30
+ const int N = 5;
31
+ vec4 sum = vec4(0.0);
32
+ for (int i = 0; i < N; i++) {
33
+ float t = (float(i) - 2.0) / 4.0;
34
+ vec2 offset = (uv - 0.5) * amount * t;
35
+ sum += getToColor(uv + offset);
36
+ }
37
+ return sum / float(N);
38
+ }
39
+
40
+ vec4 transition(vec2 uv) {
41
+ float fromScale = 1.0 + uProgress * uStrength;
42
+ float toScale = 1.0 + (1.0 - uProgress) * uStrength;
43
+
44
+ vec2 fromUv = zoomUv(uv, fromScale);
45
+ vec2 toUv = zoomUv(uv, toScale);
46
+
47
+ // Velocity-scaled radial blur (peak at midpoint, zero at endpoints).
48
+ float motion = 4.0 * uProgress * (1.0 - uProgress) * uBlur;
49
+
50
+ vec4 fromColor = sampleFromBlurred(fromUv, motion);
51
+ vec4 toColor = sampleToBlurred(toUv, motion);
52
+
53
+ // Crossfade concentrated in the middle 40% of the transition.
54
+ float mixW = smoothstep(0.3, 0.7, uProgress);
55
+ return mix(fromColor, toColor, mixW);
56
+ }
57
+ `,
58
+ });
59
+ //# sourceMappingURL=cross-zoom.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cross-zoom.js","sourceRoot":"","sources":["../../src/transitions/cross-zoom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,CAAC,MAAM,SAAS,GAAG,gBAAgB,CAAC;IACxC,IAAI,EAAE,YAAY;IAClB,QAAQ,EAAE;QACR,QAAQ,EAAE,GAAG;QACb,IAAI,EAAE,IAAI;KACX;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiDP;CACA,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Port of gl-transitions' CrossHatch. Pixels reveal based on an outer
3
+ * radial wave from `center` combined with per-row and per-column random
4
+ * thresholds, producing a sketchy hand-drawn crosshatch reveal. Outer
5
+ * smoothstep envelopes guarantee pixel-pure endpoints.
6
+ */
7
+ export declare const crosshatch: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
8
+ readonly center: readonly [0.5, 0.5];
9
+ readonly threshold: 3;
10
+ readonly fadeEdge: 0.1;
11
+ }>>;
12
+ //# sourceMappingURL=crosshatch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crosshatch.d.ts","sourceRoot":"","sources":["../../src/transitions/crosshatch.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,eAAO,MAAM,UAAU;;;;GAwCrB,CAAC"}
@@ -0,0 +1,49 @@
1
+ import { defineTransition } from "./define.js";
2
+ /**
3
+ * Port of gl-transitions' CrossHatch. Pixels reveal based on an outer
4
+ * radial wave from `center` combined with per-row and per-column random
5
+ * thresholds, producing a sketchy hand-drawn crosshatch reveal. Outer
6
+ * smoothstep envelopes guarantee pixel-pure endpoints.
7
+ */
8
+ export const crosshatch = defineTransition({
9
+ name: "crosshatch",
10
+ defaults: {
11
+ center: [0.5, 0.5],
12
+ threshold: 3,
13
+ fadeEdge: 0.1,
14
+ },
15
+ glsl: `
16
+ uniform vec2 uCenter;
17
+ uniform float uThreshold;
18
+ uniform float uFadeEdge;
19
+
20
+ float rand(vec2 co) {
21
+ return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);
22
+ }
23
+
24
+ vec4 transition(vec2 uv) {
25
+ // Below threshold=3 the radial wave doesn't have enough range to cover
26
+ // the full canvas before the outer fade-edge envelope kicks in, leaving
27
+ // patchy unrevealed pixels mid-transition that snap to revealed at the
28
+ // end. Clamp here so the transition is reliable regardless of caller input.
29
+ float threshold = max(uThreshold, 3.0);
30
+ float dist = distance(uCenter, uv) / threshold;
31
+ float r = uProgress - min(rand(vec2(uv.y, 0.0)), rand(vec2(0.0, uv.x)));
32
+
33
+ float feather = 0.02;
34
+ float inner = smoothstep(dist - feather, dist + feather, r);
35
+
36
+ // Outer mix structure (from gl-transitions): no reveal until uFadeEdge,
37
+ // forced full reveal in last uFadeEdge of progress — guarantees clean
38
+ // endpoints regardless of the random threshold's noisiness.
39
+ float w = mix(
40
+ 0.0,
41
+ mix(inner, 1.0, smoothstep(1.0 - uFadeEdge, 1.0, uProgress)),
42
+ smoothstep(0.0, uFadeEdge, uProgress)
43
+ );
44
+
45
+ return mix(getFromColor(uv), getToColor(uv), w);
46
+ }
47
+ `,
48
+ });
49
+ //# sourceMappingURL=crosshatch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crosshatch.js","sourceRoot":"","sources":["../../src/transitions/crosshatch.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,YAAY;IAClB,QAAQ,EAAE;QACR,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;QAClB,SAAS,EAAE,CAAC;QACZ,QAAQ,EAAE,GAAG;KACd;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCP;CACA,CAAC,CAAC"}
@@ -0,0 +1,35 @@
1
+ import type { MeshGeometry, Transition, UniformParams, Widen } from "../types.js";
2
+ export interface DefineTransitionSpec<P extends UniformParams> {
3
+ name: string;
4
+ glsl: string;
5
+ /**
6
+ * Full vertex-shader main(). Required when `mesh` is set. See
7
+ * TransitionShader.vertex for shell details.
8
+ */
9
+ vertex?: string;
10
+ wgsl?: string;
11
+ defaults: P;
12
+ passes?: number;
13
+ mesh?: MeshGeometry;
14
+ }
15
+ /**
16
+ * Build a `Transition` from a plain spec. Authors write a fragment-shader
17
+ * `vec4 transition(vec2 uv) { … }` body and a `defaults` object of named
18
+ * uniforms; the Runner wraps it with the standard headers (`#version
19
+ * 300 es`, precision, `uFrom` / `uTo` / `uProgress` / `uResolution`,
20
+ * sampler helpers `getFromColor` / `getToColor`) and maps each key in
21
+ * `defaults` to a `u<PascalCase>` uniform via the runner's binding rule.
22
+ *
23
+ * Mesh transitions add a `vertex` shader body and a `mesh` geometry
24
+ * descriptor; multi-pass transitions add `passes`.
25
+ *
26
+ * The returned object is a plain `Transition<Widen<P>>` — the `Widen`
27
+ * step lifts literal default tuples (e.g. `readonly [-1, 0]`) back to
28
+ * the general uniform tuple types so callers can override freely.
29
+ *
30
+ * Per the project's engineering invariants, every defined transition
31
+ * must clear the endpoint-correctness, polish-degrades-at-endpoints,
32
+ * no-hard-cuts, full-frame, and continuous-motion rules.
33
+ */
34
+ export declare function defineTransition<const P extends UniformParams>(spec: DefineTransitionSpec<P>): Transition<Widen<P>>;
35
+ //# sourceMappingURL=define.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define.d.ts","sourceRoot":"","sources":["../../src/transitions/define.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EAEV,aAAa,EACb,KAAK,EACN,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,oBAAoB,CAAC,CAAC,SAAS,aAAa;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,YAAY,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,CAAC,CAAC,SAAS,aAAa,EAC5D,IAAI,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAC5B,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAYtB"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Build a `Transition` from a plain spec. Authors write a fragment-shader
3
+ * `vec4 transition(vec2 uv) { … }` body and a `defaults` object of named
4
+ * uniforms; the Runner wraps it with the standard headers (`#version
5
+ * 300 es`, precision, `uFrom` / `uTo` / `uProgress` / `uResolution`,
6
+ * sampler helpers `getFromColor` / `getToColor`) and maps each key in
7
+ * `defaults` to a `u<PascalCase>` uniform via the runner's binding rule.
8
+ *
9
+ * Mesh transitions add a `vertex` shader body and a `mesh` geometry
10
+ * descriptor; multi-pass transitions add `passes`.
11
+ *
12
+ * The returned object is a plain `Transition<Widen<P>>` — the `Widen`
13
+ * step lifts literal default tuples (e.g. `readonly [-1, 0]`) back to
14
+ * the general uniform tuple types so callers can override freely.
15
+ *
16
+ * Per the project's engineering invariants, every defined transition
17
+ * must clear the endpoint-correctness, polish-degrades-at-endpoints,
18
+ * no-hard-cuts, full-frame, and continuous-motion rules.
19
+ */
20
+ export function defineTransition(spec) {
21
+ const shader = { glsl: spec.glsl };
22
+ if (spec.vertex !== undefined)
23
+ shader.vertex = spec.vertex;
24
+ if (spec.wgsl !== undefined)
25
+ shader.wgsl = spec.wgsl;
26
+ const t = {
27
+ name: spec.name,
28
+ shader,
29
+ defaults: spec.defaults,
30
+ };
31
+ if (spec.passes !== undefined)
32
+ t.passes = spec.passes;
33
+ if (spec.mesh !== undefined)
34
+ t.mesh = spec.mesh;
35
+ return t;
36
+ }
37
+ //# sourceMappingURL=define.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define.js","sourceRoot":"","sources":["../../src/transitions/define.ts"],"names":[],"mappings":"AAsBA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,gBAAgB,CAC9B,IAA6B;IAE7B,MAAM,MAAM,GAAqB,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;IACrD,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS;QAAE,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IAC3D,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS;QAAE,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;IACrD,MAAM,CAAC,GAAyB;QAC9B,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,MAAM;QACN,QAAQ,EAAE,IAAI,CAAC,QAA+B;KAC/C,CAAC;IACF,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS;QAAE,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IACtD,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS;QAAE,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;IAChD,OAAO,CAAC,CAAC;AACX,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Linear film-burn sibling: a warm-glowing fire line advances across the
3
+ * frame from one edge, like a sparkler running along a fuse. Distinct
4
+ * from light-leak (smooth colored band passing through) — this is a
5
+ * state-change front: unburned ahead, reveal behind, hot glow ON the
6
+ * line.
7
+ */
8
+ export declare const directionalBurn: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
9
+ readonly direction: readonly [1, 0];
10
+ readonly scale: 10;
11
+ readonly edgeWidth: 0.035;
12
+ readonly flameColor: readonly [1.6, 0.7, 0.15];
13
+ }>>;
14
+ //# sourceMappingURL=directional-burn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"directional-burn.d.ts","sourceRoot":"","sources":["../../src/transitions/directional-burn.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,eAAe;;;;;GAyD1B,CAAC"}
@@ -0,0 +1,67 @@
1
+ import { defineTransition } from "./define.js";
2
+ /**
3
+ * Linear film-burn sibling: a warm-glowing fire line advances across the
4
+ * frame from one edge, like a sparkler running along a fuse. Distinct
5
+ * from light-leak (smooth colored band passing through) — this is a
6
+ * state-change front: unburned ahead, reveal behind, hot glow ON the
7
+ * line.
8
+ */
9
+ export const directionalBurn = defineTransition({
10
+ name: "directional-burn",
11
+ defaults: {
12
+ direction: [1, 0],
13
+ scale: 10,
14
+ edgeWidth: 0.035,
15
+ flameColor: [1.6, 0.7, 0.15],
16
+ },
17
+ glsl: `
18
+ uniform vec2 uDirection;
19
+ uniform float uScale;
20
+ uniform float uEdgeWidth;
21
+ uniform vec3 uFlameColor;
22
+
23
+ float hash21(vec2 p) {
24
+ return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453);
25
+ }
26
+
27
+ float valueNoise(vec2 p) {
28
+ vec2 i = floor(p);
29
+ vec2 f = fract(p);
30
+ f = f * f * (3.0 - 2.0 * f);
31
+ float a = hash21(i);
32
+ float b = hash21(i + vec2(1.0, 0.0));
33
+ float c = hash21(i + vec2(0.0, 1.0));
34
+ float d = hash21(i + vec2(1.0, 1.0));
35
+ return mix(mix(a, b, f.x), mix(c, d, f.x), f.y);
36
+ }
37
+
38
+ vec4 transition(vec2 uv) {
39
+ vec2 d = normalize(uDirection);
40
+ float projected = dot(uv - 0.5, -d);
41
+ // Max projection magnitude for any uv in [0,1]^2 given this direction;
42
+ // L1 formula that works for axis-aligned and diagonal directions alike.
43
+ float maxProj = 0.5 * (abs(d.x) + abs(d.y));
44
+
45
+ float noiseStrength = 0.06;
46
+ float n = valueNoise(uv * uScale);
47
+ float perturbed = projected - (n - 0.5) * noiseStrength;
48
+
49
+ float totalEdge = uEdgeWidth + noiseStrength * 0.5;
50
+ float boundary = (maxProj + totalEdge) * (1.0 - 2.0 * uProgress);
51
+ float signedDist = perturbed - boundary;
52
+
53
+ // Behind the front: reveal "to". Ahead: still "from".
54
+ float w = smoothstep(-uEdgeWidth, uEdgeWidth, signedDist);
55
+ vec4 base = mix(getFromColor(uv), getToColor(uv), w);
56
+
57
+ // Tight flame band centered on the front, env-gated to zero at endpoints.
58
+ float bandX = signedDist / max(uEdgeWidth * 1.3, 0.0001);
59
+ float flameBand = exp(-bandX * bandX * 3.5);
60
+ float env = 4.0 * uProgress * (1.0 - uProgress);
61
+ vec3 flame = uFlameColor * flameBand * env;
62
+
63
+ return vec4(base.rgb + flame, base.a);
64
+ }
65
+ `,
66
+ });
67
+ //# sourceMappingURL=directional-burn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"directional-burn.js","sourceRoot":"","sources":["../../src/transitions/directional-burn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,gBAAgB,CAAC;IAC9C,IAAI,EAAE,kBAAkB;IACxB,QAAQ,EAAE;QACR,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QACjB,KAAK,EAAE,EAAE;QACT,SAAS,EAAE,KAAK;QAChB,UAAU,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC;KAC7B;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDP;CACA,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Ported from gl-transitions' directionalwarp. Uses L1-normalized direction
3
+ * so the wavefront covers the full image regardless of direction, and a
4
+ * shrink-to-center sampling that never needs to clamp outside [0,1] — so
5
+ * there are no stretched edge artifacts (the "bars" a naive displacement
6
+ * approach produces).
7
+ */
8
+ export declare const directionalWarp: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
9
+ readonly direction: readonly [-1, 1];
10
+ readonly smoothness: 0.5;
11
+ }>>;
12
+ //# sourceMappingURL=directional-warp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"directional-warp.d.ts","sourceRoot":"","sources":["../../src/transitions/directional-warp.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,eAAe;;;GAoC1B,CAAC"}
@@ -0,0 +1,46 @@
1
+ import { defineTransition } from "./define.js";
2
+ /**
3
+ * Ported from gl-transitions' directionalwarp. Uses L1-normalized direction
4
+ * so the wavefront covers the full image regardless of direction, and a
5
+ * shrink-to-center sampling that never needs to clamp outside [0,1] — so
6
+ * there are no stretched edge artifacts (the "bars" a naive displacement
7
+ * approach produces).
8
+ */
9
+ export const directionalWarp = defineTransition({
10
+ name: "directional-warp",
11
+ defaults: {
12
+ direction: [-1, 1],
13
+ smoothness: 0.5,
14
+ },
15
+ glsl: `
16
+ uniform vec2 uDirection;
17
+ uniform float uSmoothness;
18
+
19
+ vec4 transition(vec2 uv) {
20
+ // L1 normalization: ensures the projection v.x*uv.x + v.y*uv.y covers a
21
+ // range of length 1 regardless of direction.
22
+ vec2 v = uDirection;
23
+ float l = abs(v.x) + abs(v.y);
24
+ if (l < 0.0001) v = vec2(1.0, 0.0);
25
+ else v = v / l;
26
+
27
+ vec2 center = vec2(0.5);
28
+ float d = v.x * center.x + v.y * center.y;
29
+
30
+ float m = 1.0 - smoothstep(
31
+ -uSmoothness,
32
+ 0.0,
33
+ v.x * uv.x + v.y * uv.y - (d - 0.5 + uProgress * (1.0 + uSmoothness))
34
+ );
35
+
36
+ // Shrink-to-center sampling: fromUv shrinks toward center as m grows,
37
+ // toUv grows out from center. UVs stay in [0,1] — no clamping needed.
38
+ return mix(
39
+ getFromColor((uv - 0.5) * (1.0 - m) + 0.5),
40
+ getToColor((uv - 0.5) * m + 0.5),
41
+ m
42
+ );
43
+ }
44
+ `,
45
+ });
46
+ //# sourceMappingURL=directional-warp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"directional-warp.js","sourceRoot":"","sources":["../../src/transitions/directional-warp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,gBAAgB,CAAC;IAC9C,IAAI,EAAE,kBAAkB;IACxB,QAAQ,EAAE;QACR,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAClB,UAAU,EAAE,GAAG;KAChB;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BP;CACA,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const dissolve: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{}>>;
2
+ //# sourceMappingURL=dissolve.d.ts.map