vevet 3.3.2 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/components/AnimationFrame/index.js.map +1 -1
- package/lib/cjs/components/BaseTimeline/index.js.map +1 -1
- package/lib/cjs/components/Ctx2D/index.js.map +1 -1
- package/lib/cjs/components/CustomCursor/index.js.map +1 -1
- package/lib/cjs/components/DraggerBase/index.js.map +1 -1
- package/lib/cjs/components/DraggerMove/index.js.map +1 -1
- package/lib/cjs/components/Preloader/index.js.map +1 -1
- package/lib/cjs/components/ProgressPreloader/index.js.map +1 -1
- package/lib/cjs/components/ScrollBar/index.js.map +1 -1
- package/lib/cjs/components/ScrollView/index.js.map +1 -1
- package/lib/cjs/components/SmoothScroll/index.js.map +1 -1
- package/lib/cjs/components/SmoothScrollDragPlugin/index.js.map +1 -1
- package/lib/cjs/components/SmoothScrollKeyboardPlugin/index.js.map +1 -1
- package/lib/cjs/components/SplitText/index.js.map +1 -1
- package/lib/cjs/components/Timeline/index.js.map +1 -1
- package/lib/cjs/version.js +1 -1
- package/lib/esm/components/AnimationFrame/index.js.map +1 -1
- package/lib/esm/components/BaseTimeline/index.js.map +1 -1
- package/lib/esm/components/Ctx2D/index.js.map +1 -1
- package/lib/esm/components/CustomCursor/index.js.map +1 -1
- package/lib/esm/components/DraggerBase/index.js.map +1 -1
- package/lib/esm/components/DraggerMove/index.js.map +1 -1
- package/lib/esm/components/Preloader/index.js.map +1 -1
- package/lib/esm/components/ProgressPreloader/index.js.map +1 -1
- package/lib/esm/components/ScrollBar/index.js.map +1 -1
- package/lib/esm/components/ScrollView/index.js.map +1 -1
- package/lib/esm/components/SmoothScroll/index.js.map +1 -1
- package/lib/esm/components/SmoothScrollDragPlugin/index.js.map +1 -1
- package/lib/esm/components/SmoothScrollKeyboardPlugin/index.js.map +1 -1
- package/lib/esm/components/SplitText/index.js.map +1 -1
- package/lib/esm/components/Timeline/index.js.map +1 -1
- package/lib/esm/version.js +1 -1
- package/lib/types/components/AnimationFrame/index.d.ts +11 -11
- package/lib/types/components/AnimationFrame/index.d.ts.map +1 -1
- package/lib/types/components/BaseTimeline/index.d.ts +7 -4
- package/lib/types/components/BaseTimeline/index.d.ts.map +1 -1
- package/lib/types/components/Ctx2D/index.d.ts +6 -6
- package/lib/types/components/Ctx2D/index.d.ts.map +1 -1
- package/lib/types/components/CustomCursor/index.d.ts +20 -19
- package/lib/types/components/CustomCursor/index.d.ts.map +1 -1
- package/lib/types/components/DraggerBase/index.d.ts +11 -10
- package/lib/types/components/DraggerBase/index.d.ts.map +1 -1
- package/lib/types/components/DraggerMove/index.d.ts +1 -1
- package/lib/types/components/DraggerMove/index.d.ts.map +1 -1
- package/lib/types/components/Marquee/index.d.ts +2 -1
- package/lib/types/components/Marquee/index.d.ts.map +1 -1
- package/lib/types/components/Preloader/index.d.ts +7 -7
- package/lib/types/components/Preloader/index.d.ts.map +1 -1
- package/lib/types/components/ProgressPreloader/index.d.ts +11 -9
- package/lib/types/components/ProgressPreloader/index.d.ts.map +1 -1
- package/lib/types/components/ScrollBar/index.d.ts +5 -4
- package/lib/types/components/ScrollBar/index.d.ts.map +1 -1
- package/lib/types/components/ScrollView/index.d.ts +1 -1
- package/lib/types/components/ScrollView/index.d.ts.map +1 -1
- package/lib/types/components/SmoothScroll/index.d.ts +6 -4
- package/lib/types/components/SmoothScroll/index.d.ts.map +1 -1
- package/lib/types/components/SmoothScrollDragPlugin/index.d.ts +12 -10
- package/lib/types/components/SmoothScrollDragPlugin/index.d.ts.map +1 -1
- package/lib/types/components/SmoothScrollKeyboardPlugin/index.d.ts +5 -4
- package/lib/types/components/SmoothScrollKeyboardPlugin/index.d.ts.map +1 -1
- package/lib/types/components/SplitText/index.d.ts +13 -13
- package/lib/types/components/SplitText/index.d.ts.map +1 -1
- package/lib/types/components/Timeline/index.d.ts +5 -5
- package/lib/types/components/Timeline/index.d.ts.map +1 -1
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/AnimationFrame/index.ts +11 -11
- package/src/components/BaseTimeline/index.ts +4 -4
- package/src/components/Ctx2D/index.ts +6 -6
- package/src/components/CustomCursor/index.ts +19 -19
- package/src/components/DraggerBase/index.ts +10 -10
- package/src/components/DraggerMove/index.ts +1 -1
- package/src/components/Marquee/index.ts +1 -1
- package/src/components/Preloader/index.ts +7 -7
- package/src/components/ProgressPreloader/index.ts +9 -9
- package/src/components/ScrollBar/index.ts +4 -4
- package/src/components/ScrollView/index.ts +1 -1
- package/src/components/SmoothScroll/index.ts +4 -4
- package/src/components/SmoothScrollDragPlugin/index.ts +10 -10
- package/src/components/SmoothScrollKeyboardPlugin/index.ts +4 -4
- package/src/components/SplitText/index.ts +13 -13
- package/src/components/Timeline/index.ts +5 -5
- package/src/version.ts +1 -1
|
@@ -21,29 +21,29 @@ export class AnimationFrame<
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
/** If the frame is launched */
|
|
24
|
-
|
|
24
|
+
protected _isPlaying: boolean;
|
|
25
25
|
|
|
26
26
|
get isPlaying() {
|
|
27
27
|
return this._isPlaying;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
/** The animation frame */
|
|
31
|
-
|
|
31
|
+
protected _frame: number | null;
|
|
32
32
|
|
|
33
33
|
/** Last frame time */
|
|
34
|
-
|
|
34
|
+
protected _frameIndex: number;
|
|
35
35
|
|
|
36
36
|
/** First frame time */
|
|
37
|
-
|
|
37
|
+
protected _firstFrameTime: null | number;
|
|
38
38
|
|
|
39
39
|
/** Last frame time */
|
|
40
|
-
|
|
40
|
+
protected _lastFrameTime: null | number;
|
|
41
41
|
|
|
42
42
|
/** Array of frame time durations */
|
|
43
|
-
|
|
43
|
+
protected _frameDurations: number[];
|
|
44
44
|
|
|
45
45
|
/** Computed fps */
|
|
46
|
-
|
|
46
|
+
protected _computedFPS: number;
|
|
47
47
|
|
|
48
48
|
/** Computed real time fps */
|
|
49
49
|
get computedFPS() {
|
|
@@ -107,7 +107,7 @@ export class AnimationFrame<
|
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
/** Play animation */
|
|
110
|
-
|
|
110
|
+
protected _play() {
|
|
111
111
|
if (this.isPlaying) {
|
|
112
112
|
return;
|
|
113
113
|
}
|
|
@@ -130,7 +130,7 @@ export class AnimationFrame<
|
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
/** Pause animation */
|
|
133
|
-
|
|
133
|
+
protected _pause() {
|
|
134
134
|
if (!this.isPlaying) {
|
|
135
135
|
return;
|
|
136
136
|
}
|
|
@@ -147,7 +147,7 @@ export class AnimationFrame<
|
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
/** Launch the animation frame */
|
|
150
|
-
|
|
150
|
+
protected _animate() {
|
|
151
151
|
if (!this._isPlaying) {
|
|
152
152
|
return;
|
|
153
153
|
}
|
|
@@ -186,7 +186,7 @@ export class AnimationFrame<
|
|
|
186
186
|
}
|
|
187
187
|
|
|
188
188
|
/** Compute real-time FPS */
|
|
189
|
-
|
|
189
|
+
protected _computeFPS(startTime: number) {
|
|
190
190
|
const lastFrameDuration = startTime - (this._lastFrameTime ?? startTime);
|
|
191
191
|
|
|
192
192
|
// skip frames that seem not real
|
|
@@ -24,7 +24,7 @@ export class BaseTimeline<
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
/** Global timeline progress */
|
|
27
|
-
|
|
27
|
+
protected _progress: number;
|
|
28
28
|
|
|
29
29
|
/** Global timeline progress */
|
|
30
30
|
get progress() {
|
|
@@ -38,7 +38,7 @@ export class BaseTimeline<
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
/** Easing progress */
|
|
41
|
-
|
|
41
|
+
protected _easing: number;
|
|
42
42
|
|
|
43
43
|
/** Easing progress */
|
|
44
44
|
get easing() {
|
|
@@ -46,7 +46,7 @@ export class BaseTimeline<
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
/** Nested timelines */
|
|
49
|
-
|
|
49
|
+
protected _nestedTimelines: { id: string; timeline: BaseTimeline }[];
|
|
50
50
|
|
|
51
51
|
constructor(initialProps?: StaticProps & ChangeableProps, canInit = true) {
|
|
52
52
|
super(initialProps, false);
|
|
@@ -89,7 +89,7 @@ export class BaseTimeline<
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
/** Render nested timelines */
|
|
92
|
-
|
|
92
|
+
protected _renderNestedTimelines() {
|
|
93
93
|
const { length } = this._nestedTimelines;
|
|
94
94
|
if (length === 0) {
|
|
95
95
|
return;
|
|
@@ -35,7 +35,7 @@ export class Ctx2D<
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
/** The Canvas element itself */
|
|
38
|
-
|
|
38
|
+
protected _canvas: HTMLCanvasElement;
|
|
39
39
|
|
|
40
40
|
/** The Canvas element itself */
|
|
41
41
|
get canvas() {
|
|
@@ -43,7 +43,7 @@ export class Ctx2D<
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
/** 2D Context */
|
|
46
|
-
|
|
46
|
+
protected _ctx: CanvasRenderingContext2D;
|
|
47
47
|
|
|
48
48
|
/** 2D Context */
|
|
49
49
|
get ctx() {
|
|
@@ -51,7 +51,7 @@ export class Ctx2D<
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
/* Canvas width (with DPR) */
|
|
54
|
-
|
|
54
|
+
protected _width: number;
|
|
55
55
|
|
|
56
56
|
/* Canvas width (with DPR) */
|
|
57
57
|
get width() {
|
|
@@ -64,7 +64,7 @@ export class Ctx2D<
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
/* Canvas height (with DPR) */
|
|
67
|
-
|
|
67
|
+
protected _height: number;
|
|
68
68
|
|
|
69
69
|
/* Canvas height (with DPR) */
|
|
70
70
|
get height() {
|
|
@@ -77,7 +77,7 @@ export class Ctx2D<
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
/** Device pixel ratio */
|
|
80
|
-
|
|
80
|
+
protected _dpr: number;
|
|
81
81
|
|
|
82
82
|
/** Device pixel ratio */
|
|
83
83
|
get dpr() {
|
|
@@ -135,7 +135,7 @@ export class Ctx2D<
|
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
/** Set resize events */
|
|
138
|
-
|
|
138
|
+
protected _setResize() {
|
|
139
139
|
const { hasInitialResize, hasResize, viewportTarget, resizeDebounce } =
|
|
140
140
|
this.props;
|
|
141
141
|
|
|
@@ -38,10 +38,10 @@ export class CustomCursor<
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
/** Cursor container */
|
|
41
|
-
|
|
41
|
+
protected _container: Element | Window;
|
|
42
42
|
|
|
43
43
|
/** The container is window */
|
|
44
|
-
|
|
44
|
+
protected _isContainerWindow: boolean;
|
|
45
45
|
|
|
46
46
|
/** DOM parent for the cursor element */
|
|
47
47
|
get domContainer(): HTMLElement {
|
|
@@ -58,7 +58,7 @@ export class CustomCursor<
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
/** Outer cursor element */
|
|
61
|
-
|
|
61
|
+
protected _outerElement!: HTMLElement;
|
|
62
62
|
|
|
63
63
|
/** Cursor element (inner element) */
|
|
64
64
|
get innerElement() {
|
|
@@ -66,10 +66,10 @@ export class CustomCursor<
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
/** Inner cursor element */
|
|
69
|
-
|
|
69
|
+
protected _innerElement!: HTMLElement;
|
|
70
70
|
|
|
71
71
|
/** Hovered element */
|
|
72
|
-
|
|
72
|
+
protected _hoveredElement?: NCustomCursor.IHoveredElement | undefined;
|
|
73
73
|
|
|
74
74
|
/** Hovered element */
|
|
75
75
|
get hoveredElement(): NCustomCursor.IHoveredElement | undefined {
|
|
@@ -82,10 +82,10 @@ export class CustomCursor<
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
/** Animation frame */
|
|
85
|
-
|
|
85
|
+
protected _animationFrame!: AnimationFrame;
|
|
86
86
|
|
|
87
87
|
/** Current cursor coordinates */
|
|
88
|
-
|
|
88
|
+
protected _coords: NCustomCursor.ICoords;
|
|
89
89
|
|
|
90
90
|
/** Current cursor coordinates */
|
|
91
91
|
get coords() {
|
|
@@ -93,7 +93,7 @@ export class CustomCursor<
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
/** Target cursor coordinates */
|
|
96
|
-
|
|
96
|
+
protected _targetCoords: NCustomCursor.ICoords;
|
|
97
97
|
|
|
98
98
|
/** Target cursor coordinates */
|
|
99
99
|
get targetCoords() {
|
|
@@ -180,7 +180,7 @@ export class CustomCursor<
|
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
/** Create custom cursor */
|
|
183
|
-
|
|
183
|
+
protected _createCursor() {
|
|
184
184
|
const { container, domContainer } = this;
|
|
185
185
|
|
|
186
186
|
// hide native cursor
|
|
@@ -225,7 +225,7 @@ export class CustomCursor<
|
|
|
225
225
|
}
|
|
226
226
|
|
|
227
227
|
/** Set module events */
|
|
228
|
-
|
|
228
|
+
protected _setEvents() {
|
|
229
229
|
const { domContainer } = this;
|
|
230
230
|
|
|
231
231
|
this._animationFrame = new AnimationFrame();
|
|
@@ -266,7 +266,7 @@ export class CustomCursor<
|
|
|
266
266
|
}
|
|
267
267
|
|
|
268
268
|
/** Event on mouse enter */
|
|
269
|
-
|
|
269
|
+
protected _handleMouseEnter(evt: MouseEvent) {
|
|
270
270
|
this._coords.x = evt.clientX;
|
|
271
271
|
this._coords.y = evt.clientY;
|
|
272
272
|
this._targetCoords.x = evt.clientX;
|
|
@@ -276,12 +276,12 @@ export class CustomCursor<
|
|
|
276
276
|
}
|
|
277
277
|
|
|
278
278
|
/** Event on mouse leave */
|
|
279
|
-
|
|
279
|
+
protected _handleMouseLeave() {
|
|
280
280
|
this.outerElement.classList.remove(this.className('-in-action'));
|
|
281
281
|
}
|
|
282
282
|
|
|
283
283
|
/** Event on mouse move */
|
|
284
|
-
|
|
284
|
+
protected _handleMouseMove(evt: MouseEvent) {
|
|
285
285
|
this._targetCoords.x = evt.clientX;
|
|
286
286
|
this._targetCoords.y = evt.clientY;
|
|
287
287
|
|
|
@@ -293,7 +293,7 @@ export class CustomCursor<
|
|
|
293
293
|
}
|
|
294
294
|
|
|
295
295
|
/** Event on mouse down */
|
|
296
|
-
|
|
296
|
+
protected _handleMouseDown(evt: MouseEvent) {
|
|
297
297
|
if (evt.which === 1) {
|
|
298
298
|
this.outerElement.classList.add(this.className('-click'));
|
|
299
299
|
this.innerElement.classList.add(this.className('-click'));
|
|
@@ -301,13 +301,13 @@ export class CustomCursor<
|
|
|
301
301
|
}
|
|
302
302
|
|
|
303
303
|
/** Event on mouse up */
|
|
304
|
-
|
|
304
|
+
protected _handleMouseUp() {
|
|
305
305
|
this.outerElement.classList.remove(this.className('-click'));
|
|
306
306
|
this.innerElement.classList.remove(this.className('-click'));
|
|
307
307
|
}
|
|
308
308
|
|
|
309
309
|
/** Event on window blur */
|
|
310
|
-
|
|
310
|
+
protected _handleWindowBlur() {
|
|
311
311
|
this._handleMouseUp();
|
|
312
312
|
}
|
|
313
313
|
|
|
@@ -387,7 +387,7 @@ export class CustomCursor<
|
|
|
387
387
|
}
|
|
388
388
|
|
|
389
389
|
/** Recalculate current coordinates */
|
|
390
|
-
|
|
390
|
+
protected _calculateCoords() {
|
|
391
391
|
const { targetCoords, _coords: coords } = this;
|
|
392
392
|
|
|
393
393
|
coords.x = this._lerp(coords.x, targetCoords.x);
|
|
@@ -397,7 +397,7 @@ export class CustomCursor<
|
|
|
397
397
|
}
|
|
398
398
|
|
|
399
399
|
/** Linear interpolation */
|
|
400
|
-
|
|
400
|
+
protected _lerp(current: number, target: number) {
|
|
401
401
|
const { isFpsNormalized, lerp: ease } = this.props;
|
|
402
402
|
|
|
403
403
|
const fpsMultiplier = isFpsNormalized
|
|
@@ -410,7 +410,7 @@ export class CustomCursor<
|
|
|
410
410
|
}
|
|
411
411
|
|
|
412
412
|
/** Render elements */
|
|
413
|
-
|
|
413
|
+
protected _renderElements(): NCustomCursor.ICoords {
|
|
414
414
|
const { domContainer, outerElement } = this;
|
|
415
415
|
let { x, y } = this.coords;
|
|
416
416
|
const { width, height } = this.coords;
|
|
@@ -32,7 +32,7 @@ export abstract class DraggerBase<
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
/** Preloader container */
|
|
35
|
-
|
|
35
|
+
protected _container: Element | Window;
|
|
36
36
|
|
|
37
37
|
/** Preloader container */
|
|
38
38
|
get container() {
|
|
@@ -48,7 +48,7 @@ export abstract class DraggerBase<
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
/** Current pointer id */
|
|
51
|
-
|
|
51
|
+
protected _pointerID: number | null;
|
|
52
52
|
|
|
53
53
|
/** Current pointer id */
|
|
54
54
|
protected get pointerID() {
|
|
@@ -56,7 +56,7 @@ export abstract class DraggerBase<
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
/** Current coordinates */
|
|
59
|
-
|
|
59
|
+
protected _coords: NDraggerBase.IVector2;
|
|
60
60
|
|
|
61
61
|
/** Current coordinates */
|
|
62
62
|
get coords() {
|
|
@@ -69,7 +69,7 @@ export abstract class DraggerBase<
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
/** Last coordinates */
|
|
72
|
-
|
|
72
|
+
protected _prevCoords: NDraggerBase.IVector2;
|
|
73
73
|
|
|
74
74
|
/** Last coordinates */
|
|
75
75
|
get prevCoords() {
|
|
@@ -82,7 +82,7 @@ export abstract class DraggerBase<
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
/** Coordinates on drag start */
|
|
85
|
-
|
|
85
|
+
protected _startCoords: NDraggerBase.IVector2;
|
|
86
86
|
|
|
87
87
|
/** Coordinates on drag start */
|
|
88
88
|
get startCoords() {
|
|
@@ -90,10 +90,10 @@ export abstract class DraggerBase<
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
/** Timeout of `handleEnd` */
|
|
93
|
-
|
|
93
|
+
protected _handleEndTimeout?: NodeJS.Timeout;
|
|
94
94
|
|
|
95
95
|
/** Current event type */
|
|
96
|
-
|
|
96
|
+
protected _type?: 'mouse' | 'touch';
|
|
97
97
|
|
|
98
98
|
/** Current event type */
|
|
99
99
|
get type() {
|
|
@@ -173,7 +173,7 @@ export abstract class DraggerBase<
|
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
/** Remove runtime events */
|
|
176
|
-
|
|
176
|
+
protected _removeRuntimeEvents() {
|
|
177
177
|
this._runtimeListeners.forEach((listener) => listener.remove());
|
|
178
178
|
|
|
179
179
|
this._runtimeListeners = [];
|
|
@@ -202,7 +202,7 @@ export abstract class DraggerBase<
|
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
/** Event on drag start */
|
|
205
|
-
|
|
205
|
+
protected _handleStart(event: NDraggerBase.TEvent) {
|
|
206
206
|
if (!this.props.isEnabled || this.isDragging) {
|
|
207
207
|
return false;
|
|
208
208
|
}
|
|
@@ -242,7 +242,7 @@ export abstract class DraggerBase<
|
|
|
242
242
|
}
|
|
243
243
|
|
|
244
244
|
/** Event on drag end */
|
|
245
|
-
|
|
245
|
+
protected handleEnd(event: NDraggerBase.TEvent) {
|
|
246
246
|
if (this._handleEndTimeout) {
|
|
247
247
|
return;
|
|
248
248
|
}
|
|
@@ -106,7 +106,7 @@ export class DraggerMove<
|
|
|
106
106
|
this._togglePointerEvents(true);
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
protected _togglePointerEvents(isEnabledProp: boolean) {
|
|
110
110
|
if (typeof this.props.disablePointerEventsAt !== 'number') {
|
|
111
111
|
return;
|
|
112
112
|
}
|
|
@@ -63,7 +63,7 @@ export class Marquee<
|
|
|
63
63
|
protected _canPlay: boolean;
|
|
64
64
|
|
|
65
65
|
/** Animation frame */
|
|
66
|
-
|
|
66
|
+
protected _animationFrame?: AnimationFrame;
|
|
67
67
|
|
|
68
68
|
constructor(initialProps?: StaticProps & ChangeableProps, canInit = true) {
|
|
69
69
|
super(initialProps, false);
|
|
@@ -27,7 +27,7 @@ export class Preloader<
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
/** Preloader container */
|
|
30
|
-
|
|
30
|
+
protected _container?: HTMLElement | false;
|
|
31
31
|
|
|
32
32
|
/** Preloader container */
|
|
33
33
|
get container() {
|
|
@@ -35,7 +35,7 @@ export class Preloader<
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
/** Preloader start time */
|
|
38
|
-
|
|
38
|
+
protected _startTime: number;
|
|
39
39
|
|
|
40
40
|
/** Preloader start time */
|
|
41
41
|
get startTime() {
|
|
@@ -43,7 +43,7 @@ export class Preloader<
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
/** Preloader end time */
|
|
46
|
-
|
|
46
|
+
protected _endTime: number;
|
|
47
47
|
|
|
48
48
|
/** Preloader end time */
|
|
49
49
|
get endTime() {
|
|
@@ -58,10 +58,10 @@ export class Preloader<
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
/** Preloader is to be hidden */
|
|
61
|
-
|
|
61
|
+
protected _isToBeHidden: boolean;
|
|
62
62
|
|
|
63
63
|
/** Preloader is hidden */
|
|
64
|
-
|
|
64
|
+
protected _isHidden: boolean;
|
|
65
65
|
|
|
66
66
|
/** Preloader is hidden */
|
|
67
67
|
get isHidden() {
|
|
@@ -123,7 +123,7 @@ export class Preloader<
|
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
/** When the page is fully loaded */
|
|
126
|
-
|
|
126
|
+
protected _handleLoaded() {
|
|
127
127
|
this.callbacks.tbt('loaded', undefined);
|
|
128
128
|
|
|
129
129
|
// hide the preloader
|
|
@@ -169,7 +169,7 @@ export class Preloader<
|
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
/** Handle the moment when the preloader is hidden */
|
|
172
|
-
|
|
172
|
+
protected _handleHidden() {
|
|
173
173
|
this._isHidden = true;
|
|
174
174
|
this.callbacks.tbt('hidden', undefined);
|
|
175
175
|
}
|
|
@@ -33,7 +33,7 @@ export class ProgressPreloader<
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
/** Images to be preloaded */
|
|
36
|
-
|
|
36
|
+
protected _images: HTMLImageElement[];
|
|
37
37
|
|
|
38
38
|
/** Images to be preloaded */
|
|
39
39
|
get images() {
|
|
@@ -41,7 +41,7 @@ export class ProgressPreloader<
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
/** Videos to be preloaded */
|
|
44
|
-
|
|
44
|
+
protected _videos: HTMLVideoElement[];
|
|
45
45
|
|
|
46
46
|
/** Videos to be preloaded */
|
|
47
47
|
get videos() {
|
|
@@ -49,14 +49,14 @@ export class ProgressPreloader<
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
/** Custom resources to be preloaded */
|
|
52
|
-
|
|
52
|
+
protected _customResources: NProgressPreloader.ICustomResourceData[];
|
|
53
53
|
|
|
54
54
|
/** Custom resources to be preloaded */
|
|
55
55
|
get customResources() {
|
|
56
56
|
return this._customResources;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
protected _resourcesQuantity: number;
|
|
60
60
|
|
|
61
61
|
/** Quantity of resources to be preloader */
|
|
62
62
|
get resourcesQuantity() {
|
|
@@ -71,7 +71,7 @@ export class ProgressPreloader<
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
/** Quantity of loaded resources */
|
|
74
|
-
|
|
74
|
+
protected _loadedResourcesQuantity: number;
|
|
75
75
|
|
|
76
76
|
/** Quantity of loaded resources */
|
|
77
77
|
get loadedResourcesQuantity() {
|
|
@@ -84,7 +84,7 @@ export class ProgressPreloader<
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
/** Preloader progress */
|
|
87
|
-
|
|
87
|
+
protected _progress: number;
|
|
88
88
|
|
|
89
89
|
/** Preloader progress */
|
|
90
90
|
get progress() {
|
|
@@ -98,10 +98,10 @@ export class ProgressPreloader<
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
/** Animation frame for smooth progress calculation */
|
|
101
|
-
|
|
101
|
+
protected _animationFrame?: AnimationFrame;
|
|
102
102
|
|
|
103
103
|
/** Timeline to finish progress animation */
|
|
104
|
-
|
|
104
|
+
protected _endTimeline?: Timeline;
|
|
105
105
|
|
|
106
106
|
constructor(initialProps?: StaticProps & ChangeableProps, canInit = true) {
|
|
107
107
|
super(initialProps, false);
|
|
@@ -255,7 +255,7 @@ export class ProgressPreloader<
|
|
|
255
255
|
}
|
|
256
256
|
|
|
257
257
|
/** Event on resource loaded */
|
|
258
|
-
|
|
258
|
+
protected _handleLoadedResource({
|
|
259
259
|
element,
|
|
260
260
|
isSuccess,
|
|
261
261
|
}: NProgressPreloader.IHandleLoadedResourceParameter) {
|
|
@@ -35,7 +35,7 @@ export class ScrollBar<
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
/** Scroll container */
|
|
38
|
-
|
|
38
|
+
protected _container: Element | Window | SmoothScroll;
|
|
39
39
|
|
|
40
40
|
/** Scroll container */
|
|
41
41
|
get container() {
|
|
@@ -81,10 +81,10 @@ export class ScrollBar<
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
/** Horizontal scrollbar */
|
|
84
|
-
|
|
84
|
+
protected _xBar: Bar;
|
|
85
85
|
|
|
86
86
|
/** Vertical scrollbar */
|
|
87
|
-
|
|
87
|
+
protected _yBar: Bar;
|
|
88
88
|
|
|
89
89
|
constructor(initialProps?: StaticProps & ChangeableProps, canInit = true) {
|
|
90
90
|
super(initialProps, false);
|
|
@@ -139,7 +139,7 @@ export class ScrollBar<
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
// Set Module Events
|
|
142
|
-
|
|
142
|
+
protected _setEvents() {
|
|
143
143
|
const { container, props } = this;
|
|
144
144
|
|
|
145
145
|
// default resize handler
|
|
@@ -48,14 +48,14 @@ export class SmoothScroll<
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
/** Scroll container */
|
|
51
|
-
|
|
51
|
+
protected _container: HTMLElement;
|
|
52
52
|
|
|
53
53
|
/** Scroll container */
|
|
54
54
|
get container() {
|
|
55
55
|
return this._container;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
protected _elements: Elements;
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* Scroll wrapper. If the element does not exist indide the `container`,
|
|
@@ -194,7 +194,7 @@ export class SmoothScroll<
|
|
|
194
194
|
protected _isInstant?: boolean;
|
|
195
195
|
|
|
196
196
|
/** Animation frame */
|
|
197
|
-
|
|
197
|
+
protected _animationFrame: AnimationFrame;
|
|
198
198
|
|
|
199
199
|
/** Frame index */
|
|
200
200
|
protected _frameIndex: number;
|
|
@@ -299,7 +299,7 @@ export class SmoothScroll<
|
|
|
299
299
|
}
|
|
300
300
|
|
|
301
301
|
/** Set resize events */
|
|
302
|
-
|
|
302
|
+
protected _setResize() {
|
|
303
303
|
const { viewportTarget, resizeDebounce } = this.props;
|
|
304
304
|
|
|
305
305
|
// resize handler
|