vevet 2.0.1-dev.9 → 2.0.2
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/build/cdn/index.js +1 -1
- package/build/cjs/app/Application.js +8 -8
- package/build/cjs/app/events/PageLoad.js +3 -3
- package/build/cjs/app/events/Viewport.js +5 -5
- package/build/cjs/base/Callbacks.js +3 -3
- package/build/cjs/base/Module.js +16 -7
- package/build/cjs/base/MutableProp.js +10 -10
- package/build/cjs/components/animation-frame/AnimationFrame.js +1 -1
- package/build/cjs/components/canvas/Ctx2D.js +7 -3
- package/build/cjs/components/canvas/Ctx2DPrerender.js +17 -3
- package/build/cjs/components/cursor/CustomCursor.js +12 -12
- package/build/cjs/components/dragger/Dragger.js +8 -8
- package/build/cjs/components/dragger/DraggerMove.js +2 -2
- package/build/cjs/components/loading/Preloader.js +5 -5
- package/build/cjs/components/loading/ProgressPreloader.js +17 -5
- package/build/cjs/components/page/Page.js +37 -9
- package/build/cjs/components/scroll/plugins/SmoothScrollKeyboardPlugin.js +2 -2
- package/build/cjs/components/scroll/scrollable/ScrollEventsBase.js +1 -1
- package/build/cjs/components/scroll/scrollable/ScrollView.js +133 -73
- package/build/cjs/components/scroll/scrollbar/Bar.js +18 -15
- package/build/cjs/components/scroll/scrollbar/ScrollBar.js +9 -7
- package/build/cjs/components/scroll/smooth-scroll/SmoothScroll.js +26 -22
- package/build/cjs/components/text/SplitText.js +34 -12
- package/build/cjs/components/timeline/StaticTimeline.js +4 -4
- package/build/cjs/components/timeline/Timeline.js +2 -2
- package/build/cjs/handlers/wheel/WheelHandler.js +4 -4
- package/build/cjs/utils/common/mergeWithoutArrays.js +1 -1
- package/build/cjs/utils/common/randID.js +2 -2
- package/build/cjs/utils/listeners/onScroll.js +66 -28
- package/build/cjs/utils/math/{boundVal.js → clamp.js} +3 -3
- package/build/cjs/utils/math/clampScope.js +16 -0
- package/build/cjs/utils/math/inScope.js +10 -0
- package/build/cjs/utils/math/index.js +13 -7
- package/build/cjs/utils/math/scoped.js +18 -0
- package/build/cjs/utils/math/{spreadScopeProgress.js → spreadScope.js} +2 -2
- package/build/cjs/utils/math/wrap.js +13 -0
- package/build/es/base/Module.js +2 -4
- package/build/es/components/animation-frame/AnimationFrame.js +2 -2
- package/build/es/components/canvas/Ctx2D.js +6 -2
- package/build/es/components/canvas/Ctx2DPrerender.js +16 -2
- package/build/es/components/loading/ProgressPreloader.js +14 -2
- package/build/es/components/page/Page.js +32 -8
- package/build/es/components/scroll/scrollable/ScrollView.js +112 -62
- package/build/es/components/scroll/scrollbar/Bar.js +9 -6
- package/build/es/components/scroll/scrollbar/ScrollBar.js +3 -1
- package/build/es/components/scroll/smooth-scroll/SmoothScroll.js +13 -9
- package/build/es/components/text/SplitText.js +25 -3
- package/build/es/components/timeline/StaticTimeline.js +3 -3
- package/build/es/components/timeline/Timeline.js +2 -2
- package/build/es/utils/listeners/onScroll.js +65 -28
- package/build/es/utils/math/{boundVal.js → clamp.js} +2 -2
- package/build/es/utils/math/clampScope.js +8 -0
- package/build/es/utils/math/inScope.js +6 -0
- package/build/es/utils/math/index.js +7 -4
- package/build/es/utils/math/scoped.js +14 -0
- package/build/es/utils/math/{spreadScopeProgress.js → spreadScope.js} +1 -1
- package/build/es/utils/math/wrap.js +10 -0
- package/build/types/base/Module.d.ts.map +1 -1
- package/build/types/components/canvas/Ctx2D.d.ts +9 -0
- package/build/types/components/canvas/Ctx2D.d.ts.map +1 -1
- package/build/types/components/canvas/Ctx2DPrerender.d.ts +1 -1
- package/build/types/components/canvas/Ctx2DPrerender.d.ts.map +1 -1
- package/build/types/components/loading/ProgressPreloader.d.ts +7 -0
- package/build/types/components/loading/ProgressPreloader.d.ts.map +1 -1
- package/build/types/components/page/Page.d.ts +2 -0
- package/build/types/components/page/Page.d.ts.map +1 -1
- package/build/types/components/scroll/scrollable/ScrollView.d.ts +40 -14
- package/build/types/components/scroll/scrollable/ScrollView.d.ts.map +1 -1
- package/build/types/components/scroll/scrollbar/Bar.d.ts.map +1 -1
- package/build/types/components/scroll/scrollbar/ScrollBar.d.ts +4 -0
- package/build/types/components/scroll/scrollbar/ScrollBar.d.ts.map +1 -1
- package/build/types/components/scroll/smooth-scroll/SmoothScroll.d.ts +4 -0
- package/build/types/components/scroll/smooth-scroll/SmoothScroll.d.ts.map +1 -1
- package/build/types/components/text/SplitText.d.ts +10 -0
- package/build/types/components/text/SplitText.d.ts.map +1 -1
- package/build/types/utils/listeners/onScroll.d.ts +10 -6
- package/build/types/utils/listeners/onScroll.d.ts.map +1 -1
- package/build/types/utils/math/clamp.d.ts +5 -0
- package/build/types/utils/math/clamp.d.ts.map +1 -0
- package/build/types/utils/math/clampScope.d.ts +5 -0
- package/build/types/utils/math/clampScope.d.ts.map +1 -0
- package/build/types/utils/math/inScope.d.ts +5 -0
- package/build/types/utils/math/inScope.d.ts.map +1 -0
- package/build/types/utils/math/index.d.ts +7 -4
- package/build/types/utils/math/index.d.ts.map +1 -1
- package/build/types/utils/math/scoped.d.ts +12 -0
- package/build/types/utils/math/scoped.d.ts.map +1 -0
- package/build/types/utils/math/spreadScope.d.ts +5 -0
- package/build/types/utils/math/spreadScope.d.ts.map +1 -0
- package/build/types/utils/math/wrap.d.ts +5 -0
- package/build/types/utils/math/wrap.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/ts/base/Module.ts +5 -4
- package/src/ts/components/animation-frame/AnimationFrame.ts +2 -2
- package/src/ts/components/canvas/Ctx2D.ts +16 -1
- package/src/ts/components/canvas/Ctx2DPrerender.ts +19 -6
- package/src/ts/components/loading/ProgressPreloader.ts +21 -2
- package/src/ts/components/page/Page.ts +34 -8
- package/src/ts/components/scroll/scrollable/ScrollView.ts +155 -86
- package/src/ts/components/scroll/scrollbar/Bar.ts +9 -6
- package/src/ts/components/scroll/scrollbar/ScrollBar.ts +7 -0
- package/src/ts/components/scroll/smooth-scroll/SmoothScroll.ts +17 -8
- package/src/ts/components/text/SplitText.ts +38 -2
- package/src/ts/components/timeline/StaticTimeline.ts +4 -4
- package/src/ts/components/timeline/Timeline.ts +2 -2
- package/src/ts/utils/listeners/onScroll.ts +101 -38
- package/src/ts/utils/math/{boundVal.ts → clamp.ts} +3 -3
- package/src/ts/utils/math/clampScope.ts +16 -0
- package/src/ts/utils/math/inScope.ts +9 -0
- package/src/ts/utils/math/index.ts +12 -6
- package/src/ts/utils/math/scoped.ts +17 -0
- package/src/ts/utils/math/{spreadScopeProgress.ts → spreadScope.ts} +2 -2
- package/src/ts/utils/math/wrap.ts +18 -0
- package/build/cjs/components/scroll/custom-scroll/CustomScroll.js +0 -517
- package/build/cjs/components/split-text/SplitText.js +0 -233
- package/build/cjs/utils/math/scopeProgress.js +0 -25
- package/build/es/components/scroll/custom-scroll/CustomScroll.js +0 -486
- package/build/es/components/split-text/SplitText.js +0 -199
- package/build/es/utils/math/scopeProgress.js +0 -22
- package/build/types/components/scroll/custom-scroll/CustomScroll.d.ts +0 -322
- package/build/types/components/scroll/custom-scroll/CustomScroll.d.ts.map +0 -1
- package/build/types/components/split-text/SplitText.d.ts +0 -118
- package/build/types/components/split-text/SplitText.d.ts.map +0 -1
- package/build/types/utils/math/boundVal.d.ts +0 -5
- package/build/types/utils/math/boundVal.d.ts.map +0 -1
- package/build/types/utils/math/scopeProgress.d.ts +0 -20
- package/build/types/utils/math/scopeProgress.d.ts.map +0 -1
- package/build/types/utils/math/spreadScopeProgress.d.ts +0 -5
- package/build/types/utils/math/spreadScopeProgress.d.ts.map +0 -1
- package/src/ts/utils/math/scopeProgress.ts +0 -23
|
@@ -1,322 +0,0 @@
|
|
|
1
|
-
import { Component, NComponent } from '../../../base/Component';
|
|
2
|
-
import { DeepRequired } from '../../../utils/types/utility';
|
|
3
|
-
import { AnimationFrame } from '../../animation-frame/AnimationFrame';
|
|
4
|
-
import { ScrollableElement } from '../types';
|
|
5
|
-
import { NCallbacks } from '../../../base/Callbacks';
|
|
6
|
-
export declare namespace NCustomScroll {
|
|
7
|
-
/**
|
|
8
|
-
* Static properties
|
|
9
|
-
*/
|
|
10
|
-
interface StaticProp extends NComponent.StaticProp {
|
|
11
|
-
/**
|
|
12
|
-
* Scroll elements
|
|
13
|
-
*/
|
|
14
|
-
selectors: {
|
|
15
|
-
/**
|
|
16
|
-
* Scrollable wrapper.
|
|
17
|
-
* You may pass either a CSS selector to find the element or the element itself.
|
|
18
|
-
* @default '#v-custom-scroll'
|
|
19
|
-
*/
|
|
20
|
-
outer: string | HTMLElement;
|
|
21
|
-
/**
|
|
22
|
-
* Scrollable elements inside the wrapper.
|
|
23
|
-
* You may pass either a CSS selector to find the elements or the elements themselves.
|
|
24
|
-
* @default '#v-custom-scroll'
|
|
25
|
-
*/
|
|
26
|
-
elements: false | string | NodeListOf<HTMLElement> | HTMLElement | HTMLElement[];
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Animation frame.
|
|
30
|
-
* Pass an AnimationFrame instance if you want to control the scrolling outside this class.
|
|
31
|
-
* @default false
|
|
32
|
-
*/
|
|
33
|
-
animationFrame: false | AnimationFrame;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Changeable properties
|
|
37
|
-
*/
|
|
38
|
-
interface ChangeableProp extends NComponent.ChangeableProp {
|
|
39
|
-
/**
|
|
40
|
-
* If scrolling is enabled
|
|
41
|
-
* @default true
|
|
42
|
-
*/
|
|
43
|
-
enabled: boolean;
|
|
44
|
-
/**
|
|
45
|
-
* Recalculate sizes on each scroll update
|
|
46
|
-
* @default true
|
|
47
|
-
*/
|
|
48
|
-
recalculateSizes: boolean;
|
|
49
|
-
/**
|
|
50
|
-
* Use wheel event
|
|
51
|
-
* @default true
|
|
52
|
-
*/
|
|
53
|
-
useWheel: boolean;
|
|
54
|
-
/**
|
|
55
|
-
* If scrolling is horizontal
|
|
56
|
-
* @default false
|
|
57
|
-
*/
|
|
58
|
-
isHorizontal: boolean;
|
|
59
|
-
/**
|
|
60
|
-
* Automatically stop scrolling after the target and current values are approximated.
|
|
61
|
-
* @default true
|
|
62
|
-
*/
|
|
63
|
-
autoStop: boolean;
|
|
64
|
-
/**
|
|
65
|
-
* Linear interpolation ease
|
|
66
|
-
* @default 0.1
|
|
67
|
-
*/
|
|
68
|
-
lerp: number;
|
|
69
|
-
/**
|
|
70
|
-
* Sometimes scrolling may be choppy because of large decimal values in transforms.
|
|
71
|
-
* In such cases you may want to use this property.
|
|
72
|
-
* It works on the basis of "toFixed()" method
|
|
73
|
-
* @default false
|
|
74
|
-
*/
|
|
75
|
-
lerpToFixed: false | number;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Available callbacks
|
|
79
|
-
*/
|
|
80
|
-
interface CallbacksTypes extends NComponent.CallbacksTypes {
|
|
81
|
-
'render': false;
|
|
82
|
-
'resize': false;
|
|
83
|
-
'approximate': false;
|
|
84
|
-
'wheel': WheelEvent;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
interface ScrollInnerElement extends HTMLElement {
|
|
88
|
-
customScrollTop: number;
|
|
89
|
-
customScrollLeft: number;
|
|
90
|
-
customScrollLerpEase: number;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Create smooth scrolling.
|
|
94
|
-
*/
|
|
95
|
-
export declare class CustomScroll<StaticProp extends NCustomScroll.StaticProp = NCustomScroll.StaticProp, ChangeableProp extends NCustomScroll.ChangeableProp = NCustomScroll.ChangeableProp, CallbacksTypes extends NCustomScroll.CallbacksTypes = NCustomScroll.CallbacksTypes> extends Component<StaticProp, ChangeableProp, CallbacksTypes> implements ScrollableElement {
|
|
96
|
-
get prefix(): string;
|
|
97
|
-
/**
|
|
98
|
-
* Scroll parent
|
|
99
|
-
*/
|
|
100
|
-
protected _outer: HTMLElement;
|
|
101
|
-
get outer(): HTMLElement;
|
|
102
|
-
/**
|
|
103
|
-
* Scroll container. If the element does not exist indide the outer,
|
|
104
|
-
* it will be created automatically
|
|
105
|
-
*/
|
|
106
|
-
protected _container: HTMLElement;
|
|
107
|
-
get container(): HTMLElement;
|
|
108
|
-
/**
|
|
109
|
-
* If the container element existed before the class initialization
|
|
110
|
-
*/
|
|
111
|
-
protected _containerExists: boolean;
|
|
112
|
-
/**
|
|
113
|
-
* Scrollable elements
|
|
114
|
-
*/
|
|
115
|
-
protected _elements: ScrollInnerElement[];
|
|
116
|
-
get elements(): ScrollInnerElement[];
|
|
117
|
-
protected _elementsLength: number;
|
|
118
|
-
/**
|
|
119
|
-
* Scroll target value
|
|
120
|
-
*/
|
|
121
|
-
protected _targetLeft: number;
|
|
122
|
-
get targetLeft(): number;
|
|
123
|
-
set targetLeft(val: number);
|
|
124
|
-
/**
|
|
125
|
-
* Set value without animation request
|
|
126
|
-
*/
|
|
127
|
-
protected set targetLeftDry(val: number);
|
|
128
|
-
protected get targetLeftDry(): number;
|
|
129
|
-
/**
|
|
130
|
-
* Scroll target value
|
|
131
|
-
*/
|
|
132
|
-
protected _targetTop: number;
|
|
133
|
-
get targetTop(): number;
|
|
134
|
-
set targetTop(val: number);
|
|
135
|
-
/**
|
|
136
|
-
* Set value without animation request
|
|
137
|
-
*/
|
|
138
|
-
protected set targetTopDry(val: number);
|
|
139
|
-
protected get targetTopDry(): number;
|
|
140
|
-
/**
|
|
141
|
-
* Scroll left
|
|
142
|
-
*/
|
|
143
|
-
protected _scrollLeft: number;
|
|
144
|
-
get scrollLeft(): number;
|
|
145
|
-
set scrollLeft(val: number);
|
|
146
|
-
/**
|
|
147
|
-
* Scroll top
|
|
148
|
-
*/
|
|
149
|
-
protected _scrollTop: number;
|
|
150
|
-
get scrollTop(): number;
|
|
151
|
-
set scrollTop(val: number);
|
|
152
|
-
/**
|
|
153
|
-
* Scroll width
|
|
154
|
-
*/
|
|
155
|
-
protected _scrollWidth: number;
|
|
156
|
-
get scrollWidth(): number;
|
|
157
|
-
/**
|
|
158
|
-
* Scroll height
|
|
159
|
-
*/
|
|
160
|
-
protected _scrollHeight: number;
|
|
161
|
-
get scrollHeight(): number;
|
|
162
|
-
/**
|
|
163
|
-
* Parent width
|
|
164
|
-
*/
|
|
165
|
-
protected _clientWidth: number;
|
|
166
|
-
get clientWidth(): number;
|
|
167
|
-
/**
|
|
168
|
-
* Parent height
|
|
169
|
-
*/
|
|
170
|
-
protected _clientHeight: number;
|
|
171
|
-
get clientHeight(): number;
|
|
172
|
-
/**
|
|
173
|
-
* Maximum scrollable area of the X axis
|
|
174
|
-
*/
|
|
175
|
-
get maxScrollableWidth(): number;
|
|
176
|
-
/**
|
|
177
|
-
* Maximum scrollable area of the Y axis
|
|
178
|
-
*/
|
|
179
|
-
get maxScrollableHeight(): number;
|
|
180
|
-
/**
|
|
181
|
-
* If the approximation between the target and current scroll values must be instantaneous
|
|
182
|
-
*/
|
|
183
|
-
protected _instant: boolean;
|
|
184
|
-
/**
|
|
185
|
-
* Inner AnimationFrame.
|
|
186
|
-
* The AnimationFrame is not create if an outer AnimationFrame is passed in properties.
|
|
187
|
-
*/
|
|
188
|
-
protected _animationFrame?: AnimationFrame;
|
|
189
|
-
/**
|
|
190
|
-
* AnimationFrame callback is used for outer AnimationFrame only.
|
|
191
|
-
*/
|
|
192
|
-
protected _outerAnimationFrameEvent?: NCallbacks.AddedCallback;
|
|
193
|
-
constructor(initialProp?: (StaticProp & ChangeableProp), init?: boolean);
|
|
194
|
-
protected _getDefaultProp(): DeepRequired<StaticProp & ChangeableProp> & {
|
|
195
|
-
selectors: {
|
|
196
|
-
outer: string | HTMLElement;
|
|
197
|
-
elements: string | false | HTMLElement | HTMLElement[] | {
|
|
198
|
-
[x: number]: HTMLElement;
|
|
199
|
-
item: (index: number) => HTMLElement;
|
|
200
|
-
forEach: (callbackfn: (value: HTMLElement, key: number, parent: NodeListOf<HTMLElement>) => void, thisArg?: any) => void;
|
|
201
|
-
entries: () => IterableIterator<[number, HTMLElement]>;
|
|
202
|
-
keys: () => IterableIterator<number>;
|
|
203
|
-
values: () => IterableIterator<HTMLElement>;
|
|
204
|
-
[Symbol.iterator]: () => IterableIterator<HTMLElement>;
|
|
205
|
-
readonly length: number;
|
|
206
|
-
};
|
|
207
|
-
};
|
|
208
|
-
animationFrame: false | {
|
|
209
|
-
readonly isPlaying: boolean;
|
|
210
|
-
play: () => void;
|
|
211
|
-
pause: () => void;
|
|
212
|
-
readonly prop: {
|
|
213
|
-
parent: any;
|
|
214
|
-
fps: number;
|
|
215
|
-
run: boolean;
|
|
216
|
-
};
|
|
217
|
-
readonly callbacks: {
|
|
218
|
-
readonly callbacks: {
|
|
219
|
-
id: string;
|
|
220
|
-
on: boolean;
|
|
221
|
-
data: {
|
|
222
|
-
target: keyof import("../../animation-frame/AnimationFrame").NAnimationFrame.CallbacksTypes;
|
|
223
|
-
do: (arg: false | {
|
|
224
|
-
fps: number;
|
|
225
|
-
realFPS: number;
|
|
226
|
-
prevFrameDuration: number;
|
|
227
|
-
}) => void;
|
|
228
|
-
name: string;
|
|
229
|
-
timeout: number;
|
|
230
|
-
protected: boolean;
|
|
231
|
-
once: boolean;
|
|
232
|
-
};
|
|
233
|
-
}[];
|
|
234
|
-
add: <Target extends keyof import("../../animation-frame/AnimationFrame").NAnimationFrame.CallbacksTypes>(target: Target, func: (arg: import("../../animation-frame/AnimationFrame").NAnimationFrame.CallbacksTypes[Target]) => void, data?: NCallbacks.CallbackBaseSettings) => NCallbacks.AddedCallback;
|
|
235
|
-
remove: (id: string, removeProtected?: boolean) => boolean;
|
|
236
|
-
removeAll: (removeProtected?: boolean) => void;
|
|
237
|
-
turn: (id: string, enabled?: boolean) => boolean;
|
|
238
|
-
get: (id: string) => false | NCallbacks.CallbacksData<import("../../animation-frame/AnimationFrame").NAnimationFrame.CallbacksTypes>;
|
|
239
|
-
tbt: <T extends keyof import("../../animation-frame/AnimationFrame").NAnimationFrame.CallbacksTypes>(target: T, arg: import("../../animation-frame/AnimationFrame").NAnimationFrame.CallbacksTypes[T]) => void;
|
|
240
|
-
destroy: () => void;
|
|
241
|
-
};
|
|
242
|
-
readonly prefix: string;
|
|
243
|
-
readonly name: string;
|
|
244
|
-
readonly destroyed: boolean;
|
|
245
|
-
addResponsiveProp: (rules: import("../../..").NMutableProp.Responsive<import("../../animation-frame/AnimationFrame").NAnimationFrame.ChangeableProp>) => void;
|
|
246
|
-
changeProp: (prop?: import("../../animation-frame/AnimationFrame").NAnimationFrame.ChangeableProp) => void;
|
|
247
|
-
init: () => void;
|
|
248
|
-
addViewportCallback: (target: keyof import("../../..").NViewport.CallbacksTypes, func: (arg: import("../../..").NViewport.Changes) => void, data?: NCallbacks.CallbackBaseSettings) => NCallbacks.AddedCallback;
|
|
249
|
-
addCallback: <Target_1 extends keyof import("../../animation-frame/AnimationFrame").NAnimationFrame.CallbacksTypes>(target: Target_1, func: (arg: import("../../animation-frame/AnimationFrame").NAnimationFrame.CallbacksTypes[Target_1]) => void, data?: NCallbacks.CallbackBaseSettings) => NCallbacks.AddedCallback;
|
|
250
|
-
addEventListeners: <El extends import("vevet-dom").ListenerElement, Target_2 extends keyof HTMLElementEventMap, Callback extends (evt: HTMLElementEventMap[Target_2]) => void>(el: El, target: Target_2, callback: Callback, options?: import("vevet-dom").IAddEventListenerOptions) => import("vevet-dom").IAddEventListener;
|
|
251
|
-
destroy: () => void;
|
|
252
|
-
};
|
|
253
|
-
enabled: boolean;
|
|
254
|
-
recalculateSizes: boolean;
|
|
255
|
-
useWheel: boolean;
|
|
256
|
-
isHorizontal: boolean;
|
|
257
|
-
autoStop: boolean;
|
|
258
|
-
lerp: number;
|
|
259
|
-
lerpToFixed: number | false;
|
|
260
|
-
};
|
|
261
|
-
protected _setEvents(): void;
|
|
262
|
-
protected _onPropMutate(): void;
|
|
263
|
-
/**
|
|
264
|
-
* Recalculate scroll sizes
|
|
265
|
-
*/
|
|
266
|
-
resize(
|
|
267
|
-
/**
|
|
268
|
-
* If the method was called natively on window resize
|
|
269
|
-
*/
|
|
270
|
-
native?: boolean): void;
|
|
271
|
-
/**
|
|
272
|
-
* Recalculate scroll sizes
|
|
273
|
-
*/
|
|
274
|
-
protected _recalculateSizes(): void;
|
|
275
|
-
/**
|
|
276
|
-
* Update elements' properties
|
|
277
|
-
*/
|
|
278
|
-
protected _updateElementsProp(): void;
|
|
279
|
-
/**
|
|
280
|
-
* Event on wheel
|
|
281
|
-
*/
|
|
282
|
-
protected _handleWheel(evt: WheelEvent): void;
|
|
283
|
-
/**
|
|
284
|
-
* Toggle animation: Enable / Disable scrolling
|
|
285
|
-
*/
|
|
286
|
-
protected _toggle(): void;
|
|
287
|
-
/**
|
|
288
|
-
* Enable scrolling
|
|
289
|
-
*/
|
|
290
|
-
enable(): void;
|
|
291
|
-
/**
|
|
292
|
-
* Disable scrolling
|
|
293
|
-
*/
|
|
294
|
-
disable(): void;
|
|
295
|
-
/**
|
|
296
|
-
* Render elements
|
|
297
|
-
*/
|
|
298
|
-
render(): void;
|
|
299
|
-
/**
|
|
300
|
-
* Calculate elements' values.
|
|
301
|
-
* @param {boolean} instant - If animation is to be implemented instantly.
|
|
302
|
-
*/
|
|
303
|
-
protected _calcElements(): void;
|
|
304
|
-
/**
|
|
305
|
-
* Interpolate values
|
|
306
|
-
*/
|
|
307
|
-
protected _lerp(current: number, target: number, ease?: number): number;
|
|
308
|
-
/**
|
|
309
|
-
* Get element ease
|
|
310
|
-
*/
|
|
311
|
-
protected _getLerpEase(el: ScrollInnerElement): number;
|
|
312
|
-
/**
|
|
313
|
-
* Render elements
|
|
314
|
-
*/
|
|
315
|
-
protected _renderElements(): void;
|
|
316
|
-
/**
|
|
317
|
-
* Destroy the scroll
|
|
318
|
-
*/
|
|
319
|
-
protected _destroy(): void;
|
|
320
|
-
}
|
|
321
|
-
export {};
|
|
322
|
-
//# sourceMappingURL=CustomScroll.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CustomScroll.d.ts","sourceRoot":"","sources":["../../../../../src/ts/components/scroll/custom-scroll/CustomScroll.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,EA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;IACH,SAAS,CAAC,OAAO;IAQjB;;OAEG;IACI,MAAM;IAcb;;OAEG;IACI,OAAO;IAWd;;OAEG;IACI,MAAM;IAkCb;;;OAGG;IACH,SAAS,CAAC,aAAa;IAgBvB;;OAEG;IACH,SAAS,CAAC,KAAK,CACX,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,IAAI,SAAiB;IAYzB;;OAEG;IACH,SAAS,CAAC,YAAY,CAClB,EAAE,EAAE,kBAAkB;IAQ1B;;OAEG;IACH,SAAS,CAAC,eAAe;IAazB;;OAEG;IACH,SAAS,CAAC,QAAQ;CA0BrB"}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { Component, NComponent } from '../../base/Component';
|
|
2
|
-
import { DeepRequired } from '../../utils/types/utility';
|
|
3
|
-
export declare namespace NSplitText {
|
|
4
|
-
/**
|
|
5
|
-
* Static properties
|
|
6
|
-
*/
|
|
7
|
-
interface StaticProp extends NComponent.StaticProp {
|
|
8
|
-
/**
|
|
9
|
-
* Text container
|
|
10
|
-
*/
|
|
11
|
-
container?: string | Element;
|
|
12
|
-
/**
|
|
13
|
-
* Timeout before lines are updated when the window is resized.
|
|
14
|
-
* @default 0
|
|
15
|
-
*/
|
|
16
|
-
resizeTimeout?: number;
|
|
17
|
-
append?: {
|
|
18
|
-
/**
|
|
19
|
-
* If you need to wrap each letter into a single element.
|
|
20
|
-
* @default true
|
|
21
|
-
*/
|
|
22
|
-
letters: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* If you need to wrap each word into a single element.
|
|
25
|
-
* @default true
|
|
26
|
-
*/
|
|
27
|
-
words: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* If you need to wrap each line into a single element.
|
|
30
|
-
* @default false
|
|
31
|
-
*/
|
|
32
|
-
lines: boolean;
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Changeable properties
|
|
37
|
-
*/
|
|
38
|
-
interface ChangeableProp extends NComponent.ChangeableProp {
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Available callbacks
|
|
42
|
-
*/
|
|
43
|
-
interface CallbacksTypes extends NComponent.CallbacksTypes {
|
|
44
|
-
'resize': false;
|
|
45
|
-
'split': false;
|
|
46
|
-
}
|
|
47
|
-
interface Letter {
|
|
48
|
-
el: HTMLElement | false;
|
|
49
|
-
content: string;
|
|
50
|
-
newLine: boolean;
|
|
51
|
-
whitespace: boolean;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* The class splits text in an element into words, letters, and lines.
|
|
56
|
-
* This may be useful when animating the text.
|
|
57
|
-
*/
|
|
58
|
-
export declare class SplitText<StaticProp extends NSplitText.StaticProp = NSplitText.StaticProp, ChangeableProp extends NSplitText.ChangeableProp = NSplitText.ChangeableProp, CallbacksTypes extends NSplitText.CallbacksTypes = NSplitText.CallbacksTypes> extends Component<StaticProp, ChangeableProp, CallbacksTypes> {
|
|
59
|
-
protected _getDefaultProp(): DeepRequired<StaticProp & ChangeableProp> & {
|
|
60
|
-
container: string | Element;
|
|
61
|
-
append: {
|
|
62
|
-
letters: boolean;
|
|
63
|
-
words: boolean;
|
|
64
|
-
lines: boolean;
|
|
65
|
-
};
|
|
66
|
-
resizeTimeout: number;
|
|
67
|
-
};
|
|
68
|
-
protected _constructor(): void;
|
|
69
|
-
/**
|
|
70
|
-
* Text container
|
|
71
|
-
*/
|
|
72
|
-
protected _container: Element | null;
|
|
73
|
-
/**
|
|
74
|
-
* Get text container
|
|
75
|
-
*/
|
|
76
|
-
get container(): Element;
|
|
77
|
-
/**
|
|
78
|
-
* innerHTML of the container
|
|
79
|
-
*/
|
|
80
|
-
protected _html: string;
|
|
81
|
-
/**
|
|
82
|
-
* textContent of the container
|
|
83
|
-
*/
|
|
84
|
-
protected _text: string | null;
|
|
85
|
-
/**
|
|
86
|
-
* Defines if the text is already split
|
|
87
|
-
*/
|
|
88
|
-
protected _isSplit: boolean;
|
|
89
|
-
/**
|
|
90
|
-
* Text letters
|
|
91
|
-
*/
|
|
92
|
-
protected _letters: NSplitText.Letter[];
|
|
93
|
-
/**
|
|
94
|
-
* Get text letters
|
|
95
|
-
*/
|
|
96
|
-
get letters(): NSplitText.Letter[];
|
|
97
|
-
/**
|
|
98
|
-
* Create split text
|
|
99
|
-
*/
|
|
100
|
-
protected _create(): void;
|
|
101
|
-
/**
|
|
102
|
-
* Set events
|
|
103
|
-
*/
|
|
104
|
-
protected _setEvents(): void;
|
|
105
|
-
/**
|
|
106
|
-
* Resize the text
|
|
107
|
-
*/
|
|
108
|
-
protected _resize(): void;
|
|
109
|
-
/**
|
|
110
|
-
* Split the text
|
|
111
|
-
*/
|
|
112
|
-
split(): void;
|
|
113
|
-
/**
|
|
114
|
-
* Split text into words
|
|
115
|
-
*/
|
|
116
|
-
protected _splitToWords(text: string): void;
|
|
117
|
-
}
|
|
118
|
-
//# sourceMappingURL=SplitText.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SplitText.d.ts","sourceRoot":"","sources":["../../../../src/ts/components/split-text/SplitText.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAG7D,OAAO,EAAmB,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAI1E,yBAAiB,UAAU,CAAC;IAExB;;OAEG;IACH,UAAiB,UAAW,SAAQ,UAAU,CAAC,UAAU;QACrD;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;QAC7B;;;WAGG;QACH,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,MAAM,CAAC,EAAE;YACL;;;eAGG;YACH,OAAO,EAAE,OAAO,CAAC;YACjB;;;eAGG;YACH,KAAK,EAAE,OAAO,CAAC;YACf;;;eAGG;YACH,KAAK,EAAE,OAAO,CAAC;SAClB,CAAC;KACL;IAED;;OAEG;IACH,UAAiB,cAAe,SAAQ,UAAU,CAAC,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@
|
|
|
1
|
-
{"version":3,"file":"boundVal.d.ts","sourceRoot":"","sources":["../../../../src/ts/utils/math/boundVal.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAC5B,GAAG,EAAE,MAAM,EACX,KAAK,GAAE,CAAC,MAAM,EAAE,MAAM,CAAU,UASnC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Get progress relatively to the scope.
|
|
3
|
-
*
|
|
4
|
-
* @example
|
|
5
|
-
*
|
|
6
|
-
* scopeProgress(.35, [0, 1]);
|
|
7
|
-
* // => .5
|
|
8
|
-
* scopeProgress(.35, [.25, 1]);
|
|
9
|
-
* // => .133
|
|
10
|
-
*/
|
|
11
|
-
export default function scopeProgress(
|
|
12
|
-
/**
|
|
13
|
-
* Current progress
|
|
14
|
-
*/
|
|
15
|
-
progress: number,
|
|
16
|
-
/**
|
|
17
|
-
* Progress scope
|
|
18
|
-
*/
|
|
19
|
-
scope: [number, number]): number;
|
|
20
|
-
//# sourceMappingURL=scopeProgress.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scopeProgress.d.ts","sourceRoot":"","sources":["../../../../src/ts/utils/math/scopeProgress.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa;AACjC;;GAEG;AACH,QAAQ,EAAE,MAAM;AAChB;;GAEG;AACH,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,UAI1B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spreadScopeProgress.d.ts","sourceRoot":"","sources":["../../../../src/ts/utils/math/spreadScopeProgress.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CACvC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,sBAYhB"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Get progress relatively to the scope.
|
|
3
|
-
*
|
|
4
|
-
* @example
|
|
5
|
-
*
|
|
6
|
-
* scopeProgress(.35, [0, 1]);
|
|
7
|
-
* // => .5
|
|
8
|
-
* scopeProgress(.35, [.25, 1]);
|
|
9
|
-
* // => .133
|
|
10
|
-
*/
|
|
11
|
-
export default function scopeProgress (
|
|
12
|
-
/**
|
|
13
|
-
* Current progress
|
|
14
|
-
*/
|
|
15
|
-
progress: number,
|
|
16
|
-
/**
|
|
17
|
-
* Progress scope
|
|
18
|
-
*/
|
|
19
|
-
scope: [number, number],
|
|
20
|
-
) {
|
|
21
|
-
const result = (progress - scope[0]) / (scope[1] - scope[0]);
|
|
22
|
-
return result;
|
|
23
|
-
}
|