@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,76 @@
1
+ import { defineTransition } from "./define.js";
2
+ /**
3
+ * Cover slide: the "to" image slides in and covers the stationary "from".
4
+ * Distinct from `push` (which scrolls both images together as a unit).
5
+ */
6
+ export const slide = defineTransition({
7
+ name: "slide",
8
+ defaults: {
9
+ direction: [-1, 0],
10
+ feather: 0.015,
11
+ blur: 0,
12
+ },
13
+ glsl: `
14
+ uniform vec2 uDirection;
15
+ uniform float uFeather;
16
+ uniform float uBlur;
17
+
18
+ vec4 sampleToBlurred(vec2 uv, vec2 motion, float amount) {
19
+ if (amount < 0.001) return getToColor(clamp(uv, 0.0, 1.0));
20
+ // 8 Gaussian-weighted samples along the motion axis. Center samples
21
+ // dominate; trailing ones fade out so the blur reads as continuous, not
22
+ // as discrete ghost copies. Effective spread is capped at the call site
23
+ // — past ~0.05 UV the eye sees stripes regardless of sample count.
24
+ const int N = 8;
25
+ const float sigma = 0.25;
26
+ vec4 sum = vec4(0.0);
27
+ float wSum = 0.0;
28
+ for (int i = 0; i < N; i++) {
29
+ float t = float(i) / float(N - 1) - 0.5;
30
+ float w = exp(-(t * t) / (2.0 * sigma * sigma));
31
+ sum += getToColor(clamp(uv + motion * amount * t, 0.0, 1.0)) * w;
32
+ wSum += w;
33
+ }
34
+ return sum / wSum;
35
+ }
36
+
37
+ // Snap to nearest axis-aligned unit. Slide's seam math is built around
38
+ // axis-aligned motion; diagonals leave triangular gaps at the corners.
39
+ // Enforced in-shader so the UI's axis-only picker matches.
40
+ vec2 snapAxis(vec2 v) {
41
+ vec2 d = normalize(v);
42
+ return abs(d.x) > abs(d.y) ? vec2(sign(d.x), 0.0) : vec2(0.0, sign(d.y));
43
+ }
44
+
45
+ vec4 transition(vec2 uv) {
46
+ vec2 d = snapAxis(uDirection);
47
+
48
+ // "to" is translated from off-screen (behind the trailing edge) into place.
49
+ // At progress=0, to is offset by +d (fully off-screen). At progress=1, to is at origin.
50
+ vec2 toUv = uv + d * (1.0 - uProgress);
51
+
52
+ // Feathered seam between from (stationary) and to (moving into frame).
53
+ // The projected coordinate's range is ±maxProj where maxProj = (|dx|+|dy|)/2,
54
+ // so we scale by it to keep the feather zone off-screen at the endpoints
55
+ // for any direction (axis-aligned OR diagonal).
56
+ float maxProj = max((abs(d.x) + abs(d.y)) * 0.5, 0.0001);
57
+ float boundary = (maxProj + uFeather) * (1.0 - 2.0 * uProgress);
58
+ float projected = dot(uv - 0.5, -d);
59
+ float w = smoothstep(boundary - uFeather, boundary + uFeather, projected);
60
+
61
+ // From is stationary → sample cleanly, no blur.
62
+ vec4 fromColor = getFromColor(uv);
63
+
64
+ // To is the moving layer → velocity-scaled motion blur along motion axis.
65
+ // uBlur is the peak spread radius in UV units, capped at 0.1: past that
66
+ // the discrete sample structure shows as visible stripes regardless of
67
+ // sample count. Hard-clamp here so the transition is reliable for any
68
+ // caller input.
69
+ float motion = 4.0 * uProgress * (1.0 - uProgress) * min(uBlur, 0.1);
70
+ vec4 toColor = sampleToBlurred(toUv, -d, motion);
71
+
72
+ return mix(fromColor, toColor, w);
73
+ }
74
+ `,
75
+ });
76
+ //# sourceMappingURL=slide.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slide.js","sourceRoot":"","sources":["../../src/transitions/slide.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;GAGG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,gBAAgB,CAAC;IACpC,IAAI,EAAE,OAAO;IACb,QAAQ,EAAE;QACR,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAClB,OAAO,EAAE,KAAK;QACd,IAAI,EAAE,CAAC;KACR;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6DP;CACA,CAAC,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Linear burn with a smoldering trail: heavy low-frequency noise produces
3
+ * finger-like tendrils of fire reaching ahead of the main front, while
4
+ * an amber trail behind the front decays over `trailLength`. Evokes
5
+ * paper burning or a slow wildfire advancing, vs. directional-burn's
6
+ * sharper fuse-line aesthetic.
7
+ */
8
+ export declare const smolderingEdge: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
9
+ readonly direction: readonly [1, 1];
10
+ readonly scale: 3;
11
+ readonly edgeWidth: 0.04;
12
+ readonly trailLength: 0.18;
13
+ readonly emberColor: readonly [1.4, 0.5, 0.1];
14
+ }>>;
15
+ //# sourceMappingURL=smoldering-edge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"smoldering-edge.d.ts","sourceRoot":"","sources":["../../src/transitions/smoldering-edge.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,cAAc;;;;;;GAgEzB,CAAC"}
@@ -0,0 +1,74 @@
1
+ import { defineTransition } from "./define.js";
2
+ /**
3
+ * Linear burn with a smoldering trail: heavy low-frequency noise produces
4
+ * finger-like tendrils of fire reaching ahead of the main front, while
5
+ * an amber trail behind the front decays over `trailLength`. Evokes
6
+ * paper burning or a slow wildfire advancing, vs. directional-burn's
7
+ * sharper fuse-line aesthetic.
8
+ */
9
+ export const smolderingEdge = defineTransition({
10
+ name: "smoldering-edge",
11
+ defaults: {
12
+ direction: [1, 1],
13
+ scale: 3,
14
+ edgeWidth: 0.04,
15
+ trailLength: 0.18,
16
+ emberColor: [1.4, 0.5, 0.1],
17
+ },
18
+ glsl: `
19
+ uniform vec2 uDirection;
20
+ uniform float uScale;
21
+ uniform float uEdgeWidth;
22
+ uniform float uTrailLength;
23
+ uniform vec3 uEmberColor;
24
+
25
+ float hash21(vec2 p) {
26
+ return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453);
27
+ }
28
+
29
+ float valueNoise(vec2 p) {
30
+ vec2 i = floor(p);
31
+ vec2 f = fract(p);
32
+ f = f * f * (3.0 - 2.0 * f);
33
+ float a = hash21(i);
34
+ float b = hash21(i + vec2(1.0, 0.0));
35
+ float c = hash21(i + vec2(0.0, 1.0));
36
+ float d = hash21(i + vec2(1.0, 1.0));
37
+ return mix(mix(a, b, f.x), mix(c, d, f.x), f.y);
38
+ }
39
+
40
+ vec4 transition(vec2 uv) {
41
+ vec2 d = normalize(uDirection);
42
+ float projected = dot(uv - 0.5, -d);
43
+ float maxProj = 0.5 * (abs(d.x) + abs(d.y));
44
+
45
+ // Heavy low-frequency noise for tendril-like edge deformation.
46
+ float noiseStrength = 0.25;
47
+ float n = valueNoise(uv * uScale);
48
+ float perturbed = projected - (n - 0.5) * noiseStrength;
49
+
50
+ float totalEdge = uEdgeWidth + noiseStrength * 0.5;
51
+ float boundary = (maxProj + totalEdge) * (1.0 - 2.0 * uProgress);
52
+ float signedDist = perturbed - boundary;
53
+
54
+ float w = smoothstep(-uEdgeWidth, uEdgeWidth, signedDist);
55
+ vec4 base = mix(getFromColor(uv), getToColor(uv), w);
56
+
57
+ // Front band: tight Gaussian on the advancing line.
58
+ float bandX = signedDist / max(uEdgeWidth * 1.5, 0.0001);
59
+ float frontBand = exp(-bandX * bandX * 3.0);
60
+ // Trail: only behind the front (signedDist > 0 = already burned side),
61
+ // exponential decay with distance from the front.
62
+ float trail = max(signedDist, 0.0);
63
+ float trailGlow = exp(-trail / max(uTrailLength, 0.0001));
64
+ float trailMask = step(0.0, signedDist);
65
+
66
+ float glow = max(frontBand, trailGlow * trailMask * 0.55);
67
+ float env = 4.0 * uProgress * (1.0 - uProgress);
68
+ vec3 ember = uEmberColor * glow * env;
69
+
70
+ return vec4(base.rgb + ember, base.a);
71
+ }
72
+ `,
73
+ });
74
+ //# sourceMappingURL=smoldering-edge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"smoldering-edge.js","sourceRoot":"","sources":["../../src/transitions/smoldering-edge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAgB,CAAC;IAC7C,IAAI,EAAE,iBAAiB;IACvB,QAAQ,EAAE;QACR,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QACjB,KAAK,EAAE,CAAC;QACR,SAAS,EAAE,IAAI;QACf,WAAW,EAAE,IAAI;QACjB,UAAU,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;KAC5B;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsDP;CACA,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Unified split transition: open (doors part) or close (doors meet) along
3
+ * either axis. Replaces four gl-transitions (HorizontalOpen, HorizontalClose,
4
+ * VerticalOpen, VerticalClose) with one parametric transition.
5
+ *
6
+ * axis: 0 = horizontal split (parts along Y), 1 = vertical split (parts along X)
7
+ * mode: 0 = open (from parts, revealing to), 1 = close (to meets over from)
8
+ */
9
+ export declare const split: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
10
+ readonly axis: 0;
11
+ readonly mode: 0;
12
+ readonly softness: 0.01;
13
+ }>>;
14
+ //# sourceMappingURL=split.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"split.d.ts","sourceRoot":"","sources":["../../src/transitions/split.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,eAAO,MAAM,KAAK;;;;GA0ChB,CAAC"}
@@ -0,0 +1,53 @@
1
+ import { defineTransition } from "./define.js";
2
+ /**
3
+ * Unified split transition: open (doors part) or close (doors meet) along
4
+ * either axis. Replaces four gl-transitions (HorizontalOpen, HorizontalClose,
5
+ * VerticalOpen, VerticalClose) with one parametric transition.
6
+ *
7
+ * axis: 0 = horizontal split (parts along Y), 1 = vertical split (parts along X)
8
+ * mode: 0 = open (from parts, revealing to), 1 = close (to meets over from)
9
+ */
10
+ export const split = defineTransition({
11
+ name: "split",
12
+ defaults: {
13
+ axis: 0,
14
+ mode: 0,
15
+ softness: 0.01,
16
+ },
17
+ glsl: `
18
+ uniform float uAxis;
19
+ uniform float uMode;
20
+ uniform float uSoftness;
21
+
22
+ vec4 transition(vec2 uv) {
23
+ // Distance from the split axis (perpendicular to the doors' motion).
24
+ float splitCoord = mix(uv.x, uv.y, uAxis);
25
+ float absDist = abs(splitCoord - 0.5);
26
+
27
+ // Boundary is "how far from the split center the doors extend right now".
28
+ // OPEN: grows from -softness to 0.5+softness (from doors retreat outward).
29
+ // CLOSE: shrinks from 0.5+softness to -softness (to doors close inward).
30
+ // Both inner and outer sample at uv directly. Each door is a position-based
31
+ // reveal, not a texture that slides with the door — so the softness band
32
+ // blends two views of the same scene location instead of two different
33
+ // places of from/to (which produced the "wrong content at the seam"
34
+ // artifact in the previous slide-with-content implementation).
35
+ float boundary;
36
+ vec4 innerColor;
37
+ vec4 outerColor;
38
+ if (uMode < 0.5) {
39
+ boundary = -uSoftness + uProgress * (0.5 + 2.0 * uSoftness);
40
+ innerColor = getToColor(uv);
41
+ outerColor = getFromColor(uv);
42
+ } else {
43
+ boundary = (0.5 + uSoftness) - uProgress * (0.5 + 2.0 * uSoftness);
44
+ innerColor = getFromColor(uv);
45
+ outerColor = getToColor(uv);
46
+ }
47
+
48
+ float w = smoothstep(boundary - uSoftness, boundary + uSoftness, absDist);
49
+ return mix(innerColor, outerColor, w);
50
+ }
51
+ `,
52
+ });
53
+ //# sourceMappingURL=split.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"split.js","sourceRoot":"","sources":["../../src/transitions/split.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,gBAAgB,CAAC;IACpC,IAAI,EAAE,OAAO;IACb,QAAQ,EAAE;QACR,IAAI,EAAE,CAAC;QACP,IAAI,EAAE,CAAC;QACP,QAAQ,EAAE,IAAI;KACf;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCP;CACA,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Ported from gl-transitions' Swirl (by Sergey Kosarevsky). Both images are
3
+ * sampled at the same swirled UV — so the symmetric swirl envelope does NOT
4
+ * cause a visual freeze, because the linear crossfade keeps opacity changing
5
+ * throughout. Rotation uses a quadratic falloff from center: strongest at
6
+ * the center, zero at the edge of the active radius.
7
+ */
8
+ export declare const swirl: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
9
+ readonly radius: 1;
10
+ readonly strength: 25.13;
11
+ }>>;
12
+ //# sourceMappingURL=swirl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swirl.d.ts","sourceRoot":"","sources":["../../src/transitions/swirl.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,KAAK;;;GAgChB,CAAC"}
@@ -0,0 +1,42 @@
1
+ import { defineTransition } from "./define.js";
2
+ /**
3
+ * Ported from gl-transitions' Swirl (by Sergey Kosarevsky). Both images are
4
+ * sampled at the same swirled UV — so the symmetric swirl envelope does NOT
5
+ * cause a visual freeze, because the linear crossfade keeps opacity changing
6
+ * throughout. Rotation uses a quadratic falloff from center: strongest at
7
+ * the center, zero at the edge of the active radius.
8
+ */
9
+ export const swirl = defineTransition({
10
+ name: "swirl",
11
+ defaults: {
12
+ radius: 1.0,
13
+ strength: 25.13,
14
+ },
15
+ glsl: `
16
+ uniform float uRadius;
17
+ uniform float uStrength;
18
+
19
+ vec4 transition(vec2 uv) {
20
+ vec2 centered = uv - 0.5;
21
+ float dist = length(centered);
22
+
23
+ if (dist < uRadius) {
24
+ float pct = (uRadius - dist) / uRadius;
25
+ // Symmetric ramp: 0 → 1 → 0 as progress goes 0 → 0.5 → 1.
26
+ float a = uProgress <= 0.5
27
+ ? uProgress / 0.5
28
+ : 1.0 - (uProgress - 0.5) / 0.5;
29
+ float theta = pct * pct * a * uStrength;
30
+ float s = sin(theta);
31
+ float c = cos(theta);
32
+ centered = vec2(dot(centered, vec2(c, -s)), dot(centered, vec2(s, c)));
33
+ }
34
+
35
+ vec2 swirledUv = clamp(centered + 0.5, 0.0, 1.0);
36
+ vec4 c0 = getFromColor(swirledUv);
37
+ vec4 c1 = getToColor(swirledUv);
38
+ return mix(c0, c1, uProgress);
39
+ }
40
+ `,
41
+ });
42
+ //# sourceMappingURL=swirl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swirl.js","sourceRoot":"","sources":["../../src/transitions/swirl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,gBAAgB,CAAC;IACpC,IAAI,EAAE,OAAO;IACb,QAAQ,EAAE;QACR,MAAM,EAAE,GAAG;QACX,QAAQ,EAAE,KAAK;KAChB;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;CAyBP;CACA,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Directional motion blur concentrated on the wipe front. As the wipe
3
+ * sweeps across the frame, pixels near the boundary get heavy along-axis
4
+ * blur, simulating a camera pan through the cut. Away from the boundary,
5
+ * pixels stay crisp — distinct from linear-blur which blurs everything
6
+ * uniformly at midpoint.
7
+ */
8
+ export declare const tangentMotionBlur: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
9
+ readonly direction: readonly [1, 0];
10
+ readonly intensity: 0.08;
11
+ readonly softness: 0.2;
12
+ }>>;
13
+ //# sourceMappingURL=tangent-motion-blur.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tangent-motion-blur.d.ts","sourceRoot":"","sources":["../../src/transitions/tangent-motion-blur.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB;;;;GAgD5B,CAAC"}
@@ -0,0 +1,58 @@
1
+ import { defineTransition } from "./define.js";
2
+ /**
3
+ * Directional motion blur concentrated on the wipe front. As the wipe
4
+ * sweeps across the frame, pixels near the boundary get heavy along-axis
5
+ * blur, simulating a camera pan through the cut. Away from the boundary,
6
+ * pixels stay crisp — distinct from linear-blur which blurs everything
7
+ * uniformly at midpoint.
8
+ */
9
+ export const tangentMotionBlur = defineTransition({
10
+ name: "tangent-motion-blur",
11
+ defaults: {
12
+ direction: [1, 0],
13
+ intensity: 0.08,
14
+ softness: 0.2,
15
+ },
16
+ glsl: `
17
+ uniform vec2 uDirection;
18
+ uniform float uIntensity;
19
+ uniform float uSoftness;
20
+
21
+ const int SAMPLES = 24;
22
+
23
+ vec4 transition(vec2 uv) {
24
+ vec2 d = normalize(uDirection);
25
+ // Scale by maxProj so diagonal directions clear corners at endpoints
26
+ // (see paint-bleed.ts).
27
+ float maxProj = max((abs(d.x) + abs(d.y)) * 0.5, 0.0001);
28
+ float projected = dot(uv - 0.5, -d);
29
+ // Boundary sweeps from +(maxProj+softness) to -(maxProj+softness) so the
30
+ // softness band is off-screen at both endpoints, for any direction.
31
+ float boundary = (maxProj + uSoftness) * (1.0 - 2.0 * uProgress);
32
+ float signedDist = projected - boundary;
33
+
34
+ float wipeMask = smoothstep(-uSoftness, uSoftness, signedDist);
35
+
36
+ // Blur amount peaks on the wipe front; envelope-gated so it zeros at
37
+ // both endpoints regardless of the Gaussian falloff shape.
38
+ float env = 4.0 * uProgress * (1.0 - uProgress);
39
+ float falloffX = signedDist / max(uSoftness, 0.0001);
40
+ float falloff = exp(-falloffX * falloffX * 2.0);
41
+ float blur = uIntensity * env * falloff;
42
+
43
+ vec4 cFrom = vec4(0.0);
44
+ vec4 cTo = vec4(0.0);
45
+ for (int i = 0; i < SAMPLES; i++) {
46
+ float t = (float(i) - float(SAMPLES - 1) * 0.5) / float(SAMPLES - 1);
47
+ vec2 sampleUv = clamp(uv + d * blur * t, 0.0, 1.0);
48
+ cFrom += getFromColor(sampleUv);
49
+ cTo += getToColor(sampleUv);
50
+ }
51
+ cFrom /= float(SAMPLES);
52
+ cTo /= float(SAMPLES);
53
+
54
+ return mix(cFrom, cTo, wipeMask);
55
+ }
56
+ `,
57
+ });
58
+ //# sourceMappingURL=tangent-motion-blur.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tangent-motion-blur.js","sourceRoot":"","sources":["../../src/transitions/tangent-motion-blur.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;IAChD,IAAI,EAAE,qBAAqB;IAC3B,QAAQ,EAAE;QACR,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QACjB,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,GAAG;KACd;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCP;CACA,CAAC,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The plane is subdivided into tiles; each tile flies off into 3D
3
+ * space (outward xy drift from the source point, push back in z, and
4
+ * a random-axis rotation around its own centroid), staggered by per-
5
+ * tile offset. A fake-perspective divide lets z-motion visibly shrink
6
+ * the tile on screen so the fly-back feels spatial rather than flat.
7
+ *
8
+ * Tiles fade out over the last 30% of their flight. Behind them, a
9
+ * back plane at z=0.99 shows `to`. At progress=0 every tile is at
10
+ * rest covering the plane (pure from); at progress=1 every tile has
11
+ * completed its flight with alpha=0 and the back plane is unobscured
12
+ * (pure to).
13
+ *
14
+ * This proves per-primitive 3D motion — the three.js flying-tiles
15
+ * reference the user pointed at. Per-quad attributes (aCentroid,
16
+ * aOffset, aRandom shared across a tile's 6 verts) let each tile
17
+ * translate and rotate coherently.
18
+ */
19
+ export declare const tileScatter: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
20
+ readonly scatter: 1;
21
+ }>>;
22
+ //# sourceMappingURL=tile-scatter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tile-scatter.d.ts","sourceRoot":"","sources":["../../src/transitions/tile-scatter.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,WAAW;;GAqGtB,CAAC"}
@@ -0,0 +1,122 @@
1
+ import { defineTransition } from "./define.js";
2
+ /**
3
+ * The plane is subdivided into tiles; each tile flies off into 3D
4
+ * space (outward xy drift from the source point, push back in z, and
5
+ * a random-axis rotation around its own centroid), staggered by per-
6
+ * tile offset. A fake-perspective divide lets z-motion visibly shrink
7
+ * the tile on screen so the fly-back feels spatial rather than flat.
8
+ *
9
+ * Tiles fade out over the last 30% of their flight. Behind them, a
10
+ * back plane at z=0.99 shows `to`. At progress=0 every tile is at
11
+ * rest covering the plane (pure from); at progress=1 every tile has
12
+ * completed its flight with alpha=0 and the back plane is unobscured
13
+ * (pure to).
14
+ *
15
+ * This proves per-primitive 3D motion — the three.js flying-tiles
16
+ * reference the user pointed at. Per-quad attributes (aCentroid,
17
+ * aOffset, aRandom shared across a tile's 6 verts) let each tile
18
+ * translate and rotate coherently.
19
+ */
20
+ export const tileScatter = defineTransition({
21
+ name: "tile-scatter",
22
+ mesh: { subdivisions: [20, 12], instances: 2 },
23
+ defaults: {
24
+ scatter: 1.0,
25
+ },
26
+ vertex: `
27
+ uniform float uScatter;
28
+
29
+ out float vAlpha;
30
+ flat out int vInstance;
31
+
32
+ #define PI 3.14159265359
33
+ #define WINDOW 0.35
34
+
35
+ float hash(float n) {
36
+ return fract(sin(n * 12.9898 + 4.1371) * 43758.5453);
37
+ }
38
+
39
+ mat3 rotationMatrix(vec3 axis, float angle) {
40
+ float c = cos(angle);
41
+ float s = sin(angle);
42
+ float t = 1.0 - c;
43
+ vec3 a = axis;
44
+ return mat3(
45
+ c + a.x * a.x * t, a.y * a.x * t + a.z * s, a.z * a.x * t - a.y * s,
46
+ a.x * a.y * t - a.z * s, c + a.y * a.y * t, a.z * a.y * t + a.x * s,
47
+ a.x * a.z * t + a.y * s, a.y * a.z * t - a.x * s, c + a.z * a.z * t
48
+ );
49
+ }
50
+
51
+ void main() {
52
+ vUv = aUv;
53
+ vInstance = gl_InstanceID;
54
+
55
+ if (gl_InstanceID == 0) {
56
+ // Back plane: destination, far z.
57
+ gl_Position = vec4(aPosition, 0.99, 1.0);
58
+ vAlpha = 1.0;
59
+ return;
60
+ }
61
+
62
+ float start = aOffset * (1.0 - WINDOW);
63
+ float localT = smoothstep(start, start + WINDOW, uProgress);
64
+
65
+ // Random rotation: axis per tile, angle rate per tile.
66
+ vec3 axis = normalize(vec3(
67
+ hash(aRandom) * 2.0 - 1.0,
68
+ hash(aRandom + 0.13) * 2.0 - 1.0,
69
+ hash(aRandom + 0.27) * 2.0 - 1.0
70
+ ));
71
+ float angle = localT * PI * 1.6 * (0.6 + hash(aRandom + 0.41) * 0.8);
72
+ mat3 rot = rotationMatrix(axis, angle);
73
+
74
+ // Rotate the vertex around the tile centroid.
75
+ vec3 local = vec3(aPosition - aCentroid, 0.0);
76
+ vec3 rotated = rot * local;
77
+
78
+ // Translation: outward from canvas center + push back in z. Source is
79
+ // hardcoded to (0.5, 0.5) → in clip space that's (0, 0), so awayDir is
80
+ // simply the centroid's direction from origin.
81
+ vec2 awayDir = length(aCentroid) > 1e-5 ? normalize(aCentroid) : vec2(0.0);
82
+
83
+ vec3 translation = vec3(
84
+ awayDir * uScatter * 0.75 * localT,
85
+ uScatter * 2.4 * localT
86
+ );
87
+
88
+ // Per-tile jitter so tiles don't all move in perfect radial symmetry.
89
+ vec3 jitter = vec3(
90
+ hash(aRandom + 0.55) * 2.0 - 1.0,
91
+ hash(aRandom + 0.71) * 2.0 - 1.0,
92
+ hash(aRandom + 0.89)
93
+ ) * uScatter * 0.35 * localT;
94
+
95
+ vec3 worldPos = vec3(aCentroid, 0.0) + rotated + translation + jitter;
96
+
97
+ // Fake perspective: z-motion visibly shrinks tiles on screen.
98
+ float persp = max(1.0 + worldPos.z * 0.45, 0.1);
99
+ vec2 screenXY = worldPos.xy / persp;
100
+ float clipZ = clamp(worldPos.z * 0.15, -0.9, 0.95);
101
+
102
+ gl_Position = vec4(screenXY, clipZ, 1.0);
103
+
104
+ // Alpha fade over last third of flight.
105
+ vAlpha = 1.0 - smoothstep(0.7, 1.0, localT);
106
+ }
107
+ `,
108
+ glsl: `
109
+ in float vAlpha;
110
+ flat in int vInstance;
111
+
112
+ vec4 transition(vec2 uv) {
113
+ if (vInstance == 0) {
114
+ return getToColor(uv);
115
+ }
116
+ if (vAlpha < 0.01) discard;
117
+ vec4 col = getFromColor(uv);
118
+ return vec4(col.rgb, col.a * vAlpha);
119
+ }
120
+ `,
121
+ });
122
+ //# sourceMappingURL=tile-scatter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tile-scatter.js","sourceRoot":"","sources":["../../src/transitions/tile-scatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,gBAAgB,CAAC;IAC1C,IAAI,EAAE,cAAc;IACpB,IAAI,EAAE,EAAE,YAAY,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE;IAC9C,QAAQ,EAAE;QACR,OAAO,EAAE,GAAG;KACb;IACD,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiFT;IACC,IAAI,EAAE;;;;;;;;;;;;CAYP;CACA,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Port of akella demo2 (tympanus.net/Development/webGLImageTransitions).
3
+ * A directional mask that progresses faster on the leading side combined
4
+ * with bidirectional zoom: the from-image shrinks toward center while the
5
+ * to-image grows from center. The result is a diagonal sweep with an
6
+ * inward/outward zoom feel — distinct from any pure mask-based wipe.
7
+ */
8
+ export declare const tiltSweep: import("../types.js").Transition<import("../types.js").Widen<{
9
+ readonly direction: readonly [0, 1];
10
+ }>>;
11
+ //# sourceMappingURL=tilt-sweep.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tilt-sweep.d.ts","sourceRoot":"","sources":["../../src/transitions/tilt-sweep.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,SAAS;;GAqBpB,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { defineTransition } from "./define.js";
2
+ /**
3
+ * Port of akella demo2 (tympanus.net/Development/webGLImageTransitions).
4
+ * A directional mask that progresses faster on the leading side combined
5
+ * with bidirectional zoom: the from-image shrinks toward center while the
6
+ * to-image grows from center. The result is a diagonal sweep with an
7
+ * inward/outward zoom feel — distinct from any pure mask-based wipe.
8
+ */
9
+ export const tiltSweep = defineTransition({
10
+ name: "tilt-sweep",
11
+ defaults: {
12
+ direction: [0, 1],
13
+ },
14
+ glsl: `
15
+ uniform vec2 uDirection;
16
+
17
+ vec4 transition(vec2 uv) {
18
+ vec2 d = normalize(uDirection);
19
+ // Per-pixel local progress: leading edge along direction completes first.
20
+ float projected = clamp(dot(uv - 0.5, d) + 0.5, 0.0, 1.0);
21
+ float x = smoothstep(0.0, 1.0, uProgress * 2.0 + projected - 1.0);
22
+
23
+ // From shrinks to center, to grows from center.
24
+ vec2 fromUv = (uv - 0.5) * (1.0 - x) + 0.5;
25
+ vec2 toUv = (uv - 0.5) * x + 0.5;
26
+
27
+ return mix(getFromColor(fromUv), getToColor(toUv), x);
28
+ }
29
+ `,
30
+ });
31
+ //# sourceMappingURL=tilt-sweep.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tilt-sweep.js","sourceRoot":"","sources":["../../src/transitions/tilt-sweep.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,gBAAgB,CAAC;IACxC,IAAI,EAAE,YAAY;IAClB,QAAQ,EAAE;QACR,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;KAClB;IACD,IAAI,EAAE;;;;;;;;;;;;;;;CAeP;CACA,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare const warpZoom: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
2
+ readonly center: readonly [0.5, 0.5];
3
+ readonly strength: 1;
4
+ readonly rotation: 1;
5
+ readonly blur: 0.02;
6
+ }>>;
7
+ //# sourceMappingURL=warp-zoom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"warp-zoom.d.ts","sourceRoot":"","sources":["../../src/transitions/warp-zoom.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ;;;;;GAmEnB,CAAC"}