@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 @@
1
+ {"version":3,"file":"dissolve.d.ts","sourceRoot":"","sources":["../../src/transitions/dissolve.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,sEAanB,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { defineTransition } from "./define.js";
2
+ export const dissolve = defineTransition({
3
+ name: "dissolve",
4
+ defaults: {},
5
+ glsl: `
6
+ vec4 transition(vec2 uv) {
7
+ vec4 a = getFromColor(uv);
8
+ vec4 b = getToColor(uv);
9
+ vec3 aLin = pow(a.rgb, vec3(2.2));
10
+ vec3 bLin = pow(b.rgb, vec3(2.2));
11
+ vec3 mixed = mix(aLin, bLin, uProgress);
12
+ return vec4(pow(mixed, vec3(1.0 / 2.2)), mix(a.a, b.a, uProgress));
13
+ }
14
+ `,
15
+ });
16
+ //# sourceMappingURL=dissolve.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dissolve.js","sourceRoot":"","sources":["../../src/transitions/dissolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,CAAC,MAAM,QAAQ,GAAG,gBAAgB,CAAC;IACvC,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE;;;;;;;;;CASP;CACA,CAAC,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Port of gl-transitions' DreamyZoom (Zeh Fernando, MIT). Phase 1 (p<0.5):
3
+ * from-image zooms in + rotates, fading toward white. Phase 2 (p>0.5):
4
+ * white fades back to to-image starting pre-rotated and unwinding to
5
+ * identity while zooming out. The white flash at p=0.5 masks the from→to
6
+ * image swap.
7
+ *
8
+ * Note: the original gl-transitions source has a bug (`* vec4(0)`) that
9
+ * disables the flash — fixed here to use white, matching the actual
10
+ * preview on gl-transitions.com.
11
+ *
12
+ * Single `intensity` param drives both rotation and scale internally.
13
+ * Rotation alone would push corners outside the canvas (visible edge-clamp
14
+ * streaks); scale must compensate. Splitting them as separate params lets
15
+ * the caller pick mismatched values that produce streaks. We map intensity
16
+ * to (rotation, scale) along a curve where scale always covers rotation,
17
+ * so any value in [0, 1] is visually safe.
18
+ *
19
+ * Default `intensity: 0.5` reproduces gl-transitions' defaults exactly
20
+ * (rotation ≈ 0.105 rad / 6°, scale ≈ 1.2).
21
+ */
22
+ export declare const dreamyZoom: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
23
+ readonly intensity: 0.5;
24
+ }>>;
25
+ //# sourceMappingURL=dreamy-zoom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dreamy-zoom.d.ts","sourceRoot":"","sources":["../../src/transitions/dreamy-zoom.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,UAAU;;GA0CrB,CAAC"}
@@ -0,0 +1,66 @@
1
+ import { defineTransition } from "./define.js";
2
+ /**
3
+ * Port of gl-transitions' DreamyZoom (Zeh Fernando, MIT). Phase 1 (p<0.5):
4
+ * from-image zooms in + rotates, fading toward white. Phase 2 (p>0.5):
5
+ * white fades back to to-image starting pre-rotated and unwinding to
6
+ * identity while zooming out. The white flash at p=0.5 masks the from→to
7
+ * image swap.
8
+ *
9
+ * Note: the original gl-transitions source has a bug (`* vec4(0)`) that
10
+ * disables the flash — fixed here to use white, matching the actual
11
+ * preview on gl-transitions.com.
12
+ *
13
+ * Single `intensity` param drives both rotation and scale internally.
14
+ * Rotation alone would push corners outside the canvas (visible edge-clamp
15
+ * streaks); scale must compensate. Splitting them as separate params lets
16
+ * the caller pick mismatched values that produce streaks. We map intensity
17
+ * to (rotation, scale) along a curve where scale always covers rotation,
18
+ * so any value in [0, 1] is visually safe.
19
+ *
20
+ * Default `intensity: 0.5` reproduces gl-transitions' defaults exactly
21
+ * (rotation ≈ 0.105 rad / 6°, scale ≈ 1.2).
22
+ */
23
+ export const dreamyZoom = defineTransition({
24
+ name: "dreamy-zoom",
25
+ defaults: {
26
+ intensity: 0.5,
27
+ },
28
+ glsl: `
29
+ uniform float uIntensity;
30
+
31
+ vec4 transition(vec2 uv) {
32
+ float ratio = uResolution.x / max(uResolution.y, 1.0);
33
+
34
+ // Single knob, mapped to rotation + scale together. Coefficients chosen
35
+ // so intensity=0.5 reproduces gl-transitions' (0.105 rad, 1.2) defaults.
36
+ float intensity = clamp(uIntensity, 0.0, 1.0);
37
+ float rotation = intensity * 0.21;
38
+ float scale = 1.0 + intensity * 0.4;
39
+
40
+ float phase = uProgress < 0.5 ? uProgress * 2.0 : (uProgress - 0.5) * 2.0;
41
+ float angleOffset = uProgress < 0.5
42
+ ? mix(0.0, rotation, phase)
43
+ : mix(-rotation, 0.0, phase);
44
+ float newScale = uProgress < 0.5
45
+ ? mix(1.0, scale, phase)
46
+ : mix(scale, 1.0, phase);
47
+
48
+ vec2 p = (uv - vec2(0.5)) / newScale * vec2(ratio, 1.0);
49
+ float angle = atan(p.y, p.x) + angleOffset;
50
+ float dist = length(p);
51
+ vec2 sampledP = vec2(
52
+ cos(angle) * dist / ratio + 0.5,
53
+ sin(angle) * dist + 0.5
54
+ );
55
+
56
+ vec4 c = uProgress < 0.5
57
+ ? getFromColor(sampledP)
58
+ : getToColor(sampledP);
59
+
60
+ // White flash: zero at endpoints, peaks at midpoint to mask the swap.
61
+ float flash = uProgress < 0.5 ? phase : 1.0 - phase;
62
+ return vec4(c.rgb + flash, c.a);
63
+ }
64
+ `,
65
+ });
66
+ //# sourceMappingURL=dreamy-zoom.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dreamy-zoom.js","sourceRoot":"","sources":["../../src/transitions/dreamy-zoom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC;IACzC,IAAI,EAAE,aAAa;IACnB,QAAQ,EAAE;QACR,SAAS,EAAE,GAAG;KACf;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCP;CACA,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Ported from gl-transitions' Dreamy. A gentle vertical wobble displaces
3
+ * both images with opposing phases; combined with the linear crossfade this
4
+ * gives a soft, hypnotic "dream" feel. Procedural, no displacement texture
5
+ * required.
6
+ */
7
+ export declare const dreamy: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{}>>;
8
+ //# sourceMappingURL=dreamy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dreamy.d.ts","sourceRoot":"","sources":["../../src/transitions/dreamy.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,eAAO,MAAM,MAAM,sEAiBjB,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { defineTransition } from "./define.js";
2
+ /**
3
+ * Ported from gl-transitions' Dreamy. A gentle vertical wobble displaces
4
+ * both images with opposing phases; combined with the linear crossfade this
5
+ * gives a soft, hypnotic "dream" feel. Procedural, no displacement texture
6
+ * required.
7
+ */
8
+ export const dreamy = defineTransition({
9
+ name: "dreamy",
10
+ defaults: {},
11
+ glsl: `
12
+ vec2 dreamyOffset(float progress, float x, float theta) {
13
+ float shifty = 0.03 * progress * cos(10.0 * (progress + x) + theta);
14
+ return vec2(0.0, shifty);
15
+ }
16
+
17
+ vec4 transition(vec2 uv) {
18
+ return mix(
19
+ getFromColor(uv + dreamyOffset(uProgress, uv.x, 0.0)),
20
+ getToColor(uv + dreamyOffset(1.0 - uProgress, uv.x, 3.14159)),
21
+ uProgress
22
+ );
23
+ }
24
+ `,
25
+ });
26
+ //# sourceMappingURL=dreamy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dreamy.js","sourceRoot":"","sources":["../../src/transitions/dreamy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,gBAAgB,CAAC;IACrC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE;;;;;;;;;;;;;CAaP;CACA,CAAC,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Faithful port of akella demo1. Horizontal sweep whose boundary is broken
3
+ * up by high-frequency Perlin noise hard-thresholded against the sweep
4
+ * position, producing isolated drip/splatter islands as the edge crosses.
5
+ *
6
+ * Deviations from the original:
7
+ * - The original's `smoothstep(edge, edge, x)` (undefined behavior when
8
+ * edge0 == edge1) is avoided by clamping `w` to a tiny positive value,
9
+ * so the edge smoothstep is always well-formed.
10
+ * - Endpoint position is `mix(-w, 1+w, progress)` (not akella's
11
+ * `mix(-w/2, 1-w/2, progress)`) so at progress=0/1 the mask saturates
12
+ * fully past the image bounds instead of relying on the UB fallback.
13
+ * - The displacement sampler is dropped — akella's shader declares it
14
+ * but never references it.
15
+ */
16
+ export declare const dripWipe: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
17
+ readonly direction: readonly [-1, 0];
18
+ readonly width: 0.5;
19
+ readonly scaleX: 40;
20
+ readonly scaleY: 40;
21
+ }>>;
22
+ //# sourceMappingURL=drip-wipe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drip-wipe.d.ts","sourceRoot":"","sources":["../../src/transitions/drip-wipe.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,QAAQ;;;;;GA2FnB,CAAC"}
@@ -0,0 +1,109 @@
1
+ import { defineTransition } from "./define.js";
2
+ /**
3
+ * Faithful port of akella demo1. Horizontal sweep whose boundary is broken
4
+ * up by high-frequency Perlin noise hard-thresholded against the sweep
5
+ * position, producing isolated drip/splatter islands as the edge crosses.
6
+ *
7
+ * Deviations from the original:
8
+ * - The original's `smoothstep(edge, edge, x)` (undefined behavior when
9
+ * edge0 == edge1) is avoided by clamping `w` to a tiny positive value,
10
+ * so the edge smoothstep is always well-formed.
11
+ * - Endpoint position is `mix(-w, 1+w, progress)` (not akella's
12
+ * `mix(-w/2, 1-w/2, progress)`) so at progress=0/1 the mask saturates
13
+ * fully past the image bounds instead of relying on the UB fallback.
14
+ * - The displacement sampler is dropped — akella's shader declares it
15
+ * but never references it.
16
+ */
17
+ export const dripWipe = defineTransition({
18
+ name: "drip-wipe",
19
+ defaults: {
20
+ direction: [-1, 0],
21
+ width: 0.5,
22
+ scaleX: 40,
23
+ scaleY: 40,
24
+ },
25
+ glsl: `
26
+ uniform vec2 uDirection;
27
+ uniform float uWidth;
28
+ uniform float uScaleX;
29
+ uniform float uScaleY;
30
+
31
+ // Stefan Gustavson classic 2D Perlin noise. Output range ≈ [-1, 1].
32
+ vec4 mod289(vec4 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }
33
+ vec4 permute(vec4 x) { return mod289((x * 34.0 + 1.0) * x); }
34
+ vec2 fade2(vec2 t) { return t * t * t * (t * (t * 6.0 - 15.0) + 10.0); }
35
+
36
+ float pnoise(vec2 P) {
37
+ vec4 Pi = floor(P.xyxy) + vec4(0.0, 0.0, 1.0, 1.0);
38
+ vec4 Pf = fract(P.xyxy) - vec4(0.0, 0.0, 1.0, 1.0);
39
+ Pi = mod289(Pi);
40
+ vec4 ix = Pi.xzxz;
41
+ vec4 iy = Pi.yyww;
42
+ vec4 fx = Pf.xzxz;
43
+ vec4 fy = Pf.yyww;
44
+ vec4 i = permute(permute(ix) + iy);
45
+ vec4 gx = 2.0 * fract(i * (1.0 / 41.0)) - 1.0;
46
+ vec4 gy = abs(gx) - 0.5;
47
+ vec4 tx = floor(gx + 0.5);
48
+ gx = gx - tx;
49
+ vec2 g00 = vec2(gx.x, gy.x);
50
+ vec2 g10 = vec2(gx.y, gy.y);
51
+ vec2 g01 = vec2(gx.z, gy.z);
52
+ vec2 g11 = vec2(gx.w, gy.w);
53
+ vec4 norm = 1.79284291400159 - 0.85373472095314 *
54
+ vec4(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11));
55
+ g00 *= norm.x;
56
+ g01 *= norm.y;
57
+ g10 *= norm.z;
58
+ g11 *= norm.w;
59
+ float n00 = dot(g00, vec2(fx.x, fy.x));
60
+ float n10 = dot(g10, vec2(fx.y, fy.y));
61
+ float n01 = dot(g01, vec2(fx.z, fy.z));
62
+ float n11 = dot(g11, vec2(fx.w, fy.w));
63
+ vec2 fxy = fade2(Pf.xy);
64
+ vec2 n_x = mix(vec2(n00, n01), vec2(n10, n11), fxy.x);
65
+ return 2.3 * mix(n_x.x, n_x.y, fxy.y);
66
+ }
67
+
68
+ // Snap to nearest axis-aligned unit. The proj normalization below assumes
69
+ // axis-aligned d (so proj ∈ [0,1]); diagonals would push it outside [0,1]
70
+ // and the wipe edge would never reach part of the canvas. Enforced
71
+ // in-shader so the UI's axis-only picker matches.
72
+ vec2 snapAxis(vec2 v) {
73
+ vec2 dn = normalize(v);
74
+ return abs(dn.x) > abs(dn.y) ? vec2(sign(dn.x), 0.0) : vec2(0.0, sign(dn.y));
75
+ }
76
+
77
+ vec4 transition(vec2 uv) {
78
+ vec2 d = snapAxis(uDirection);
79
+
80
+ // Project uv onto -d, centered at 0.5, so axis-aligned d gives a sweep
81
+ // coordinate in [0, 1]. Replaces the original's hardcoded uv.x.
82
+ // d=[-1, 0] (Left) → proj = uv.x (default; matches old shader)
83
+ // d=[ 1, 0] (Right) → proj = 1.0 - uv.x
84
+ // d=[ 0,-1] (Down) → proj = uv.y
85
+ // d=[ 0, 1] (Up) → proj = 1.0 - uv.y
86
+ float proj = dot(uv - vec2(0.5), -d) + 0.5;
87
+
88
+ // Width envelope: 0 at endpoints, 1 at mid-transition.
89
+ float dt = 4.0 * uProgress * (1.0 - uProgress);
90
+ // Keep w strictly positive so smoothstep(edge0, edge1, ...) never collapses.
91
+ float w = max(uWidth * dt, 0.001);
92
+
93
+ // Edge sweep: proj + shift spans well past [1 - w, 1] at both endpoints,
94
+ // so maskvalue saturates to 0 at progress=0 and 1 at progress=1.
95
+ float shift = mix(-w, 1.0 + w, uProgress);
96
+ float maskvalue = smoothstep(1.0 - w, 1.0, proj + shift);
97
+
98
+ // High-frequency Perlin, remapped to [0, 1] for akella's additive form.
99
+ float realnoise = 0.5 * (pnoise(uv * vec2(uScaleX, uScaleY)) + 1.0);
100
+
101
+ // Hard threshold with tiny softness (anti-alias only).
102
+ float mask = maskvalue + maskvalue * realnoise;
103
+ float final = smoothstep(0.99, 1.0, mask);
104
+
105
+ return mix(getFromColor(uv), getToColor(uv), final);
106
+ }
107
+ `,
108
+ });
109
+ //# sourceMappingURL=drip-wipe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drip-wipe.js","sourceRoot":"","sources":["../../src/transitions/drip-wipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,gBAAgB,CAAC;IACvC,IAAI,EAAE,WAAW;IACjB,QAAQ,EAAE;QACR,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAClB,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,EAAE;QACV,MAAM,EAAE,EAAE;KACX;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkFP;CACA,CAAC,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Multi-point film-burn: a jittered grid of ignition points each expand
3
+ * outward with their own warm flame glow, merging as they meet to cover
4
+ * the frame. Per-ember staggered start times so different burns are at
5
+ * different phases.
6
+ *
7
+ * Locality invariant (to avoid cell-boundary rectangles): effective max
8
+ * reach of any ember = maxRadius + edgeWidth + noiseStrength, and this
9
+ * MUST stay under the distance to the nearest cell outside the search
10
+ * window (= (window_half-1) / uCount uv-units). With a 7x7 window that
11
+ * nearest-outside distance is 3/uCount, so `maxRadius = 1.6/uCount` plus
12
+ * edgeWidth=0.04 plus noiseStrength=0.06 gives reach = 1.6/uCount + 0.1,
13
+ * which stays below 3/uCount for uCount ≤ 12 (slider's max).
14
+ */
15
+ export declare const emberScatter: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
16
+ readonly count: 5;
17
+ readonly scale: 8;
18
+ readonly edgeWidth: 0.04;
19
+ readonly stagger: 0.35;
20
+ readonly flameColor: readonly [1.6, 0.7, 0.15];
21
+ }>>;
22
+ //# sourceMappingURL=ember-scatter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ember-scatter.d.ts","sourceRoot":"","sources":["../../src/transitions/ember-scatter.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,YAAY;;;;;;GA6EvB,CAAC"}
@@ -0,0 +1,94 @@
1
+ import { defineTransition } from "./define.js";
2
+ /**
3
+ * Multi-point film-burn: a jittered grid of ignition points each expand
4
+ * outward with their own warm flame glow, merging as they meet to cover
5
+ * the frame. Per-ember staggered start times so different burns are at
6
+ * different phases.
7
+ *
8
+ * Locality invariant (to avoid cell-boundary rectangles): effective max
9
+ * reach of any ember = maxRadius + edgeWidth + noiseStrength, and this
10
+ * MUST stay under the distance to the nearest cell outside the search
11
+ * window (= (window_half-1) / uCount uv-units). With a 7x7 window that
12
+ * nearest-outside distance is 3/uCount, so `maxRadius = 1.6/uCount` plus
13
+ * edgeWidth=0.04 plus noiseStrength=0.06 gives reach = 1.6/uCount + 0.1,
14
+ * which stays below 3/uCount for uCount ≤ 12 (slider's max).
15
+ */
16
+ export const emberScatter = defineTransition({
17
+ name: "ember-scatter",
18
+ defaults: {
19
+ count: 5,
20
+ scale: 8,
21
+ edgeWidth: 0.04,
22
+ stagger: 0.35,
23
+ flameColor: [1.6, 0.7, 0.15],
24
+ },
25
+ glsl: `
26
+ uniform float uCount;
27
+ uniform float uScale;
28
+ uniform float uEdgeWidth;
29
+ uniform float uStagger;
30
+ uniform vec3 uFlameColor;
31
+
32
+ float hash21(vec2 p) {
33
+ return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453);
34
+ }
35
+
36
+ float valueNoise(vec2 p) {
37
+ vec2 i = floor(p);
38
+ vec2 f = fract(p);
39
+ f = f * f * (3.0 - 2.0 * f);
40
+ float a = hash21(i);
41
+ float b = hash21(i + vec2(1.0, 0.0));
42
+ float c = hash21(i + vec2(0.0, 1.0));
43
+ float d = hash21(i + vec2(1.0, 1.0));
44
+ return mix(mix(a, b, f.x), mix(c, d, f.x), f.y);
45
+ }
46
+
47
+ vec4 transition(vec2 uv) {
48
+ float noiseStrength = 0.06;
49
+ float n = valueNoise(uv * uScale);
50
+ float noiseOffset = (n - 0.5) * noiseStrength;
51
+ float totalEdge = uEdgeWidth + noiseStrength * 0.5;
52
+ float maxRadius = 1.6 / max(uCount, 1.0);
53
+
54
+ vec2 gridPos = uv * uCount;
55
+ vec2 gridCell = floor(gridPos);
56
+
57
+ float bestSignedDist = 100.0;
58
+ for (int dy = -3; dy <= 3; dy++) {
59
+ for (int dx = -3; dx <= 3; dx++) {
60
+ vec2 neighborCell = gridCell + vec2(float(dx), float(dy));
61
+ vec2 jitter = vec2(
62
+ hash21(neighborCell + vec2(3.14, 0.0)),
63
+ hash21(neighborCell + vec2(0.0, 2.71))
64
+ );
65
+ vec2 emberUv = (neighborCell + jitter) / max(uCount, 1.0);
66
+
67
+ float emberStart = hash21(neighborCell + vec2(5.55, 5.55)) * uStagger;
68
+ float localP = clamp(
69
+ (uProgress - emberStart) / max(1.0 - uStagger, 0.0001),
70
+ 0.0, 1.0
71
+ );
72
+
73
+ float d = distance(uv, emberUv);
74
+ float perturbed = d - noiseOffset;
75
+ float burnRadius = localP * (maxRadius + 2.0 * totalEdge) - totalEdge;
76
+ float signedDist = perturbed - burnRadius;
77
+
78
+ bestSignedDist = min(bestSignedDist, signedDist);
79
+ }
80
+ }
81
+
82
+ float w = smoothstep(-uEdgeWidth, uEdgeWidth, -bestSignedDist);
83
+ vec4 base = mix(getFromColor(uv), getToColor(uv), w);
84
+
85
+ float bandX = bestSignedDist / max(uEdgeWidth * 1.5, 0.0001);
86
+ float flameBand = exp(-bandX * bandX * 3.0);
87
+ float env = 4.0 * uProgress * (1.0 - uProgress);
88
+ vec3 flame = uFlameColor * flameBand * env;
89
+
90
+ return vec4(base.rgb + flame, base.a);
91
+ }
92
+ `,
93
+ });
94
+ //# sourceMappingURL=ember-scatter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ember-scatter.js","sourceRoot":"","sources":["../../src/transitions/ember-scatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,gBAAgB,CAAC;IAC3C,IAAI,EAAE,eAAe;IACrB,QAAQ,EAAE;QACR,KAAK,EAAE,CAAC;QACR,KAAK,EAAE,CAAC;QACR,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC;KAC7B;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmEP;CACA,CAAC,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Cinematic film-burn reveal: an irregular hot-edged hole expands from a
3
+ * center point, eating through `from` to reveal `to` beneath. The burn
4
+ * front glows with a warm flame color that fades at the endpoints.
5
+ *
6
+ * Optional `chroma` param adds a radial RGB split concentrated at the
7
+ * advancing edge — set `flameColor` to a cool triplet (e.g. [1.2, 1.6, 2.5]
8
+ * "Electric") and `chroma > 0` for an electric / plasma-style vibe.
9
+ */
10
+ export declare const filmBurn: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
11
+ readonly center: readonly [0.5, 0.5];
12
+ readonly scale: 6;
13
+ readonly edgeWidth: 0.05;
14
+ readonly chroma: 0;
15
+ readonly flameColor: readonly [1.6, 0.7, 0.15];
16
+ }>>;
17
+ //# sourceMappingURL=film-burn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"film-burn.d.ts","sourceRoot":"","sources":["../../src/transitions/film-burn.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,eAAO,MAAM,QAAQ;;;;;;GAyFnB,CAAC"}
@@ -0,0 +1,101 @@
1
+ import { defineTransition } from "./define.js";
2
+ /**
3
+ * Cinematic film-burn reveal: an irregular hot-edged hole expands from a
4
+ * center point, eating through `from` to reveal `to` beneath. The burn
5
+ * front glows with a warm flame color that fades at the endpoints.
6
+ *
7
+ * Optional `chroma` param adds a radial RGB split concentrated at the
8
+ * advancing edge — set `flameColor` to a cool triplet (e.g. [1.2, 1.6, 2.5]
9
+ * "Electric") and `chroma > 0` for an electric / plasma-style vibe.
10
+ */
11
+ export const filmBurn = defineTransition({
12
+ name: "film-burn",
13
+ defaults: {
14
+ center: [0.5, 0.5],
15
+ scale: 6,
16
+ edgeWidth: 0.05,
17
+ chroma: 0,
18
+ flameColor: [1.6, 0.7, 0.15],
19
+ },
20
+ glsl: `
21
+ uniform vec2 uCenter;
22
+ uniform float uScale;
23
+ uniform float uEdgeWidth;
24
+ uniform float uChroma;
25
+ uniform vec3 uFlameColor;
26
+
27
+ float hash21(vec2 p) {
28
+ return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453);
29
+ }
30
+
31
+ float valueNoise(vec2 p) {
32
+ vec2 i = floor(p);
33
+ vec2 f = fract(p);
34
+ f = f * f * (3.0 - 2.0 * f);
35
+ float a = hash21(i);
36
+ float b = hash21(i + vec2(1.0, 0.0));
37
+ float c = hash21(i + vec2(0.0, 1.0));
38
+ float d = hash21(i + vec2(1.0, 1.0));
39
+ return mix(mix(a, b, f.x), mix(c, d, f.x), f.y);
40
+ }
41
+
42
+ vec4 transition(vec2 uv) {
43
+ // Aspect-correct radial distance from center, normalized to [0,1] by the
44
+ // farthest canvas corner (matches the shape-reveal pattern).
45
+ vec2 pixel = uv * uResolution;
46
+ vec2 centerPx = uCenter * uResolution;
47
+ float dist = distance(pixel, centerPx);
48
+ float maxDist = max(
49
+ max(length(centerPx), length(centerPx - vec2(uResolution.x, 0.0))),
50
+ max(length(centerPx - vec2(0.0, uResolution.y)), length(centerPx - uResolution))
51
+ );
52
+ float normalizedDist = dist / max(maxDist, 0.0001);
53
+
54
+ // Noise pushes the burn edge organically off a perfect circle.
55
+ float noiseStrength = 0.15;
56
+ float n = valueNoise(uv * uScale);
57
+ float perturbed = normalizedDist - (n - 0.5) * noiseStrength;
58
+
59
+ // Extend the threshold sweep so the full edgeWidth + noise half-range is
60
+ // beyond the valid [0,1] normalized-distance band at each endpoint.
61
+ float totalEdge = uEdgeWidth + noiseStrength * 0.5;
62
+ float burnRadius = uProgress * (1.0 + 2.0 * totalEdge) - totalEdge;
63
+ float signedDist = perturbed - burnRadius;
64
+
65
+ // Inside the burn: show to. Outside: show from.
66
+ float w = smoothstep(-uEdgeWidth, uEdgeWidth, -signedDist);
67
+ float env = 4.0 * uProgress * (1.0 - uProgress);
68
+
69
+ // Optional radial chromatic aberration concentrated at the burn edge.
70
+ // chroma=0 → no split; sample once and mix normally. chroma>0 → split
71
+ // R/B along the radial direction with edge-proximity Gaussian falloff.
72
+ vec3 baseRGB;
73
+ if (uChroma > 0.0001) {
74
+ float edgeX = signedDist / max(uEdgeWidth * 2.0, 0.0001);
75
+ float edgeProximity = exp(-edgeX * edgeX * 2.0);
76
+ float chromaStrength = env * edgeProximity * uChroma;
77
+
78
+ vec2 toCenter = uv - uCenter;
79
+ float r = length(toCenter);
80
+ vec2 dir = r > 0.0001 ? toCenter / r : vec2(1.0, 0.0);
81
+ vec2 offR = clamp(uv - dir * chromaStrength, 0.0, 1.0);
82
+ vec2 offB = clamp(uv + dir * chromaStrength, 0.0, 1.0);
83
+
84
+ vec3 fromRGB = vec3(getFromColor(offR).r, getFromColor(uv).g, getFromColor(offB).b);
85
+ vec3 toRGB = vec3(getToColor(offR).r, getToColor(uv).g, getToColor(offB).b);
86
+ baseRGB = mix(fromRGB, toRGB, w);
87
+ } else {
88
+ baseRGB = mix(getFromColor(uv).rgb, getToColor(uv).rgb, w);
89
+ }
90
+
91
+ // Flame glow: tight Gaussian band at the burn edge, env-gated to zero
92
+ // at both endpoints.
93
+ float bandX = signedDist / max(uEdgeWidth * 1.5, 0.0001);
94
+ float flameBand = exp(-bandX * bandX * 3.0);
95
+ vec3 flame = uFlameColor * flameBand * env;
96
+
97
+ return vec4(baseRGB + flame, 1.0);
98
+ }
99
+ `,
100
+ });
101
+ //# sourceMappingURL=film-burn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"film-burn.js","sourceRoot":"","sources":["../../src/transitions/film-burn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,gBAAgB,CAAC;IACvC,IAAI,EAAE,WAAW;IACjB,QAAQ,EAAE;QACR,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;QAClB,KAAK,EAAE,CAAC;QACR,SAAS,EAAE,IAAI;QACf,MAAM,EAAE,CAAC;QACT,UAAU,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC;KAC7B;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+EP;CACA,CAAC,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Filmic dissolve. Everything that modulates the image is gated by a
3
+ * 4·p·(1-p) peak envelope so endpoints are pixel-pure from/to.
4
+ *
5
+ * At peak, the image picks up:
6
+ * - multi-scale animated grain (fine + medium + coarse), reseeded
7
+ * in discrete progress frames so scrubbing flickers like a
8
+ * projector
9
+ * - partial desaturation (content drifts toward luminance)
10
+ * - subtle warm tint (R up, B down)
11
+ * - a soft corner vignette
12
+ * - occasional dark vertical scratches on ~2% of columns, reseeded
13
+ * every couple of frames
14
+ *
15
+ * Base crossfade is a soft smoothstep(0.25, 0.75) so from and to
16
+ * overlap through the grainy middle — the grain is what carries the
17
+ * hand-off, rather than a geometric wipe with film on top.
18
+ *
19
+ * One param: grain (master intensity of the whole film character).
20
+ */
21
+ export declare const filmGrain: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
22
+ readonly grain: 1;
23
+ }>>;
24
+ //# sourceMappingURL=film-grain.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"film-grain.d.ts","sourceRoot":"","sources":["../../src/transitions/film-grain.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,SAAS;;GAuDpB,CAAC"}