@smoove/transitions 0.1.1
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.
- package/LICENSE +21 -0
- package/README.md +55 -0
- package/dist/gl/compositor.d.ts +67 -0
- package/dist/gl/compositor.d.ts.map +1 -0
- package/dist/gl/compositor.js +147 -0
- package/dist/gl/compositor.js.map +1 -0
- package/dist/gl/gl-transition.d.ts +8 -0
- package/dist/gl/gl-transition.d.ts.map +1 -0
- package/dist/gl/gl-transition.js +9 -0
- package/dist/gl/gl-transition.js.map +1 -0
- package/dist/gl/shared.d.ts +10 -0
- package/dist/gl/shared.d.ts.map +1 -0
- package/dist/gl/shared.js +56 -0
- package/dist/gl/shared.js.map +1 -0
- package/dist/gl/transpile.d.ts +16 -0
- package/dist/gl/transpile.d.ts.map +1 -0
- package/dist/gl/transpile.js +29 -0
- package/dist/gl/transpile.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/presentations/book-flip.d.ts +8 -0
- package/dist/presentations/book-flip.d.ts.map +1 -0
- package/dist/presentations/book-flip.js +124 -0
- package/dist/presentations/book-flip.js.map +1 -0
- package/dist/presentations/clock-wipe.d.ts +12 -0
- package/dist/presentations/clock-wipe.d.ts.map +1 -0
- package/dist/presentations/clock-wipe.js +27 -0
- package/dist/presentations/clock-wipe.js.map +1 -0
- package/dist/presentations/cross-zoom.d.ts +7 -0
- package/dist/presentations/cross-zoom.d.ts.map +1 -0
- package/dist/presentations/cross-zoom.js +80 -0
- package/dist/presentations/cross-zoom.js.map +1 -0
- package/dist/presentations/crosswarp.d.ts +5 -0
- package/dist/presentations/crosswarp.d.ts.map +1 -0
- package/dist/presentations/crosswarp.js +32 -0
- package/dist/presentations/crosswarp.js.map +1 -0
- package/dist/presentations/dissolve.d.ts +11 -0
- package/dist/presentations/dissolve.d.ts.map +1 -0
- package/dist/presentations/dissolve.js +69 -0
- package/dist/presentations/dissolve.js.map +1 -0
- package/dist/presentations/dreamy-zoom.d.ts +8 -0
- package/dist/presentations/dreamy-zoom.d.ts.map +1 -0
- package/dist/presentations/dreamy-zoom.js +52 -0
- package/dist/presentations/dreamy-zoom.js.map +1 -0
- package/dist/presentations/fade.d.ts +9 -0
- package/dist/presentations/fade.d.ts.map +1 -0
- package/dist/presentations/fade.js +17 -0
- package/dist/presentations/fade.js.map +1 -0
- package/dist/presentations/film-burn.d.ts +7 -0
- package/dist/presentations/film-burn.d.ts.map +1 -0
- package/dist/presentations/film-burn.js +146 -0
- package/dist/presentations/film-burn.js.map +1 -0
- package/dist/presentations/flip.d.ts +13 -0
- package/dist/presentations/flip.d.ts.map +1 -0
- package/dist/presentations/flip.js +39 -0
- package/dist/presentations/flip.js.map +1 -0
- package/dist/presentations/index.d.ts +19 -0
- package/dist/presentations/index.d.ts.map +1 -0
- package/dist/presentations/index.js +21 -0
- package/dist/presentations/index.js.map +1 -0
- package/dist/presentations/iris.d.ts +12 -0
- package/dist/presentations/iris.d.ts.map +1 -0
- package/dist/presentations/iris.js +21 -0
- package/dist/presentations/iris.js.map +1 -0
- package/dist/presentations/linear-blur.d.ts +7 -0
- package/dist/presentations/linear-blur.d.ts.map +1 -0
- package/dist/presentations/linear-blur.js +47 -0
- package/dist/presentations/linear-blur.js.map +1 -0
- package/dist/presentations/none.d.ts +8 -0
- package/dist/presentations/none.d.ts.map +1 -0
- package/dist/presentations/none.js +12 -0
- package/dist/presentations/none.js.map +1 -0
- package/dist/presentations/ripple.d.ts +8 -0
- package/dist/presentations/ripple.d.ts.map +1 -0
- package/dist/presentations/ripple.js +39 -0
- package/dist/presentations/ripple.js.map +1 -0
- package/dist/presentations/slide.d.ts +11 -0
- package/dist/presentations/slide.d.ts.map +1 -0
- package/dist/presentations/slide.js +43 -0
- package/dist/presentations/slide.js.map +1 -0
- package/dist/presentations/swap.d.ts +9 -0
- package/dist/presentations/swap.d.ts.map +1 -0
- package/dist/presentations/swap.js +95 -0
- package/dist/presentations/swap.js.map +1 -0
- package/dist/presentations/wipe.d.ts +12 -0
- package/dist/presentations/wipe.d.ts.map +1 -0
- package/dist/presentations/wipe.js +31 -0
- package/dist/presentations/wipe.js.map +1 -0
- package/dist/presentations/zoom-blur.d.ts +7 -0
- package/dist/presentations/zoom-blur.d.ts.map +1 -0
- package/dist/presentations/zoom-blur.js +69 -0
- package/dist/presentations/zoom-blur.js.map +1 -0
- package/dist/presentations/zoom-in-out.d.ts +5 -0
- package/dist/presentations/zoom-in-out.d.ts.map +1 -0
- package/dist/presentations/zoom-in-out.js +33 -0
- package/dist/presentations/zoom-in-out.js.map +1 -0
- package/dist/timings/index.d.ts +4 -0
- package/dist/timings/index.d.ts.map +1 -0
- package/dist/timings/index.js +4 -0
- package/dist/timings/index.js.map +1 -0
- package/dist/timings/linear-timing.d.ts +12 -0
- package/dist/timings/linear-timing.d.ts.map +1 -0
- package/dist/timings/linear-timing.js +20 -0
- package/dist/timings/linear-timing.js.map +1 -0
- package/dist/timings/spring/index.d.ts +19 -0
- package/dist/timings/spring/index.d.ts.map +1 -0
- package/dist/timings/spring/index.js +30 -0
- package/dist/timings/spring/index.js.map +1 -0
- package/dist/timings/spring/measure-spring.d.ts +12 -0
- package/dist/timings/spring/measure-spring.d.ts.map +1 -0
- package/dist/timings/spring/measure-spring.js +37 -0
- package/dist/timings/spring/measure-spring.js.map +1 -0
- package/dist/timings/spring/spring-utils.d.ts +20 -0
- package/dist/timings/spring/spring-utils.d.ts.map +1 -0
- package/dist/timings/spring/spring-utils.js +65 -0
- package/dist/timings/spring/spring-utils.js.map +1 -0
- package/dist/timings/spring-timing.d.ts +16 -0
- package/dist/timings/spring-timing.d.ts.map +1 -0
- package/dist/timings/spring-timing.js +28 -0
- package/dist/timings/spring-timing.js.map +1 -0
- package/dist/transition-series.d.ts +52 -0
- package/dist/transition-series.d.ts.map +1 -0
- package/dist/transition-series.js +217 -0
- package/dist/transition-series.js.map +1 -0
- package/dist/types.d.ts +40 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +38 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Tier A — geometric (Konva-native).
|
|
2
|
+
export { bookFlip } from "./book-flip.js";
|
|
3
|
+
export { clockWipe } from "./clock-wipe.js";
|
|
4
|
+
export { crossZoom } from "./cross-zoom.js";
|
|
5
|
+
export { crosswarp } from "./crosswarp.js";
|
|
6
|
+
// Tier B — GLSL shaders (shared WebGL compositor).
|
|
7
|
+
export { dissolve } from "./dissolve.js";
|
|
8
|
+
export { dreamyZoom } from "./dreamy-zoom.js";
|
|
9
|
+
export { fade } from "./fade.js";
|
|
10
|
+
export { filmBurn } from "./film-burn.js";
|
|
11
|
+
export { flip } from "./flip.js";
|
|
12
|
+
export { iris } from "./iris.js";
|
|
13
|
+
export { linearBlur } from "./linear-blur.js";
|
|
14
|
+
export { none } from "./none.js";
|
|
15
|
+
export { ripple } from "./ripple.js";
|
|
16
|
+
export { slide } from "./slide.js";
|
|
17
|
+
export { swap } from "./swap.js";
|
|
18
|
+
export { wipe } from "./wipe.js";
|
|
19
|
+
export { zoomBlur } from "./zoom-blur.js";
|
|
20
|
+
export { zoomInOut } from "./zoom-in-out.js";
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/presentations/index.ts"],"names":[],"mappings":"AAAA,qCAAqC;AAErC,OAAO,EAA8C,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACtF,OAAO,EAAuB,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAuB,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAuB,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChE,mDAAmD;AACnD,OAAO,EAAsB,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAwB,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAsB,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAsC,IAAI,EAAE,MAAM,WAAW,CAAC;AACrE,OAAO,EAAkB,IAAI,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAwB,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAoB,MAAM,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAwC,KAAK,EAAE,MAAM,YAAY,CAAC;AACzE,OAAO,EAAkB,IAAI,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAsC,IAAI,EAAE,MAAM,WAAW,CAAC;AACrE,OAAO,EAAsB,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAuB,SAAS,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Presentation } from "../types.js";
|
|
2
|
+
export type IrisProps = {
|
|
3
|
+
width?: number;
|
|
4
|
+
height?: number;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Circular reveal: the incoming layer is clipped to a circle that grows from
|
|
8
|
+
* the centre to cover the frame. Mirrors Remotion's `iris`. `width`/`height`
|
|
9
|
+
* default to the Composition stage size.
|
|
10
|
+
*/
|
|
11
|
+
export declare function iris(props?: IrisProps): Presentation;
|
|
12
|
+
//# sourceMappingURL=iris.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iris.d.ts","sourceRoot":"","sources":["../../src/presentations/iris.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,MAAM,SAAS,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5D;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,KAAK,GAAE,SAAc,GAAG,YAAY,CAcxD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Circular reveal: the incoming layer is clipped to a circle that grows from
|
|
3
|
+
* the centre to cover the frame. Mirrors Remotion's `iris`. `width`/`height`
|
|
4
|
+
* default to the Composition stage size.
|
|
5
|
+
*/
|
|
6
|
+
export function iris(props = {}) {
|
|
7
|
+
return {
|
|
8
|
+
enter(layer, progress, dims) {
|
|
9
|
+
const width = props.width ?? dims.width;
|
|
10
|
+
const height = props.height ?? dims.height;
|
|
11
|
+
const maxRadius = Math.sqrt(width * width + height * height) / 2;
|
|
12
|
+
const radius = maxRadius * progress;
|
|
13
|
+
layer.clipFunc((ctx) => {
|
|
14
|
+
ctx.arc(width / 2, height / 2, Math.max(radius, 0), 0, Math.PI * 2, false);
|
|
15
|
+
});
|
|
16
|
+
},
|
|
17
|
+
// Outgoing scene stays visible under the expanding iris.
|
|
18
|
+
exit() { },
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=iris.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iris.js","sourceRoot":"","sources":["../../src/presentations/iris.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,MAAM,UAAU,IAAI,CAAC,QAAmB,EAAE;IACxC,OAAO;QACL,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;YACzB,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC;YACxC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC;YAC3C,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;YACjE,MAAM,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;YACpC,KAAK,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,EAAE;gBACrB,GAAG,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;YAC7E,CAAC,CAAC,CAAC;QACL,CAAC;QACD,yDAAyD;QACzD,IAAI,KAAI,CAAC;KACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Presentation } from "../types.js";
|
|
2
|
+
export type LinearBlurProps = {
|
|
3
|
+
intensity?: number;
|
|
4
|
+
};
|
|
5
|
+
/** Directionless blur cross-dissolve (gl-transitions `LinearBlur`). */
|
|
6
|
+
export declare function linearBlur(props?: LinearBlurProps): Presentation;
|
|
7
|
+
//# sourceMappingURL=linear-blur.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linear-blur.d.ts","sourceRoot":"","sources":["../../src/presentations/linear-blur.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AA4ChD,MAAM,MAAM,eAAe,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAErD,uEAAuE;AACvE,wBAAgB,UAAU,CAAC,KAAK,GAAE,eAAoB,GAAG,YAAY,CAGpE"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { glTransition } from "../gl/gl-transition.js";
|
|
2
|
+
// Adapted from https://gl-transitions.com/editor/LinearBlur
|
|
3
|
+
// Author: gre · License: MIT
|
|
4
|
+
const FRAGMENT = `#version 300 es
|
|
5
|
+
precision highp float;
|
|
6
|
+
|
|
7
|
+
uniform sampler2D u_prev;
|
|
8
|
+
uniform sampler2D u_next;
|
|
9
|
+
uniform float u_time;
|
|
10
|
+
uniform float u_intensity;
|
|
11
|
+
|
|
12
|
+
in vec2 v_uv;
|
|
13
|
+
out vec4 outColor;
|
|
14
|
+
|
|
15
|
+
const int PASSES = 6;
|
|
16
|
+
|
|
17
|
+
vec4 transition(vec2 uv, float progress) {
|
|
18
|
+
vec4 c1 = vec4(0.0);
|
|
19
|
+
vec4 c2 = vec4(0.0);
|
|
20
|
+
|
|
21
|
+
float disp = u_intensity * (0.5 - distance(0.5, progress));
|
|
22
|
+
for (int xi = 0; xi < PASSES; xi++) {
|
|
23
|
+
float x = float(xi) / float(PASSES) - 0.5;
|
|
24
|
+
for (int yi = 0; yi < PASSES; yi++) {
|
|
25
|
+
float y = float(yi) / float(PASSES) - 0.5;
|
|
26
|
+
vec2 v = vec2(x, y);
|
|
27
|
+
c1 += texture(u_prev, uv + disp * v);
|
|
28
|
+
c2 += texture(u_next, uv + disp * v);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
c1 /= float(PASSES * PASSES);
|
|
33
|
+
c2 /= float(PASSES * PASSES);
|
|
34
|
+
return mix(c1, c2, progress);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
void main() {
|
|
38
|
+
float progress = 1.0 - u_time;
|
|
39
|
+
outColor = transition(v_uv, progress);
|
|
40
|
+
}`;
|
|
41
|
+
const DEFAULT_INTENSITY = 0.1;
|
|
42
|
+
/** Directionless blur cross-dissolve (gl-transitions `LinearBlur`). */
|
|
43
|
+
export function linearBlur(props = {}) {
|
|
44
|
+
const intensity = props.intensity ?? DEFAULT_INTENSITY;
|
|
45
|
+
return glTransition(FRAGMENT, () => ({ u_intensity: intensity }));
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=linear-blur.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linear-blur.js","sourceRoot":"","sources":["../../src/presentations/linear-blur.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGtD,4DAA4D;AAC5D,6BAA6B;AAC7B,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoCf,CAAC;AAEH,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAI9B,uEAAuE;AACvE,MAAM,UAAU,UAAU,CAAC,QAAyB,EAAE;IACpD,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,IAAI,iBAAiB,CAAC;IACvD,OAAO,YAAY,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Presentation } from "../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Hard cut — no visual transform. The incoming layer (on top) simply replaces
|
|
4
|
+
* the outgoing one for the overlap window. Useful for driving custom effects
|
|
5
|
+
* off the timing alone. Mirrors Remotion's `none`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function none(): Presentation;
|
|
8
|
+
//# sourceMappingURL=none.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"none.d.ts","sourceRoot":"","sources":["../../src/presentations/none.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;;;GAIG;AACH,wBAAgB,IAAI,IAAI,YAAY,CAKnC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hard cut — no visual transform. The incoming layer (on top) simply replaces
|
|
3
|
+
* the outgoing one for the overlap window. Useful for driving custom effects
|
|
4
|
+
* off the timing alone. Mirrors Remotion's `none`.
|
|
5
|
+
*/
|
|
6
|
+
export function none() {
|
|
7
|
+
return {
|
|
8
|
+
enter() { },
|
|
9
|
+
exit() { },
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=none.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"none.js","sourceRoot":"","sources":["../../src/presentations/none.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,UAAU,IAAI;IAClB,OAAO;QACL,KAAK,KAAI,CAAC;QACV,IAAI,KAAI,CAAC;KACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Presentation } from "../types.js";
|
|
2
|
+
export type RippleProps = {
|
|
3
|
+
amplitude?: number;
|
|
4
|
+
speed?: number;
|
|
5
|
+
};
|
|
6
|
+
/** Concentric ripple cross-dissolve (gl-transitions `ripple`). */
|
|
7
|
+
export declare function ripple(props?: RippleProps): Presentation;
|
|
8
|
+
//# sourceMappingURL=ripple.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ripple.d.ts","sourceRoot":"","sources":["../../src/presentations/ripple.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAmChD,MAAM,MAAM,WAAW,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjE,kEAAkE;AAClE,wBAAgB,MAAM,CAAC,KAAK,GAAE,WAAgB,GAAG,YAAY,CAI5D"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { glTransition } from "../gl/gl-transition.js";
|
|
2
|
+
// Adapted from https://gl-transitions.com/editor/ripple
|
|
3
|
+
// Author: gre · License: MIT
|
|
4
|
+
const FRAGMENT = `#version 300 es
|
|
5
|
+
precision highp float;
|
|
6
|
+
|
|
7
|
+
uniform sampler2D u_prev;
|
|
8
|
+
uniform sampler2D u_next;
|
|
9
|
+
uniform float u_time;
|
|
10
|
+
uniform float u_amplitude;
|
|
11
|
+
uniform float u_speed;
|
|
12
|
+
|
|
13
|
+
in vec2 v_uv;
|
|
14
|
+
out vec4 outColor;
|
|
15
|
+
|
|
16
|
+
vec4 transition(vec2 uv, float progress) {
|
|
17
|
+
vec2 dir = uv - vec2(0.5);
|
|
18
|
+
float dist = length(dir);
|
|
19
|
+
vec2 offset = dir * (sin(progress * dist * u_amplitude - progress * u_speed) + 0.5) / 30.0 * progress;
|
|
20
|
+
return mix(
|
|
21
|
+
texture(u_next, uv + offset),
|
|
22
|
+
texture(u_prev, uv),
|
|
23
|
+
smoothstep(0.2, 1.0, progress)
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
void main() {
|
|
28
|
+
float progress = u_time;
|
|
29
|
+
outColor = transition(v_uv, progress);
|
|
30
|
+
}`;
|
|
31
|
+
const DEFAULT_AMPLITUDE = 100.0;
|
|
32
|
+
const DEFAULT_SPEED = 50.0;
|
|
33
|
+
/** Concentric ripple cross-dissolve (gl-transitions `ripple`). */
|
|
34
|
+
export function ripple(props = {}) {
|
|
35
|
+
const amplitude = props.amplitude ?? DEFAULT_AMPLITUDE;
|
|
36
|
+
const speed = props.speed ?? DEFAULT_SPEED;
|
|
37
|
+
return glTransition(FRAGMENT, () => ({ u_amplitude: amplitude, u_speed: speed }));
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=ripple.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ripple.js","sourceRoot":"","sources":["../../src/presentations/ripple.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGtD,wDAAwD;AACxD,6BAA6B;AAC7B,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;EA0Bf,CAAC;AAEH,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAChC,MAAM,aAAa,GAAG,IAAI,CAAC;AAI3B,kEAAkE;AAClE,MAAM,UAAU,MAAM,CAAC,QAAqB,EAAE;IAC5C,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,IAAI,iBAAiB,CAAC;IACvD,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,aAAa,CAAC;IAC3C,OAAO,YAAY,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;AACpF,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Presentation } from "../types.js";
|
|
2
|
+
export type SlideDirection = "from-left" | "from-right" | "from-top" | "from-bottom";
|
|
3
|
+
export type SlideProps = {
|
|
4
|
+
direction?: SlideDirection;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Translate the incoming layer in from `direction` while pushing the outgoing
|
|
8
|
+
* layer out the opposite side. Mirrors Remotion's `slide`.
|
|
9
|
+
*/
|
|
10
|
+
export declare function slide(props?: SlideProps): Presentation;
|
|
11
|
+
//# sourceMappingURL=slide.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slide.d.ts","sourceRoot":"","sources":["../../src/presentations/slide.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,YAAY,GAAG,UAAU,GAAG,aAAa,CAAC;AAErF,MAAM,MAAM,UAAU,GAAG;IAAE,SAAS,CAAC,EAAE,cAAc,CAAA;CAAE,CAAC;AAExD;;;GAGG;AACH,wBAAgB,KAAK,CAAC,KAAK,GAAE,UAAe,GAAG,YAAY,CAqC1D"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Translate the incoming layer in from `direction` while pushing the outgoing
|
|
3
|
+
* layer out the opposite side. Mirrors Remotion's `slide`.
|
|
4
|
+
*/
|
|
5
|
+
export function slide(props = {}) {
|
|
6
|
+
const direction = props.direction ?? "from-left";
|
|
7
|
+
return {
|
|
8
|
+
enter(layer, progress, { width, height }) {
|
|
9
|
+
const t = 1 - progress; // 1 → fully off-screen, 0 → in place
|
|
10
|
+
switch (direction) {
|
|
11
|
+
case "from-left":
|
|
12
|
+
layer.position({ x: -width * t, y: 0 });
|
|
13
|
+
break;
|
|
14
|
+
case "from-right":
|
|
15
|
+
layer.position({ x: width * t, y: 0 });
|
|
16
|
+
break;
|
|
17
|
+
case "from-top":
|
|
18
|
+
layer.position({ x: 0, y: -height * t });
|
|
19
|
+
break;
|
|
20
|
+
case "from-bottom":
|
|
21
|
+
layer.position({ x: 0, y: height * t });
|
|
22
|
+
break;
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
exit(layer, progress, { width, height }) {
|
|
26
|
+
switch (direction) {
|
|
27
|
+
case "from-left":
|
|
28
|
+
layer.position({ x: width * progress, y: 0 });
|
|
29
|
+
break;
|
|
30
|
+
case "from-right":
|
|
31
|
+
layer.position({ x: -width * progress, y: 0 });
|
|
32
|
+
break;
|
|
33
|
+
case "from-top":
|
|
34
|
+
layer.position({ x: 0, y: height * progress });
|
|
35
|
+
break;
|
|
36
|
+
case "from-bottom":
|
|
37
|
+
layer.position({ x: 0, y: -height * progress });
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=slide.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slide.js","sourceRoot":"","sources":["../../src/presentations/slide.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,MAAM,UAAU,KAAK,CAAC,QAAoB,EAAE;IAC1C,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,IAAI,WAAW,CAAC;IACjD,OAAO;QACL,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;YACtC,MAAM,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,CAAC,qCAAqC;YAC7D,QAAQ,SAAS,EAAE,CAAC;gBAClB,KAAK,WAAW;oBACd,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;oBACxC,MAAM;gBACR,KAAK,YAAY;oBACf,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;oBACvC,MAAM;gBACR,KAAK,UAAU;oBACb,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC;oBACzC,MAAM;gBACR,KAAK,aAAa;oBAChB,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC;oBACxC,MAAM;YACV,CAAC;QACH,CAAC;QACD,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;YACrC,QAAQ,SAAS,EAAE,CAAC;gBAClB,KAAK,WAAW;oBACd,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,KAAK,GAAG,QAAQ,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;oBAC9C,MAAM;gBACR,KAAK,YAAY;oBACf,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,GAAG,QAAQ,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;oBAC/C,MAAM;gBACR,KAAK,UAAU;oBACb,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,QAAQ,EAAE,CAAC,CAAC;oBAC/C,MAAM;gBACR,KAAK,aAAa;oBAChB,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,GAAG,QAAQ,EAAE,CAAC,CAAC;oBAChD,MAAM;YACV,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Presentation } from "../types.js";
|
|
2
|
+
export type SwapProps = {
|
|
3
|
+
reflection?: number;
|
|
4
|
+
perspective?: number;
|
|
5
|
+
depth?: number;
|
|
6
|
+
};
|
|
7
|
+
/** Perspective card swap with floor reflection (gl-transitions `swap`). */
|
|
8
|
+
export declare function swap(props?: SwapProps): Presentation;
|
|
9
|
+
//# sourceMappingURL=swap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swap.d.ts","sourceRoot":"","sources":["../../src/presentations/swap.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAsFhD,MAAM,MAAM,SAAS,GAAG;IAAE,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtF,2EAA2E;AAC3E,wBAAgB,IAAI,CAAC,KAAK,GAAE,SAAc,GAAG,YAAY,CASxD"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { glTransition } from "../gl/gl-transition.js";
|
|
2
|
+
// Adapted from https://gl-transitions.com/editor/swap
|
|
3
|
+
// Author: gre - License: MIT
|
|
4
|
+
const FRAGMENT = `#version 300 es
|
|
5
|
+
precision highp float;
|
|
6
|
+
|
|
7
|
+
uniform sampler2D u_prev;
|
|
8
|
+
uniform sampler2D u_next;
|
|
9
|
+
uniform float u_time;
|
|
10
|
+
uniform float u_reflection;
|
|
11
|
+
uniform float u_perspective;
|
|
12
|
+
uniform float u_depth;
|
|
13
|
+
|
|
14
|
+
in vec2 v_uv;
|
|
15
|
+
out vec4 outColor;
|
|
16
|
+
|
|
17
|
+
const vec4 black = vec4(0.0, 0.0, 0.0, 1.0);
|
|
18
|
+
const vec2 boundMin = vec2(0.0, 0.0);
|
|
19
|
+
const vec2 boundMax = vec2(1.0, 1.0);
|
|
20
|
+
|
|
21
|
+
bool inBounds(vec2 p) {
|
|
22
|
+
return all(lessThan(boundMin, p)) && all(lessThan(p, boundMax));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
vec2 project(vec2 p) {
|
|
26
|
+
return p * vec2(1.0, -1.2) + vec2(0.0, 2.22);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
vec4 bgColor(vec2 p, vec2 pfr, vec2 pto) {
|
|
30
|
+
vec4 c = black;
|
|
31
|
+
pfr = project(pfr);
|
|
32
|
+
if (inBounds(pfr)) {
|
|
33
|
+
c += mix(black, texture(u_prev, pfr), u_reflection * mix(1.0, 0.0, pfr.y));
|
|
34
|
+
}
|
|
35
|
+
pto = project(pto);
|
|
36
|
+
if (inBounds(pto)) {
|
|
37
|
+
c += mix(black, texture(u_next, pto), u_reflection * mix(1.0, 0.0, pto.y));
|
|
38
|
+
}
|
|
39
|
+
return c;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
vec4 transition(vec2 p, float progress) {
|
|
43
|
+
vec2 pfr;
|
|
44
|
+
vec2 pto = vec2(-1.0);
|
|
45
|
+
|
|
46
|
+
float size = mix(1.0, u_depth, progress);
|
|
47
|
+
float persp = u_perspective * progress;
|
|
48
|
+
pfr = (p + vec2(-0.0, -0.5)) * vec2(
|
|
49
|
+
size / (1.0 - u_perspective * progress),
|
|
50
|
+
size / (1.0 - size * persp * p.x)
|
|
51
|
+
) + vec2(0.0, 0.5);
|
|
52
|
+
|
|
53
|
+
size = mix(1.0, u_depth, 1.0 - progress);
|
|
54
|
+
persp = u_perspective * (1.0 - progress);
|
|
55
|
+
pto = (p + vec2(-1.0, -0.5)) * vec2(
|
|
56
|
+
size / (1.0 - u_perspective * (1.0 - progress)),
|
|
57
|
+
size / (1.0 - size * persp * (0.5 - p.x))
|
|
58
|
+
) + vec2(1.0, 0.5);
|
|
59
|
+
|
|
60
|
+
if (progress < 0.5) {
|
|
61
|
+
if (inBounds(pfr)) {
|
|
62
|
+
return texture(u_prev, pfr);
|
|
63
|
+
}
|
|
64
|
+
if (inBounds(pto)) {
|
|
65
|
+
return texture(u_next, pto);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (inBounds(pto)) {
|
|
69
|
+
return texture(u_next, pto);
|
|
70
|
+
}
|
|
71
|
+
if (inBounds(pfr)) {
|
|
72
|
+
return texture(u_prev, pfr);
|
|
73
|
+
}
|
|
74
|
+
return bgColor(p, pfr, pto);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
void main() {
|
|
78
|
+
float progress = 1.0 - u_time;
|
|
79
|
+
outColor = transition(v_uv, progress);
|
|
80
|
+
}`;
|
|
81
|
+
const DEFAULT_REFLECTION = 0.4;
|
|
82
|
+
const DEFAULT_PERSPECTIVE = 0.2;
|
|
83
|
+
const DEFAULT_DEPTH = 3.0;
|
|
84
|
+
/** Perspective card swap with floor reflection (gl-transitions `swap`). */
|
|
85
|
+
export function swap(props = {}) {
|
|
86
|
+
const reflection = props.reflection ?? DEFAULT_REFLECTION;
|
|
87
|
+
const perspective = props.perspective ?? DEFAULT_PERSPECTIVE;
|
|
88
|
+
const depth = props.depth ?? DEFAULT_DEPTH;
|
|
89
|
+
return glTransition(FRAGMENT, () => ({
|
|
90
|
+
u_reflection: reflection,
|
|
91
|
+
u_perspective: perspective,
|
|
92
|
+
u_depth: depth,
|
|
93
|
+
}));
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=swap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swap.js","sourceRoot":"","sources":["../../src/presentations/swap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGtD,sDAAsD;AACtD,6BAA6B;AAC7B,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4Ef,CAAC;AAEH,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAC/B,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAChC,MAAM,aAAa,GAAG,GAAG,CAAC;AAI1B,2EAA2E;AAC3E,MAAM,UAAU,IAAI,CAAC,QAAmB,EAAE;IACxC,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,IAAI,kBAAkB,CAAC;IAC1D,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,IAAI,mBAAmB,CAAC;IAC7D,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,aAAa,CAAC;IAC3C,OAAO,YAAY,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC;QACnC,YAAY,EAAE,UAAU;QACxB,aAAa,EAAE,WAAW;QAC1B,OAAO,EAAE,KAAK;KACf,CAAC,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Presentation } from "../types.js";
|
|
2
|
+
export type WipeDirection = "from-left" | "from-right" | "from-top" | "from-bottom";
|
|
3
|
+
export type WipeProps = {
|
|
4
|
+
direction?: WipeDirection;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Reveal the incoming layer behind a moving rectangular edge (a `clipFunc` on
|
|
8
|
+
* the incoming layer); the outgoing layer stays put underneath. Mirrors
|
|
9
|
+
* Remotion's `wipe`.
|
|
10
|
+
*/
|
|
11
|
+
export declare function wipe(props?: WipeProps): Presentation;
|
|
12
|
+
//# sourceMappingURL=wipe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wipe.d.ts","sourceRoot":"","sources":["../../src/presentations/wipe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,YAAY,GAAG,UAAU,GAAG,aAAa,CAAC;AAEpF,MAAM,MAAM,SAAS,GAAG;IAAE,SAAS,CAAC,EAAE,aAAa,CAAA;CAAE,CAAC;AAEtD;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,KAAK,GAAE,SAAc,GAAG,YAAY,CAwBxD"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reveal the incoming layer behind a moving rectangular edge (a `clipFunc` on
|
|
3
|
+
* the incoming layer); the outgoing layer stays put underneath. Mirrors
|
|
4
|
+
* Remotion's `wipe`.
|
|
5
|
+
*/
|
|
6
|
+
export function wipe(props = {}) {
|
|
7
|
+
const direction = props.direction ?? "from-left";
|
|
8
|
+
return {
|
|
9
|
+
enter(layer, progress, { width, height }) {
|
|
10
|
+
layer.clipFunc((ctx) => {
|
|
11
|
+
switch (direction) {
|
|
12
|
+
case "from-left":
|
|
13
|
+
ctx.rect(0, 0, width * progress, height);
|
|
14
|
+
break;
|
|
15
|
+
case "from-right":
|
|
16
|
+
ctx.rect(width * (1 - progress), 0, width * progress, height);
|
|
17
|
+
break;
|
|
18
|
+
case "from-top":
|
|
19
|
+
ctx.rect(0, 0, width, height * progress);
|
|
20
|
+
break;
|
|
21
|
+
case "from-bottom":
|
|
22
|
+
ctx.rect(0, height * (1 - progress), width, height * progress);
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
},
|
|
27
|
+
// Outgoing scene is untouched — it stays fully visible under the wipe.
|
|
28
|
+
exit() { },
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=wipe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wipe.js","sourceRoot":"","sources":["../../src/presentations/wipe.ts"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,MAAM,UAAU,IAAI,CAAC,QAAmB,EAAE;IACxC,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,IAAI,WAAW,CAAC;IACjD,OAAO;QACL,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;YACtC,KAAK,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,EAAE;gBACrB,QAAQ,SAAS,EAAE,CAAC;oBAClB,KAAK,WAAW;wBACd,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,GAAG,QAAQ,EAAE,MAAM,CAAC,CAAC;wBACzC,MAAM;oBACR,KAAK,YAAY;wBACf,GAAG,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,EAAE,KAAK,GAAG,QAAQ,EAAE,MAAM,CAAC,CAAC;wBAC9D,MAAM;oBACR,KAAK,UAAU;wBACb,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC;wBACzC,MAAM;oBACR,KAAK,aAAa;wBAChB,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC;wBAC/D,MAAM;gBACV,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;QACD,uEAAuE;QACvE,IAAI,KAAI,CAAC;KACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Presentation } from "../types.js";
|
|
2
|
+
export type ZoomBlurProps = {
|
|
3
|
+
rotation?: number;
|
|
4
|
+
};
|
|
5
|
+
/** Counter-rotating radial zoom blur (Remotion-original `zoomBlur`). */
|
|
6
|
+
export declare function zoomBlur(props?: ZoomBlurProps): Presentation;
|
|
7
|
+
//# sourceMappingURL=zoom-blur.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zoom-blur.d.ts","sourceRoot":"","sources":["../../src/presentations/zoom-blur.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AA+DhD,MAAM,MAAM,aAAa,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAElD,wEAAwE;AACxE,wBAAgB,QAAQ,CAAC,KAAK,GAAE,aAAkB,GAAG,YAAY,CAMhE"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { glTransition } from "../gl/gl-transition.js";
|
|
2
|
+
// Symmetric counter-rotating zoom blur. Remotion-original shader.
|
|
3
|
+
const FRAGMENT = `#version 300 es
|
|
4
|
+
precision highp float;
|
|
5
|
+
|
|
6
|
+
uniform sampler2D u_prev;
|
|
7
|
+
uniform sampler2D u_next;
|
|
8
|
+
uniform float u_time;
|
|
9
|
+
uniform float u_aspect;
|
|
10
|
+
uniform float u_max_angle;
|
|
11
|
+
|
|
12
|
+
in vec2 v_uv;
|
|
13
|
+
out vec4 outColor;
|
|
14
|
+
|
|
15
|
+
const int SAMPLES = 16;
|
|
16
|
+
const float STRENGTH = 0.35;
|
|
17
|
+
|
|
18
|
+
vec2 transformUV(vec2 uv, float angle, float scale) {
|
|
19
|
+
vec2 p = uv - 0.5;
|
|
20
|
+
p.x *= u_aspect;
|
|
21
|
+
p /= scale;
|
|
22
|
+
float c = cos(-angle);
|
|
23
|
+
float s = sin(-angle);
|
|
24
|
+
p = vec2(p.x * c - p.y * s, p.x * s + p.y * c);
|
|
25
|
+
p.x /= u_aspect;
|
|
26
|
+
return p + 0.5;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
float coverScale(float angle) {
|
|
30
|
+
float c = abs(cos(angle));
|
|
31
|
+
float s = abs(sin(angle));
|
|
32
|
+
float ar = max(u_aspect, 1.0 / u_aspect);
|
|
33
|
+
return c + ar * s;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
vec4 zoomBlur(sampler2D tex, vec2 uv, float strength) {
|
|
37
|
+
vec2 dir = uv - 0.5;
|
|
38
|
+
vec4 acc = vec4(0.0);
|
|
39
|
+
for (int i = 0; i < SAMPLES; i++) {
|
|
40
|
+
float t = float(i) / float(SAMPLES - 1);
|
|
41
|
+
float scale = 1.0 - strength * t;
|
|
42
|
+
acc += texture(tex, 0.5 + dir * scale);
|
|
43
|
+
}
|
|
44
|
+
return acc / float(SAMPLES);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
void main() {
|
|
48
|
+
float mixT = u_time;
|
|
49
|
+
|
|
50
|
+
float nextAngle = u_max_angle * mixT;
|
|
51
|
+
float prevAngle = -u_max_angle * (1.0 - mixT);
|
|
52
|
+
|
|
53
|
+
vec2 prevUV = transformUV(v_uv, prevAngle, coverScale(prevAngle));
|
|
54
|
+
vec2 nextUV = transformUV(v_uv, nextAngle, coverScale(nextAngle));
|
|
55
|
+
|
|
56
|
+
vec4 prev = zoomBlur(u_prev, prevUV, STRENGTH * (1.0 - mixT));
|
|
57
|
+
vec4 next = zoomBlur(u_next, nextUV, STRENGTH * mixT);
|
|
58
|
+
outColor = mix(prev, next, (1.0 - mixT));
|
|
59
|
+
}`;
|
|
60
|
+
const DEFAULT_ROTATION = Math.PI / 6;
|
|
61
|
+
/** Counter-rotating radial zoom blur (Remotion-original `zoomBlur`). */
|
|
62
|
+
export function zoomBlur(props = {}) {
|
|
63
|
+
const rotation = props.rotation ?? DEFAULT_ROTATION;
|
|
64
|
+
return glTransition(FRAGMENT, (_p, { width, height }) => ({
|
|
65
|
+
u_aspect: width / height,
|
|
66
|
+
u_max_angle: rotation,
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=zoom-blur.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zoom-blur.js","sourceRoot":"","sources":["../../src/presentations/zoom-blur.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGtD,kEAAkE;AAClE,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwDf,CAAC;AAEH,MAAM,gBAAgB,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;AAIrC,wEAAwE;AACxE,MAAM,UAAU,QAAQ,CAAC,QAAuB,EAAE;IAChD,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,gBAAgB,CAAC;IACpD,OAAO,YAAY,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;QACxD,QAAQ,EAAE,KAAK,GAAG,MAAM;QACxB,WAAW,EAAE,QAAQ;KACtB,CAAC,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zoom-in-out.d.ts","sourceRoot":"","sources":["../../src/presentations/zoom-in-out.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AA8BhD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAEnD,mEAAmE;AACnE,wBAAgB,SAAS,IAAI,YAAY,CAExC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { glTransition } from "../gl/gl-transition.js";
|
|
2
|
+
// Adapted from https://gl-transitions.com/editor/zoomInOut
|
|
3
|
+
// Author: OllyOllyOlly · License: MIT
|
|
4
|
+
const FRAGMENT = `#version 300 es
|
|
5
|
+
precision highp float;
|
|
6
|
+
|
|
7
|
+
uniform sampler2D u_prev;
|
|
8
|
+
uniform sampler2D u_next;
|
|
9
|
+
uniform float u_time;
|
|
10
|
+
|
|
11
|
+
in vec2 v_uv;
|
|
12
|
+
out vec4 outColor;
|
|
13
|
+
|
|
14
|
+
vec2 zoom(vec2 uv, float amount) {
|
|
15
|
+
return 0.5 + ((uv - 0.5) * (1.0 - amount));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
void main() {
|
|
19
|
+
float progress = 1.0 - u_time;
|
|
20
|
+
float zoomFrom = smoothstep(0.0, 1.0, progress * 2.0);
|
|
21
|
+
float zoomTo = smoothstep(0.0, 1.0, (1.0 - progress) * 2.0);
|
|
22
|
+
float crossfade = smoothstep(0.4, 0.6, progress);
|
|
23
|
+
outColor = mix(
|
|
24
|
+
texture(u_prev, zoom(v_uv, zoomFrom)),
|
|
25
|
+
texture(u_next, zoom(v_uv, zoomTo)),
|
|
26
|
+
crossfade
|
|
27
|
+
);
|
|
28
|
+
}`;
|
|
29
|
+
/** Punch-in / punch-out crossfade (gl-transitions `zoomInOut`). */
|
|
30
|
+
export function zoomInOut() {
|
|
31
|
+
return glTransition(FRAGMENT);
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=zoom-in-out.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zoom-in-out.js","sourceRoot":"","sources":["../../src/presentations/zoom-in-out.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGtD,2DAA2D;AAC3D,sCAAsC;AACtC,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;EAwBf,CAAC;AAIH,mEAAmE;AACnE,MAAM,UAAU,SAAS;IACvB,OAAO,YAAY,CAAC,QAAQ,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { type LinearTimingOptions, linearTiming } from "./linear-timing.js";
|
|
2
|
+
export { defaultSpringConfig, measureSpring, type SpringConfig, spring } from "./spring/index.js";
|
|
3
|
+
export { type SpringTimingOptions, springTiming } from "./spring-timing.js";
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/timings/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,mBAAmB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,KAAK,YAAY,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAClG,OAAO,EAAE,KAAK,mBAAmB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/timings/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAqB,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAClG,OAAO,EAA4B,YAAY,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Timing } from "../types.js";
|
|
2
|
+
export type LinearTimingOptions = {
|
|
3
|
+
durationInFrames: number;
|
|
4
|
+
/** Optional easing curve from core's `Easing` (e.g. `Easing.inOut(Easing.cubic)`). */
|
|
5
|
+
easing?: (input: number) => number;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* A transition whose progress moves linearly (optionally eased) from 0 to 1
|
|
9
|
+
* over `durationInFrames`. Mirrors Remotion's `linearTiming`.
|
|
10
|
+
*/
|
|
11
|
+
export declare function linearTiming(options: LinearTimingOptions): Timing;
|
|
12
|
+
//# sourceMappingURL=linear-timing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linear-timing.d.ts","sourceRoot":"","sources":["../../src/timings/linear-timing.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,MAAM,mBAAmB,GAAG;IAChC,gBAAgB,EAAE,MAAM,CAAC;IACzB,sFAAsF;IACtF,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CACpC,CAAC;AAEF;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,CAcjE"}
|