@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,12 @@
|
|
|
1
|
+
import type { Presentation } from "../types.js";
|
|
2
|
+
export type ClockWipeProps = {
|
|
3
|
+
width?: number;
|
|
4
|
+
height?: number;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Angular sweep: the incoming layer is clipped to a pie wedge that grows
|
|
8
|
+
* clockwise from 12 o'clock to a full turn. Mirrors Remotion's `clockWipe`.
|
|
9
|
+
* `width`/`height` default to the Composition stage size.
|
|
10
|
+
*/
|
|
11
|
+
export declare function clockWipe(props?: ClockWipeProps): Presentation;
|
|
12
|
+
//# sourceMappingURL=clock-wipe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clock-wipe.d.ts","sourceRoot":"","sources":["../../src/presentations/clock-wipe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,MAAM,cAAc,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjE;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,GAAE,cAAmB,GAAG,YAAY,CAoBlE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Angular sweep: the incoming layer is clipped to a pie wedge that grows
|
|
3
|
+
* clockwise from 12 o'clock to a full turn. Mirrors Remotion's `clockWipe`.
|
|
4
|
+
* `width`/`height` default to the Composition stage size.
|
|
5
|
+
*/
|
|
6
|
+
export function clockWipe(props = {}) {
|
|
7
|
+
return {
|
|
8
|
+
enter(layer, progress, dims) {
|
|
9
|
+
const width = props.width ?? dims.width;
|
|
10
|
+
const height = props.height ?? dims.height;
|
|
11
|
+
const cx = width / 2;
|
|
12
|
+
const cy = height / 2;
|
|
13
|
+
// Oversized so the wedge always covers the rectangle's corners.
|
|
14
|
+
const radius = Math.sqrt(width * width + height * height) / 2;
|
|
15
|
+
const start = -Math.PI / 2; // 12 o'clock
|
|
16
|
+
const sweep = Math.PI * 2 * progress;
|
|
17
|
+
layer.clipFunc((ctx) => {
|
|
18
|
+
ctx.moveTo(cx, cy);
|
|
19
|
+
ctx.arc(cx, cy, radius, start, start + sweep, false);
|
|
20
|
+
ctx.closePath();
|
|
21
|
+
});
|
|
22
|
+
},
|
|
23
|
+
// Outgoing scene stays visible under the sweeping clock hand.
|
|
24
|
+
exit() { },
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=clock-wipe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clock-wipe.js","sourceRoot":"","sources":["../../src/presentations/clock-wipe.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,QAAwB,EAAE;IAClD,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,EAAE,GAAG,KAAK,GAAG,CAAC,CAAC;YACrB,MAAM,EAAE,GAAG,MAAM,GAAG,CAAC,CAAC;YACtB,gEAAgE;YAChE,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;YAC9D,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,aAAa;YACzC,MAAM,KAAK,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,GAAG,QAAQ,CAAC;YACrC,KAAK,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,EAAE;gBACrB,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;gBACnB,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,KAAK,EAAE,KAAK,CAAC,CAAC;gBACrD,GAAG,CAAC,SAAS,EAAE,CAAC;YAClB,CAAC,CAAC,CAAC;QACL,CAAC;QACD,8DAA8D;QAC9D,IAAI,KAAI,CAAC;KACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Presentation } from "../types.js";
|
|
2
|
+
export type CrossZoomProps = {
|
|
3
|
+
strength?: number;
|
|
4
|
+
};
|
|
5
|
+
/** Zoom-blur cross-dissolve (gl-transitions `CrossZoom`). */
|
|
6
|
+
export declare function crossZoom(props?: CrossZoomProps): Presentation;
|
|
7
|
+
//# sourceMappingURL=cross-zoom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cross-zoom.d.ts","sourceRoot":"","sources":["../../src/presentations/cross-zoom.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AA6EhD,MAAM,MAAM,cAAc,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnD,6DAA6D;AAC7D,wBAAgB,SAAS,CAAC,KAAK,GAAE,cAAmB,GAAG,YAAY,CAGlE"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { glTransition } from "../gl/gl-transition.js";
|
|
2
|
+
// Adapted from https://gl-transitions.com/editor/CrossZoom
|
|
3
|
+
// Author: rectalogic · 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_strength;
|
|
11
|
+
|
|
12
|
+
in vec2 v_uv;
|
|
13
|
+
out vec4 outColor;
|
|
14
|
+
|
|
15
|
+
const float PI = 3.141592653589793;
|
|
16
|
+
|
|
17
|
+
float linearEase(float begin, float change, float duration, float time) {
|
|
18
|
+
return change * time / duration + begin;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
float exponentialEaseInOut(float begin, float change, float duration, float time) {
|
|
22
|
+
if (time == 0.0) {
|
|
23
|
+
return begin;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (time == duration) {
|
|
27
|
+
return begin + change;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
float t = time / (duration / 2.0);
|
|
31
|
+
if (t < 1.0) {
|
|
32
|
+
return change / 2.0 * pow(2.0, 10.0 * (t - 1.0)) + begin;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return change / 2.0 * (-pow(2.0, -10.0 * (t - 1.0)) + 2.0) + begin;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
float sinusoidalEaseInOut(float begin, float change, float duration, float time) {
|
|
39
|
+
return -change / 2.0 * (cos(PI * time / duration) - 1.0) + begin;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
float random(vec2 co) {
|
|
43
|
+
return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
vec4 crossFade(vec2 uv, float dissolve) {
|
|
47
|
+
return mix(texture(u_prev, uv), texture(u_next, uv), dissolve);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
vec4 transition(vec2 uv, float progress) {
|
|
51
|
+
vec2 center = vec2(linearEase(0.25, 0.5, 1.0, progress), 0.5);
|
|
52
|
+
float dissolve = exponentialEaseInOut(0.0, 1.0, 1.0, progress);
|
|
53
|
+
float strength = sinusoidalEaseInOut(0.0, u_strength, 0.5, progress);
|
|
54
|
+
|
|
55
|
+
vec4 color = vec4(0.0);
|
|
56
|
+
float total = 0.0;
|
|
57
|
+
vec2 toCenter = center - uv;
|
|
58
|
+
float offset = random(uv);
|
|
59
|
+
|
|
60
|
+
for (int i = 0; i <= 40; i++) {
|
|
61
|
+
float percent = (float(i) + offset) / 40.0;
|
|
62
|
+
float weight = 4.0 * (percent - percent * percent);
|
|
63
|
+
color += crossFade(uv + toCenter * percent * strength, dissolve) * weight;
|
|
64
|
+
total += weight;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return color / total;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
void main() {
|
|
71
|
+
float progress = 1.0 - u_time;
|
|
72
|
+
outColor = transition(v_uv, progress);
|
|
73
|
+
}`;
|
|
74
|
+
const DEFAULT_STRENGTH = 0.4;
|
|
75
|
+
/** Zoom-blur cross-dissolve (gl-transitions `CrossZoom`). */
|
|
76
|
+
export function crossZoom(props = {}) {
|
|
77
|
+
const strength = props.strength ?? DEFAULT_STRENGTH;
|
|
78
|
+
return glTransition(FRAGMENT, () => ({ u_strength: strength }));
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=cross-zoom.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cross-zoom.js","sourceRoot":"","sources":["../../src/presentations/cross-zoom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGtD,2DAA2D;AAC3D,oCAAoC;AACpC,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqEf,CAAC;AAEH,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAI7B,6DAA6D;AAC7D,MAAM,UAAU,SAAS,CAAC,QAAwB,EAAE;IAClD,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,gBAAgB,CAAC;IACpD,OAAO,YAAY,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crosswarp.d.ts","sourceRoot":"","sources":["../../src/presentations/crosswarp.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AA6BhD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAEnD,2DAA2D;AAC3D,wBAAgB,SAAS,IAAI,YAAY,CAExC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { glTransition } from "../gl/gl-transition.js";
|
|
2
|
+
// Adapted from https://gl-transitions.com/editor/crosswarp
|
|
3
|
+
// Author: Eke Péter · 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
|
+
vec4 transition(vec2 uv, float progress) {
|
|
15
|
+
float x = progress;
|
|
16
|
+
x = smoothstep(0.0, 1.0, x * 2.0 + uv.x - 1.0);
|
|
17
|
+
return mix(
|
|
18
|
+
texture(u_next, (uv - 0.5) * (1.0 - x) + 0.5),
|
|
19
|
+
texture(u_prev, (uv - 0.5) * x + 0.5),
|
|
20
|
+
x
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
void main() {
|
|
25
|
+
float progress = u_time;
|
|
26
|
+
outColor = transition(v_uv, progress);
|
|
27
|
+
}`;
|
|
28
|
+
/** Warping cross-dissolve (gl-transitions `crosswarp`). */
|
|
29
|
+
export function crosswarp() {
|
|
30
|
+
return glTransition(FRAGMENT);
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=crosswarp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crosswarp.js","sourceRoot":"","sources":["../../src/presentations/crosswarp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGtD,2DAA2D;AAC3D,mCAAmC;AACnC,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;EAuBf,CAAC;AAIH,2DAA2D;AAC3D,MAAM,UAAU,SAAS;IACvB,OAAO,YAAY,CAAC,QAAQ,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Presentation } from "../types.js";
|
|
2
|
+
export type DissolveProps = {
|
|
3
|
+
lineWidth?: number;
|
|
4
|
+
spreadColor?: string;
|
|
5
|
+
hotColor?: string;
|
|
6
|
+
pow?: number;
|
|
7
|
+
intensity?: number;
|
|
8
|
+
};
|
|
9
|
+
/** Burning cross-dissolve with a glowing edge (gl-transitions `dissolve`). */
|
|
10
|
+
export declare function dissolve(props?: DissolveProps): Presentation;
|
|
11
|
+
//# sourceMappingURL=dissolve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dissolve.d.ts","sourceRoot":"","sources":["../../src/presentations/dissolve.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAyDhD,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,8EAA8E;AAC9E,wBAAgB,QAAQ,CAAC,KAAK,GAAE,aAAkB,GAAG,YAAY,CAahE"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { glTransition } from "../gl/gl-transition.js";
|
|
2
|
+
// Adapted from https://gl-transitions.com/editor/dissolve
|
|
3
|
+
// Author: hjm1fb · 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_line_width;
|
|
11
|
+
uniform vec3 u_spread_color;
|
|
12
|
+
uniform vec3 u_hot_color;
|
|
13
|
+
uniform float u_pow;
|
|
14
|
+
uniform float u_intensity;
|
|
15
|
+
|
|
16
|
+
in vec2 v_uv;
|
|
17
|
+
out vec4 outColor;
|
|
18
|
+
|
|
19
|
+
vec4 transition(vec2 uv, float progress) {
|
|
20
|
+
vec4 from = texture(u_next, uv);
|
|
21
|
+
vec4 to = texture(u_prev, uv);
|
|
22
|
+
float burn = 0.5 + 0.5 * (0.299 * from.r + 0.587 * from.g + 0.114 * from.b);
|
|
23
|
+
float show = burn - progress;
|
|
24
|
+
if (show < 0.001) {
|
|
25
|
+
return to;
|
|
26
|
+
}
|
|
27
|
+
float factor = 1.0 - smoothstep(0.0, u_line_width, show);
|
|
28
|
+
vec3 burnColor = mix(u_spread_color, u_hot_color, factor);
|
|
29
|
+
burnColor = pow(burnColor, vec3(u_pow)) * u_intensity;
|
|
30
|
+
vec3 finalRGB = mix(from.rgb, burnColor, factor * step(0.0001, progress));
|
|
31
|
+
return vec4(finalRGB, from.a);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
void main() {
|
|
35
|
+
float progress = u_time;
|
|
36
|
+
outColor = transition(v_uv, progress);
|
|
37
|
+
}`;
|
|
38
|
+
const DEFAULT_LINE_WIDTH = 0.1;
|
|
39
|
+
const DEFAULT_SPREAD_COLOR = "#ff0000";
|
|
40
|
+
const DEFAULT_HOT_COLOR = "#e6e633";
|
|
41
|
+
const DEFAULT_POW = 5.0;
|
|
42
|
+
const DEFAULT_INTENSITY = 1.0;
|
|
43
|
+
function parseHexColor(hex) {
|
|
44
|
+
const cleaned = hex.startsWith("#") ? hex.slice(1) : hex;
|
|
45
|
+
if (!/^[0-9a-fA-F]{6}$/.test(cleaned)) {
|
|
46
|
+
throw new Error(`dissolve: invalid color "${hex}". Expected a "#rrggbb" hex string.`);
|
|
47
|
+
}
|
|
48
|
+
return [
|
|
49
|
+
Number.parseInt(cleaned.slice(0, 2), 16) / 255,
|
|
50
|
+
Number.parseInt(cleaned.slice(2, 4), 16) / 255,
|
|
51
|
+
Number.parseInt(cleaned.slice(4, 6), 16) / 255,
|
|
52
|
+
];
|
|
53
|
+
}
|
|
54
|
+
/** Burning cross-dissolve with a glowing edge (gl-transitions `dissolve`). */
|
|
55
|
+
export function dissolve(props = {}) {
|
|
56
|
+
const lineWidth = props.lineWidth ?? DEFAULT_LINE_WIDTH;
|
|
57
|
+
const spread = parseHexColor(props.spreadColor ?? DEFAULT_SPREAD_COLOR);
|
|
58
|
+
const hot = parseHexColor(props.hotColor ?? DEFAULT_HOT_COLOR);
|
|
59
|
+
const pow = props.pow ?? DEFAULT_POW;
|
|
60
|
+
const intensity = props.intensity ?? DEFAULT_INTENSITY;
|
|
61
|
+
return glTransition(FRAGMENT, () => ({
|
|
62
|
+
u_line_width: lineWidth,
|
|
63
|
+
u_spread_color: spread,
|
|
64
|
+
u_hot_color: hot,
|
|
65
|
+
u_pow: pow,
|
|
66
|
+
u_intensity: intensity,
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=dissolve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dissolve.js","sourceRoot":"","sources":["../../src/presentations/dissolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGtD,0DAA0D;AAC1D,gCAAgC;AAChC,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiCf,CAAC;AAEH,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AAS,GAAG,KAAK,CAAC,SAAS,IAAI,iBAAiB,CAAC;IACvD,OAAO,YAAY,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC;QACnC,YAAY,EAAE,SAAS;QACvB,cAAc,EAAE,MAAM;QACtB,WAAW,EAAE,GAAG;QAChB,KAAK,EAAE,GAAG;QACV,WAAW,EAAE,SAAS;KACvB,CAAC,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Presentation } from "../types.js";
|
|
2
|
+
export type DreamyZoomProps = {
|
|
3
|
+
rotation?: number;
|
|
4
|
+
scale?: number;
|
|
5
|
+
};
|
|
6
|
+
/** Spiralling dreamy zoom (gl-transitions `DreamyZoom`). */
|
|
7
|
+
export declare function dreamyZoom(props?: DreamyZoomProps): Presentation;
|
|
8
|
+
//# sourceMappingURL=dreamy-zoom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dreamy-zoom.d.ts","sourceRoot":"","sources":["../../src/presentations/dreamy-zoom.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AA4ChD,MAAM,MAAM,eAAe,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpE,4DAA4D;AAC5D,wBAAgB,UAAU,CAAC,KAAK,GAAE,eAAoB,GAAG,YAAY,CAQpE"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { glTransition } from "../gl/gl-transition.js";
|
|
2
|
+
// Adapted from https://gl-transitions.com/editor/DreamyZoom
|
|
3
|
+
// Author: Zeh Fernando · 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_rotation;
|
|
11
|
+
uniform float u_scale;
|
|
12
|
+
uniform float u_ratio;
|
|
13
|
+
|
|
14
|
+
in vec2 v_uv;
|
|
15
|
+
out vec4 outColor;
|
|
16
|
+
|
|
17
|
+
const float DEG2RAD = 0.03926990816987241548078304229099;
|
|
18
|
+
|
|
19
|
+
vec4 transition(vec2 uv, float progress) {
|
|
20
|
+
float phase = progress < 0.5 ? progress * 2.0 : (progress - 0.5) * 2.0;
|
|
21
|
+
float angleOffset = progress < 0.5 ? mix(0.0, u_rotation * DEG2RAD, phase) : mix(-u_rotation * DEG2RAD, 0.0, phase);
|
|
22
|
+
float newScale = progress < 0.5 ? mix(1.0, u_scale, phase) : mix(u_scale, 1.0, phase);
|
|
23
|
+
|
|
24
|
+
vec2 center = vec2(0.0, 0.0);
|
|
25
|
+
vec2 p = (uv.xy - vec2(0.5, 0.5)) / newScale * vec2(u_ratio, 1.0);
|
|
26
|
+
float angle = atan(p.y, p.x) + angleOffset;
|
|
27
|
+
float dist = distance(center, p);
|
|
28
|
+
|
|
29
|
+
p.x = cos(angle) * dist / u_ratio + 0.5;
|
|
30
|
+
p.y = sin(angle) * dist + 0.5;
|
|
31
|
+
|
|
32
|
+
vec4 c = progress < 0.5 ? texture(u_prev, p) : texture(u_next, p);
|
|
33
|
+
return c + (progress < 0.5 ? mix(0.0, 1.0, phase) : mix(1.0, 0.0, phase));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
void main() {
|
|
37
|
+
float progress = 1.0 - u_time;
|
|
38
|
+
outColor = transition(v_uv, progress);
|
|
39
|
+
}`;
|
|
40
|
+
const DEFAULT_ROTATION = 6;
|
|
41
|
+
const DEFAULT_SCALE = 1.2;
|
|
42
|
+
/** Spiralling dreamy zoom (gl-transitions `DreamyZoom`). */
|
|
43
|
+
export function dreamyZoom(props = {}) {
|
|
44
|
+
const rotation = props.rotation ?? DEFAULT_ROTATION;
|
|
45
|
+
const scale = props.scale ?? DEFAULT_SCALE;
|
|
46
|
+
return glTransition(FRAGMENT, (_p, { width, height }) => ({
|
|
47
|
+
u_rotation: rotation,
|
|
48
|
+
u_scale: scale,
|
|
49
|
+
u_ratio: width / height,
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=dreamy-zoom.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dreamy-zoom.js","sourceRoot":"","sources":["../../src/presentations/dreamy-zoom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGtD,4DAA4D;AAC5D,sCAAsC;AACtC,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmCf,CAAC;AAEH,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAC3B,MAAM,aAAa,GAAG,GAAG,CAAC;AAI1B,4DAA4D;AAC5D,MAAM,UAAU,UAAU,CAAC,QAAyB,EAAE;IACpD,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,gBAAgB,CAAC;IACpD,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,aAAa,CAAC;IAC3C,OAAO,YAAY,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;QACxD,UAAU,EAAE,QAAQ;QACpB,OAAO,EAAE,KAAK;QACd,OAAO,EAAE,KAAK,GAAG,MAAM;KACxB,CAAC,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Presentation } from "../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Opacity cross-dissolve. Both layers fade simultaneously: at `progress = 0.5`
|
|
4
|
+
* the incoming and outgoing layers are each at 0.5 opacity. (Remotion's default
|
|
5
|
+
* keeps the exiting scene fully opaque; we cross-fade so the midpoint is a true
|
|
6
|
+
* 50/50 blend.)
|
|
7
|
+
*/
|
|
8
|
+
export declare function fade(): Presentation;
|
|
9
|
+
//# sourceMappingURL=fade.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fade.d.ts","sourceRoot":"","sources":["../../src/presentations/fade.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;;;;GAKG;AACH,wBAAgB,IAAI,IAAI,YAAY,CASnC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Opacity cross-dissolve. Both layers fade simultaneously: at `progress = 0.5`
|
|
3
|
+
* the incoming and outgoing layers are each at 0.5 opacity. (Remotion's default
|
|
4
|
+
* keeps the exiting scene fully opaque; we cross-fade so the midpoint is a true
|
|
5
|
+
* 50/50 blend.)
|
|
6
|
+
*/
|
|
7
|
+
export function fade() {
|
|
8
|
+
return {
|
|
9
|
+
enter(layer, progress) {
|
|
10
|
+
layer.opacity(progress);
|
|
11
|
+
},
|
|
12
|
+
exit(layer, progress) {
|
|
13
|
+
layer.opacity(1 - progress);
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=fade.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fade.js","sourceRoot":"","sources":["../../src/presentations/fade.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,UAAU,IAAI;IAClB,OAAO;QACL,KAAK,CAAC,KAAK,EAAE,QAAQ;YACnB,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC1B,CAAC;QACD,IAAI,CAAC,KAAK,EAAE,QAAQ;YAClB,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC;QAC9B,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Presentation } from "../types.js";
|
|
2
|
+
export type FilmBurnProps = {
|
|
3
|
+
seed?: number;
|
|
4
|
+
};
|
|
5
|
+
/** Fiery film-burn dissolve (gl-transitions `FilmBurn`). */
|
|
6
|
+
export declare function filmBurn(props?: FilmBurnProps): Presentation;
|
|
7
|
+
//# sourceMappingURL=film-burn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"film-burn.d.ts","sourceRoot":"","sources":["../../src/presentations/film-burn.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AA+IhD,MAAM,MAAM,aAAa,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9C,4DAA4D;AAC5D,wBAAgB,QAAQ,CAAC,KAAK,GAAE,aAAkB,GAAG,YAAY,CAGhE"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { glTransition } from "../gl/gl-transition.js";
|
|
2
|
+
// Adapted from https://gl-transitions.com/editor/FilmBurn
|
|
3
|
+
// Author: Anastasia Dunbar · 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_seed;
|
|
11
|
+
|
|
12
|
+
in vec2 v_uv;
|
|
13
|
+
out vec4 outColor;
|
|
14
|
+
|
|
15
|
+
#define PI 3.14159265358979323
|
|
16
|
+
#define CLAMPS(x) clamp(x, 0.0, 1.0)
|
|
17
|
+
#define REPEATS 50.0
|
|
18
|
+
|
|
19
|
+
float sigmoid(float x, float a) {
|
|
20
|
+
float b = pow(x * 2.0, a) / 2.0;
|
|
21
|
+
if (x > 0.5) {
|
|
22
|
+
b = 1.0 - pow(2.0 - (x * 2.0), a) / 2.0;
|
|
23
|
+
}
|
|
24
|
+
return b;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
float rand(float co) {
|
|
28
|
+
return fract(sin((co * 24.9898) + u_seed) * 43758.5453);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
float rand(vec2 co) {
|
|
32
|
+
return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
float apow(float a, float b) {
|
|
36
|
+
return pow(abs(a), b) * sign(b);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
vec3 pow3(vec3 a, vec3 b) {
|
|
40
|
+
return vec3(apow(a.r, b.r), apow(a.g, b.g), apow(a.b, b.b));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
float smoothMix(float a, float b, float c) {
|
|
44
|
+
return mix(a, b, sigmoid(c, 2.0));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
float random(vec2 co, float shft) {
|
|
48
|
+
co += 10.0;
|
|
49
|
+
return smoothMix(
|
|
50
|
+
fract(
|
|
51
|
+
sin(
|
|
52
|
+
dot(
|
|
53
|
+
co.xy,
|
|
54
|
+
vec2(12.9898 + (floor(shft) * 0.5), 78.233 + u_seed)
|
|
55
|
+
)
|
|
56
|
+
) * 43758.5453
|
|
57
|
+
),
|
|
58
|
+
fract(
|
|
59
|
+
sin(
|
|
60
|
+
dot(
|
|
61
|
+
co.xy,
|
|
62
|
+
vec2(12.9898 + (floor(shft + 1.0) * 0.5), 78.233 + u_seed)
|
|
63
|
+
)
|
|
64
|
+
) * 43758.5453
|
|
65
|
+
),
|
|
66
|
+
fract(shft)
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
float smoothRandom(vec2 co, float shft) {
|
|
71
|
+
return smoothMix(
|
|
72
|
+
smoothMix(
|
|
73
|
+
random(floor(co), shft),
|
|
74
|
+
random(floor(co + vec2(1.0, 0.0)), shft),
|
|
75
|
+
fract(co.x)
|
|
76
|
+
),
|
|
77
|
+
smoothMix(
|
|
78
|
+
random(floor(co + vec2(0.0, 1.0)), shft),
|
|
79
|
+
random(floor(co + vec2(1.0, 1.0)), shft),
|
|
80
|
+
fract(co.x)
|
|
81
|
+
),
|
|
82
|
+
fract(co.y)
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
vec4 sampleTexture(vec2 p, float progress) {
|
|
87
|
+
return mix(texture(u_prev, p), texture(u_next, p), sigmoid(progress, 10.0));
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
vec4 transition(vec2 p, float progress) {
|
|
91
|
+
vec3 f = vec3(0.0);
|
|
92
|
+
for (float i = 0.0; i < 13.0; i++) {
|
|
93
|
+
f += sin(((p.x * rand(i) * 6.0) + (progress * 8.0)) + rand(i + 1.43)) *
|
|
94
|
+
sin(
|
|
95
|
+
((p.y * rand(i + 4.4) * 6.0) + (progress * 6.0)) +
|
|
96
|
+
rand(i + 2.4)
|
|
97
|
+
);
|
|
98
|
+
f += 1.0 - CLAMPS(
|
|
99
|
+
length(
|
|
100
|
+
p -
|
|
101
|
+
vec2(
|
|
102
|
+
smoothRandom(vec2(progress * 1.3), i + 1.0),
|
|
103
|
+
smoothRandom(vec2(progress * 0.5), i + 6.25)
|
|
104
|
+
)
|
|
105
|
+
) * mix(20.0, 70.0, rand(i))
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
f += 4.0;
|
|
110
|
+
f /= 11.0;
|
|
111
|
+
f = pow3(
|
|
112
|
+
f * vec3(1.0, 0.7, 0.6),
|
|
113
|
+
vec3(1.0, 2.0 - sin(progress * PI), 1.3)
|
|
114
|
+
);
|
|
115
|
+
f *= sin(progress * PI);
|
|
116
|
+
|
|
117
|
+
p -= 0.5;
|
|
118
|
+
p *= 1.0 + (smoothRandom(vec2(progress * 5.0), 6.3) * sin(progress * PI) * 0.05);
|
|
119
|
+
p += 0.5;
|
|
120
|
+
|
|
121
|
+
vec4 blurredImage = vec4(0.0);
|
|
122
|
+
float blurAmount = sin(progress * PI) * 0.03;
|
|
123
|
+
for (float i = 0.0; i < REPEATS; i++) {
|
|
124
|
+
vec2 q = vec2(
|
|
125
|
+
cos(degrees((i / REPEATS) * 360.0)),
|
|
126
|
+
sin(degrees((i / REPEATS) * 360.0))
|
|
127
|
+
) * (rand(vec2(i, p.x + p.y)) + blurAmount);
|
|
128
|
+
vec2 uv2 = p + (q * blurAmount);
|
|
129
|
+
blurredImage += sampleTexture(uv2, progress);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
blurredImage /= REPEATS;
|
|
133
|
+
return blurredImage + vec4(f, 0.0);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
void main() {
|
|
137
|
+
float progress = 1.0 - u_time;
|
|
138
|
+
outColor = transition(v_uv, progress);
|
|
139
|
+
}`;
|
|
140
|
+
const DEFAULT_SEED = 2.31;
|
|
141
|
+
/** Fiery film-burn dissolve (gl-transitions `FilmBurn`). */
|
|
142
|
+
export function filmBurn(props = {}) {
|
|
143
|
+
const seed = props.seed ?? DEFAULT_SEED;
|
|
144
|
+
return glTransition(FRAGMENT, () => ({ u_seed: seed }));
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=film-burn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"film-burn.js","sourceRoot":"","sources":["../../src/presentations/film-burn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGtD,0DAA0D;AAC1D,0CAA0C;AAC1C,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuIf,CAAC;AAEH,MAAM,YAAY,GAAG,IAAI,CAAC;AAI1B,4DAA4D;AAC5D,MAAM,UAAU,QAAQ,CAAC,QAAuB,EAAE;IAChD,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,YAAY,CAAC;IACxC,OAAO,YAAY,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Presentation } from "../types.js";
|
|
2
|
+
export type FlipDirection = "from-left" | "from-right" | "from-top" | "from-bottom";
|
|
3
|
+
export type FlipProps = {
|
|
4
|
+
direction?: FlipDirection;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Card-flip: the outgoing layer squashes to a thin line while the incoming
|
|
8
|
+
* layer expands from one. This is a **fake** flip — Konva has no real 3D, so we
|
|
9
|
+
* animate `scaleX`/`scaleY` (with a centring offset) rather than a perspective
|
|
10
|
+
* rotation. Mirrors Remotion's `flip` visually, not its 3D transform.
|
|
11
|
+
*/
|
|
12
|
+
export declare function flip(props?: FlipProps): Presentation;
|
|
13
|
+
//# sourceMappingURL=flip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flip.d.ts","sourceRoot":"","sources":["../../src/presentations/flip.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;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,KAAK,GAAE,SAAc,GAAG,YAAY,CA6BxD"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Card-flip: the outgoing layer squashes to a thin line while the incoming
|
|
3
|
+
* layer expands from one. This is a **fake** flip — Konva has no real 3D, so we
|
|
4
|
+
* animate `scaleX`/`scaleY` (with a centring offset) rather than a perspective
|
|
5
|
+
* rotation. Mirrors Remotion's `flip` visually, not its 3D transform.
|
|
6
|
+
*/
|
|
7
|
+
export function flip(props = {}) {
|
|
8
|
+
const direction = props.direction ?? "from-left";
|
|
9
|
+
const horizontal = direction === "from-left" || direction === "from-right";
|
|
10
|
+
return {
|
|
11
|
+
enter(layer, progress, { width, height }) {
|
|
12
|
+
const s = progress; // 0 → flat, 1 → full
|
|
13
|
+
if (horizontal) {
|
|
14
|
+
layer.scaleX(s);
|
|
15
|
+
layer.scaleY(1);
|
|
16
|
+
layer.position({ x: (width * (1 - s)) / 2, y: 0 });
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
layer.scaleY(s);
|
|
20
|
+
layer.scaleX(1);
|
|
21
|
+
layer.position({ x: 0, y: (height * (1 - s)) / 2 });
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
exit(layer, progress, { width, height }) {
|
|
25
|
+
const s = 1 - progress; // 1 → full, 0 → flat
|
|
26
|
+
if (horizontal) {
|
|
27
|
+
layer.scaleX(s);
|
|
28
|
+
layer.scaleY(1);
|
|
29
|
+
layer.position({ x: (width * (1 - s)) / 2, y: 0 });
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
layer.scaleY(s);
|
|
33
|
+
layer.scaleX(1);
|
|
34
|
+
layer.position({ x: 0, y: (height * (1 - s)) / 2 });
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=flip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flip.js","sourceRoot":"","sources":["../../src/presentations/flip.ts"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,MAAM,UAAU,IAAI,CAAC,QAAmB,EAAE;IACxC,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,IAAI,WAAW,CAAC;IACjD,MAAM,UAAU,GAAG,SAAS,KAAK,WAAW,IAAI,SAAS,KAAK,YAAY,CAAC;IAC3E,OAAO;QACL,KAAK,CAAC,KAA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C,CAAC;gBAChB,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACtD,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export { type BookFlipDirection, type BookFlipProps, bookFlip } from "./book-flip.js";
|
|
2
|
+
export { type ClockWipeProps, clockWipe } from "./clock-wipe.js";
|
|
3
|
+
export { type CrossZoomProps, crossZoom } from "./cross-zoom.js";
|
|
4
|
+
export { type CrosswarpProps, crosswarp } from "./crosswarp.js";
|
|
5
|
+
export { type DissolveProps, dissolve } from "./dissolve.js";
|
|
6
|
+
export { type DreamyZoomProps, dreamyZoom } from "./dreamy-zoom.js";
|
|
7
|
+
export { fade } from "./fade.js";
|
|
8
|
+
export { type FilmBurnProps, filmBurn } from "./film-burn.js";
|
|
9
|
+
export { type FlipDirection, type FlipProps, flip } from "./flip.js";
|
|
10
|
+
export { type IrisProps, iris } from "./iris.js";
|
|
11
|
+
export { type LinearBlurProps, linearBlur } from "./linear-blur.js";
|
|
12
|
+
export { none } from "./none.js";
|
|
13
|
+
export { type RippleProps, ripple } from "./ripple.js";
|
|
14
|
+
export { type SlideDirection, type SlideProps, slide } from "./slide.js";
|
|
15
|
+
export { type SwapProps, swap } from "./swap.js";
|
|
16
|
+
export { type WipeDirection, type WipeProps, wipe } from "./wipe.js";
|
|
17
|
+
export { type ZoomBlurProps, zoomBlur } from "./zoom-blur.js";
|
|
18
|
+
export { type ZoomInOutProps, zoomInOut } from "./zoom-in-out.js";
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/presentations/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,iBAAiB,EAA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