@visactor/vrender-animate 0.23.0-alpha.3 → 1.0.0-alpha.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/cjs/animate-extension.d.ts +1 -3
- package/cjs/animate-extension.js +0 -7
- package/cjs/animate-extension.js.map +1 -1
- package/cjs/animate.d.ts +1 -5
- package/cjs/animate.js +12 -12
- package/cjs/animate.js.map +1 -1
- package/cjs/component/component-animator.d.ts +3 -2
- package/cjs/component/component-animator.js +18 -32
- package/cjs/component/component-animator.js.map +1 -1
- package/cjs/custom/clip-graphic.d.ts +1 -1
- package/cjs/custom/clip-graphic.js.map +1 -1
- package/cjs/custom/clip.d.ts +1 -1
- package/cjs/custom/clip.js.map +1 -1
- package/cjs/custom/common.d.ts +1 -2
- package/cjs/custom/common.js +12 -10
- package/cjs/custom/common.js.map +1 -1
- package/cjs/custom/custom-animate.d.ts +2 -4
- package/cjs/custom/custom-animate.js +2 -2
- package/cjs/custom/custom-animate.js.map +1 -1
- package/cjs/custom/fade.d.ts +1 -1
- package/cjs/custom/fade.js.map +1 -1
- package/cjs/custom/from-to.d.ts +9 -0
- package/cjs/custom/from-to.js +38 -0
- package/cjs/custom/from-to.js.map +1 -0
- package/cjs/custom/group-fade.d.ts +8 -14
- package/cjs/custom/group-fade.js +9 -50
- package/cjs/custom/group-fade.js.map +1 -1
- package/cjs/custom/growAngle.d.ts +2 -2
- package/cjs/custom/growAngle.js +17 -12
- package/cjs/custom/growAngle.js.map +1 -1
- package/cjs/custom/growCenter.d.ts +1 -2
- package/cjs/custom/growCenter.js +8 -7
- package/cjs/custom/growCenter.js.map +1 -1
- package/cjs/custom/growHeight.d.ts +1 -3
- package/cjs/custom/growHeight.js +7 -7
- package/cjs/custom/growHeight.js.map +1 -1
- package/cjs/custom/growPoints.d.ts +1 -2
- package/cjs/custom/growPoints.js +19 -17
- package/cjs/custom/growPoints.js.map +1 -1
- package/cjs/custom/growRadius.d.ts +4 -5
- package/cjs/custom/growRadius.js +12 -12
- package/cjs/custom/growRadius.js.map +1 -1
- package/cjs/custom/growWidth.d.ts +1 -3
- package/cjs/custom/growWidth.js +7 -6
- package/cjs/custom/growWidth.js.map +1 -1
- package/cjs/custom/input-text.d.ts +1 -2
- package/cjs/custom/input-text.js.map +1 -1
- package/cjs/custom/label-item-animate.js +2 -2
- package/cjs/custom/label-item-animate.js.map +1 -1
- package/cjs/custom/move.d.ts +92 -0
- package/cjs/custom/move.js +131 -0
- package/cjs/custom/move.js.map +1 -0
- package/cjs/custom/number.d.ts +1 -2
- package/cjs/custom/number.js.map +1 -1
- package/cjs/custom/poptip-animate.js +2 -1
- package/cjs/custom/poptip-animate.js.map +1 -1
- package/cjs/custom/register.js +21 -2
- package/cjs/custom/register.js.map +1 -1
- package/cjs/custom/richtext/input-richtext.d.ts +33 -0
- package/cjs/custom/richtext/input-richtext.js +70 -0
- package/cjs/custom/richtext/input-richtext.js.map +1 -0
- package/cjs/custom/richtext/output-richtext.d.ts +37 -0
- package/cjs/custom/richtext/output-richtext.js +94 -0
- package/cjs/custom/richtext/output-richtext.js.map +1 -0
- package/cjs/custom/richtext/slide-out-richtext.d.ts +38 -0
- package/cjs/custom/richtext/slide-out-richtext.js +146 -0
- package/cjs/custom/richtext/slide-out-richtext.js.map +1 -0
- package/cjs/custom/richtext/slide-richtext.d.ts +36 -0
- package/cjs/custom/richtext/slide-richtext.js +144 -0
- package/cjs/custom/richtext/slide-richtext.js.map +1 -0
- package/cjs/custom/rotate.d.ts +33 -0
- package/cjs/custom/rotate.js +76 -0
- package/cjs/custom/rotate.js.map +1 -0
- package/cjs/custom/scale.d.ts +2 -2
- package/cjs/custom/scale.js +25 -21
- package/cjs/custom/scale.js.map +1 -1
- package/cjs/custom/sphere.js +1 -2
- package/cjs/custom/state.d.ts +1 -1
- package/cjs/custom/state.js.map +1 -1
- package/cjs/custom/story.d.ts +128 -0
- package/cjs/custom/story.js +347 -0
- package/cjs/custom/story.js.map +1 -0
- package/cjs/custom/tag-points.d.ts +2 -3
- package/cjs/custom/tag-points.js +18 -5
- package/cjs/custom/tag-points.js.map +1 -1
- package/cjs/custom/update.d.ts +2 -1
- package/cjs/custom/update.js +10 -2
- package/cjs/custom/update.js.map +1 -1
- package/cjs/executor/animate-executor.d.ts +6 -5
- package/cjs/executor/animate-executor.js +57 -29
- package/cjs/executor/animate-executor.js.map +1 -1
- package/cjs/executor/executor.d.ts +6 -3
- package/cjs/executor/executor.js.map +1 -1
- package/cjs/index.d.ts +3 -6
- package/cjs/index.js +16 -4
- package/cjs/index.js.map +1 -1
- package/cjs/interpolate/store.d.ts +2 -2
- package/cjs/interpolate/store.js +2 -0
- package/cjs/interpolate/store.js.map +1 -1
- package/cjs/state/animation-state.d.ts +2 -2
- package/cjs/state/animation-state.js +3 -3
- package/cjs/state/animation-state.js.map +1 -1
- package/cjs/state/graphic-extension.d.ts +1 -1
- package/cjs/state/graphic-extension.js.map +1 -1
- package/cjs/step.d.ts +2 -4
- package/cjs/step.js +1 -1
- package/cjs/step.js.map +1 -1
- package/cjs/ticker/default-ticker.d.ts +2 -3
- package/cjs/ticker/default-ticker.js +14 -12
- package/cjs/ticker/default-ticker.js.map +1 -1
- package/cjs/ticker/manual-ticker.d.ts +1 -1
- package/cjs/ticker/manual-ticker.js.map +1 -1
- package/cjs/timeline.d.ts +1 -2
- package/cjs/timeline.js.map +1 -1
- package/cjs/utils/easing-func.js +2 -1
- package/dist/index.es.js +1859 -554
- package/es/animate-extension.d.ts +1 -3
- package/es/animate-extension.js +0 -7
- package/es/animate-extension.js.map +1 -1
- package/es/animate.d.ts +1 -5
- package/es/animate.js +1 -3
- package/es/animate.js.map +1 -1
- package/es/component/component-animator.d.ts +3 -2
- package/es/component/component-animator.js +18 -32
- package/es/component/component-animator.js.map +1 -1
- package/es/custom/clip-graphic.d.ts +1 -1
- package/es/custom/clip-graphic.js.map +1 -1
- package/es/custom/clip.d.ts +1 -1
- package/es/custom/clip.js.map +1 -1
- package/es/custom/common.d.ts +1 -2
- package/es/custom/common.js +12 -10
- package/es/custom/common.js.map +1 -1
- package/es/custom/custom-animate.d.ts +2 -4
- package/es/custom/custom-animate.js +2 -2
- package/es/custom/custom-animate.js.map +1 -1
- package/es/custom/fade.d.ts +1 -1
- package/es/custom/fade.js.map +1 -1
- package/es/custom/from-to.d.ts +9 -0
- package/es/custom/from-to.js +30 -0
- package/es/custom/from-to.js.map +1 -0
- package/es/custom/group-fade.d.ts +8 -14
- package/es/custom/group-fade.js +9 -50
- package/es/custom/group-fade.js.map +1 -1
- package/es/custom/growAngle.d.ts +2 -2
- package/es/custom/growAngle.js +20 -12
- package/es/custom/growAngle.js.map +1 -1
- package/es/custom/growCenter.d.ts +1 -2
- package/es/custom/growCenter.js +8 -7
- package/es/custom/growCenter.js.map +1 -1
- package/es/custom/growHeight.d.ts +1 -3
- package/es/custom/growHeight.js +8 -8
- package/es/custom/growHeight.js.map +1 -1
- package/es/custom/growPoints.d.ts +1 -2
- package/es/custom/growPoints.js +19 -17
- package/es/custom/growPoints.js.map +1 -1
- package/es/custom/growRadius.d.ts +4 -5
- package/es/custom/growRadius.js +12 -10
- package/es/custom/growRadius.js.map +1 -1
- package/es/custom/growWidth.d.ts +1 -3
- package/es/custom/growWidth.js +8 -7
- package/es/custom/growWidth.js.map +1 -1
- package/es/custom/input-text.d.ts +1 -2
- package/es/custom/input-text.js.map +1 -1
- package/es/custom/label-item-animate.js +2 -2
- package/es/custom/label-item-animate.js.map +1 -1
- package/es/custom/move.d.ts +92 -0
- package/es/custom/move.js +116 -0
- package/es/custom/move.js.map +1 -0
- package/es/custom/number.d.ts +1 -2
- package/es/custom/number.js.map +1 -1
- package/es/custom/poptip-animate.js +2 -1
- package/es/custom/poptip-animate.js.map +1 -1
- package/es/custom/register.js +41 -16
- package/es/custom/register.js.map +1 -1
- package/es/custom/richtext/input-richtext.d.ts +33 -0
- package/es/custom/richtext/input-richtext.js +64 -0
- package/es/custom/richtext/input-richtext.js.map +1 -0
- package/es/custom/richtext/output-richtext.d.ts +37 -0
- package/es/custom/richtext/output-richtext.js +88 -0
- package/es/custom/richtext/output-richtext.js.map +1 -0
- package/es/custom/richtext/slide-out-richtext.d.ts +38 -0
- package/es/custom/richtext/slide-out-richtext.js +140 -0
- package/es/custom/richtext/slide-out-richtext.js.map +1 -0
- package/es/custom/richtext/slide-richtext.d.ts +36 -0
- package/es/custom/richtext/slide-richtext.js +138 -0
- package/es/custom/richtext/slide-richtext.js.map +1 -0
- package/es/custom/rotate.d.ts +33 -0
- package/es/custom/rotate.js +62 -0
- package/es/custom/rotate.js.map +1 -0
- package/es/custom/scale.d.ts +2 -2
- package/es/custom/scale.js +25 -21
- package/es/custom/scale.js.map +1 -1
- package/es/custom/sphere.js +1 -2
- package/es/custom/state.d.ts +1 -1
- package/es/custom/state.js.map +1 -1
- package/es/custom/story.d.ts +128 -0
- package/es/custom/story.js +323 -0
- package/es/custom/story.js.map +1 -0
- package/es/custom/tag-points.d.ts +2 -3
- package/es/custom/tag-points.js +19 -6
- package/es/custom/tag-points.js.map +1 -1
- package/es/custom/update.d.ts +2 -1
- package/es/custom/update.js +10 -2
- package/es/custom/update.js.map +1 -1
- package/es/executor/animate-executor.d.ts +6 -5
- package/es/executor/animate-executor.js +55 -29
- package/es/executor/animate-executor.js.map +1 -1
- package/es/executor/executor.d.ts +6 -3
- package/es/executor/executor.js.map +1 -1
- package/es/index.d.ts +3 -6
- package/es/index.js +4 -10
- package/es/index.js.map +1 -1
- package/es/interpolate/store.d.ts +2 -2
- package/es/interpolate/store.js +2 -0
- package/es/interpolate/store.js.map +1 -1
- package/es/state/animation-state.d.ts +2 -2
- package/es/state/animation-state.js +4 -2
- package/es/state/animation-state.js.map +1 -1
- package/es/state/graphic-extension.d.ts +1 -1
- package/es/state/graphic-extension.js.map +1 -1
- package/es/step.d.ts +2 -4
- package/es/step.js +2 -2
- package/es/step.js.map +1 -1
- package/es/ticker/default-ticker.d.ts +2 -3
- package/es/ticker/default-ticker.js +5 -5
- package/es/ticker/default-ticker.js.map +1 -1
- package/es/ticker/manual-ticker.d.ts +1 -1
- package/es/ticker/manual-ticker.js.map +1 -1
- package/es/timeline.d.ts +1 -2
- package/es/timeline.js +1 -1
- package/es/timeline.js.map +1 -1
- package/es/utils/easing-func.js +2 -1
- package/package.json +5 -5
- package/cjs/custom/label-animate.d.ts +0 -4
- package/cjs/custom/label-animate.js +0 -48
- package/cjs/custom/label-animate.js.map +0 -1
- package/cjs/intreface/animate.d.ts +0 -92
- package/cjs/intreface/animate.js +0 -10
- package/cjs/intreface/animate.js.map +0 -1
- package/cjs/intreface/easing.d.ts +0 -3
- package/cjs/intreface/easing.js +0 -6
- package/cjs/intreface/easing.js.map +0 -1
- package/cjs/intreface/ticker.d.ts +0 -37
- package/cjs/intreface/ticker.js +0 -11
- package/cjs/intreface/ticker.js.map +0 -1
- package/cjs/intreface/timeline.d.ts +0 -17
- package/cjs/intreface/timeline.js +0 -6
- package/cjs/intreface/timeline.js.map +0 -1
- package/cjs/intreface/type.d.ts +0 -13
- package/cjs/intreface/type.js +0 -15
- package/cjs/intreface/type.js.map +0 -1
- package/es/custom/label-animate.d.ts +0 -4
- package/es/custom/label-animate.js +0 -42
- package/es/custom/label-animate.js.map +0 -1
- package/es/intreface/animate.d.ts +0 -92
- package/es/intreface/animate.js +0 -6
- package/es/intreface/animate.js.map +0 -1
- package/es/intreface/easing.d.ts +0 -3
- package/es/intreface/easing.js +0 -2
- package/es/intreface/easing.js.map +0 -1
- package/es/intreface/ticker.d.ts +0 -37
- package/es/intreface/ticker.js +0 -7
- package/es/intreface/ticker.js.map +0 -1
- package/es/intreface/timeline.d.ts +0 -17
- package/es/intreface/timeline.js +0 -2
- package/es/intreface/timeline.js.map +0 -1
- package/es/intreface/type.d.ts +0 -13
- package/es/intreface/type.js +0 -14
- package/es/intreface/type.js.map +0 -1
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.MoveRotateOut = exports.MoveScaleOut = exports.SpinOut = exports.GrowOut = exports.SlideOut = exports.MoveRotateIn = exports.MoveScaleIn = exports.SpinIn = exports.GrowIn = exports.SlideIn = exports.StoryFadeIn = void 0;
|
|
6
|
+
|
|
7
|
+
const fade_1 = require("./fade"), custom_animate_1 = require("./custom-animate"), animate_executor_1 = require("../executor/animate-executor");
|
|
8
|
+
|
|
9
|
+
class StoryFadeIn extends fade_1.FadeIn {}
|
|
10
|
+
|
|
11
|
+
exports.StoryFadeIn = StoryFadeIn;
|
|
12
|
+
|
|
13
|
+
class SlideIn extends custom_animate_1.ACustomAnimate {
|
|
14
|
+
constructor(from, to, duration, easing, params) {
|
|
15
|
+
super(from, to, duration, easing, params);
|
|
16
|
+
}
|
|
17
|
+
onBind() {
|
|
18
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
19
|
+
const attrs = this.target.getFinalAttribute(), direction = (null === (_a = this.params) || void 0 === _a ? void 0 : _a.direction) || "right", distance = (null === (_b = this.params) || void 0 === _b ? void 0 : _b.distance) || 50, fromOpacity = null !== (_d = null === (_c = this.params) || void 0 === _c ? void 0 : _c.fromOpacity) && void 0 !== _d ? _d : 0, from = {
|
|
20
|
+
opacity: fromOpacity,
|
|
21
|
+
baseOpacity: fromOpacity
|
|
22
|
+
}, to = {
|
|
23
|
+
opacity: 1,
|
|
24
|
+
baseOpacity: 1
|
|
25
|
+
};
|
|
26
|
+
"top" === direction ? (from.y = (null !== (_e = attrs.y) && void 0 !== _e ? _e : 0) - distance,
|
|
27
|
+
to.y = null !== (_f = attrs.y) && void 0 !== _f ? _f : 0, this.propKeys = [ "opacity", "baseOpacity", "y" ]) : "bottom" === direction ? (from.y = (null !== (_g = attrs.y) && void 0 !== _g ? _g : 0) + distance,
|
|
28
|
+
to.y = null !== (_h = attrs.y) && void 0 !== _h ? _h : 0, this.propKeys = [ "opacity", "baseOpacity", "y" ]) : "left" === direction ? (from.x = (null !== (_j = attrs.x) && void 0 !== _j ? _j : 0) - distance,
|
|
29
|
+
to.x = null !== (_k = attrs.x) && void 0 !== _k ? _k : 0, this.propKeys = [ "opacity", "baseOpacity", "x" ]) : (from.x = (null !== (_l = attrs.x) && void 0 !== _l ? _l : 0) + distance,
|
|
30
|
+
to.x = null !== (_m = attrs.x) && void 0 !== _m ? _m : 0, this.propKeys = [ "opacity", "baseOpacity", "x" ]),
|
|
31
|
+
this.from = from, this.to = to, this.props = to, this.target.setAttributes(from);
|
|
32
|
+
}
|
|
33
|
+
onUpdate(end, ratio, out) {
|
|
34
|
+
const attribute = this.target.attribute;
|
|
35
|
+
this.propKeys.forEach((key => {
|
|
36
|
+
attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
|
|
37
|
+
})), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
exports.SlideIn = SlideIn;
|
|
42
|
+
|
|
43
|
+
class GrowIn extends custom_animate_1.ACustomAnimate {
|
|
44
|
+
constructor(from, to, duration, easing, params) {
|
|
45
|
+
super(from, to, duration, easing, params);
|
|
46
|
+
}
|
|
47
|
+
onBind() {
|
|
48
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
49
|
+
const attrs = this.target.getFinalAttribute(), fromScale = null !== (_b = null === (_a = this.params) || void 0 === _a ? void 0 : _a.fromScale) && void 0 !== _b ? _b : 0, direction = (null === (_c = this.params) || void 0 === _c ? void 0 : _c.direction) || "xy", fromOpacity = null !== (_e = null === (_d = this.params) || void 0 === _d ? void 0 : _d.fromOpacity) && void 0 !== _e ? _e : 0, from = {
|
|
50
|
+
opacity: fromOpacity,
|
|
51
|
+
baseOpacity: fromOpacity
|
|
52
|
+
}, to = {
|
|
53
|
+
opacity: 1,
|
|
54
|
+
baseOpacity: 1
|
|
55
|
+
};
|
|
56
|
+
this.propKeys = [ "opacity", "baseOpacity" ], "x" !== direction && "xy" !== direction || (from.scaleX = fromScale,
|
|
57
|
+
to.scaleX = null !== (_f = attrs.scaleX) && void 0 !== _f ? _f : 1, this.propKeys.push("scaleX")),
|
|
58
|
+
"y" !== direction && "xy" !== direction || (from.scaleY = fromScale, to.scaleY = null !== (_g = attrs.scaleY) && void 0 !== _g ? _g : 1,
|
|
59
|
+
this.propKeys.push("scaleY")), this.from = from, this.to = to, this.props = to,
|
|
60
|
+
this.target.setAttributes(from);
|
|
61
|
+
}
|
|
62
|
+
onUpdate(end, ratio, out) {
|
|
63
|
+
const attribute = this.target.attribute;
|
|
64
|
+
this.propKeys.forEach((key => {
|
|
65
|
+
attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
|
|
66
|
+
})), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
exports.GrowIn = GrowIn;
|
|
71
|
+
|
|
72
|
+
class SpinIn extends custom_animate_1.ACustomAnimate {
|
|
73
|
+
constructor(from, to, duration, easing, params) {
|
|
74
|
+
super(from, to, duration, easing, params);
|
|
75
|
+
}
|
|
76
|
+
onBind() {
|
|
77
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
78
|
+
const attrs = this.target.getFinalAttribute(), fromAngle = null !== (_b = null === (_a = this.params) || void 0 === _a ? void 0 : _a.fromAngle) && void 0 !== _b ? _b : 2 * Math.PI, fromScale = null !== (_d = null === (_c = this.params) || void 0 === _c ? void 0 : _c.fromScale) && void 0 !== _d ? _d : 0, fromOpacity = null !== (_f = null === (_e = this.params) || void 0 === _e ? void 0 : _e.fromOpacity) && void 0 !== _f ? _f : 0, from = {
|
|
79
|
+
opacity: fromOpacity,
|
|
80
|
+
baseOpacity: fromOpacity,
|
|
81
|
+
angle: fromAngle,
|
|
82
|
+
scaleX: fromScale,
|
|
83
|
+
scaleY: fromScale
|
|
84
|
+
}, to = {
|
|
85
|
+
opacity: 1,
|
|
86
|
+
baseOpacity: 1,
|
|
87
|
+
angle: null !== (_g = attrs.angle) && void 0 !== _g ? _g : 0,
|
|
88
|
+
scaleX: null !== (_h = attrs.scaleX) && void 0 !== _h ? _h : 1,
|
|
89
|
+
scaleY: null !== (_j = attrs.scaleY) && void 0 !== _j ? _j : 1
|
|
90
|
+
};
|
|
91
|
+
this.propKeys = [ "opacity", "baseOpacity", "angle", "scaleX", "scaleY" ], this.from = from,
|
|
92
|
+
this.to = to, this.props = to, this.target.setAttributes(from);
|
|
93
|
+
}
|
|
94
|
+
onUpdate(end, ratio, out) {
|
|
95
|
+
const attribute = this.target.attribute;
|
|
96
|
+
this.propKeys.forEach((key => {
|
|
97
|
+
attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
|
|
98
|
+
})), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
exports.SpinIn = SpinIn;
|
|
103
|
+
|
|
104
|
+
class MoveScaleIn extends custom_animate_1.ACustomAnimate {
|
|
105
|
+
constructor(from, to, duration, easing, params) {
|
|
106
|
+
var _a;
|
|
107
|
+
super(from, to, duration, easing, params);
|
|
108
|
+
const slideRatio = null !== (_a = null == params ? void 0 : params.slideRatio) && void 0 !== _a ? _a : .5;
|
|
109
|
+
this.slideInDuration = duration * slideRatio, this.growInDuration = duration * (1 - slideRatio);
|
|
110
|
+
}
|
|
111
|
+
onBind() {
|
|
112
|
+
var _a, _b, _c, _d, _e, _f;
|
|
113
|
+
const executor = new animate_executor_1.AnimateExecutor(this.target);
|
|
114
|
+
executor.execute({
|
|
115
|
+
type: "custom",
|
|
116
|
+
custom: SlideIn,
|
|
117
|
+
customParameters: {
|
|
118
|
+
direction: (null === (_a = this.params) || void 0 === _a ? void 0 : _a.slideDirection) || "right",
|
|
119
|
+
distance: (null === (_b = this.params) || void 0 === _b ? void 0 : _b.slideDistance) || 50,
|
|
120
|
+
fromOpacity: null !== (_d = null === (_c = this.params) || void 0 === _c ? void 0 : _c.fromOpacity) && void 0 !== _d ? _d : 0
|
|
121
|
+
},
|
|
122
|
+
duration: this.slideInDuration,
|
|
123
|
+
easing: this.easing
|
|
124
|
+
}), executor.execute({
|
|
125
|
+
type: "custom",
|
|
126
|
+
custom: GrowIn,
|
|
127
|
+
customParameters: {
|
|
128
|
+
fromScale: (null === (_e = this.params) || void 0 === _e ? void 0 : _e.fromScale) || .5,
|
|
129
|
+
direction: (null === (_f = this.params) || void 0 === _f ? void 0 : _f.scaleDirection) || "xy",
|
|
130
|
+
fromOpacity: 1
|
|
131
|
+
},
|
|
132
|
+
duration: this.growInDuration,
|
|
133
|
+
easing: this.easing,
|
|
134
|
+
delay: this.slideInDuration
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
onUpdate(end, ratio, out) {}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
exports.MoveScaleIn = MoveScaleIn;
|
|
141
|
+
|
|
142
|
+
class MoveRotateIn extends custom_animate_1.ACustomAnimate {
|
|
143
|
+
constructor(from, to, duration, easing, params) {
|
|
144
|
+
var _a;
|
|
145
|
+
super(from, to, duration, easing, params);
|
|
146
|
+
const slideRatio = null !== (_a = null == params ? void 0 : params.slideRatio) && void 0 !== _a ? _a : .5;
|
|
147
|
+
this.slideInDuration = duration * slideRatio, this.spinInDuration = duration * (1 - slideRatio);
|
|
148
|
+
}
|
|
149
|
+
onBind() {
|
|
150
|
+
var _a, _b, _c, _d, _e, _f;
|
|
151
|
+
const executor = new animate_executor_1.AnimateExecutor(this.target);
|
|
152
|
+
executor.execute({
|
|
153
|
+
type: "custom",
|
|
154
|
+
custom: SlideIn,
|
|
155
|
+
customParameters: {
|
|
156
|
+
direction: (null === (_a = this.params) || void 0 === _a ? void 0 : _a.slideDirection) || "right",
|
|
157
|
+
distance: (null === (_b = this.params) || void 0 === _b ? void 0 : _b.slideDistance) || 50,
|
|
158
|
+
fromOpacity: null !== (_d = null === (_c = this.params) || void 0 === _c ? void 0 : _c.fromOpacity) && void 0 !== _d ? _d : 0
|
|
159
|
+
},
|
|
160
|
+
duration: this.slideInDuration,
|
|
161
|
+
easing: this.easing
|
|
162
|
+
}), executor.execute({
|
|
163
|
+
type: "custom",
|
|
164
|
+
custom: SpinIn,
|
|
165
|
+
customParameters: {
|
|
166
|
+
fromAngle: (null === (_e = this.params) || void 0 === _e ? void 0 : _e.fromAngle) || Math.PI,
|
|
167
|
+
fromScale: (null === (_f = this.params) || void 0 === _f ? void 0 : _f.fromScale) || .5,
|
|
168
|
+
fromOpacity: 1
|
|
169
|
+
},
|
|
170
|
+
duration: this.spinInDuration,
|
|
171
|
+
easing: this.easing,
|
|
172
|
+
delay: this.slideInDuration
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
onUpdate(end, ratio, out) {}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
exports.MoveRotateIn = MoveRotateIn;
|
|
179
|
+
|
|
180
|
+
class SlideOut extends custom_animate_1.ACustomAnimate {
|
|
181
|
+
constructor(from, to, duration, easing, params) {
|
|
182
|
+
super(from, to, duration, easing, params);
|
|
183
|
+
}
|
|
184
|
+
onFirstRun() {
|
|
185
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
186
|
+
const attrs = this.target.getAttributes(), direction = (null === (_a = this.params) || void 0 === _a ? void 0 : _a.direction) || "right", distance = (null === (_b = this.params) || void 0 === _b ? void 0 : _b.distance) || 50, fromOpacity = null !== (_d = null === (_c = this.params) || void 0 === _c ? void 0 : _c.fromOpacity) && void 0 !== _d ? _d : 1, toOpacity = null !== (_f = null === (_e = this.params) || void 0 === _e ? void 0 : _e.toOpacity) && void 0 !== _f ? _f : 0, from = {
|
|
187
|
+
opacity: fromOpacity,
|
|
188
|
+
baseOpacity: fromOpacity
|
|
189
|
+
}, to = {
|
|
190
|
+
opacity: toOpacity,
|
|
191
|
+
baseOpacity: toOpacity
|
|
192
|
+
};
|
|
193
|
+
"top" === direction ? (from.y = null !== (_g = attrs.y) && void 0 !== _g ? _g : 0,
|
|
194
|
+
to.y = (null !== (_h = attrs.y) && void 0 !== _h ? _h : 0) - distance, this.propKeys = [ "opacity", "baseOpacity", "y" ]) : "bottom" === direction ? (from.y = null !== (_j = attrs.y) && void 0 !== _j ? _j : 0,
|
|
195
|
+
to.y = (null !== (_k = attrs.y) && void 0 !== _k ? _k : 0) + distance, this.propKeys = [ "opacity", "baseOpacity", "y" ]) : "left" === direction ? (from.x = null !== (_l = attrs.x) && void 0 !== _l ? _l : 0,
|
|
196
|
+
to.x = (null !== (_m = attrs.x) && void 0 !== _m ? _m : 0) - distance, this.propKeys = [ "opacity", "baseOpacity", "x" ]) : (from.x = null !== (_o = attrs.x) && void 0 !== _o ? _o : 0,
|
|
197
|
+
to.x = (null !== (_p = attrs.x) && void 0 !== _p ? _p : 0) + distance, this.propKeys = [ "opacity", "baseOpacity", "x" ]),
|
|
198
|
+
this.from = from, this.to = to, this.props = to;
|
|
199
|
+
}
|
|
200
|
+
onUpdate(end, ratio, out) {
|
|
201
|
+
const attribute = this.target.attribute;
|
|
202
|
+
this.propKeys.forEach((key => {
|
|
203
|
+
attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
|
|
204
|
+
})), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
exports.SlideOut = SlideOut;
|
|
209
|
+
|
|
210
|
+
class GrowOut extends custom_animate_1.ACustomAnimate {
|
|
211
|
+
constructor(from, to, duration, easing, params) {
|
|
212
|
+
super(from, to, duration, easing, params);
|
|
213
|
+
}
|
|
214
|
+
onFirstRun() {
|
|
215
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
216
|
+
const attrs = this.target.getAttributes(), toScale = null !== (_b = null === (_a = this.params) || void 0 === _a ? void 0 : _a.fromScale) && void 0 !== _b ? _b : 0, direction = (null === (_c = this.params) || void 0 === _c ? void 0 : _c.direction) || "xy", fromOpacity = null !== (_e = null === (_d = this.params) || void 0 === _d ? void 0 : _d.fromOpacity) && void 0 !== _e ? _e : 1, toOpacity = null !== (_g = null === (_f = this.params) || void 0 === _f ? void 0 : _f.toOpacity) && void 0 !== _g ? _g : 0, from = {
|
|
217
|
+
opacity: fromOpacity,
|
|
218
|
+
baseOpacity: fromOpacity
|
|
219
|
+
}, to = {
|
|
220
|
+
opacity: toOpacity,
|
|
221
|
+
baseOpacity: toOpacity
|
|
222
|
+
};
|
|
223
|
+
this.propKeys = [ "opacity", "baseOpacity" ], "x" !== direction && "xy" !== direction || (from.scaleX = null !== (_h = attrs.scaleX) && void 0 !== _h ? _h : 1,
|
|
224
|
+
to.scaleX = toScale, this.propKeys.push("scaleX")), "y" !== direction && "xy" !== direction || (from.scaleY = null !== (_j = attrs.scaleY) && void 0 !== _j ? _j : 1,
|
|
225
|
+
to.scaleY = toScale, this.propKeys.push("scaleY")), this.from = from, this.to = to,
|
|
226
|
+
this.props = to;
|
|
227
|
+
}
|
|
228
|
+
onUpdate(end, ratio, out) {
|
|
229
|
+
const attribute = this.target.attribute;
|
|
230
|
+
this.propKeys.forEach((key => {
|
|
231
|
+
attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
|
|
232
|
+
})), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
exports.GrowOut = GrowOut;
|
|
237
|
+
|
|
238
|
+
class SpinOut extends custom_animate_1.ACustomAnimate {
|
|
239
|
+
constructor(from, to, duration, easing, params) {
|
|
240
|
+
super(from, to, duration, easing, params);
|
|
241
|
+
}
|
|
242
|
+
onFirstRun() {
|
|
243
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
244
|
+
const attrs = this.target.getAttributes(), toAngle = null !== (_b = null === (_a = this.params) || void 0 === _a ? void 0 : _a.fromAngle) && void 0 !== _b ? _b : 2 * Math.PI, toScale = null !== (_d = null === (_c = this.params) || void 0 === _c ? void 0 : _c.fromScale) && void 0 !== _d ? _d : 0, fromOpacity = null !== (_f = null === (_e = this.params) || void 0 === _e ? void 0 : _e.fromOpacity) && void 0 !== _f ? _f : 1, toOpacity = null !== (_h = null === (_g = this.params) || void 0 === _g ? void 0 : _g.toOpacity) && void 0 !== _h ? _h : 0, from = {
|
|
245
|
+
opacity: fromOpacity,
|
|
246
|
+
baseOpacity: fromOpacity,
|
|
247
|
+
angle: null !== (_j = attrs.angle) && void 0 !== _j ? _j : 0,
|
|
248
|
+
scaleX: null !== (_k = attrs.scaleX) && void 0 !== _k ? _k : 1,
|
|
249
|
+
scaleY: null !== (_l = attrs.scaleY) && void 0 !== _l ? _l : 1
|
|
250
|
+
}, to = {
|
|
251
|
+
opacity: toOpacity,
|
|
252
|
+
baseOpacity: toOpacity,
|
|
253
|
+
angle: toAngle,
|
|
254
|
+
scaleX: toScale,
|
|
255
|
+
scaleY: toScale
|
|
256
|
+
};
|
|
257
|
+
this.propKeys = [ "opacity", "baseOpacity", "angle", "scaleX", "scaleY" ], this.from = from,
|
|
258
|
+
this.to = to, this.props = to;
|
|
259
|
+
}
|
|
260
|
+
onUpdate(end, ratio, out) {
|
|
261
|
+
const attribute = this.target.attribute;
|
|
262
|
+
this.propKeys.forEach((key => {
|
|
263
|
+
attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
|
|
264
|
+
})), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
exports.SpinOut = SpinOut;
|
|
269
|
+
|
|
270
|
+
class MoveScaleOut extends custom_animate_1.ACustomAnimate {
|
|
271
|
+
constructor(from, to, duration, easing, params) {
|
|
272
|
+
var _a;
|
|
273
|
+
super(from, to, duration, easing, params);
|
|
274
|
+
const slideRatio = null !== (_a = null == params ? void 0 : params.slideRatio) && void 0 !== _a ? _a : .5;
|
|
275
|
+
this.growOutDuration = duration * (1 - slideRatio), this.slideOutDuration = duration * slideRatio;
|
|
276
|
+
}
|
|
277
|
+
onFirstRun() {
|
|
278
|
+
var _a, _b, _c, _d;
|
|
279
|
+
const executor = new animate_executor_1.AnimateExecutor(this.target);
|
|
280
|
+
executor.execute({
|
|
281
|
+
type: "custom",
|
|
282
|
+
custom: GrowOut,
|
|
283
|
+
customParameters: {
|
|
284
|
+
fromScale: (null === (_a = this.params) || void 0 === _a ? void 0 : _a.fromScale) || .5,
|
|
285
|
+
direction: (null === (_b = this.params) || void 0 === _b ? void 0 : _b.scaleDirection) || "xy",
|
|
286
|
+
fromOpacity: 1,
|
|
287
|
+
toOpacity: 1
|
|
288
|
+
},
|
|
289
|
+
duration: this.growOutDuration,
|
|
290
|
+
easing: this.easing
|
|
291
|
+
}), executor.execute({
|
|
292
|
+
type: "custom",
|
|
293
|
+
custom: SlideOut,
|
|
294
|
+
customParameters: {
|
|
295
|
+
direction: (null === (_c = this.params) || void 0 === _c ? void 0 : _c.slideDirection) || "right",
|
|
296
|
+
distance: (null === (_d = this.params) || void 0 === _d ? void 0 : _d.slideDistance) || 50,
|
|
297
|
+
fromOpacity: 1
|
|
298
|
+
},
|
|
299
|
+
duration: this.slideOutDuration,
|
|
300
|
+
easing: this.easing,
|
|
301
|
+
delay: this.growOutDuration
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
onUpdate(end, ratio, out) {}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
exports.MoveScaleOut = MoveScaleOut;
|
|
308
|
+
|
|
309
|
+
class MoveRotateOut extends custom_animate_1.ACustomAnimate {
|
|
310
|
+
constructor(from, to, duration, easing, params) {
|
|
311
|
+
var _a;
|
|
312
|
+
super(from, to, duration, easing, params);
|
|
313
|
+
const slideRatio = null !== (_a = null == params ? void 0 : params.slideRatio) && void 0 !== _a ? _a : .5;
|
|
314
|
+
this.spinOutDuration = duration * (1 - slideRatio), this.slideOutDuration = duration * slideRatio;
|
|
315
|
+
}
|
|
316
|
+
onFirstRun() {
|
|
317
|
+
var _a, _b, _c, _d;
|
|
318
|
+
const executor = new animate_executor_1.AnimateExecutor(this.target);
|
|
319
|
+
executor.execute({
|
|
320
|
+
type: "custom",
|
|
321
|
+
custom: SpinOut,
|
|
322
|
+
customParameters: {
|
|
323
|
+
fromAngle: (null === (_a = this.params) || void 0 === _a ? void 0 : _a.fromAngle) || Math.PI,
|
|
324
|
+
fromScale: (null === (_b = this.params) || void 0 === _b ? void 0 : _b.fromScale) || .5,
|
|
325
|
+
fromOpacity: 1,
|
|
326
|
+
toOpacity: 1
|
|
327
|
+
},
|
|
328
|
+
duration: this.spinOutDuration,
|
|
329
|
+
easing: this.easing
|
|
330
|
+
}), executor.execute({
|
|
331
|
+
type: "custom",
|
|
332
|
+
custom: SlideOut,
|
|
333
|
+
customParameters: {
|
|
334
|
+
direction: (null === (_c = this.params) || void 0 === _c ? void 0 : _c.slideDirection) || "right",
|
|
335
|
+
distance: (null === (_d = this.params) || void 0 === _d ? void 0 : _d.slideDistance) || 50,
|
|
336
|
+
fromOpacity: 1
|
|
337
|
+
},
|
|
338
|
+
duration: this.slideOutDuration,
|
|
339
|
+
easing: this.easing,
|
|
340
|
+
delay: this.spinOutDuration
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
onUpdate(end, ratio, out) {}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
exports.MoveRotateOut = MoveRotateOut;
|
|
347
|
+
//# sourceMappingURL=story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/custom/story.ts"],"names":[],"mappings":";;;AAAA,iCAAgC;AAEhC,qDAAkD;AAClD,mEAA+D;AAE/D,MAAa,WAAY,SAAQ,aAAM;CAAG;AAA1C,kCAA0C;AA0B1C,MAAa,OAAQ,SAAQ,+BAAsC;IAMjE,YAAY,IAAU,EAAE,EAA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Q,CAAC,GAAY,EAAE,KAAa,EAAE,GAAwB;IAE9D,CAAC;CACF;AAhDD,sCAgDC","file":"story.js","sourcesContent":["import { FadeIn } from './fade';\nimport type { EasingType } from '@visactor/vrender-core';\nimport { ACustomAnimate } from './custom-animate';\nimport { AnimateExecutor } from '../executor/animate-executor';\n\nexport class StoryFadeIn extends FadeIn {}\n\n// 滑动动画的参数接口\nexport interface ISlideAnimationOptions {\n direction?: 'top' | 'bottom' | 'left' | 'right';\n distance?: number;\n fromOpacity?: number; // 透明度初始值,默认0\n}\n\n// 缩放动画的参数接口\nexport interface IGrowAnimationOptions {\n fromScale?: number;\n direction?: 'x' | 'y' | 'xy';\n fromOpacity?: number; // 透明度初始值,默认0\n}\n\n// 旋转动画的参数接口\nexport interface ISpinAnimationOptions {\n fromAngle?: number;\n fromScale?: number;\n fromOpacity?: number; // 透明度初始值,默认0\n}\n\n/**\n * 滑动入场动画,包括从上到下,从下到上,从左到右,从右到左的位置,以及透明度属性插值\n */\nexport class SlideIn extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n declare propKeys: string[];\n declare from: Record<string, number>;\n declare to: Record<string, number>;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: ISlideAnimationOptions) {\n super(from, to, duration, easing, params);\n }\n\n onBind(): void {\n // 用于入场的时候设置属性\n const attrs = this.target.getFinalAttribute();\n\n const direction = (this.params?.direction as 'top' | 'bottom' | 'left' | 'right') || 'right';\n const distance = this.params?.distance || 50;\n const fromOpacity = this.params?.fromOpacity ?? 0; // 使用透明度初始值参数\n\n // 初始化from和to对象\n const from: Record<string, number> = { opacity: fromOpacity, baseOpacity: fromOpacity };\n const to: Record<string, number> = { opacity: 1, baseOpacity: 1 };\n\n // 根据方向设置对应的属性\n if (direction === 'top') {\n from.y = (attrs.y ?? 0) - distance;\n to.y = attrs.y ?? 0;\n this.propKeys = ['opacity', 'baseOpacity', 'y'];\n } else if (direction === 'bottom') {\n from.y = (attrs.y ?? 0) + distance;\n to.y = attrs.y ?? 0;\n this.propKeys = ['opacity', 'baseOpacity', 'y'];\n } else if (direction === 'left') {\n from.x = (attrs.x ?? 0) - distance;\n to.x = attrs.x ?? 0;\n this.propKeys = ['opacity', 'baseOpacity', 'x'];\n } else {\n // right\n from.x = (attrs.x ?? 0) + distance;\n to.x = attrs.x ?? 0;\n this.propKeys = ['opacity', 'baseOpacity', 'x'];\n }\n\n this.from = from;\n this.to = to;\n this.props = to;\n\n // 将初始属性应用到目标对象\n this.target.setAttributes(from as any);\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n const attribute: Record<string, any> = this.target.attribute;\n this.propKeys.forEach(key => {\n attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;\n });\n this.target.addUpdatePositionTag();\n this.target.addUpdateShapeAndBoundsTag();\n }\n}\n\n/**\n * 缩放入场动画,包括scaleX、scaleY属性从某个比例缩放到1,该比例可以小于1也可以大于1,以及透明度属性插值\n */\nexport class GrowIn extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n declare propKeys: string[];\n declare from: Record<string, number>;\n declare to: Record<string, number>;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: IGrowAnimationOptions) {\n super(from, to, duration, easing, params);\n }\n\n onBind(): void {\n // 用于入场的时候设置属性\n const attrs = this.target.getFinalAttribute();\n\n const fromScale = this.params?.fromScale ?? 0;\n const direction = this.params?.direction || 'xy';\n const fromOpacity = this.params?.fromOpacity ?? 0; // 使用透明度初始值参数\n\n // 初始化from和to对象\n const from: Record<string, number> = { opacity: fromOpacity, baseOpacity: fromOpacity };\n const to: Record<string, number> = { opacity: 1, baseOpacity: 1 };\n this.propKeys = ['opacity', 'baseOpacity'];\n\n // 根据方向设置对应的缩放属性\n if (direction === 'x' || direction === 'xy') {\n from.scaleX = fromScale;\n to.scaleX = attrs.scaleX ?? 1;\n this.propKeys.push('scaleX');\n }\n\n if (direction === 'y' || direction === 'xy') {\n from.scaleY = fromScale;\n to.scaleY = attrs.scaleY ?? 1;\n this.propKeys.push('scaleY');\n }\n\n this.from = from;\n this.to = to;\n this.props = to;\n\n // 将初始属性应用到目标对象\n this.target.setAttributes(from as any);\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n const attribute: Record<string, any> = this.target.attribute;\n this.propKeys.forEach(key => {\n attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;\n });\n this.target.addUpdatePositionTag();\n this.target.addUpdateShapeAndBoundsTag();\n }\n}\n\n/**\n * 旋转入场动画,包括rotate属性从某个角度度旋转到0,以及缩放属性从某个比例缩放到1,该比例可以小于1也可以大于1\n */\nexport class SpinIn extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n declare propKeys: string[];\n declare from: Record<string, number>;\n declare to: Record<string, number>;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: ISpinAnimationOptions) {\n super(from, to, duration, easing, params);\n }\n\n onBind(): void {\n // 用于入场的时候设置属性\n const attrs = this.target.getFinalAttribute();\n\n const fromAngle = this.params?.fromAngle ?? Math.PI * 2; // 默认旋转一圈\n const fromScale = this.params?.fromScale ?? 0;\n const fromOpacity = this.params?.fromOpacity ?? 0; // 使用透明度初始值参数\n\n // 初始化from和to对象\n const from: Record<string, number> = {\n opacity: fromOpacity,\n baseOpacity: fromOpacity,\n angle: fromAngle,\n scaleX: fromScale,\n scaleY: fromScale\n };\n\n const to: Record<string, number> = {\n opacity: 1,\n baseOpacity: 1,\n angle: attrs.angle ?? 0,\n scaleX: attrs.scaleX ?? 1,\n scaleY: attrs.scaleY ?? 1\n };\n\n this.propKeys = ['opacity', 'baseOpacity', 'angle', 'scaleX', 'scaleY'];\n this.from = from;\n this.to = to;\n this.props = to;\n\n // 将初始属性应用到目标对象\n this.target.setAttributes(from as any);\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n const attribute: Record<string, any> = this.target.attribute;\n this.propKeys.forEach(key => {\n attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;\n });\n this.target.addUpdatePositionTag();\n this.target.addUpdateShapeAndBoundsTag();\n }\n}\n\n// 复合动画的参数接口\nexport interface IMoveScaleAnimationOptions {\n slideDirection?: 'top' | 'bottom' | 'left' | 'right';\n slideDistance?: number;\n fromScale?: number;\n scaleDirection?: 'x' | 'y' | 'xy';\n slideRatio?: number; // 滑动动画占总时长的比例,默认0.5\n fromOpacity?: number; // 透明度初始值,默认0\n}\n\n/**\n * 移动+缩放入场动画\n * 先走SlideIn,然后走GrowIn\n */\nexport class MoveScaleIn extends ACustomAnimate<any> {\n declare valid: boolean;\n private readonly slideInDuration: number;\n private readonly growInDuration: number;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: IMoveScaleAnimationOptions) {\n super(from, to, duration, easing, params);\n const slideRatio = params?.slideRatio ?? 0.5;\n this.slideInDuration = duration * slideRatio;\n this.growInDuration = duration * (1 - slideRatio);\n }\n\n onBind(): void {\n // 创建AnimateExecutor来运行序列动画\n const executor = new AnimateExecutor(this.target);\n\n // 第一步:滑动入场(包含透明度变化)\n executor.execute({\n type: 'custom',\n custom: SlideIn,\n customParameters: {\n direction: this.params?.slideDirection || 'right',\n distance: this.params?.slideDistance || 50,\n fromOpacity: this.params?.fromOpacity ?? 0\n },\n duration: this.slideInDuration,\n easing: this.easing\n });\n\n // 第二步:缩放入场(不包含透明度变化)\n executor.execute({\n type: 'custom',\n custom: GrowIn,\n customParameters: {\n fromScale: this.params?.fromScale || 0.5,\n direction: this.params?.scaleDirection || 'xy',\n fromOpacity: 1 // 设置初始透明度为1,使第二阶段不进行透明度插值\n },\n duration: this.growInDuration,\n easing: this.easing,\n delay: this.slideInDuration // 等第一步完成后再开始\n });\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n // 动画逻辑由子动画处理\n }\n}\n\n// 移动旋转动画的参数接口\nexport interface IMoveRotateAnimationOptions {\n slideDirection?: 'top' | 'bottom' | 'left' | 'right';\n slideDistance?: number;\n fromAngle?: number;\n fromScale?: number;\n slideRatio?: number; // 滑动动画占总时长的比例,默认0.5\n fromOpacity?: number; // 透明度初始值,默认0\n}\n\n/**\n * 移动+旋转入场动画\n * 先走SlideIn,然后走SpinIn\n */\nexport class MoveRotateIn extends ACustomAnimate<any> {\n declare valid: boolean;\n private readonly slideInDuration: number;\n private readonly spinInDuration: number;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: IMoveRotateAnimationOptions) {\n super(from, to, duration, easing, params);\n const slideRatio = params?.slideRatio ?? 0.5;\n this.slideInDuration = duration * slideRatio;\n this.spinInDuration = duration * (1 - slideRatio);\n }\n\n onBind(): void {\n // 创建AnimateExecutor来运行序列动画\n const executor = new AnimateExecutor(this.target);\n\n // 第一步:滑动入场(包含透明度变化)\n executor.execute({\n type: 'custom',\n custom: SlideIn,\n customParameters: {\n direction: this.params?.slideDirection || 'right',\n distance: this.params?.slideDistance || 50,\n fromOpacity: this.params?.fromOpacity ?? 0\n },\n duration: this.slideInDuration,\n easing: this.easing\n });\n\n // 第二步:旋转入场(不包含透明度变化)\n executor.execute({\n type: 'custom',\n custom: SpinIn,\n customParameters: {\n fromAngle: this.params?.fromAngle || Math.PI,\n fromScale: this.params?.fromScale || 0.5,\n fromOpacity: 1 // 设置初始透明度为1,使第二阶段不进行透明度插值\n },\n duration: this.spinInDuration,\n easing: this.easing,\n delay: this.slideInDuration // 等第一步完成后再开始\n });\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n // 动画逻辑由子动画处理\n }\n}\n\n/**\n * 滑动出场动画,包括从当前位置滑动到指定方向,以及透明度属性插值\n */\nexport class SlideOut extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n declare propKeys: string[];\n declare from: Record<string, number>;\n declare to: Record<string, number>;\n\n constructor(\n from: null,\n to: null,\n duration: number,\n easing: EasingType,\n params?: ISlideAnimationOptions & { toOpacity?: number }\n ) {\n super(from, to, duration, easing, params);\n }\n\n onFirstRun(): void {\n // 用于出场的时候设置属性\n const attrs = this.target.getAttributes();\n\n const direction = (this.params?.direction as 'top' | 'bottom' | 'left' | 'right') || 'right';\n const distance = this.params?.distance || 50;\n const fromOpacity = this.params?.fromOpacity ?? 1; // 使用透明度初始值参数\n const toOpacity = this.params?.toOpacity ?? 0; // 使用目标透明度参数\n\n // 初始化from和to对象\n const from: Record<string, number> = { opacity: fromOpacity, baseOpacity: fromOpacity };\n const to: Record<string, number> = { opacity: toOpacity, baseOpacity: toOpacity };\n\n // 根据方向设置对应的属性\n if (direction === 'top') {\n from.y = attrs.y ?? 0;\n to.y = (attrs.y ?? 0) - distance;\n this.propKeys = ['opacity', 'baseOpacity', 'y'];\n } else if (direction === 'bottom') {\n from.y = attrs.y ?? 0;\n to.y = (attrs.y ?? 0) + distance;\n this.propKeys = ['opacity', 'baseOpacity', 'y'];\n } else if (direction === 'left') {\n from.x = attrs.x ?? 0;\n to.x = (attrs.x ?? 0) - distance;\n this.propKeys = ['opacity', 'baseOpacity', 'x'];\n } else {\n // right\n from.x = attrs.x ?? 0;\n to.x = (attrs.x ?? 0) + distance;\n this.propKeys = ['opacity', 'baseOpacity', 'x'];\n }\n\n this.from = from;\n this.to = to;\n this.props = to;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n const attribute: Record<string, any> = this.target.attribute;\n this.propKeys.forEach(key => {\n attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;\n });\n this.target.addUpdatePositionTag();\n this.target.addUpdateShapeAndBoundsTag();\n }\n}\n\n/**\n * 缩放出场动画,包括scaleX、scaleY属性从当前比例缩放到指定比例,以及透明度属性插值\n */\nexport class GrowOut extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n declare propKeys: string[];\n declare from: Record<string, number>;\n declare to: Record<string, number>;\n\n constructor(\n from: null,\n to: null,\n duration: number,\n easing: EasingType,\n params?: IGrowAnimationOptions & { toOpacity?: number }\n ) {\n super(from, to, duration, easing, params);\n }\n\n onFirstRun(): void {\n // 用于出场的时候设置属性\n const attrs = this.target.getAttributes();\n\n const toScale = this.params?.fromScale ?? 0; // 使用fromScale作为目标比例\n const direction = this.params?.direction || 'xy';\n const fromOpacity = this.params?.fromOpacity ?? 1; // 使用透明度初始值参数\n const toOpacity = this.params?.toOpacity ?? 0; // 使用目标透明度参数\n\n // 初始化from和to对象\n const from: Record<string, number> = { opacity: fromOpacity, baseOpacity: fromOpacity };\n const to: Record<string, number> = { opacity: toOpacity, baseOpacity: toOpacity };\n this.propKeys = ['opacity', 'baseOpacity'];\n\n // 根据方向设置对应的缩放属性\n if (direction === 'x' || direction === 'xy') {\n from.scaleX = attrs.scaleX ?? 1;\n to.scaleX = toScale;\n this.propKeys.push('scaleX');\n }\n\n if (direction === 'y' || direction === 'xy') {\n from.scaleY = attrs.scaleY ?? 1;\n to.scaleY = toScale;\n this.propKeys.push('scaleY');\n }\n\n this.from = from;\n this.to = to;\n this.props = to;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n const attribute: Record<string, any> = this.target.attribute;\n this.propKeys.forEach(key => {\n attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;\n });\n this.target.addUpdatePositionTag();\n this.target.addUpdateShapeAndBoundsTag();\n }\n}\n\n/**\n * 旋转出场动画,包括rotate属性从当前角度旋转到指定角度,以及缩放属性从当前比例缩放到指定比例\n */\nexport class SpinOut extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n declare propKeys: string[];\n declare from: Record<string, number>;\n declare to: Record<string, number>;\n\n constructor(\n from: null,\n to: null,\n duration: number,\n easing: EasingType,\n params?: ISpinAnimationOptions & { toOpacity?: number }\n ) {\n super(from, to, duration, easing, params);\n }\n\n onFirstRun(): void {\n // 用于出场的时候设置属性\n const attrs = this.target.getAttributes();\n\n const toAngle = this.params?.fromAngle ?? Math.PI * 2; // 默认旋转一圈\n const toScale = this.params?.fromScale ?? 0;\n const fromOpacity = this.params?.fromOpacity ?? 1; // 使用透明度初始值参数\n const toOpacity = this.params?.toOpacity ?? 0; // 使用目标透明度参数\n\n // 初始化from和to对象\n const from: Record<string, number> = {\n opacity: fromOpacity,\n baseOpacity: fromOpacity,\n angle: attrs.angle ?? 0,\n scaleX: attrs.scaleX ?? 1,\n scaleY: attrs.scaleY ?? 1\n };\n\n const to: Record<string, number> = {\n opacity: toOpacity,\n baseOpacity: toOpacity,\n angle: toAngle,\n scaleX: toScale,\n scaleY: toScale\n };\n\n this.propKeys = ['opacity', 'baseOpacity', 'angle', 'scaleX', 'scaleY'];\n this.from = from;\n this.to = to;\n this.props = to;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n const attribute: Record<string, any> = this.target.attribute;\n this.propKeys.forEach(key => {\n attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;\n });\n this.target.addUpdatePositionTag();\n this.target.addUpdateShapeAndBoundsTag();\n }\n}\n\n/**\n * 移动+缩放出场动画\n * 先走GrowOut,然后走SlideOut\n */\nexport class MoveScaleOut extends ACustomAnimate<any> {\n declare valid: boolean;\n private readonly growOutDuration: number;\n private readonly slideOutDuration: number;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: IMoveScaleAnimationOptions) {\n super(from, to, duration, easing, params);\n const slideRatio = params?.slideRatio ?? 0.5;\n this.growOutDuration = duration * (1 - slideRatio);\n this.slideOutDuration = duration * slideRatio;\n }\n\n onFirstRun(): void {\n // 创建AnimateExecutor来运行序列动画\n const executor = new AnimateExecutor(this.target);\n\n // 第一步:缩放出场(不包含透明度变化)\n executor.execute({\n type: 'custom',\n custom: GrowOut,\n customParameters: {\n fromScale: this.params?.fromScale || 0.5,\n direction: this.params?.scaleDirection || 'xy',\n fromOpacity: 1, // 保持透明度为1,不做变化\n toOpacity: 1 // 确保第一阶段不改变透明度\n },\n duration: this.growOutDuration,\n easing: this.easing\n });\n\n // 第二步:滑动出场(包含透明度变化)\n executor.execute({\n type: 'custom',\n custom: SlideOut,\n customParameters: {\n direction: this.params?.slideDirection || 'right',\n distance: this.params?.slideDistance || 50,\n fromOpacity: 1 // 起始透明度为1\n },\n duration: this.slideOutDuration,\n easing: this.easing,\n delay: this.growOutDuration // 等第一步完成后再开始\n });\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n // 动画逻辑由子动画处理\n }\n}\n\n/**\n * 移动+旋转出场动画\n * 先走SpinOut,然后走SlideOut\n */\nexport class MoveRotateOut extends ACustomAnimate<any> {\n declare valid: boolean;\n private readonly spinOutDuration: number;\n private readonly slideOutDuration: number;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: IMoveRotateAnimationOptions) {\n super(from, to, duration, easing, params);\n const slideRatio = params?.slideRatio ?? 0.5;\n this.spinOutDuration = duration * (1 - slideRatio);\n this.slideOutDuration = duration * slideRatio;\n }\n\n onFirstRun(): void {\n // 创建AnimateExecutor来运行序列动画\n const executor = new AnimateExecutor(this.target);\n\n // 第一步:旋转出场(不包含透明度变化)\n executor.execute({\n type: 'custom',\n custom: SpinOut,\n customParameters: {\n fromAngle: this.params?.fromAngle || Math.PI,\n fromScale: this.params?.fromScale || 0.5,\n fromOpacity: 1, // 保持透明度为1,不做变化\n toOpacity: 1 // 确保第一阶段不改变透明度\n },\n duration: this.spinOutDuration,\n easing: this.easing\n });\n\n // 第二步:滑动出场(包含透明度变化)\n executor.execute({\n type: 'custom',\n custom: SlideOut,\n customParameters: {\n direction: this.params?.slideDirection || 'right',\n distance: this.params?.slideDistance || 50,\n fromOpacity: 1 // 起始透明度为1\n },\n duration: this.slideOutDuration,\n easing: this.easing,\n delay: this.spinOutDuration // 等第一步完成后再开始\n });\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n // 动画逻辑由子动画处理\n }\n}\n"]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type IPointLike } from '@visactor/vutils';
|
|
2
|
+
import type { ISegment, EasingType } from '@visactor/vrender-core';
|
|
2
3
|
import { ACustomAnimate } from './custom-animate';
|
|
3
|
-
import type { ISegment } from '@visactor/vrender-core';
|
|
4
|
-
import type { EasingType } from '../intreface/easing';
|
|
5
4
|
export declare class TagPointsUpdate extends ACustomAnimate<{
|
|
6
5
|
points?: IPointLike[];
|
|
7
6
|
segments?: ISegment[];
|
package/cjs/custom/tag-points.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.TagPointsUpdate = void 0;
|
|
6
6
|
|
|
7
|
-
const vutils_1 = require("@visactor/vutils"),
|
|
7
|
+
const vutils_1 = require("@visactor/vutils"), vrender_core_1 = require("@visactor/vrender-core"), custom_animate_1 = require("./custom-animate");
|
|
8
8
|
|
|
9
9
|
class TagPointsUpdate extends custom_animate_1.ACustomAnimate {
|
|
10
10
|
constructor(from, to, duration, easing, params) {
|
|
@@ -24,6 +24,14 @@ class TagPointsUpdate extends custom_animate_1.ACustomAnimate {
|
|
|
24
24
|
return [];
|
|
25
25
|
}
|
|
26
26
|
onBind() {
|
|
27
|
+
const {points: points, segments: segments} = this.target.attribute, {points: pointsTo, segments: segmentsTo} = this.target.getFinalAttribute();
|
|
28
|
+
this.from = {
|
|
29
|
+
points: points,
|
|
30
|
+
segments: segments
|
|
31
|
+
}, this.to = {
|
|
32
|
+
points: pointsTo,
|
|
33
|
+
segments: segmentsTo
|
|
34
|
+
}, this.props = this.to;
|
|
27
35
|
const originFromPoints = this.getPoints(this.from), originToPoints = this.getPoints(this.to, !0);
|
|
28
36
|
this.fromPoints = originFromPoints ? Array.isArray(originFromPoints) ? originFromPoints : [ originFromPoints ] : [],
|
|
29
37
|
this.toPoints = originToPoints ? Array.isArray(originToPoints) ? originToPoints : [ originToPoints ] : [];
|
|
@@ -63,18 +71,23 @@ class TagPointsUpdate extends custom_animate_1.ACustomAnimate {
|
|
|
63
71
|
})), this.clipRange) {
|
|
64
72
|
if (this.shrinkClipRange) return void (end ? (out.points = this.toPoints, out.clipRange = 1) : (out.points = this.fromPoints,
|
|
65
73
|
out.clipRange = this.clipRange - (this.clipRange - this.shrinkClipRange) * ratio));
|
|
66
|
-
|
|
74
|
+
this.target.setAttributes({
|
|
75
|
+
clipRange: this.clipRange + (1 - this.clipRange) * ratio
|
|
76
|
+
});
|
|
67
77
|
}
|
|
68
78
|
if (this.segmentsCache && this.to.segments) {
|
|
69
79
|
let start = 0;
|
|
70
|
-
|
|
80
|
+
const segments = this.to.segments.map(((segment, index) => {
|
|
71
81
|
const end = start + this.segmentsCache[index], points = this.points.slice(start, end);
|
|
72
82
|
return start = end, Object.assign(Object.assign({}, segment), {
|
|
73
83
|
points: points
|
|
74
84
|
});
|
|
75
85
|
}));
|
|
76
|
-
|
|
86
|
+
this.target.attribute.points = segments;
|
|
87
|
+
} else this.target.attribute.points = this.points;
|
|
88
|
+
this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
|
|
77
89
|
}
|
|
78
90
|
}
|
|
79
91
|
|
|
80
|
-
exports.TagPointsUpdate = TagPointsUpdate;
|
|
92
|
+
exports.TagPointsUpdate = TagPointsUpdate;
|
|
93
|
+
//# sourceMappingURL=tag-points.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/custom/tag-points.ts"],"names":[],"mappings":";;;AACA,6CAA+D;AAC/D,qDAAkD;AAElD,yDAA4D;AAG5D,MAAa,eAAgB,SAAQ,+BAAgE;IAWnG,YACE,IAAS,EACT,EAAO,EACP,QAAgB,EAChB,MAAkB,EAClB,MAA+F;;QAE/F,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAC1C,IAAI,CAAC,mBAAmB,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,mBAAmB,mCAAI,MAAM,CAAC;QACjE,IAAI,CAAC,oBAAoB,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,oBAAoB,mCAAI,GAAG,CAAC;IAClE,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KAAU,EAAE,EAAE;gBAC/D,MAAM,GAAG,GAAG,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;gBAC9C,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;gBAC7C,KAAK,GAAG,GAAG,CAAC;gBACZ,uCACK,OAAO,KACV,MAAM,IACN;YACJ,CAAC,CAAC,CAAC;SACJ;aAAM;YACL,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;SAC1B;IACH,CAAC;CACF;AA5KD,0CA4KC","file":"tag-points.js","sourcesContent":["import type { IPointLike } from '@visactor/vutils';\nimport { clamp, isValidNumber, Point } from '@visactor/vutils';\nimport { ACustomAnimate } from './custom-animate';\nimport type { ISegment } from '@visactor/vrender-core';\nimport { pointInterpolation } from '@visactor/vrender-core';\nimport type { EasingType } from '../intreface/easing';\n\nexport class TagPointsUpdate extends ACustomAnimate<{ points?: IPointLike[]; segments?: ISegment[] }> {\n protected fromPoints: IPointLike[];\n protected toPoints: IPointLike[];\n protected points: IPointLike[];\n protected interpolatePoints: [IPointLike, IPointLike][];\n protected newPointAnimateType: 'grow' | 'appear' | 'clip';\n protected clipRange: number;\n protected shrinkClipRange: number;\n protected clipRangeByDimension: 'x' | 'y';\n protected segmentsCache: number[];\n\n constructor(\n from: any,\n to: any,\n duration: number,\n easing: EasingType,\n params?: { newPointAnimateType?: 'grow' | 'appear' | 'clip'; clipRangeByDimension?: 'x' | 'y' }\n ) {\n super(from, to, duration, easing, params);\n this.newPointAnimateType = params?.newPointAnimateType ?? 'grow';\n this.clipRangeByDimension = params?.clipRangeByDimension ?? 'x';\n }\n\n private getPoints(attribute: typeof this.from, cache = false): IPointLike[] {\n if (attribute.points) {\n return attribute.points;\n }\n\n if (attribute.segments) {\n const points = [] as IPointLike[];\n if (!this.segmentsCache) {\n this.segmentsCache = [];\n }\n attribute.segments.map((segment: any) => {\n if (segment.points) {\n points.push(...segment.points);\n }\n if (cache) {\n this.segmentsCache.push(segment.points?.length ?? 0);\n }\n });\n return points;\n }\n return [];\n }\n\n onBind(): void {\n const originFromPoints = this.getPoints(this.from);\n const originToPoints = this.getPoints(this.to, true);\n this.fromPoints = !originFromPoints ? [] : !Array.isArray(originFromPoints) ? [originFromPoints] : originFromPoints;\n this.toPoints = !originToPoints ? [] : !Array.isArray(originToPoints) ? [originToPoints] : originToPoints;\n\n const tagMap = new Map<string, IPointLike>();\n this.fromPoints.forEach(point => {\n if (point.context) {\n tagMap.set(point.context, point);\n }\n });\n let firstMatchedIndex = Infinity;\n let lastMatchedIndex = -Infinity;\n let firstMatchedPoint: IPointLike;\n let lastMatchedPoint: IPointLike;\n for (let i = 0; i < this.toPoints.length; i += 1) {\n if (tagMap.has(this.toPoints[i].context)) {\n firstMatchedIndex = i;\n firstMatchedPoint = tagMap.get(this.toPoints[i].context);\n break;\n }\n }\n for (let i = this.toPoints.length - 1; i >= 0; i -= 1) {\n if (tagMap.has(this.toPoints[i].context)) {\n lastMatchedIndex = i;\n lastMatchedPoint = tagMap.get(this.toPoints[i].context);\n break;\n }\n }\n\n if (this.newPointAnimateType === 'clip') {\n if (this.toPoints.length !== 0) {\n if (Number.isFinite(lastMatchedIndex)) {\n this.clipRange =\n this.toPoints[lastMatchedIndex][this.clipRangeByDimension] /\n this.toPoints[this.toPoints.length - 1][this.clipRangeByDimension];\n if (this.clipRange === 1) {\n this.shrinkClipRange =\n this.toPoints[lastMatchedIndex][this.clipRangeByDimension] /\n this.fromPoints[this.fromPoints.length - 1][this.clipRangeByDimension];\n }\n if (!isValidNumber(this.clipRange)) {\n this.clipRange = 0;\n } else {\n this.clipRange = clamp(this.clipRange, 0, 1);\n }\n } else {\n this.clipRange = 0;\n }\n }\n }\n // TODO: shrink removed points\n // if no point is matched, animation should start from toPoint[0]\n let prevMatchedPoint = this.toPoints[0];\n this.interpolatePoints = this.toPoints.map((point, index) => {\n const matchedPoint = tagMap.get(point.context);\n if (matchedPoint) {\n prevMatchedPoint = matchedPoint;\n return [matchedPoint, point];\n }\n // appear new point\n if (this.newPointAnimateType === 'appear' || this.newPointAnimateType === 'clip') {\n return [point, point];\n }\n // grow new point\n if (index < firstMatchedIndex && firstMatchedPoint) {\n return [firstMatchedPoint, point];\n } else if (index > lastMatchedIndex && lastMatchedPoint) {\n return [lastMatchedPoint, point];\n }\n return [prevMatchedPoint, point];\n });\n this.points = this.interpolatePoints.map(interpolate => {\n const fromPoint = interpolate[0];\n const toPoint = interpolate[1];\n const newPoint = new Point(fromPoint.x, fromPoint.y, fromPoint.x1, fromPoint.y1);\n newPoint.defined = toPoint.defined;\n newPoint.context = toPoint.context;\n return newPoint;\n });\n }\n\n onFirstRun(): void {\n const lastClipRange = (this.target.attribute as any).clipRange;\n if (isValidNumber(lastClipRange * this.clipRange)) {\n this.clipRange *= lastClipRange;\n }\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n // if not create new points, multi points animation might not work well.\n this.points = this.points.map((point, index) => {\n const newPoint = pointInterpolation(this.interpolatePoints[index][0], this.interpolatePoints[index][1], ratio);\n newPoint.context = point.context;\n return newPoint;\n });\n if (this.clipRange) {\n if (this.shrinkClipRange) {\n // 折线变短\n if (!end) {\n out.points = this.fromPoints;\n out.clipRange = this.clipRange - (this.clipRange - this.shrinkClipRange) * ratio;\n } else {\n out.points = this.toPoints;\n out.clipRange = 1;\n }\n return;\n }\n out.clipRange = this.clipRange + (1 - this.clipRange) * ratio;\n }\n if (this.segmentsCache && this.to.segments) {\n let start = 0;\n out.segments = this.to.segments.map((segment: any, index: any) => {\n const end = start + this.segmentsCache[index];\n const points = this.points.slice(start, end);\n start = end;\n return {\n ...segment,\n points\n };\n });\n } else {\n out.points = this.points;\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/custom/tag-points.ts"],"names":[],"mappings":";;;AAAA,6CAAgF;AAEhF,yDAA4D;AAC5D,qDAAkD;AAElD,MAAa,eAA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CAAC,SAA4B,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;SAChE;QACD,IAAI,CAAC,MAAM,CAAC,oBAAoB,EAAE,CAAC;QACnC,IAAI,CAAC,MAAM,CAAC,0BAA0B,EAAE,CAAC;IAC3C,CAAC;CACF;AAtLD,0CAsLC","file":"tag-points.js","sourcesContent":["import { clamp, isValidNumber, Point, type IPointLike } from '@visactor/vutils';\nimport type { ISegment, ILineAttribute, EasingType } from '@visactor/vrender-core';\nimport { pointInterpolation } from '@visactor/vrender-core';\nimport { ACustomAnimate } from './custom-animate';\n\nexport class TagPointsUpdate extends ACustomAnimate<{ points?: IPointLike[]; segments?: ISegment[] }> {\n protected fromPoints: IPointLike[];\n protected toPoints: IPointLike[];\n protected points: IPointLike[];\n protected interpolatePoints: [IPointLike, IPointLike][];\n protected newPointAnimateType: 'grow' | 'appear' | 'clip';\n protected clipRange: number;\n protected shrinkClipRange: number;\n protected clipRangeByDimension: 'x' | 'y';\n protected segmentsCache: number[];\n\n constructor(\n from: any,\n to: any,\n duration: number,\n easing: EasingType,\n params?: { newPointAnimateType?: 'grow' | 'appear' | 'clip'; clipRangeByDimension?: 'x' | 'y' }\n ) {\n super(from, to, duration, easing, params);\n this.newPointAnimateType = params?.newPointAnimateType ?? 'grow';\n this.clipRangeByDimension = params?.clipRangeByDimension ?? 'x';\n }\n\n private getPoints(attribute: typeof this.from, cache = false): IPointLike[] {\n if (attribute.points) {\n return attribute.points;\n }\n\n if (attribute.segments) {\n const points = [] as IPointLike[];\n if (!this.segmentsCache) {\n this.segmentsCache = [];\n }\n attribute.segments.map((segment: any) => {\n if (segment.points) {\n points.push(...segment.points);\n }\n if (cache) {\n this.segmentsCache.push(segment.points?.length ?? 0);\n }\n });\n return points;\n }\n return [];\n }\n\n onBind(): void {\n const { points, segments } = this.target.attribute as any;\n const { points: pointsTo, segments: segmentsTo } = this.target.getFinalAttribute() as any;\n\n this.from = { points, segments };\n this.to = { points: pointsTo, segments: segmentsTo };\n this.props = this.to;\n\n const originFromPoints = this.getPoints(this.from);\n const originToPoints = this.getPoints(this.to, true);\n this.fromPoints = !originFromPoints ? [] : !Array.isArray(originFromPoints) ? [originFromPoints] : originFromPoints;\n this.toPoints = !originToPoints ? [] : !Array.isArray(originToPoints) ? [originToPoints] : originToPoints;\n\n const tagMap = new Map<string, IPointLike>();\n this.fromPoints.forEach(point => {\n if (point.context) {\n tagMap.set(point.context, point);\n }\n });\n let firstMatchedIndex = Infinity;\n let lastMatchedIndex = -Infinity;\n let firstMatchedPoint: IPointLike;\n let lastMatchedPoint: IPointLike;\n for (let i = 0; i < this.toPoints.length; i += 1) {\n if (tagMap.has(this.toPoints[i].context)) {\n firstMatchedIndex = i;\n firstMatchedPoint = tagMap.get(this.toPoints[i].context);\n break;\n }\n }\n for (let i = this.toPoints.length - 1; i >= 0; i -= 1) {\n if (tagMap.has(this.toPoints[i].context)) {\n lastMatchedIndex = i;\n lastMatchedPoint = tagMap.get(this.toPoints[i].context);\n break;\n }\n }\n\n if (this.newPointAnimateType === 'clip') {\n if (this.toPoints.length !== 0) {\n if (Number.isFinite(lastMatchedIndex)) {\n this.clipRange =\n this.toPoints[lastMatchedIndex][this.clipRangeByDimension] /\n this.toPoints[this.toPoints.length - 1][this.clipRangeByDimension];\n if (this.clipRange === 1) {\n this.shrinkClipRange =\n this.toPoints[lastMatchedIndex][this.clipRangeByDimension] /\n this.fromPoints[this.fromPoints.length - 1][this.clipRangeByDimension];\n }\n if (!isValidNumber(this.clipRange)) {\n this.clipRange = 0;\n } else {\n this.clipRange = clamp(this.clipRange, 0, 1);\n }\n } else {\n this.clipRange = 0;\n }\n }\n }\n // TODO: shrink removed points\n // if no point is matched, animation should start from toPoint[0]\n let prevMatchedPoint = this.toPoints[0];\n this.interpolatePoints = this.toPoints.map((point, index) => {\n const matchedPoint = tagMap.get(point.context);\n if (matchedPoint) {\n prevMatchedPoint = matchedPoint;\n return [matchedPoint, point];\n }\n // appear new point\n if (this.newPointAnimateType === 'appear' || this.newPointAnimateType === 'clip') {\n return [point, point];\n }\n // grow new point\n if (index < firstMatchedIndex && firstMatchedPoint) {\n return [firstMatchedPoint, point];\n } else if (index > lastMatchedIndex && lastMatchedPoint) {\n return [lastMatchedPoint, point];\n }\n return [prevMatchedPoint, point];\n });\n this.points = this.interpolatePoints.map(interpolate => {\n const fromPoint = interpolate[0];\n const toPoint = interpolate[1];\n const newPoint = new Point(fromPoint.x, fromPoint.y, fromPoint.x1, fromPoint.y1);\n newPoint.defined = toPoint.defined;\n newPoint.context = toPoint.context;\n return newPoint;\n });\n }\n\n onFirstRun(): void {\n const lastClipRange = (this.target.attribute as any).clipRange;\n if (isValidNumber(lastClipRange * this.clipRange)) {\n this.clipRange *= lastClipRange;\n }\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n // if not create new points, multi points animation might not work well.\n this.points = this.points.map((point, index) => {\n const newPoint = pointInterpolation(this.interpolatePoints[index][0], this.interpolatePoints[index][1], ratio);\n newPoint.context = point.context;\n return newPoint;\n });\n if (this.clipRange) {\n if (this.shrinkClipRange) {\n // 折线变短\n if (!end) {\n out.points = this.fromPoints;\n out.clipRange = this.clipRange - (this.clipRange - this.shrinkClipRange) * ratio;\n } else {\n out.points = this.toPoints;\n out.clipRange = 1;\n }\n return;\n }\n this.target.setAttributes({ clipRange: this.clipRange + (1 - this.clipRange) * ratio } as any);\n }\n if (this.segmentsCache && this.to.segments) {\n let start = 0;\n const segments = this.to.segments.map((segment: any, index: any) => {\n const end = start + this.segmentsCache[index];\n const points = this.points.slice(start, end);\n start = end;\n return {\n ...segment,\n points\n };\n });\n (this.target.attribute as ILineAttribute).points = segments;\n } else {\n (this.target.attribute as ILineAttribute).points = this.points;\n }\n this.target.addUpdatePositionTag();\n this.target.addUpdateShapeAndBoundsTag();\n }\n}\n"]}
|
package/cjs/custom/update.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { EasingType } from '
|
|
1
|
+
import type { EasingType } from '@visactor/vrender-core';
|
|
2
2
|
import { ACustomAnimate } from './custom-animate';
|
|
3
3
|
export interface IUpdateAnimationOptions {
|
|
4
4
|
diffAttrs: Record<string, any>;
|
|
@@ -9,5 +9,6 @@ export interface IUpdateAnimationOptions {
|
|
|
9
9
|
export declare class Update extends ACustomAnimate<Record<string, number>> {
|
|
10
10
|
valid: boolean;
|
|
11
11
|
constructor(from: null, to: null, duration: number, easing: EasingType, params?: IUpdateAnimationOptions);
|
|
12
|
+
onBind(): void;
|
|
12
13
|
update(end: boolean, ratio: number, out: Record<string, any>): void;
|
|
13
14
|
}
|
package/cjs/custom/update.js
CHANGED
|
@@ -8,8 +8,16 @@ const custom_animate_1 = require("./custom-animate");
|
|
|
8
8
|
|
|
9
9
|
class Update extends custom_animate_1.ACustomAnimate {
|
|
10
10
|
constructor(from, to, duration, easing, params) {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
super(from, to, duration, easing, params);
|
|
12
|
+
}
|
|
13
|
+
onBind() {
|
|
14
|
+
var _a, _b;
|
|
15
|
+
let {diffAttrs: diffAttrs = {}} = null !== (_a = this.target.context) && void 0 !== _a ? _a : {};
|
|
16
|
+
const {options: options} = this.params;
|
|
17
|
+
(null === (_b = null == options ? void 0 : options.excludeChannels) || void 0 === _b ? void 0 : _b.length) && (diffAttrs = Object.assign({}, diffAttrs),
|
|
18
|
+
options.excludeChannels.forEach((channel => {
|
|
19
|
+
delete diffAttrs[channel];
|
|
20
|
+
}))), this.props = diffAttrs;
|
|
13
21
|
}
|
|
14
22
|
update(end, ratio, out) {
|
|
15
23
|
if (this.onStart(), !this.props || !this.propKeys) return;
|
package/cjs/custom/update.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/custom/update.ts"],"names":[],"mappings":";;;AACA,qDAAkD;AAclD,MAAa,MAAO,SAAQ,+BAAsC;IAIhE,YAAY,IAAU,EAAE,EAAQ,EAAE,QAAgB,EAAE,MAAkB,EAAE,MAAgC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E,IAAI,CAAC,MAAM,CAAC;YACnG,CAAC,CAAC,IAAI,CAAC,0BAA0B,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;gBAEtD,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE;oBACjD,OAAO;iBACR;gBACD,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;gBACjC,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;gBACtC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBAChC,IAAI,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YAC/D,CAAC,CAAC,CAAC;QACP,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,CAAC,CAAC;IACtC,CAAC;CACF;AA5CD,wBA4CC","file":"update.js","sourcesContent":["import type { EasingType } from '@visactor/vrender-core';\nimport { ACustomAnimate } from './custom-animate';\n\nexport interface IUpdateAnimationOptions {\n diffAttrs: Record<string, any>;\n animationState: string;\n diffState: string;\n data: Record<string, any>[];\n}\n\n/**\n * 文本输入动画,实现类似打字机的字符逐个显示效果\n * 支持通过beforeText和afterText参数添加前缀和后缀\n * 支持通过showCursor参数显示光标,cursorChar自定义光标字符\n */\nexport class Update extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n // params: IUpdateAnimationOptions;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: IUpdateAnimationOptions) {\n super(from, to, duration, easing, params);\n // this.params = params;\n }\n\n onBind() {\n let { diffAttrs = {} } = this.target.context ?? ({} as any);\n const { options } = this.params as any;\n\n if (options?.excludeChannels?.length) {\n diffAttrs = { ...diffAttrs };\n options.excludeChannels.forEach((channel: string) => {\n delete diffAttrs[channel];\n });\n }\n\n this.props = diffAttrs;\n }\n\n update(end: boolean, ratio: number, out: Record<string, any>): void {\n this.onStart();\n if (!this.props || !this.propKeys) {\n return;\n }\n // 应用缓动函数\n const easedRatio = this.easing(ratio);\n this.animate.interpolateUpdateFunction\n ? this.animate.interpolateUpdateFunction(this.fromProps, this.props, easedRatio, this, this.target)\n : this.interpolateUpdateFunctions.forEach((func, index) => {\n // 如果这个属性被屏蔽了,直接跳过\n if (!this.animate.validAttr(this.propKeys[index])) {\n return;\n }\n const key = this.propKeys[index];\n const fromValue = this.fromProps[key];\n const toValue = this.props[key];\n func(key, fromValue, toValue, easedRatio, this, this.target);\n });\n this.onUpdate(end, easedRatio, out);\n }\n}\n"]}
|