@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,23 @@
1
+ /**
2
+ * The image is partitioned into small rectangular cells; each cell
3
+ * translates as a rigid block along its own per-cell random direction,
4
+ * with a 4·p·(1-p) envelope so displacement is zero at both endpoints
5
+ * and peaks at mid-progress. Neighbouring cells with different flight
6
+ * directions tear apart, producing visible seams that read as discrete
7
+ * particle boundaries — the key difference from per-pixel noise
8
+ * displacement, which only ever blurs continuously.
9
+ *
10
+ * Update param is density (cells per unit height) rather than
11
+ * scatter-only, so authors directly control particle grain. Aspect
12
+ * is compensated so cells stay roughly square regardless of canvas
13
+ * shape.
14
+ *
15
+ * Endpoints: envelope = 0 at progress 0/1, so displacement collapses
16
+ * and each pixel samples from/to at its own uv. Crossfade smoothstep
17
+ * saturates to 0 at progress 0 and 1 at progress 1.
18
+ */
19
+ export declare const particleAssemble: import("../types.js").Transition<import("../types.js").Widen<{
20
+ readonly scatter: 0.22;
21
+ readonly density: 48;
22
+ }>>;
23
+ //# sourceMappingURL=particle-assemble.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"particle-assemble.d.ts","sourceRoot":"","sources":["../../src/transitions/particle-assemble.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,gBAAgB;;;GA4C3B,CAAC"}
@@ -0,0 +1,65 @@
1
+ import { defineTransition } from "./define.js";
2
+ /**
3
+ * The image is partitioned into small rectangular cells; each cell
4
+ * translates as a rigid block along its own per-cell random direction,
5
+ * with a 4·p·(1-p) envelope so displacement is zero at both endpoints
6
+ * and peaks at mid-progress. Neighbouring cells with different flight
7
+ * directions tear apart, producing visible seams that read as discrete
8
+ * particle boundaries — the key difference from per-pixel noise
9
+ * displacement, which only ever blurs continuously.
10
+ *
11
+ * Update param is density (cells per unit height) rather than
12
+ * scatter-only, so authors directly control particle grain. Aspect
13
+ * is compensated so cells stay roughly square regardless of canvas
14
+ * shape.
15
+ *
16
+ * Endpoints: envelope = 0 at progress 0/1, so displacement collapses
17
+ * and each pixel samples from/to at its own uv. Crossfade smoothstep
18
+ * saturates to 0 at progress 0 and 1 at progress 1.
19
+ */
20
+ export const particleAssemble = defineTransition({
21
+ name: "particle-assemble",
22
+ defaults: {
23
+ scatter: 0.22,
24
+ density: 48,
25
+ },
26
+ glsl: `
27
+ uniform float uScatter;
28
+ uniform float uDensity;
29
+
30
+ float hash21(vec2 p) {
31
+ return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453);
32
+ }
33
+
34
+ vec2 hash22(vec2 p) {
35
+ return vec2(hash21(p), hash21(p + vec2(17.3, 23.7)));
36
+ }
37
+
38
+ vec4 transition(vec2 uv) {
39
+ float aspect = uResolution.x / uResolution.y;
40
+
41
+ // Aspect-square cells. Density is cells per unit height.
42
+ vec2 cellSize = vec2(1.0 / (aspect * uDensity), 1.0 / uDensity);
43
+ vec2 cellId = floor(uv / cellSize);
44
+
45
+ // One random flight direction per cell → pixels in the same cell
46
+ // share displacement, so the cell moves as a rigid block. Adjacent
47
+ // cells with different directions tear apart visibly.
48
+ vec2 dir = normalize(hash22(cellId) * 2.0 - 1.0 + vec2(1e-4));
49
+
50
+ float envelope = 4.0 * uProgress * (1.0 - uProgress);
51
+ vec2 disp = dir * envelope * uScatter;
52
+
53
+ // Sample source as if the cell is showing at its displaced position.
54
+ // Approximation: sample at uv - d(uv). Neighbouring cells with
55
+ // different d produce hard seams = particle boundaries.
56
+ vec2 homeUv = clamp(uv - disp, 0.0, 1.0);
57
+
58
+ // Wide crossfade so both images overlap through most of the peak
59
+ // scatter, giving the eye time to read the particle motion.
60
+ float blend = smoothstep(0.15, 0.85, uProgress);
61
+ return mix(getFromColor(homeUv), getToColor(homeUv), blend);
62
+ }
63
+ `,
64
+ });
65
+ //# sourceMappingURL=particle-assemble.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"particle-assemble.js","sourceRoot":"","sources":["../../src/transitions/particle-assemble.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,gBAAgB,CAAC;IAC/C,IAAI,EAAE,mBAAmB;IACzB,QAAQ,EAAE;QACR,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,EAAE;KACZ;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCP;CACA,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Multi-spoke angular sweep: `spokes` wedges each open simultaneously around
3
+ * a center, sweeping through their angular slice as progress grows. A
4
+ * rotating "fan" reveal, aspect-corrected so spokes stay radial.
5
+ */
6
+ export declare const pinwheel: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
7
+ readonly center: readonly [0.5, 0.5];
8
+ readonly spokes: 8;
9
+ readonly softness: 0.05;
10
+ }>>;
11
+ //# sourceMappingURL=pinwheel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pinwheel.d.ts","sourceRoot":"","sources":["../../src/transitions/pinwheel.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,QAAQ;;;;GAgCnB,CAAC"}
@@ -0,0 +1,40 @@
1
+ import { defineTransition } from "./define.js";
2
+ /**
3
+ * Multi-spoke angular sweep: `spokes` wedges each open simultaneously around
4
+ * a center, sweeping through their angular slice as progress grows. A
5
+ * rotating "fan" reveal, aspect-corrected so spokes stay radial.
6
+ */
7
+ export const pinwheel = defineTransition({
8
+ name: "pinwheel",
9
+ defaults: {
10
+ center: [0.5, 0.5],
11
+ spokes: 8,
12
+ softness: 0.05,
13
+ },
14
+ glsl: `
15
+ uniform vec2 uCenter;
16
+ uniform float uSpokes;
17
+ uniform float uSoftness;
18
+
19
+ const float TWO_PI = 6.2831853;
20
+
21
+ vec4 transition(vec2 uv) {
22
+ // Aspect-correct so spokes remain radial on non-square canvases.
23
+ vec2 delta = (uv - uCenter) * vec2(uResolution.x / uResolution.y, 1.0);
24
+ float angle = atan(delta.y, delta.x);
25
+ float slice = TWO_PI / max(uSpokes, 2.0);
26
+
27
+ // Position within a single spoke's angular range, 0 to slice.
28
+ float folded = mod(angle, slice);
29
+
30
+ // Softness expressed as a fraction of the slice so it scales with spoke count.
31
+ float s = slice * uSoftness;
32
+ // Threshold sweeps from -s (outside range) to slice+s (outside range), so
33
+ // feather never reaches visible pixels at the endpoints.
34
+ float threshold = -s + uProgress * (slice + 2.0 * s);
35
+ float w = smoothstep(threshold - s, threshold + s, folded);
36
+ return mix(getToColor(uv), getFromColor(uv), w);
37
+ }
38
+ `,
39
+ });
40
+ //# sourceMappingURL=pinwheel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pinwheel.js","sourceRoot":"","sources":["../../src/transitions/pinwheel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,gBAAgB,CAAC;IACvC,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE;QACR,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;QAClB,MAAM,EAAE,CAAC;QACT,QAAQ,EAAE,IAAI;KACf;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;CAwBP;CACA,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const pixelate: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
2
+ readonly maxBlockSize: 40;
3
+ }>>;
4
+ //# sourceMappingURL=pixelate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pixelate.d.ts","sourceRoot":"","sources":["../../src/transitions/pixelate.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ;;GAuBnB,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { defineTransition } from "./define.js";
2
+ export const pixelate = defineTransition({
3
+ name: "pixelate",
4
+ defaults: {
5
+ maxBlockSize: 40,
6
+ },
7
+ glsl: `
8
+ uniform float uMaxBlockSize;
9
+
10
+ vec4 transition(vec2 uv) {
11
+ // Block size peaks at midpoint, 1px at endpoints.
12
+ float env = 4.0 * uProgress * (1.0 - uProgress);
13
+ float blockSize = max(1.0, uMaxBlockSize * env);
14
+
15
+ // Quantize to a grid of blockSize-pixel cells, sample from cell centers.
16
+ vec2 pixel = uv * uResolution;
17
+ vec2 quantized = floor(pixel / blockSize) * blockSize + blockSize * 0.5;
18
+ vec2 quantUv = quantized / uResolution;
19
+
20
+ // Crossfade concentrated in the middle 40% when pixelation is heaviest.
21
+ float mixW = smoothstep(0.3, 0.7, uProgress);
22
+ return mix(getFromColor(quantUv), getToColor(quantUv), mixW);
23
+ }
24
+ `,
25
+ });
26
+ //# sourceMappingURL=pixelate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pixelate.js","sourceRoot":"","sources":["../../src/transitions/pixelate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,CAAC,MAAM,QAAQ,GAAG,gBAAgB,CAAC;IACvC,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE;QACR,YAAY,EAAE,EAAE;KACjB;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;CAiBP;CACA,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plasma-pulse.d.ts","sourceRoot":"","sources":["../../src/transitions/plasma-pulse.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,WAAW;;;;;;GAoFtB,CAAC"}
@@ -0,0 +1,92 @@
1
+ import { defineTransition } from "./define.js";
2
+ /**
3
+ * Electric sibling to film-burn: expanding ring with a bright white-blue
4
+ * plasma core + radial chromatic aberration concentrated at the advancing
5
+ * edge. Lightning-like turbulence (layered noise) for the electric feel.
6
+ */
7
+ export const plasmaPulse = defineTransition({
8
+ name: "plasma-pulse",
9
+ defaults: {
10
+ center: [0.5, 0.5],
11
+ scale: 8,
12
+ edgeWidth: 0.04,
13
+ chroma: 0.012,
14
+ plasmaColor: [1.2, 1.6, 2.5],
15
+ },
16
+ glsl: `
17
+ uniform vec2 uCenter;
18
+ uniform float uScale;
19
+ uniform float uEdgeWidth;
20
+ uniform float uChroma;
21
+ uniform vec3 uPlasmaColor;
22
+
23
+ float hash21(vec2 p) {
24
+ return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453);
25
+ }
26
+
27
+ float valueNoise(vec2 p) {
28
+ vec2 i = floor(p);
29
+ vec2 f = fract(p);
30
+ f = f * f * (3.0 - 2.0 * f);
31
+ float a = hash21(i);
32
+ float b = hash21(i + vec2(1.0, 0.0));
33
+ float c = hash21(i + vec2(0.0, 1.0));
34
+ float d = hash21(i + vec2(1.0, 1.0));
35
+ return mix(mix(a, b, f.x), mix(c, d, f.x), f.y);
36
+ }
37
+
38
+ vec4 transition(vec2 uv) {
39
+ vec2 pixel = uv * uResolution;
40
+ vec2 centerPx = uCenter * uResolution;
41
+ float dist = distance(pixel, centerPx);
42
+ float maxDist = max(
43
+ max(length(centerPx), length(centerPx - vec2(uResolution.x, 0.0))),
44
+ max(length(centerPx - vec2(0.0, uResolution.y)), length(centerPx - uResolution))
45
+ );
46
+ float normalizedDist = dist / max(maxDist, 0.0001);
47
+
48
+ // Layered noise: fast turbulence + slow drift → electric flicker feel.
49
+ float noiseStrength = 0.06;
50
+ float n = valueNoise(uv * uScale) * 0.6 + valueNoise(uv * uScale * 2.3) * 0.4;
51
+ float perturbed = normalizedDist - (n - 0.5) * noiseStrength;
52
+
53
+ float totalEdge = uEdgeWidth + noiseStrength * 0.5;
54
+ float plasmaRadius = uProgress * (1.0 + 2.0 * totalEdge) - totalEdge;
55
+ float signedDist = perturbed - plasmaRadius;
56
+
57
+ float w = smoothstep(-uEdgeWidth, uEdgeWidth, -signedDist);
58
+
59
+ // Radial chromatic aberration concentrated at the edge, env-gated.
60
+ float env = 4.0 * uProgress * (1.0 - uProgress);
61
+ float edgeX = signedDist / max(uEdgeWidth * 2.0, 0.0001);
62
+ float edgeProximity = exp(-edgeX * edgeX * 2.0);
63
+ float chromaStrength = env * edgeProximity * uChroma;
64
+
65
+ vec2 toCenter = uv - uCenter;
66
+ float r = length(toCenter);
67
+ vec2 dir = r > 0.0001 ? toCenter / r : vec2(1.0, 0.0);
68
+ vec2 offR = clamp(uv - dir * chromaStrength, 0.0, 1.0);
69
+ vec2 offB = clamp(uv + dir * chromaStrength, 0.0, 1.0);
70
+
71
+ vec3 fromRGB = vec3(
72
+ getFromColor(offR).r,
73
+ getFromColor(uv).g,
74
+ getFromColor(offB).b
75
+ );
76
+ vec3 toRGB = vec3(
77
+ getToColor(offR).r,
78
+ getToColor(uv).g,
79
+ getToColor(offB).b
80
+ );
81
+ vec3 base = mix(fromRGB, toRGB, w);
82
+
83
+ // Plasma core: tight bright band at the ring, env-gated.
84
+ float plasmaX = signedDist / max(uEdgeWidth * 1.2, 0.0001);
85
+ float plasmaBand = exp(-plasmaX * plasmaX * 4.0);
86
+ vec3 plasma = uPlasmaColor * plasmaBand * env;
87
+
88
+ return vec4(base + plasma, 1.0);
89
+ }
90
+ `,
91
+ });
92
+ //# sourceMappingURL=plasma-pulse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plasma-pulse.js","sourceRoot":"","sources":["../../src/transitions/plasma-pulse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,gBAAgB,CAAC;IAC1C,IAAI,EAAE,cAAc;IACpB,QAAQ,EAAE;QACR,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;QAClB,KAAK,EAAE,CAAC;QACR,SAAS,EAAE,IAAI;QACf,MAAM,EAAE,KAAK;QACb,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;KAC7B;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0EP;CACA,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Radial dot-grid reveal: every cell of an N×N grid contains a dot that
3
+ * grows to cover its cell, with cells near the center revealing first.
4
+ * Stylized but kept premium by softening the dot edge with smoothstep
5
+ * and bounding maxDotRadius so each dot fully covers its cell at the
6
+ * end (no leftover background between dots).
7
+ */
8
+ export declare const polkaDotsCurtain: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
9
+ readonly dots: 15;
10
+ readonly center: readonly [0.5, 0.5];
11
+ readonly softness: 0.05;
12
+ }>>;
13
+ //# sourceMappingURL=polka-dots-curtain.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polka-dots-curtain.d.ts","sourceRoot":"","sources":["../../src/transitions/polka-dots-curtain.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB;;;;GAoC3B,CAAC"}
@@ -0,0 +1,46 @@
1
+ import { defineTransition } from "./define.js";
2
+ /**
3
+ * Radial dot-grid reveal: every cell of an N×N grid contains a dot that
4
+ * grows to cover its cell, with cells near the center revealing first.
5
+ * Stylized but kept premium by softening the dot edge with smoothstep
6
+ * and bounding maxDotRadius so each dot fully covers its cell at the
7
+ * end (no leftover background between dots).
8
+ */
9
+ export const polkaDotsCurtain = defineTransition({
10
+ name: "polka-dots-curtain",
11
+ defaults: {
12
+ dots: 15,
13
+ center: [0.5, 0.5],
14
+ softness: 0.05,
15
+ },
16
+ glsl: `
17
+ uniform float uDots;
18
+ uniform vec2 uCenter;
19
+ uniform float uSoftness;
20
+
21
+ vec4 transition(vec2 uv) {
22
+ // dots=0 produces degenerate cellPos math (uv*0=0, all pixels in same cell);
23
+ // floor at 1. Clamp here so the transition is reliable regardless of caller input.
24
+ float dots = max(uDots, 1.0);
25
+ vec2 cellPos = fract(uv * dots);
26
+ float dotDist = distance(cellPos, vec2(0.5));
27
+ float distToCenter = distance(uv, uCenter);
28
+
29
+ // Per-cell ignition time: cells near uCenter reveal first.
30
+ float cellRevealTime = distToCenter / 1.4142136;
31
+ float window = 0.6;
32
+ float start = cellRevealTime * (1.0 - window);
33
+ float localP = clamp((uProgress - start) / max(window, 0.0001), 0.0, 1.0);
34
+
35
+ // Dot radius grows from -softness (off) to maxDotRadius+softness (covers
36
+ // cell corners cleanly). 0.85 > sqrt(2)/2 so corners are guaranteed inside.
37
+ float maxDotRadius = 0.85;
38
+ float radius = localP * (maxDotRadius + 2.0 * uSoftness) - uSoftness;
39
+
40
+ float w = 1.0 - smoothstep(radius - uSoftness, radius + uSoftness, dotDist);
41
+
42
+ return mix(getFromColor(uv), getToColor(uv), w);
43
+ }
44
+ `,
45
+ });
46
+ //# sourceMappingURL=polka-dots-curtain.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polka-dots-curtain.js","sourceRoot":"","sources":["../../src/transitions/polka-dots-curtain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,gBAAgB,CAAC;IAC/C,IAAI,EAAE,oBAAoB;IAC1B,QAAQ,EAAE;QACR,IAAI,EAAE,EAAE;QACR,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;QAClB,QAAQ,EAAE,IAAI;KACf;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BP;CACA,CAAC,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Subdivided plane of square tiles. Each tile flips 180° around a
3
+ * horizontal axis through its centre, staggered by a diagonal wavefront
4
+ * so the flip sweeps top-left → bottom-right with per-tile jitter.
5
+ *
6
+ * Because a tile (quad) is self-symmetric under 180° horizontal flip,
7
+ * its canvas footprint is invariant across the rotation — no "screwed
8
+ * rect" overlap with neighbours. The two triangles that compose each
9
+ * tile share the same per-quad centroid, so they flip together.
10
+ *
11
+ * Front face (angle 0 → π/2) samples `from` at the tile's own uv —
12
+ * source content rides on the flipping card. Back face (angle π/2 → π)
13
+ * samples `to` at gl_FragCoord-based screen uv — destination stays
14
+ * pinned to the canvas, so at progress=1 every pixel is exactly to.
15
+ *
16
+ * Instance 0 is a back plane at z=0.9 cross-fading from → to; it fills
17
+ * the thin moments when a tile is edge-on so the full-frame rule holds.
18
+ *
19
+ * Endpoints: progress 0 → all tiles flat, front-facing, sampling from
20
+ * at aUv = pixel-pure from. Progress 1 → all tiles flat-mirrored (tile
21
+ * is self-symmetric), back-facing, sampling to at screen uv = pixel-
22
+ * pure to.
23
+ */
24
+ export declare const polygonFlip: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
25
+ readonly rim: 0.25;
26
+ }>>;
27
+ //# sourceMappingURL=polygon-flip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polygon-flip.d.ts","sourceRoot":"","sources":["../../src/transitions/polygon-flip.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,WAAW;;GAuEtB,CAAC"}
@@ -0,0 +1,97 @@
1
+ import { defineTransition } from "./define.js";
2
+ /**
3
+ * Subdivided plane of square tiles. Each tile flips 180° around a
4
+ * horizontal axis through its centre, staggered by a diagonal wavefront
5
+ * so the flip sweeps top-left → bottom-right with per-tile jitter.
6
+ *
7
+ * Because a tile (quad) is self-symmetric under 180° horizontal flip,
8
+ * its canvas footprint is invariant across the rotation — no "screwed
9
+ * rect" overlap with neighbours. The two triangles that compose each
10
+ * tile share the same per-quad centroid, so they flip together.
11
+ *
12
+ * Front face (angle 0 → π/2) samples `from` at the tile's own uv —
13
+ * source content rides on the flipping card. Back face (angle π/2 → π)
14
+ * samples `to` at gl_FragCoord-based screen uv — destination stays
15
+ * pinned to the canvas, so at progress=1 every pixel is exactly to.
16
+ *
17
+ * Instance 0 is a back plane at z=0.9 cross-fading from → to; it fills
18
+ * the thin moments when a tile is edge-on so the full-frame rule holds.
19
+ *
20
+ * Endpoints: progress 0 → all tiles flat, front-facing, sampling from
21
+ * at aUv = pixel-pure from. Progress 1 → all tiles flat-mirrored (tile
22
+ * is self-symmetric), back-facing, sampling to at screen uv = pixel-
23
+ * pure to.
24
+ */
25
+ export const polygonFlip = defineTransition({
26
+ name: "polygon-flip",
27
+ mesh: { subdivisions: [24, 14], instances: 2 },
28
+ defaults: {
29
+ rim: 0.25,
30
+ },
31
+ vertex: `
32
+ out float vFlip;
33
+ flat out int vInstance;
34
+
35
+ #define PI 3.14159265359
36
+
37
+ void main() {
38
+ vInstance = gl_InstanceID;
39
+ vUv = aUv;
40
+
41
+ if (gl_InstanceID == 0) {
42
+ gl_Position = vec4(aPosition, 0.9, 1.0);
43
+ vFlip = 0.0;
44
+ return;
45
+ }
46
+
47
+ // Diagonal wavefront top-left → bottom-right, plus a strong per-tile
48
+ // jitter so neighbours don't all finish together. aCentroid is per-
49
+ // quad (same for all 6 vertices of a tile) so the whole tile flips
50
+ // as one unit.
51
+ float waveX = (aCentroid.x + 1.0) * 0.5;
52
+ float waveY = 1.0 - (aCentroid.y + 1.0) * 0.5; // top → bottom
53
+ float wave = waveX * 0.55 + waveY * 0.35 + (aOffset - 0.5) * 0.35;
54
+ wave = clamp(wave, 0.0, 1.0);
55
+
56
+ float window = 0.22;
57
+ float start = wave * (1.0 - window);
58
+ float t = smoothstep(start, start + window, uProgress);
59
+ vFlip = t;
60
+
61
+ float angle = t * PI;
62
+ float c = cos(angle);
63
+ float s = sin(angle);
64
+
65
+ vec2 p = aPosition - aCentroid;
66
+ vec3 q = vec3(p.x, p.y * c, p.y * s);
67
+ q.xy += aCentroid;
68
+
69
+ // Slight z-bias forward of the back plane; in-plane rotation produces
70
+ // a small depth spread that helps adjacent tiles resolve cleanly.
71
+ gl_Position = vec4(q.x, q.y, q.z * 0.4 + 0.05, 1.0);
72
+ }
73
+ `,
74
+ glsl: `
75
+ in float vFlip;
76
+ flat in int vInstance;
77
+ uniform float uRim;
78
+
79
+ vec4 transition(vec2 uv) {
80
+ if (vInstance == 0) {
81
+ return mix(getFromColor(uv), getToColor(uv), smoothstep(0.0, 1.0, uProgress));
82
+ }
83
+
84
+ vec2 screenUv = gl_FragCoord.xy / uResolution;
85
+ vec4 col = gl_FrontFacing ? getFromColor(uv) : getToColor(screenUv);
86
+
87
+ // Subtle rim darkening across the flip window — tiles read as
88
+ // tilted cards catching light, without the hard wireframe look
89
+ // that fwidth(bary) edge highlights produce.
90
+ float amt = 4.0 * vFlip * (1.0 - vFlip);
91
+ col.rgb *= 1.0 - amt * uRim;
92
+
93
+ return col;
94
+ }
95
+ `,
96
+ });
97
+ //# sourceMappingURL=polygon-flip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polygon-flip.js","sourceRoot":"","sources":["../../src/transitions/polygon-flip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;GAsBG;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,GAAG,EAAE,IAAI;KACV;IACD,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0CT;IACC,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;CAqBP;CACA,CAAC,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Polar-coordinate portal. A circular reveal front sweeps from the centre
3
+ * outward, and around the front a narrow radial band swirls + magnifies
4
+ * the sampled content to evoke a tunnel mouth. Swirl and magnification
5
+ * fall off both radially (gaussian band around the reveal front) and
6
+ * temporally (zero at progress 0 and 1), which keeps every sample in
7
+ * bounds — no clamp streaks, no empty frame regions.
8
+ *
9
+ * Endpoints: at progress 0/1 the envelope is zero so the sample UV is
10
+ * identity, and the reveal edge sits well outside the frame on both
11
+ * sides, so output is pixel-pure from/to.
12
+ */
13
+ export declare const portalDive: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
14
+ readonly twist: 3.14159;
15
+ readonly depth: 1;
16
+ readonly reflection: 0;
17
+ }>>;
18
+ //# sourceMappingURL=portal-dive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"portal-dive.d.ts","sourceRoot":"","sources":["../../src/transitions/portal-dive.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU;;;;GAoErB,CAAC"}
@@ -0,0 +1,83 @@
1
+ import { defineTransition } from "./define.js";
2
+ /**
3
+ * Polar-coordinate portal. A circular reveal front sweeps from the centre
4
+ * outward, and around the front a narrow radial band swirls + magnifies
5
+ * the sampled content to evoke a tunnel mouth. Swirl and magnification
6
+ * fall off both radially (gaussian band around the reveal front) and
7
+ * temporally (zero at progress 0 and 1), which keeps every sample in
8
+ * bounds — no clamp streaks, no empty frame regions.
9
+ *
10
+ * Endpoints: at progress 0/1 the envelope is zero so the sample UV is
11
+ * identity, and the reveal edge sits well outside the frame on both
12
+ * sides, so output is pixel-pure from/to.
13
+ */
14
+ export const portalDive = defineTransition({
15
+ name: "portal-dive",
16
+ defaults: {
17
+ twist: 3.14159,
18
+ depth: 1.0,
19
+ reflection: 0.0,
20
+ },
21
+ glsl: `
22
+ uniform float uTwist;
23
+ uniform float uDepth;
24
+ uniform float uReflection;
25
+
26
+ vec4 transition(vec2 uv) {
27
+ float aspect = uResolution.x / uResolution.y;
28
+ vec2 c = vec2(0.5);
29
+ vec2 aDelta = vec2((uv.x - c.x) * aspect, uv.y - c.y);
30
+ float r = length(aDelta);
31
+ float theta = atan(aDelta.y, aDelta.x);
32
+ float maxR = sqrt(aspect * aspect * 0.25 + 0.25);
33
+
34
+ // Portal front position: negative at progress=0, past the farthest
35
+ // corner at progress=1, for any aspect ratio.
36
+ float portalR = mix(-0.15, maxR + 0.15, uProgress);
37
+
38
+ // Strength of distortion: gaussian band around the portal front,
39
+ // zero at progress 0/1. Both falloffs together guarantee sample UVs
40
+ // stay in-bounds everywhere (keeps clamp streaks out).
41
+ float bandWidth = 0.25;
42
+ float band = exp(-pow((r - portalR) / bandWidth, 2.0));
43
+ float envelope = 4.0 * uProgress * (1.0 - uProgress);
44
+ float strength = band * envelope;
45
+
46
+ // Swirl: rotate sample direction around centre.
47
+ float swirlAngle = strength * uTwist;
48
+ float newTheta = theta + swirlAngle;
49
+
50
+ // Inward pull: sample from a slightly smaller radius so content appears
51
+ // to be drawn toward the portal mouth (magnification = depth feel).
52
+ // Radius only ever DECREASES, so a pixel in bounds stays in bounds.
53
+ float pulledR = r * (1.0 - strength * uDepth * 0.3);
54
+
55
+ vec2 newAD = vec2(cos(newTheta), sin(newTheta)) * pulledR;
56
+ vec2 sampleUv = c + vec2(newAD.x / aspect, newAD.y);
57
+ // Defensive clamp — should be a no-op given the analysis above.
58
+ sampleUv = clamp(sampleUv, 0.0, 1.0);
59
+
60
+ vec4 fromColor = getFromColor(sampleUv);
61
+ vec4 toColor = getToColor(sampleUv);
62
+
63
+ // Soft radial reveal: centre crosses to to first, expanding outward.
64
+ float fade = smoothstep(portalR - 0.08, portalR + 0.08, r);
65
+ vec4 result = mix(toColor, fromColor, fade);
66
+
67
+ // Env glint at the tunnel mouth: use the radial direction as a
68
+ // surface-normal-like lookup into the env map, so the rim reads as a
69
+ // curved glass lip catching reflections. Gated by strength (= band *
70
+ // envelope), which is already zero at endpoints and away from the
71
+ // tunnel mouth — clean endpoints, no global tint bleed.
72
+ if (uReflection > 0.0) {
73
+ vec2 nDir = r > 1e-4 ? aDelta / r : vec2(0.0);
74
+ vec2 envUv = vec2(0.5 + 0.5 * nDir.x, 0.5 - 0.5 * nDir.y);
75
+ vec3 envColor = getEnvironment(envUv).rgb;
76
+ result.rgb = mix(result.rgb, envColor, strength * uReflection);
77
+ }
78
+
79
+ return result;
80
+ }
81
+ `,
82
+ });
83
+ //# sourceMappingURL=portal-dive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"portal-dive.js","sourceRoot":"","sources":["../../src/transitions/portal-dive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC;IACzC,IAAI,EAAE,aAAa;IACnB,QAAQ,EAAE;QACR,KAAK,EAAE,OAAO;QACd,KAAK,EAAE,GAAG;QACV,UAAU,EAAE,GAAG;KAChB;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4DP;CACA,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Directional RGB chromatic split. Like looking through a prism along a
3
+ * fixed axis: red and blue channels separate along `direction` while
4
+ * green stays put, then recombine on the to-image. Distinct from
5
+ * chromatic-pulse (which is radial outward from center).
6
+ */
7
+ export declare const prismSplit: import("../types.js").Transition<import("@vysmo/gl-core").Widen<{
8
+ readonly direction: readonly [1, 0];
9
+ readonly intensity: 0.04;
10
+ readonly softness: 0.2;
11
+ }>>;
12
+ //# sourceMappingURL=prism-split.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prism-split.d.ts","sourceRoot":"","sources":["../../src/transitions/prism-split.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,eAAO,MAAM,UAAU;;;;GA2CrB,CAAC"}