vevet 3.0.0-beta.2 → 3.0.0-beta.3
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/lib/cjs/version.js +1 -1
- package/lib/esm/Application/events/PageLoad/index.js +28 -54
- package/lib/esm/Application/events/PageLoad/index.js.map +1 -1
- package/lib/esm/Application/events/Viewport/index.js +107 -180
- package/lib/esm/Application/events/Viewport/index.js.map +1 -1
- package/lib/esm/Application/index.js +96 -178
- package/lib/esm/Application/index.js.map +1 -1
- package/lib/esm/base/Callbacks/index.js +45 -78
- package/lib/esm/base/Callbacks/index.js.map +1 -1
- package/lib/esm/base/Component/index.js +10 -31
- package/lib/esm/base/Component/index.js.map +1 -1
- package/lib/esm/base/Module/index.js +77 -132
- package/lib/esm/base/Module/index.js.map +1 -1
- package/lib/esm/base/MutableProps/index.js +30 -49
- package/lib/esm/base/MutableProps/index.js.map +1 -1
- package/lib/esm/base/Plugin/index.js +13 -35
- package/lib/esm/base/Plugin/index.js.map +1 -1
- package/lib/esm/components/AnimationFrame/index.js +55 -98
- package/lib/esm/components/AnimationFrame/index.js.map +1 -1
- package/lib/esm/components/BaseTimeline/index.js +41 -88
- package/lib/esm/components/BaseTimeline/index.js.map +1 -1
- package/lib/esm/components/Ctx2D/index.js +82 -150
- package/lib/esm/components/Ctx2D/index.js.map +1 -1
- package/lib/esm/components/Ctx2DPrerender/index.js +20 -54
- package/lib/esm/components/Ctx2DPrerender/index.js.map +1 -1
- package/lib/esm/components/CustomCursor/index.js +149 -216
- package/lib/esm/components/CustomCursor/index.js.map +1 -1
- package/lib/esm/components/DraggerBase/index.js +98 -164
- package/lib/esm/components/DraggerBase/index.js.map +1 -1
- package/lib/esm/components/DraggerDirection/index.js +10 -42
- package/lib/esm/components/DraggerDirection/index.js.map +1 -1
- package/lib/esm/components/DraggerMove/index.js +42 -83
- package/lib/esm/components/DraggerMove/index.js.map +1 -1
- package/lib/esm/components/Preloader/index.js +77 -135
- package/lib/esm/components/Preloader/index.js.map +1 -1
- package/lib/esm/components/ProgressPreloader/index.js +112 -190
- package/lib/esm/components/ProgressPreloader/index.js.map +1 -1
- package/lib/esm/components/ProgressPreloader/utils/preloadCustomElement.js +9 -10
- package/lib/esm/components/ProgressPreloader/utils/preloadCustomElement.js.map +1 -1
- package/lib/esm/components/ProgressPreloader/utils/preloadImage.js +3 -3
- package/lib/esm/components/ProgressPreloader/utils/preloadImage.js.map +1 -1
- package/lib/esm/components/ProgressPreloader/utils/preloadVideo.js +2 -2
- package/lib/esm/components/ProgressPreloader/utils/preloadVideo.js.map +1 -1
- package/lib/esm/components/ScrollBar/Bar/index.js +90 -136
- package/lib/esm/components/ScrollBar/Bar/index.js.map +1 -1
- package/lib/esm/components/ScrollBar/index.js +70 -118
- package/lib/esm/components/ScrollBar/index.js.map +1 -1
- package/lib/esm/components/ScrollView/index.js +103 -154
- package/lib/esm/components/ScrollView/index.js.map +1 -1
- package/lib/esm/components/SectionScrollProgress/index.js +95 -170
- package/lib/esm/components/SectionScrollProgress/index.js.map +1 -1
- package/lib/esm/components/SmoothScroll/AnimatonFrame.js +20 -37
- package/lib/esm/components/SmoothScroll/AnimatonFrame.js.map +1 -1
- package/lib/esm/components/SmoothScroll/Elements.js +42 -59
- package/lib/esm/components/SmoothScroll/Elements.js.map +1 -1
- package/lib/esm/components/SmoothScroll/index.js +205 -304
- package/lib/esm/components/SmoothScroll/index.js.map +1 -1
- package/lib/esm/components/SmoothScrollDragPlugin/index.js +48 -86
- package/lib/esm/components/SmoothScrollDragPlugin/index.js.map +1 -1
- package/lib/esm/components/SmoothScrollKeyboardPlugin/index.js +34 -70
- package/lib/esm/components/SmoothScrollKeyboardPlugin/index.js.map +1 -1
- package/lib/esm/components/SplitText/index.js +117 -177
- package/lib/esm/components/SplitText/index.js.map +1 -1
- package/lib/esm/components/Timeline/index.js +45 -88
- package/lib/esm/components/Timeline/index.js.map +1 -1
- package/lib/esm/utils/common/mergeWithoutArrays.js +1 -1
- package/lib/esm/utils/common/mergeWithoutArrays.js.map +1 -1
- package/lib/esm/utils/common/normalizedTimeoutCallback.js +3 -3
- package/lib/esm/utils/common/normalizedTimeoutCallback.js.map +1 -1
- package/lib/esm/utils/common/pickObjectProps.js +2 -2
- package/lib/esm/utils/common/pickObjectProps.js.map +1 -1
- package/lib/esm/utils/common/times.js +2 -2
- package/lib/esm/utils/common/times.js.map +1 -1
- package/lib/esm/utils/common/uid.js +3 -4
- package/lib/esm/utils/common/uid.js.map +1 -1
- package/lib/esm/utils/image/load.js +15 -26
- package/lib/esm/utils/image/load.js.map +1 -1
- package/lib/esm/utils/image/pathsToProps.js +5 -5
- package/lib/esm/utils/image/pathsToProps.js.map +1 -1
- package/lib/esm/utils/image/sizesToSrcSet.js +5 -5
- package/lib/esm/utils/image/sizesToSrcSet.js.map +1 -1
- package/lib/esm/utils/internal/fetchWebpSupport.js +3 -3
- package/lib/esm/utils/internal/fetchWebpSupport.js.map +1 -1
- package/lib/esm/utils/internal/getDeviceInfo.js +7 -7
- package/lib/esm/utils/internal/getDeviceInfo.js.map +1 -1
- package/lib/esm/utils/internal/onResize.js +13 -16
- package/lib/esm/utils/internal/onResize.js.map +1 -1
- package/lib/esm/utils/math/clamp.js +1 -2
- package/lib/esm/utils/math/clamp.js.map +1 -1
- package/lib/esm/utils/math/clampScope.js +1 -3
- package/lib/esm/utils/math/clampScope.js.map +1 -1
- package/lib/esm/utils/math/easing.js +1 -5
- package/lib/esm/utils/math/easing.js.map +1 -1
- package/lib/esm/utils/math/inScope.js +1 -2
- package/lib/esm/utils/math/inScope.js.map +1 -1
- package/lib/esm/utils/math/lerp.js +3 -4
- package/lib/esm/utils/math/lerp.js.map +1 -1
- package/lib/esm/utils/math/normalizeNestedScope.js +1 -1
- package/lib/esm/utils/math/normalizeNestedScope.js.map +1 -1
- package/lib/esm/utils/math/scoped.js +2 -3
- package/lib/esm/utils/math/scoped.js.map +1 -1
- package/lib/esm/utils/math/spreadScope.js +5 -5
- package/lib/esm/utils/math/spreadScope.js.map +1 -1
- package/lib/esm/utils/math/wrap.js +2 -2
- package/lib/esm/utils/math/wrap.js.map +1 -1
- package/lib/esm/utils/scroll/getScrollValues.js +5 -6
- package/lib/esm/utils/scroll/getScrollValues.js.map +1 -1
- package/lib/esm/utils/scroll/onScroll.js +20 -23
- package/lib/esm/utils/scroll/onScroll.js.map +1 -1
- package/lib/esm/utils/scroll/scrollTo.js +10 -12
- package/lib/esm/utils/scroll/scrollTo.js.map +1 -1
- package/lib/esm/utils/scroll/scrollToElement.js +8 -19
- package/lib/esm/utils/scroll/scrollToElement.js.map +1 -1
- package/lib/esm/version.js +1 -1
- package/lib/esm/version.js.map +1 -1
- package/lib/esm/vevet.js +1 -1
- package/lib/esm/vevet.js.map +1 -1
- package/lib/types/version.d.ts +1 -1
- package/package.json +2 -2
- package/src/version.ts +1 -1
|
@@ -1,29 +1,3 @@
|
|
|
1
|
-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
if (typeof b !== "function" && b !== null)
|
|
10
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
-
extendStatics(d, b);
|
|
12
|
-
function __() { this.constructor = d; }
|
|
13
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
-
};
|
|
15
|
-
})();
|
|
16
|
-
var __assign = (this && this.__assign) || function () {
|
|
17
|
-
__assign = Object.assign || function(t) {
|
|
18
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
19
|
-
s = arguments[i];
|
|
20
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
21
|
-
t[p] = s[p];
|
|
22
|
-
}
|
|
23
|
-
return t;
|
|
24
|
-
};
|
|
25
|
-
return __assign.apply(this, arguments);
|
|
26
|
-
};
|
|
27
1
|
import { selectOne } from 'vevet-dom';
|
|
28
2
|
import { Component as ComponentClass } from '../../base/Component';
|
|
29
3
|
import { clampScope } from '../../utils/math';
|
|
@@ -32,157 +6,113 @@ import { onResize } from '../../utils/internal/onResize';
|
|
|
32
6
|
/**
|
|
33
7
|
* Trace scroll progress of a section
|
|
34
8
|
*/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
9
|
+
export class SectionScrollProgress extends ComponentClass {
|
|
10
|
+
_getDefaultProps() {
|
|
11
|
+
return Object.assign(Object.assign({}, super._getDefaultProps()), { container: window, viewportTarget: 'any', resizeTimeout: 0 });
|
|
12
|
+
}
|
|
13
|
+
/** Scroll container */
|
|
14
|
+
get scrollContainer() {
|
|
15
|
+
return this._scrollContainer;
|
|
16
|
+
}
|
|
17
|
+
/** Section element */
|
|
18
|
+
get section() {
|
|
19
|
+
return this._section;
|
|
20
|
+
}
|
|
21
|
+
/** Scrolling scope */
|
|
22
|
+
get scopeGlobal() {
|
|
23
|
+
return this._scopeGlobal;
|
|
24
|
+
}
|
|
25
|
+
/** Scope of element appearing from bottom to top */
|
|
26
|
+
get scopeIn() {
|
|
27
|
+
return this._scopeIn;
|
|
28
|
+
}
|
|
29
|
+
/** Scope of element moving */
|
|
30
|
+
get scopeMove() {
|
|
31
|
+
return this._scopeMove;
|
|
32
|
+
}
|
|
33
|
+
/** Scope of element disappearing from bottom to top */
|
|
34
|
+
get scopeOut() {
|
|
35
|
+
return this._scopeOut;
|
|
36
|
+
}
|
|
37
|
+
/** Global progress */
|
|
38
|
+
get progressGlobal() {
|
|
39
|
+
return this._progressGlobal;
|
|
40
|
+
}
|
|
41
|
+
set progressGlobal(value) {
|
|
42
|
+
this._progressGlobal = value;
|
|
43
|
+
}
|
|
44
|
+
constructor(initialProps, canInit = true) {
|
|
45
|
+
super(initialProps, false);
|
|
46
|
+
const { container, section } = this.props;
|
|
41
47
|
// get scroll container
|
|
42
48
|
if (typeof container === 'string') {
|
|
43
|
-
|
|
49
|
+
this._scrollContainer = selectOne(container);
|
|
44
50
|
}
|
|
45
51
|
else {
|
|
46
|
-
|
|
52
|
+
this._scrollContainer = container;
|
|
47
53
|
}
|
|
48
54
|
// get section element
|
|
49
|
-
|
|
55
|
+
this._section = selectOne(section);
|
|
50
56
|
// set defaults
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
this._prevProgressGlobal = -0.001;
|
|
58
|
+
this._progressGlobal = -0.001;
|
|
59
|
+
this._scopeGlobal = [0, 0];
|
|
60
|
+
this._scopeIn = [0, 0];
|
|
61
|
+
this._scopeMove = [0, 0];
|
|
62
|
+
this._scopeOut = [0, 0];
|
|
63
|
+
this._frameThrottleIndex = 0;
|
|
58
64
|
// initialize the class
|
|
59
65
|
if (canInit) {
|
|
60
|
-
|
|
66
|
+
this.init();
|
|
61
67
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
return __assign(__assign({}, _super.prototype._getDefaultProps.call(this)), { container: window, viewportTarget: 'any', resizeTimeout: 0 });
|
|
66
|
-
};
|
|
67
|
-
Object.defineProperty(SectionScrollProgress.prototype, "scrollContainer", {
|
|
68
|
-
/** Scroll container */
|
|
69
|
-
get: function () {
|
|
70
|
-
return this._scrollContainer;
|
|
71
|
-
},
|
|
72
|
-
enumerable: false,
|
|
73
|
-
configurable: true
|
|
74
|
-
});
|
|
75
|
-
Object.defineProperty(SectionScrollProgress.prototype, "section", {
|
|
76
|
-
/** Section element */
|
|
77
|
-
get: function () {
|
|
78
|
-
return this._section;
|
|
79
|
-
},
|
|
80
|
-
enumerable: false,
|
|
81
|
-
configurable: true
|
|
82
|
-
});
|
|
83
|
-
Object.defineProperty(SectionScrollProgress.prototype, "scopeGlobal", {
|
|
84
|
-
/** Scrolling scope */
|
|
85
|
-
get: function () {
|
|
86
|
-
return this._scopeGlobal;
|
|
87
|
-
},
|
|
88
|
-
enumerable: false,
|
|
89
|
-
configurable: true
|
|
90
|
-
});
|
|
91
|
-
Object.defineProperty(SectionScrollProgress.prototype, "scopeIn", {
|
|
92
|
-
/** Scope of element appearing from bottom to top */
|
|
93
|
-
get: function () {
|
|
94
|
-
return this._scopeIn;
|
|
95
|
-
},
|
|
96
|
-
enumerable: false,
|
|
97
|
-
configurable: true
|
|
98
|
-
});
|
|
99
|
-
Object.defineProperty(SectionScrollProgress.prototype, "scopeMove", {
|
|
100
|
-
/** Scope of element moving */
|
|
101
|
-
get: function () {
|
|
102
|
-
return this._scopeMove;
|
|
103
|
-
},
|
|
104
|
-
enumerable: false,
|
|
105
|
-
configurable: true
|
|
106
|
-
});
|
|
107
|
-
Object.defineProperty(SectionScrollProgress.prototype, "scopeOut", {
|
|
108
|
-
/** Scope of element disappearing from bottom to top */
|
|
109
|
-
get: function () {
|
|
110
|
-
return this._scopeOut;
|
|
111
|
-
},
|
|
112
|
-
enumerable: false,
|
|
113
|
-
configurable: true
|
|
114
|
-
});
|
|
115
|
-
Object.defineProperty(SectionScrollProgress.prototype, "progressGlobal", {
|
|
116
|
-
/** Global progress */
|
|
117
|
-
get: function () {
|
|
118
|
-
return this._progressGlobal;
|
|
119
|
-
},
|
|
120
|
-
set: function (value) {
|
|
121
|
-
this._progressGlobal = value;
|
|
122
|
-
},
|
|
123
|
-
enumerable: false,
|
|
124
|
-
configurable: true
|
|
125
|
-
});
|
|
126
|
-
SectionScrollProgress.prototype._init = function () {
|
|
127
|
-
_super.prototype._init.call(this);
|
|
68
|
+
}
|
|
69
|
+
_init() {
|
|
70
|
+
super._init();
|
|
128
71
|
this._setEvents();
|
|
129
|
-
}
|
|
72
|
+
}
|
|
130
73
|
/** Set events */
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
onResize: function () { return _this.resize(); },
|
|
74
|
+
_setEvents() {
|
|
75
|
+
const { viewportTarget, resizeDebounce } = this.props;
|
|
76
|
+
const resizeHandler = onResize({
|
|
77
|
+
onResize: () => this.resize(),
|
|
136
78
|
element: this.section,
|
|
137
|
-
viewportTarget
|
|
79
|
+
viewportTarget,
|
|
138
80
|
hasBothEvents: true,
|
|
139
|
-
resizeDebounce
|
|
81
|
+
resizeDebounce,
|
|
140
82
|
});
|
|
141
|
-
|
|
142
|
-
loadEvent.then(
|
|
83
|
+
const loadEvent = this.app.onPageLoad();
|
|
84
|
+
loadEvent.then(() => resizeHandler.debounceResize()).catch(() => { });
|
|
143
85
|
// set scroll events
|
|
144
|
-
|
|
86
|
+
const scrollEvent = onScroll({
|
|
145
87
|
container: this.scrollContainer,
|
|
146
|
-
callback:
|
|
88
|
+
callback: (data) => this._render(data),
|
|
147
89
|
});
|
|
148
90
|
// destroy events
|
|
149
|
-
this.addDestroyableAction(
|
|
91
|
+
this.addDestroyableAction(() => {
|
|
150
92
|
resizeHandler.remove();
|
|
151
93
|
loadEvent.cancel();
|
|
152
94
|
scrollEvent.remove();
|
|
153
95
|
});
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
|
|
96
|
+
}
|
|
97
|
+
_onPropsMutate() {
|
|
98
|
+
super._onPropsMutate();
|
|
157
99
|
this.resize();
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
},
|
|
172
|
-
enumerable: false,
|
|
173
|
-
configurable: true
|
|
174
|
-
});
|
|
175
|
-
Object.defineProperty(SectionScrollProgress.prototype, "progressMove", {
|
|
176
|
-
/** 'move' progress */
|
|
177
|
-
get: function () {
|
|
178
|
-
return clampScope(this.progressGlobal, this.scopeMove) || 0;
|
|
179
|
-
},
|
|
180
|
-
enumerable: false,
|
|
181
|
-
configurable: true
|
|
182
|
-
});
|
|
100
|
+
}
|
|
101
|
+
/** 'in' progress */
|
|
102
|
+
get progressIn() {
|
|
103
|
+
return clampScope(this.progressGlobal, this.scopeIn) || 0;
|
|
104
|
+
}
|
|
105
|
+
/** 'out' progress */
|
|
106
|
+
get progressOut() {
|
|
107
|
+
return clampScope(this.progressGlobal, this.scopeOut) || 0;
|
|
108
|
+
}
|
|
109
|
+
/** 'move' progress */
|
|
110
|
+
get progressMove() {
|
|
111
|
+
return clampScope(this.progressGlobal, this.scopeMove) || 0;
|
|
112
|
+
}
|
|
183
113
|
/** Resize the scene */
|
|
184
|
-
|
|
185
|
-
|
|
114
|
+
resize() {
|
|
115
|
+
const scrollValues = getScrollValues(this.scrollContainer);
|
|
186
116
|
if (!scrollValues) {
|
|
187
117
|
return;
|
|
188
118
|
}
|
|
@@ -190,30 +120,27 @@ var SectionScrollProgress = /** @class */ (function (_super) {
|
|
|
190
120
|
this.callbacks.tbt('resize', undefined);
|
|
191
121
|
// render the scene
|
|
192
122
|
this._render(scrollValues, true);
|
|
193
|
-
}
|
|
123
|
+
}
|
|
194
124
|
/** Calculate scopes */
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
var sectionBounding = this.section.getBoundingClientRect();
|
|
125
|
+
_calculateScopes({ scrollTop }) {
|
|
126
|
+
const { height: vHeight } = this.app.viewport;
|
|
127
|
+
const sectionBounding = this.section.getBoundingClientRect();
|
|
199
128
|
// calculate scroll scope
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
129
|
+
const inStart = scrollTop + sectionBounding.top - vHeight;
|
|
130
|
+
const moveEnd = scrollTop + sectionBounding.top + sectionBounding.height;
|
|
131
|
+
const scrollLine = moveEnd - inStart;
|
|
203
132
|
this._scopeGlobal = [inStart, moveEnd];
|
|
204
133
|
// calculate other scopes
|
|
205
134
|
this._scopeIn = [0, vHeight / scrollLine];
|
|
206
135
|
this._scopeOut = [1 - vHeight / scrollLine, 1];
|
|
207
136
|
this._scopeMove = [this._scopeIn[1], this._scopeOut[0]];
|
|
208
|
-
}
|
|
137
|
+
}
|
|
209
138
|
/** Check if the section can be rendered */
|
|
210
|
-
|
|
211
|
-
if (isForce === void 0) { isForce = false; }
|
|
139
|
+
_canRender(isForce = false) {
|
|
212
140
|
return isForce || this.progressGlobal !== this._prevProgressGlobal;
|
|
213
|
-
}
|
|
141
|
+
}
|
|
214
142
|
/** Render the scene */
|
|
215
|
-
|
|
216
|
-
if (isForce === void 0) { isForce = false; }
|
|
143
|
+
_render(scrollValues, isForce = false) {
|
|
217
144
|
this._frameThrottleIndex += 1;
|
|
218
145
|
if (this._frameThrottleIndex % 60 === 0 || isForce) {
|
|
219
146
|
this._calculateScopes(scrollValues);
|
|
@@ -224,8 +151,6 @@ var SectionScrollProgress = /** @class */ (function (_super) {
|
|
|
224
151
|
return;
|
|
225
152
|
}
|
|
226
153
|
this.callbacks.tbt('render', undefined);
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
}(ComponentClass));
|
|
230
|
-
export { SectionScrollProgress };
|
|
154
|
+
}
|
|
155
|
+
}
|
|
231
156
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/SectionScrollProgress/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/SectionScrollProgress/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAGtC,OAAO,EAAE,SAAS,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAoB,eAAe,EAAE,QAAQ,EAAE,MAAM,gBAA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,GAAG,UAAU,CAAC,YAAY,CAAC,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAE5E,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;YAC7B,OAAO;SACR;QAED,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IAC1C,CAAC;CACF"}
|
|
@@ -1,61 +1,44 @@
|
|
|
1
1
|
import { AnimationFrame as AnimationFrameClass } from '../AnimationFrame';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
export class AnimationFrame {
|
|
3
|
+
get animationFrame() {
|
|
4
|
+
return (this.props.outerAnimationFrame || this._innerAnimationFrame);
|
|
5
|
+
}
|
|
6
|
+
get easeMultiplier() {
|
|
7
|
+
return this.animationFrame.easeMultiplier;
|
|
8
|
+
}
|
|
9
|
+
get props() {
|
|
10
|
+
return this._props;
|
|
11
|
+
}
|
|
12
|
+
constructor(_props) {
|
|
4
13
|
this._props = _props;
|
|
5
14
|
}
|
|
6
|
-
|
|
7
|
-
get: function () {
|
|
8
|
-
return (this.props.outerAnimationFrame || this._innerAnimationFrame);
|
|
9
|
-
},
|
|
10
|
-
enumerable: false,
|
|
11
|
-
configurable: true
|
|
12
|
-
});
|
|
13
|
-
Object.defineProperty(AnimationFrame.prototype, "easeMultiplier", {
|
|
14
|
-
get: function () {
|
|
15
|
-
return this.animationFrame.easeMultiplier;
|
|
16
|
-
},
|
|
17
|
-
enumerable: false,
|
|
18
|
-
configurable: true
|
|
19
|
-
});
|
|
20
|
-
Object.defineProperty(AnimationFrame.prototype, "props", {
|
|
21
|
-
get: function () {
|
|
22
|
-
return this._props;
|
|
23
|
-
},
|
|
24
|
-
enumerable: false,
|
|
25
|
-
configurable: true
|
|
26
|
-
});
|
|
27
|
-
AnimationFrame.prototype.enable = function () {
|
|
28
|
-
var _this = this;
|
|
15
|
+
enable() {
|
|
29
16
|
// set animation callback for the outer AnimationFrame
|
|
30
17
|
if (this.props.outerAnimationFrame) {
|
|
31
18
|
if (!this._animationFrameEvent) {
|
|
32
|
-
this._animationFrameEvent = this.props.outerAnimationFrame.addCallback('frame',
|
|
19
|
+
this._animationFrameEvent = this.props.outerAnimationFrame.addCallback('frame', () => this.props.callback(), { name: 'SmoothScroll' });
|
|
33
20
|
}
|
|
34
21
|
return;
|
|
35
22
|
}
|
|
36
23
|
// otherwise, check if inner AnimationFrame is created
|
|
37
24
|
if (!this._innerAnimationFrame) {
|
|
38
25
|
this._innerAnimationFrame = new AnimationFrameClass({ fps: 'auto' });
|
|
39
|
-
this._innerAnimationFrame.addCallback('frame',
|
|
40
|
-
return _this.props.callback();
|
|
41
|
-
});
|
|
26
|
+
this._innerAnimationFrame.addCallback('frame', () => this.props.callback());
|
|
42
27
|
}
|
|
43
28
|
// play
|
|
44
29
|
this._innerAnimationFrame.play();
|
|
45
|
-
}
|
|
30
|
+
}
|
|
46
31
|
/** Disable scrolling */
|
|
47
|
-
|
|
32
|
+
disable() {
|
|
48
33
|
var _a, _b;
|
|
49
34
|
(_a = this._animationFrameEvent) === null || _a === void 0 ? void 0 : _a.remove();
|
|
50
35
|
this._animationFrameEvent = undefined;
|
|
51
36
|
(_b = this._innerAnimationFrame) === null || _b === void 0 ? void 0 : _b.pause();
|
|
52
|
-
}
|
|
53
|
-
|
|
37
|
+
}
|
|
38
|
+
destroy() {
|
|
54
39
|
var _a;
|
|
55
40
|
this.disable();
|
|
56
41
|
(_a = this._innerAnimationFrame) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
}());
|
|
60
|
-
export { AnimationFrame };
|
|
42
|
+
}
|
|
43
|
+
}
|
|
61
44
|
//# sourceMappingURL=AnimatonFrame.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimatonFrame.js","sourceRoot":"","sources":["../../../../src/components/SmoothScroll/AnimatonFrame.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,c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CAAC,IAAI,EAAE,CAAC;IACnC,CAAC;IAED,wBAAwB;IACjB,OAAO;;QACZ,MAAA,IAAI,CAAC,oBAAoB,0CAAE,MAAM,EAAE,CAAC;QACpC,IAAI,CAAC,oBAAoB,GAAG,SAAS,CAAC;QAEtC,MAAA,IAAI,CAAC,oBAAoB,0CAAE,KAAK,EAAE,CAAC;IACrC,CAAC;IAEM,OAAO;;QACZ,IAAI,CAAC,OAAO,EAAE,CAAC;QAEf,MAAA,IAAI,CAAC,oBAAoB,0CAAE,OAAO,EAAE,CAAC;IACvC,CAAC;CACF"}
|
|
@@ -1,35 +1,23 @@
|
|
|
1
1
|
import { createElement, selectAll, selectOne } from 'vevet-dom';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
export class Elements {
|
|
3
|
+
get wrapper() {
|
|
4
|
+
return this._wrapper;
|
|
5
|
+
}
|
|
6
|
+
get elements() {
|
|
7
|
+
return this._elements;
|
|
8
|
+
}
|
|
9
|
+
get props() {
|
|
10
|
+
return this._props;
|
|
11
|
+
}
|
|
12
|
+
constructor(_props) {
|
|
4
13
|
this._props = _props;
|
|
5
14
|
this._createWrapper();
|
|
6
15
|
this._createElements();
|
|
7
16
|
}
|
|
8
|
-
Object.defineProperty(Elements.prototype, "wrapper", {
|
|
9
|
-
get: function () {
|
|
10
|
-
return this._wrapper;
|
|
11
|
-
},
|
|
12
|
-
enumerable: false,
|
|
13
|
-
configurable: true
|
|
14
|
-
});
|
|
15
|
-
Object.defineProperty(Elements.prototype, "elements", {
|
|
16
|
-
get: function () {
|
|
17
|
-
return this._elements;
|
|
18
|
-
},
|
|
19
|
-
enumerable: false,
|
|
20
|
-
configurable: true
|
|
21
|
-
});
|
|
22
|
-
Object.defineProperty(Elements.prototype, "props", {
|
|
23
|
-
get: function () {
|
|
24
|
-
return this._props;
|
|
25
|
-
},
|
|
26
|
-
enumerable: false,
|
|
27
|
-
configurable: true
|
|
28
|
-
});
|
|
29
17
|
/** Create scrollable wrapper */
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
18
|
+
_createWrapper() {
|
|
19
|
+
const { wrapperClassName, container } = this.props;
|
|
20
|
+
const existingWrapper = selectOne(`.${wrapperClassName}`, container);
|
|
33
21
|
if (existingWrapper instanceof HTMLElement) {
|
|
34
22
|
this._wrapper = existingWrapper;
|
|
35
23
|
this._wrapperInitiallyExists = true;
|
|
@@ -41,9 +29,9 @@ var Elements = /** @class */ (function () {
|
|
|
41
29
|
children: Array.from(container.children),
|
|
42
30
|
});
|
|
43
31
|
this._wrapperInitiallyExists = false;
|
|
44
|
-
}
|
|
32
|
+
}
|
|
45
33
|
/** Create scrollable elements */
|
|
46
|
-
|
|
34
|
+
_createElements() {
|
|
47
35
|
if (this.props.elements) {
|
|
48
36
|
this._elements = Array.from(selectAll(this.props.elements, this.props.container));
|
|
49
37
|
}
|
|
@@ -52,52 +40,49 @@ var Elements = /** @class */ (function () {
|
|
|
52
40
|
}
|
|
53
41
|
// add will-change
|
|
54
42
|
if (this.props.hasWillChange) {
|
|
55
|
-
this._elements.forEach(
|
|
43
|
+
this._elements.forEach((element) => {
|
|
56
44
|
// eslint-disable-next-line no-param-reassign
|
|
57
45
|
element.style.willChange = 'transform';
|
|
58
46
|
});
|
|
59
47
|
}
|
|
60
|
-
}
|
|
48
|
+
}
|
|
61
49
|
/** Update elements' properties */
|
|
62
|
-
|
|
63
|
-
for (
|
|
64
|
-
|
|
50
|
+
updateElementsProp(scrollLeft, scrollTop) {
|
|
51
|
+
for (let index = 0; index < this.elements.length; index += 1) {
|
|
52
|
+
const element = this.elements[index];
|
|
65
53
|
// update scroll values
|
|
66
54
|
element.smoothScrollLeft = scrollLeft;
|
|
67
55
|
element.smoothScrollTop = scrollTop;
|
|
68
56
|
// update easing
|
|
69
|
-
|
|
57
|
+
const lerpAttr = element.getAttribute('data-smooth-scroll-lerp');
|
|
70
58
|
if (lerpAttr) {
|
|
71
59
|
element.smoothScrollLerp = parseFloat(lerpAttr);
|
|
72
60
|
}
|
|
73
61
|
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
|
|
62
|
+
}
|
|
63
|
+
_getToFixed(value) {
|
|
64
|
+
const { translatePrecision } = this.props;
|
|
77
65
|
if (typeof translatePrecision === 'number') {
|
|
78
66
|
return parseFloat(value.toFixed(translatePrecision));
|
|
79
67
|
}
|
|
80
68
|
return value;
|
|
81
|
-
}
|
|
69
|
+
}
|
|
82
70
|
/** Render elements */
|
|
83
|
-
|
|
84
|
-
for (
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
element.style.transform =
|
|
71
|
+
render() {
|
|
72
|
+
for (let index = 0; index < this.elements.length; index += 1) {
|
|
73
|
+
const element = this._elements[index];
|
|
74
|
+
const x = this._getToFixed(-element.smoothScrollLeft);
|
|
75
|
+
const y = this._getToFixed(-element.smoothScrollTop);
|
|
76
|
+
element.style.transform = `matrix3d(1,0,0.00,0,0.00,1,0.00,0,0,0,1,0, ${x}, ${y}, 0,1)`;
|
|
89
77
|
}
|
|
90
|
-
}
|
|
78
|
+
}
|
|
91
79
|
/** Check if scroll values are interpolated */
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
return array.every(
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
});
|
|
99
|
-
};
|
|
100
|
-
Elements.prototype.destroy = function () {
|
|
80
|
+
checkAllScrollValuesEqual() {
|
|
81
|
+
const array = this.elements;
|
|
82
|
+
return array.every(({ smoothScrollLeft, smoothScrollTop }) => smoothScrollLeft === array[0].smoothScrollLeft &&
|
|
83
|
+
smoothScrollTop === array[0].smoothScrollTop);
|
|
84
|
+
}
|
|
85
|
+
destroy() {
|
|
101
86
|
// remove wrapper
|
|
102
87
|
if (!this._wrapperInitiallyExists) {
|
|
103
88
|
while (this.wrapper.firstChild) {
|
|
@@ -106,14 +91,12 @@ var Elements = /** @class */ (function () {
|
|
|
106
91
|
this._wrapper.remove();
|
|
107
92
|
}
|
|
108
93
|
// reset styles
|
|
109
|
-
this._elements.forEach(
|
|
94
|
+
this._elements.forEach((element) => {
|
|
110
95
|
// eslint-disable-next-line no-param-reassign
|
|
111
96
|
element.style.transform = '';
|
|
112
97
|
// eslint-disable-next-line no-param-reassign
|
|
113
98
|
element.style.willChange = '';
|
|
114
99
|
});
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
}());
|
|
118
|
-
export { Elements };
|
|
100
|
+
}
|
|
101
|
+
}
|
|
119
102
|
//# sourceMappingURL=Elements.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Elements.js","sourceRoot":"","sources":["../../../../src/components/SmoothScroll/Elements.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAWhE
|
|
1
|
+
{"version":3,"file":"Elements.js","sourceRoot":"","sources":["../../../../src/components/SmoothScroll/Elements.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAWhE,MAAM,OAAO,QAAQ;IAGnB,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAMD,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,YAAoB,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QAChC,IAAI,CAAC,cAAc,EAAE,CAAC;QACtB,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC;IAED,gCAAgC;IACxB,cAAc;QACpB,MAAM,EAAE,gBAAgB,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAEnD,MAAM,eAAe,GAAG,SAAS,CAAC,IAAI,gBAAgB,EAAE,EAAE,SAAS,CAAC,CAAC;QAErE,IAAI,eAAe,YAAY,WAAW,EAAE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