@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,70 @@
1
+ import { defineTransition } from "./define.js";
2
+ export const warpZoom = defineTransition({
3
+ name: "warp-zoom",
4
+ defaults: {
5
+ center: [0.5, 0.5],
6
+ strength: 1.0,
7
+ rotation: 1.0,
8
+ blur: 0.02,
9
+ },
10
+ glsl: `
11
+ uniform vec2 uCenter;
12
+ uniform float uStrength;
13
+ uniform float uRotation;
14
+ uniform float uBlur;
15
+
16
+ vec2 warpAround(vec2 uv, vec2 center, float angle, float scale) {
17
+ vec2 d = uv - center;
18
+ float c = cos(angle);
19
+ float s = sin(angle);
20
+ mat2 rot = mat2(c, -s, s, c);
21
+ return rot * d / scale + center;
22
+ }
23
+
24
+ vec4 sampleFromBlurred(vec2 uv, float amount) {
25
+ if (amount < 0.001) return getFromColor(clamp(uv, 0.0, 1.0));
26
+ const int N = 5;
27
+ vec4 sum = vec4(0.0);
28
+ for (int i = 0; i < N; i++) {
29
+ float t = (float(i) - 2.0) / 4.0;
30
+ vec2 offset = (uv - 0.5) * amount * t;
31
+ sum += getFromColor(clamp(uv + offset, 0.0, 1.0));
32
+ }
33
+ return sum / float(N);
34
+ }
35
+
36
+ vec4 sampleToBlurred(vec2 uv, float amount) {
37
+ if (amount < 0.001) return getToColor(clamp(uv, 0.0, 1.0));
38
+ const int N = 5;
39
+ vec4 sum = vec4(0.0);
40
+ for (int i = 0; i < N; i++) {
41
+ float t = (float(i) - 2.0) / 4.0;
42
+ vec2 offset = (uv - 0.5) * amount * t;
43
+ sum += getToColor(clamp(uv + offset, 0.0, 1.0));
44
+ }
45
+ return sum / float(N);
46
+ }
47
+
48
+ vec4 transition(vec2 uv) {
49
+ // From: rotates clockwise + zooms outward (gets bigger, we see less of it)
50
+ float fromAngle = uProgress * uRotation;
51
+ float fromScale = 1.0 + uProgress * uStrength;
52
+
53
+ // To: rotates counter-clockwise + zooms in (starts big, settles to native)
54
+ float toAngle = -(1.0 - uProgress) * uRotation;
55
+ float toScale = 1.0 + (1.0 - uProgress) * uStrength;
56
+
57
+ vec2 fromUv = warpAround(uv, uCenter, fromAngle, fromScale);
58
+ vec2 toUv = warpAround(uv, uCenter, toAngle, toScale);
59
+
60
+ // Velocity-scaled radial blur
61
+ float motion = 4.0 * uProgress * (1.0 - uProgress) * uBlur;
62
+ vec4 fromColor = sampleFromBlurred(fromUv, motion);
63
+ vec4 toColor = sampleToBlurred(toUv, motion);
64
+
65
+ float mixW = smoothstep(0.3, 0.7, uProgress);
66
+ return mix(fromColor, toColor, mixW);
67
+ }
68
+ `,
69
+ });
70
+ //# sourceMappingURL=warp-zoom.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"warp-zoom.js","sourceRoot":"","sources":["../../src/transitions/warp-zoom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,CAAC,MAAM,QAAQ,GAAG,gBAAgB,CAAC;IACvC,IAAI,EAAE,WAAW;IACjB,QAAQ,EAAE;QACR,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;QAClB,QAAQ,EAAE,GAAG;QACb,QAAQ,EAAE,GAAG;QACb,IAAI,EAAE,IAAI;KACX;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DP;CACA,CAAC,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Inspired by chungeric's codepen MWQoLqV. The reveal pattern is a
3
+ * `mod()` modulation of an oblique sine field — which creates curved
4
+ * stripes following the iso-contours of `cos(x) + 0.8*sin(y)`. A moving
5
+ * threshold biased along `direction` flips stripes from from→to one by
6
+ * one. The original used a hard `step()`; we soften with smoothstep to
7
+ * honor the no-hard-cuts rule while keeping the curved-stripe character.
8
+ *
9
+ * `scale` and `softness` are baked-in — they don't expose meaningful
10
+ * tuning at this scale (single sine field, single stripe period). Only
11
+ * `direction` is user-tunable.
12
+ */
13
+ export declare const waveStripes: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
14
+ readonly direction: readonly [1, 0];
15
+ }>>;
16
+ //# sourceMappingURL=wave-stripes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wave-stripes.d.ts","sourceRoot":"","sources":["../../src/transitions/wave-stripes.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,WAAW;;GAwCtB,CAAC"}
@@ -0,0 +1,55 @@
1
+ import { defineTransition } from "./define.js";
2
+ /**
3
+ * Inspired by chungeric's codepen MWQoLqV. The reveal pattern is a
4
+ * `mod()` modulation of an oblique sine field — which creates curved
5
+ * stripes following the iso-contours of `cos(x) + 0.8*sin(y)`. A moving
6
+ * threshold biased along `direction` flips stripes from from→to one by
7
+ * one. The original used a hard `step()`; we soften with smoothstep to
8
+ * honor the no-hard-cuts rule while keeping the curved-stripe character.
9
+ *
10
+ * `scale` and `softness` are baked-in — they don't expose meaningful
11
+ * tuning at this scale (single sine field, single stripe period). Only
12
+ * `direction` is user-tunable.
13
+ */
14
+ export const waveStripes = defineTransition({
15
+ name: "wave-stripes",
16
+ defaults: {
17
+ direction: [1, 0],
18
+ },
19
+ glsl: `
20
+ uniform vec2 uDirection;
21
+
22
+ // Snap to nearest axis-aligned unit. The sweep math projects uv onto -d
23
+ // for the threshold bias; diagonals give an out-of-range projection that
24
+ // breaks endpoint correctness. Enforced in-shader so the UI's axis-only
25
+ // picker matches.
26
+ vec2 snapAxis(vec2 v) {
27
+ vec2 dn = normalize(v);
28
+ return abs(dn.x) > abs(dn.y) ? vec2(sign(dn.x), 0.0) : vec2(0.0, sign(dn.y));
29
+ }
30
+
31
+ vec4 transition(vec2 uv) {
32
+ const float SCALE = 1.0;
33
+ const float SOFTNESS = 0.003;
34
+
35
+ vec2 d = snapAxis(uDirection);
36
+
37
+ // Oblique sine field; mod creates stripes following its iso-contours.
38
+ float field = cos(uv.x * SCALE) + sin(uv.y * SCALE) * 0.8;
39
+ float stripe = mod(field, 0.05);
40
+
41
+ // Threshold sweeps from above-max-stripe to below-zero. Pixels flip
42
+ // earliest where threshold-bias is lowest, so the reveal travels in
43
+ // the direction +d. d=[1,0] (default) → bias = uv.x*0.05 → reveal
44
+ // moves left-to-right, matching the original hardcoded behavior.
45
+ float proj = dot(uv - vec2(0.5), d) + 0.5;
46
+ float bias = proj * 0.05;
47
+ float threshold = (0.05 + 2.0 * SOFTNESS + bias) * (1.0 - uProgress) - SOFTNESS;
48
+
49
+ float dMix = smoothstep(threshold - SOFTNESS, threshold + SOFTNESS, stripe);
50
+
51
+ return mix(getFromColor(uv), getToColor(uv), dMix);
52
+ }
53
+ `,
54
+ });
55
+ //# sourceMappingURL=wave-stripes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wave-stripes.js","sourceRoot":"","sources":["../../src/transitions/wave-stripes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,gBAAgB,CAAC;IAC1C,IAAI,EAAE,cAAc;IACpB,QAAQ,EAAE;QACR,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;KAClB;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCP;CACA,CAAC,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Direct port of the "wave-wipe" CodePen shader: a directional wipe
3
+ * whose cut line is distorted by sin(uv.y · π) · wave · p·(1-p), so
4
+ * the reveal edge S-curves through the frame. to is zoomed slightly
5
+ * at the start and settles to normal; chromatic aberration on to's
6
+ * R and B channels jitters via sin(uProgress · 30); and a white-noise
7
+ * grain rides the same wave envelope.
8
+ *
9
+ * Endpoints: every effect rides p·(1-p), which is zero at progress 0
10
+ * and 1. The wipe saturates (m=0 at p=0, m=1 at p=1), zoom clamps to
11
+ * 1 at p=1, chroma offsets go to 0, grain goes to 0. Output is
12
+ * pixel-pure from/to.
13
+ *
14
+ * Differs from our existing wipe-directional by the curving cut line
15
+ * and the bundled cinematic polish (zoom, chroma jitter, grain) all
16
+ * gated cleanly by a single envelope.
17
+ */
18
+ export declare const waveWipe: import("../types.js").Transition<import("../types.js").Widen<{
19
+ readonly wave: 4.5;
20
+ readonly chroma: 0.03;
21
+ readonly grain: 0.08;
22
+ }>>;
23
+ //# sourceMappingURL=wave-wipe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wave-wipe.d.ts","sourceRoot":"","sources":["../../src/transitions/wave-wipe.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,QAAQ;;;;GAgEnB,CAAC"}
@@ -0,0 +1,84 @@
1
+ import { defineTransition } from "./define.js";
2
+ /**
3
+ * Direct port of the "wave-wipe" CodePen shader: a directional wipe
4
+ * whose cut line is distorted by sin(uv.y · π) · wave · p·(1-p), so
5
+ * the reveal edge S-curves through the frame. to is zoomed slightly
6
+ * at the start and settles to normal; chromatic aberration on to's
7
+ * R and B channels jitters via sin(uProgress · 30); and a white-noise
8
+ * grain rides the same wave envelope.
9
+ *
10
+ * Endpoints: every effect rides p·(1-p), which is zero at progress 0
11
+ * and 1. The wipe saturates (m=0 at p=0, m=1 at p=1), zoom clamps to
12
+ * 1 at p=1, chroma offsets go to 0, grain goes to 0. Output is
13
+ * pixel-pure from/to.
14
+ *
15
+ * Differs from our existing wipe-directional by the curving cut line
16
+ * and the bundled cinematic polish (zoom, chroma jitter, grain) all
17
+ * gated cleanly by a single envelope.
18
+ */
19
+ export const waveWipe = defineTransition({
20
+ name: "wave-wipe",
21
+ defaults: {
22
+ wave: 4.5,
23
+ chroma: 0.03,
24
+ grain: 0.08,
25
+ },
26
+ glsl: `
27
+ uniform float uWave;
28
+ uniform float uChroma;
29
+ uniform float uGrain;
30
+
31
+ float hash21(vec2 p) {
32
+ return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453);
33
+ }
34
+
35
+ vec4 transition(vec2 uv) {
36
+ float waveProgress = uProgress * (1.0 - uProgress);
37
+
38
+ // Wave-distorted cut direction. Base is (0, 1) (top-to-bottom wipe);
39
+ // x-component gets a sin(uv.y · π) wobble so the cut S-curves.
40
+ vec2 v = vec2(0.0, 1.0);
41
+ v /= abs(v.x) + abs(v.y);
42
+ v.x += sin(uv.y * 3.14159265) * uWave * waveProgress;
43
+
44
+ float cx = 0.5;
45
+ float d = v.x * cx + v.y * cx;
46
+ float smoothness = 0.005;
47
+ float m = 1.0 - smoothstep(
48
+ -smoothness, 0.0,
49
+ v.x * uv.x + v.y * uv.y - (d - 0.5 + uProgress * (1.0 + smoothness))
50
+ );
51
+
52
+ // to zooms in at start (samples a tighter region, appears magnified)
53
+ // and eases out to normal by progress 1.
54
+ float zoom = clamp(0.5 + uProgress * 0.5, 0.7, 1.0);
55
+ vec2 toUV = clamp((uv - 0.5) * zoom + 0.5, 0.0, 1.0);
56
+
57
+ // Chromatic aberration jitter on to: R and B sampled with opposite
58
+ // horizontal offsets, phase riding sin(uProgress · 30) so the
59
+ // jitter wiggles through the transition.
60
+ float caPhase = sin(uProgress * 30.0);
61
+ vec2 displR = vec2(caPhase * waveProgress * -uChroma, 0.0);
62
+ vec2 displB = vec2(caPhase * waveProgress * uChroma, 0.0);
63
+
64
+ vec3 toCol = vec3(
65
+ getToColor(clamp(toUV + displR, 0.0, 1.0)).r,
66
+ getToColor(toUV).g,
67
+ getToColor(clamp(toUV + displB, 0.0, 1.0)).b
68
+ );
69
+ vec3 fromCol = getFromColor(uv).rgb;
70
+
71
+ // White-noise grain, reseeded in discrete progress frames so
72
+ // scrubbing reads as film-like jitter. Gated by waveProgress·4 so
73
+ // endpoints have grain = 0 (peaks 1 at mid-transition).
74
+ float grainSeed = floor(uProgress * 30.0);
75
+ float whiteNoise = (hash21(uv + vec2(grainSeed)) * 2.0 - 1.0) *
76
+ uGrain * waveProgress * 4.0;
77
+ vec3 result = mix(fromCol, toCol, m);
78
+ result *= 1.0 - whiteNoise;
79
+
80
+ return vec4(result, 1.0);
81
+ }
82
+ `,
83
+ });
84
+ //# sourceMappingURL=wave-wipe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wave-wipe.js","sourceRoot":"","sources":["../../src/transitions/wave-wipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,gBAAgB,CAAC;IACvC,IAAI,EAAE,WAAW;IACjB,QAAQ,EAAE;QACR,IAAI,EAAE,GAAG;QACT,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,IAAI;KACZ;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwDP;CACA,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Ported from gl-transitions' wind. Per-row random offset creates a ragged,
3
+ * wind-blown edge sweeping across the frame.
4
+ */
5
+ export declare const wind: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
6
+ readonly size: 0.2;
7
+ readonly direction: readonly [1, 0];
8
+ }>>;
9
+ //# sourceMappingURL=wind.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wind.d.ts","sourceRoot":"","sources":["../../src/transitions/wind.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,IAAI;;;GAyCf,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { defineTransition } from "./define.js";
2
+ /**
3
+ * Ported from gl-transitions' wind. Per-row random offset creates a ragged,
4
+ * wind-blown edge sweeping across the frame.
5
+ */
6
+ export const wind = defineTransition({
7
+ name: "wind",
8
+ defaults: {
9
+ size: 0.2,
10
+ direction: [1, 0],
11
+ },
12
+ glsl: `
13
+ uniform float uSize;
14
+ uniform vec2 uDirection;
15
+
16
+ float hash(vec2 p) {
17
+ return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453);
18
+ }
19
+
20
+ vec4 transition(vec2 uv) {
21
+ vec2 d = normalize(uDirection);
22
+ // Perpendicular coordinate: one random value per "row" along the direction.
23
+ vec2 perp = vec2(-d.y, d.x);
24
+ float rowCoord = dot(uv, perp);
25
+ float r = hash(vec2(rowCoord, 0.0));
26
+
27
+ // Projected position along direction, normalized to [0, 1] regardless
28
+ // of direction (axis-aligned or diagonal). See paint-bleed.ts.
29
+ float maxProj = max((abs(d.x) + abs(d.y)) * 0.5, 0.0001);
30
+ float projected = 0.5 + dot(uv - 0.5, -d) / (2.0 * maxProj);
31
+
32
+ // size is a fractional ratio in [0, 1]: how much per-row jitter the
33
+ // wavefront has. Values >1 break endpoint correctness because the
34
+ // smoothstep range no longer covers the projected coordinate at p=0 or
35
+ // p=1, leaving per-row stripes visible. Clamp here so the transition
36
+ // is reliable regardless of caller input.
37
+ float size = clamp(uSize, 0.0, 1.0);
38
+
39
+ // Wavefront sweeps from 0 to 1 + size. Per-row random shift gives ragged edge.
40
+ // Note: smoothstep(edge0, edge1, x) is undefined when edge0 > edge1, so
41
+ // express the inverted form as 1 - smoothstep(low, high, x) instead.
42
+ float arg = projected * (1.0 - size) + size * r - uProgress * (1.0 + size);
43
+ float m = 1.0 - smoothstep(-size, 0.0, arg);
44
+ return mix(getFromColor(uv), getToColor(uv), m);
45
+ }
46
+ `,
47
+ });
48
+ //# sourceMappingURL=wind.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wind.js","sourceRoot":"","sources":["../../src/transitions/wind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;GAGG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,gBAAgB,CAAC;IACnC,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE;QACR,IAAI,EAAE,GAAG;QACT,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;KAClB;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCP;CACA,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Vertical slice curtain: the frame is partitioned into N vertical strips
3
+ * which open one after another (left-to-right by default), each strip
4
+ * itself revealing top-to-bottom. Distinct from kinetic-bands (which
5
+ * uses staggered horizontal bands) and from a simple wipe.
6
+ */
7
+ export declare const windowSlice: import("../types.js").Transition<import("../types.js").Widen<{
8
+ readonly count: 12;
9
+ readonly stagger: 0.6;
10
+ }>>;
11
+ //# sourceMappingURL=window-slice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"window-slice.d.ts","sourceRoot":"","sources":["../../src/transitions/window-slice.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,eAAO,MAAM,WAAW;;;GAyBtB,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { defineTransition } from "./define.js";
2
+ /**
3
+ * Vertical slice curtain: the frame is partitioned into N vertical strips
4
+ * which open one after another (left-to-right by default), each strip
5
+ * itself revealing top-to-bottom. Distinct from kinetic-bands (which
6
+ * uses staggered horizontal bands) and from a simple wipe.
7
+ */
8
+ export const windowSlice = defineTransition({
9
+ name: "window-slice",
10
+ defaults: {
11
+ count: 12,
12
+ stagger: 0.6,
13
+ },
14
+ glsl: `
15
+ uniform float uCount;
16
+ uniform float uStagger;
17
+
18
+ vec4 transition(vec2 uv) {
19
+ float sliceI = floor(uv.x * uCount);
20
+ // Linear left-to-right sweep across slices.
21
+ float sliceProg = sliceI / max(uCount - 1.0, 1.0);
22
+ float start = sliceProg * uStagger;
23
+ float window = max(1.0 - uStagger, 0.0001);
24
+ float localP = clamp((uProgress - start) / window, 0.0, 1.0);
25
+
26
+ // Each slice opens top-to-bottom: at localP=0 nothing revealed,
27
+ // localP=1 fully revealed.
28
+ float reveal = smoothstep(0.0, 1.0, localP * 2.0 - uv.y);
29
+
30
+ return mix(getFromColor(uv), getToColor(uv), reveal);
31
+ }
32
+ `,
33
+ });
34
+ //# sourceMappingURL=window-slice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"window-slice.js","sourceRoot":"","sources":["../../src/transitions/window-slice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,gBAAgB,CAAC;IAC1C,IAAI,EAAE,cAAc;IACpB,QAAQ,EAAE;QACR,KAAK,EAAE,EAAE;QACT,OAAO,EAAE,GAAG;KACb;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;CAkBP;CACA,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const wipeDirectional: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
2
+ readonly angle: 0;
3
+ readonly softness: 0.05;
4
+ }>>;
5
+ //# sourceMappingURL=wipe-directional.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wipe-directional.d.ts","sourceRoot":"","sources":["../../src/transitions/wipe-directional.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe;;;GAuB1B,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { defineTransition } from "./define.js";
2
+ export const wipeDirectional = defineTransition({
3
+ name: "wipe-directional",
4
+ defaults: {
5
+ angle: 0,
6
+ softness: 0.05,
7
+ },
8
+ glsl: `
9
+ uniform float uAngle;
10
+ uniform float uSoftness;
11
+
12
+ vec4 transition(vec2 uv) {
13
+ vec2 dir = vec2(cos(uAngle), sin(uAngle));
14
+ // Normalize the projection by max |dot(uv-0.5, dir)| = (|dx|+|dy|)/2 so
15
+ // gradient ∈ [0, 1] for any angle (axis-aligned or diagonal). Without
16
+ // this, diagonal angles leave corner slivers of the previous image at
17
+ // progress=1.
18
+ float maxProj = max((abs(dir.x) + abs(dir.y)) * 0.5, 0.0001);
19
+ float p = 0.5 + dot(uv - 0.5, dir) / (2.0 * maxProj);
20
+ float reveal = uProgress * (1.0 + uSoftness);
21
+ float m = smoothstep(reveal - uSoftness, reveal, p);
22
+ return mix(getToColor(uv), getFromColor(uv), m);
23
+ }
24
+ `,
25
+ });
26
+ //# sourceMappingURL=wipe-directional.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wipe-directional.js","sourceRoot":"","sources":["../../src/transitions/wipe-directional.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,CAAC,MAAM,eAAe,GAAG,gBAAgB,CAAC;IAC9C,IAAI,EAAE,kBAAkB;IACxB,QAAQ,EAAE;QACR,KAAK,EAAE,CAAC;QACR,QAAQ,EAAE,IAAI;KACf;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;CAgBP;CACA,CAAC,CAAC"}
@@ -0,0 +1,78 @@
1
+ import type { TextureSource, UniformValue, UniformParams, Widen } from "@vysmo/gl-core";
2
+ export type { TextureSource, UniformValue, UniformParams, Widen };
3
+ export interface TransitionShader {
4
+ glsl: string;
5
+ /**
6
+ * Full vertex-shader main() body. Required when the transition declares
7
+ * a `mesh`. Runner prepends a header with `#version 300 es`, precision,
8
+ * standard uniforms (uProgress, uResolution, uPass, uPassCount,
9
+ * uInstances, plus author's custom uniforms), the standard attribute
10
+ * inputs (aPosition, aUv, aOffset, aCentroid, aBary, aRandom), and
11
+ * `out vec2 vUv`. The author writes `void main() { ... }` and is
12
+ * responsible for assigning `gl_Position` and passing through `vUv`
13
+ * (and any other varyings they declare themselves).
14
+ */
15
+ vertex?: string;
16
+ wgsl?: string;
17
+ }
18
+ export interface MeshGeometry {
19
+ /**
20
+ * Grid subdivisions of the [-1, 1] plane. `[nx, ny]` yields `2·nx·ny`
21
+ * triangles.
22
+ */
23
+ subdivisions: readonly [number, number];
24
+ /**
25
+ * Number of mesh instances rendered per pass via drawArraysInstanced.
26
+ * The vertex shader can branch on `gl_InstanceID` (0..instances-1) to
27
+ * produce overlapping meshes with different behaviours (e.g. a back
28
+ * plane + a rotating foreground). Defaults to 1.
29
+ */
30
+ instances?: number;
31
+ }
32
+ export interface Transition<P extends UniformParams = UniformParams> {
33
+ name: string;
34
+ shader: TransitionShader;
35
+ defaults: P;
36
+ /**
37
+ * Number of fragment-shader passes the runner should execute per
38
+ * render(). Defaults to 1. When > 1, the runner ping-pongs between
39
+ * two framebuffers; each pass can read the previous pass's output
40
+ * via getPrevious(uv). The final pass renders to the canvas.
41
+ *
42
+ * Ignored when `mesh` is set (mesh transitions are single-pass in v1).
43
+ */
44
+ passes?: number;
45
+ /**
46
+ * If set, the runner renders this transition with a subdivided-plane
47
+ * mesh and the author-provided vertex shader, enabling true vertex
48
+ * geometry effects (per-triangle rotation, flying tiles, real 3D
49
+ * flips). Transitions without `mesh` keep using the fullscreen-triangle
50
+ * fragment-only pipeline.
51
+ */
52
+ mesh?: MeshGeometry;
53
+ }
54
+ export interface RenderArgs<P extends UniformParams> {
55
+ from: TextureSource;
56
+ to: TextureSource;
57
+ progress: number;
58
+ params?: Partial<P>;
59
+ /**
60
+ * Optional displacement-map texture. Transitions that read it via the
61
+ * `getDisplacement(uv)` shader helper (e.g. flow-warp) will use it to
62
+ * drive per-pixel UV offsets. Mid-gray (RGB ≈ 128) is interpreted as
63
+ * "no displacement"; brighter / darker pixels offset positively /
64
+ * negatively. If omitted, the runner binds a default 1×1 mid-gray
65
+ * texture so displacement-using transitions degrade to no-op rather
66
+ * than failing.
67
+ */
68
+ displacement?: TextureSource;
69
+ /**
70
+ * Optional environment-map texture. Transitions that read it via the
71
+ * getEnvironment(uv) shader helper (e.g. liquid-chrome with reflection
72
+ * enabled) use it to fake reflections off metallic / glass surfaces.
73
+ * If omitted, the runner binds a default 1×1 mid-gray texture so
74
+ * environment-using transitions degrade to a neutral no-op.
75
+ */
76
+ environment?: TextureSource;
77
+ }
78
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EACZ,aAAa,EACb,KAAK,EACN,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;AAElE,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,YAAY,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,UAAU,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa;IACjE,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,gBAAgB,CAAC;IACzB,QAAQ,EAAE,CAAC,CAAC;IACZ;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC;CACrB;AAED,MAAM,WAAW,UAAU,CAAC,CAAC,SAAS,aAAa;IACjD,IAAI,EAAE,aAAa,CAAC;IACpB,EAAE,EAAE,aAAa,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACpB;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,aAAa,CAAC;CAC7B"}
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@vysmo/transitions",
3
+ "version": "0.1.0",
4
+ "description": "60 WebGL2 transition shaders, defined as plain data. Mesh-based, tree-shakable to the byte, endpoint-correct by construction. Drives canvas, image, and video sources via one Runner.",
5
+ "license": "MIT",
6
+ "keywords": [
7
+ "webgl",
8
+ "webgl2",
9
+ "transitions",
10
+ "video",
11
+ "canvas",
12
+ "shader",
13
+ "glsl",
14
+ "animation",
15
+ "mesh",
16
+ "page-curl",
17
+ "tree-shakable",
18
+ "headless"
19
+ ],
20
+ "type": "module",
21
+ "sideEffects": false,
22
+ "main": "./dist/index.js",
23
+ "module": "./src/index.ts",
24
+ "types": "./dist/index.d.ts",
25
+ "exports": {
26
+ ".": {
27
+ "types": "./dist/index.d.ts",
28
+ "import": "./dist/index.js"
29
+ }
30
+ },
31
+ "files": [
32
+ "dist",
33
+ "src",
34
+ "README.md",
35
+ "LICENSE"
36
+ ],
37
+ "dependencies": {
38
+ "@vysmo/gl-core": "0.1.0"
39
+ },
40
+ "devDependencies": {
41
+ "@vitest/browser": "^3.2.4",
42
+ "esbuild": "^0.28.0",
43
+ "playwright": "^1.59.1",
44
+ "typescript": "^5.6.3",
45
+ "vitest": "^3.2.4"
46
+ },
47
+ "scripts": {
48
+ "build": "tsc -p tsconfig.json",
49
+ "typecheck": "tsc -p tsconfig.typecheck.json",
50
+ "test": "vitest run && vitest run --config vitest.ssr.config.ts",
51
+ "test:browser": "vitest run",
52
+ "test:ssr": "vitest run --config vitest.ssr.config.ts",
53
+ "test:watch": "vitest",
54
+ "size": "node scripts/check-bundle-size.mjs"
55
+ }
56
+ }