vevet 1.4.27 → 2.0.1-dev.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/LICENSE +1 -1
- package/README.md +7 -71
- package/build/cdn/index.js +12 -0
- package/build/cdn/index.js.LICENSE.txt +14 -0
- package/build/cjs/app/Application.js +297 -0
- package/build/cjs/app/events/PageLoad.js +74 -0
- package/build/cjs/app/events/Viewport.js +303 -0
- package/build/cjs/base/Callbacks.js +232 -0
- package/build/cjs/base/Component.js +56 -0
- package/build/cjs/base/Module.js +262 -0
- package/build/cjs/base/MutableProp.js +165 -0
- package/build/cjs/base/Plugin.js +56 -0
- package/build/cjs/components/animation-frame/AnimationFrame.js +183 -0
- package/build/cjs/components/canvas/Ctx2D.js +200 -0
- package/build/cjs/components/canvas/Ctx2DPrerender.js +72 -0
- package/build/cjs/components/cursor/CustomCursor.js +344 -0
- package/build/cjs/components/dragger/Dragger.js +229 -0
- package/build/cjs/components/dragger/DraggerDirection.js +77 -0
- package/build/cjs/components/dragger/DraggerMove.js +84 -0
- package/build/cjs/components/loading/Preloader.js +229 -0
- package/build/cjs/components/loading/ProgressPreloader.js +377 -0
- package/build/cjs/components/page/Page.js +353 -0
- package/build/cjs/components/scroll/custom-scroll/CustomScroll.js +517 -0
- package/build/cjs/components/scroll/plugins/SmoothScrollDragPlugin.js +178 -0
- package/build/cjs/components/scroll/plugins/SmoothScrollKeyboardPlugin.js +138 -0
- package/build/cjs/components/scroll/scrollable/ScrollEventsBase.js +133 -0
- package/build/cjs/components/scroll/scrollable/ScrollView.js +315 -0
- package/build/cjs/components/scroll/scrollbar/Bar.js +315 -0
- package/build/cjs/components/scroll/scrollbar/ScrollBar.js +206 -0
- package/build/cjs/components/scroll/smooth-scroll/SmoothScroll.js +625 -0
- package/build/cjs/components/scroll/types.js +2 -0
- package/build/cjs/components/split-text/SplitText.js +233 -0
- package/build/cjs/components/text/SplitText.js +329 -0
- package/build/cjs/components/timeline/StaticTimeline.js +137 -0
- package/build/cjs/components/timeline/Timeline.js +190 -0
- package/build/cjs/index.js +87 -0
- package/build/cjs/utils/common/index.js +12 -0
- package/build/cjs/utils/common/mergeWithoutArrays.js +19 -0
- package/build/cjs/utils/common/randID.js +11 -0
- package/build/cjs/utils/common/timeoutCallback.js +17 -0
- package/build/cjs/utils/errors.js +8 -0
- package/build/cjs/utils/listeners/index.js +10 -0
- package/build/cjs/utils/listeners/intersectionObserverSupported.js +11 -0
- package/build/cjs/utils/listeners/onScroll.js +47 -0
- package/build/cjs/utils/math/boundVal.js +16 -0
- package/build/cjs/utils/math/index.js +12 -0
- package/build/cjs/utils/math/lerp.js +15 -0
- package/build/cjs/utils/math/scopeProgress.js +25 -0
- package/build/cjs/utils/types/general.js +2 -0
- package/build/cjs/utils/types/utility.js +2 -0
- package/build/es/app/Application.js +210 -0
- package/build/es/app/events/PageLoad.js +47 -0
- package/build/es/app/events/Viewport.js +232 -0
- package/build/es/base/Callbacks.js +205 -0
- package/build/es/base/Component.js +32 -0
- package/build/es/base/Module.js +225 -0
- package/build/es/base/MutableProp.js +152 -0
- package/build/es/base/Plugin.js +31 -0
- package/build/es/components/animation-frame/AnimationFrame.js +145 -0
- package/build/es/components/canvas/Ctx2D.js +133 -0
- package/build/es/components/canvas/Ctx2DPrerender.js +37 -0
- package/build/es/components/cursor/CustomCursor.js +274 -0
- package/build/es/components/dragger/Dragger.js +175 -0
- package/build/es/components/dragger/DraggerDirection.js +42 -0
- package/build/es/components/dragger/DraggerMove.js +56 -0
- package/build/es/components/loading/Preloader.js +164 -0
- package/build/es/components/loading/ProgressPreloader.js +304 -0
- package/build/es/components/page/Page.js +283 -0
- package/build/es/components/scroll/custom-scroll/CustomScroll.js +486 -0
- package/build/es/components/scroll/plugins/SmoothScrollDragPlugin.js +140 -0
- package/build/es/components/scroll/plugins/SmoothScrollKeyboardPlugin.js +109 -0
- package/build/es/components/scroll/scrollable/ScrollEventsBase.js +79 -0
- package/build/es/components/scroll/scrollable/ScrollView.js +264 -0
- package/build/es/components/scroll/scrollbar/Bar.js +262 -0
- package/build/es/components/scroll/scrollbar/ScrollBar.js +152 -0
- package/build/es/components/scroll/smooth-scroll/SmoothScroll.js +519 -0
- package/build/es/components/scroll/types.js +1 -0
- package/build/es/components/split-text/SplitText.js +199 -0
- package/build/es/components/text/SplitText.js +270 -0
- package/build/es/components/timeline/StaticTimeline.js +92 -0
- package/build/es/components/timeline/Timeline.js +141 -0
- package/build/es/index.js +37 -0
- package/build/es/utils/common/index.js +4 -0
- package/build/es/utils/common/mergeWithoutArrays.js +13 -0
- package/build/es/utils/common/randID.js +7 -0
- package/build/es/utils/common/timeoutCallback.js +14 -0
- package/build/es/utils/errors.js +5 -0
- package/build/es/utils/listeners/index.js +3 -0
- package/build/es/utils/listeners/intersectionObserverSupported.js +8 -0
- package/build/es/utils/listeners/onScroll.js +44 -0
- package/build/es/utils/math/boundVal.js +12 -0
- package/build/es/utils/math/index.js +4 -0
- package/build/es/utils/math/lerp.js +11 -0
- package/build/es/utils/math/scopeProgress.js +22 -0
- package/build/es/utils/types/general.js +1 -0
- package/build/es/utils/types/utility.js +1 -0
- package/build/types/app/Application.d.ts +161 -0
- package/build/types/app/Application.d.ts.map +1 -0
- package/build/types/app/events/PageLoad.d.ts +28 -0
- package/build/types/app/events/PageLoad.d.ts.map +1 -0
- package/build/types/app/events/Viewport.d.ts +137 -0
- package/build/types/app/events/Viewport.d.ts.map +1 -0
- package/build/types/base/Callbacks.d.ts +174 -0
- package/build/types/base/Callbacks.d.ts.map +1 -0
- package/build/types/base/Component.d.ts +48 -0
- package/build/types/base/Component.d.ts.map +1 -0
- package/build/types/base/Module.d.ts +179 -0
- package/build/types/base/Module.d.ts.map +1 -0
- package/build/types/base/MutableProp.d.ts +142 -0
- package/build/types/base/MutableProp.d.ts.map +1 -0
- package/build/types/base/Plugin.d.ts +35 -0
- package/build/types/base/Plugin.d.ts.map +1 -0
- package/build/types/components/animation-frame/AnimationFrame.d.ts +96 -0
- package/build/types/components/animation-frame/AnimationFrame.d.ts.map +1 -0
- package/build/types/components/canvas/Ctx2D.d.ts +111 -0
- package/build/types/components/canvas/Ctx2D.d.ts.map +1 -0
- package/build/types/components/canvas/Ctx2DPrerender.d.ts +41 -0
- package/build/types/components/canvas/Ctx2DPrerender.d.ts.map +1 -0
- package/build/types/components/cursor/CustomCursor.d.ts +181 -0
- package/build/types/components/cursor/CustomCursor.d.ts.map +1 -0
- package/build/types/components/dragger/Dragger.d.ts +120 -0
- package/build/types/components/dragger/Dragger.d.ts.map +1 -0
- package/build/types/components/dragger/DraggerDirection.d.ts +39 -0
- package/build/types/components/dragger/DraggerDirection.d.ts.map +1 -0
- package/build/types/components/dragger/DraggerMove.d.ts +49 -0
- package/build/types/components/dragger/DraggerMove.d.ts.map +1 -0
- package/build/types/components/loading/Preloader.d.ts +107 -0
- package/build/types/components/loading/Preloader.d.ts.map +1 -0
- package/build/types/components/loading/ProgressPreloader.d.ts +166 -0
- package/build/types/components/loading/ProgressPreloader.d.ts.map +1 -0
- package/build/types/components/page/Page.d.ts +126 -0
- package/build/types/components/page/Page.d.ts.map +1 -0
- package/build/types/components/scroll/custom-scroll/CustomScroll.d.ts +322 -0
- package/build/types/components/scroll/custom-scroll/CustomScroll.d.ts.map +1 -0
- package/build/types/components/scroll/plugins/SmoothScrollDragPlugin.d.ts +97 -0
- package/build/types/components/scroll/plugins/SmoothScrollDragPlugin.d.ts.map +1 -0
- package/build/types/components/scroll/plugins/SmoothScrollKeyboardPlugin.d.ts +34 -0
- package/build/types/components/scroll/plugins/SmoothScrollKeyboardPlugin.d.ts.map +1 -0
- package/build/types/components/scroll/scrollable/ScrollEventsBase.d.ts +60 -0
- package/build/types/components/scroll/scrollable/ScrollEventsBase.d.ts.map +1 -0
- package/build/types/components/scroll/scrollable/ScrollView.d.ts +140 -0
- package/build/types/components/scroll/scrollable/ScrollView.d.ts.map +1 -0
- package/build/types/components/scroll/scrollbar/Bar.d.ts +84 -0
- package/build/types/components/scroll/scrollbar/Bar.d.ts.map +1 -0
- package/build/types/components/scroll/scrollbar/ScrollBar.d.ts +109 -0
- package/build/types/components/scroll/scrollbar/ScrollBar.d.ts.map +1 -0
- package/build/types/components/scroll/smooth-scroll/SmoothScroll.d.ts +307 -0
- package/build/types/components/scroll/smooth-scroll/SmoothScroll.d.ts.map +1 -0
- package/build/types/components/scroll/types.d.ts +11 -0
- package/build/types/components/scroll/types.d.ts.map +1 -0
- package/build/types/components/split-text/SplitText.d.ts +118 -0
- package/build/types/components/split-text/SplitText.d.ts.map +1 -0
- package/build/types/components/text/SplitText.d.ts +118 -0
- package/build/types/components/text/SplitText.d.ts.map +1 -0
- package/build/types/components/timeline/StaticTimeline.d.ts +92 -0
- package/build/types/components/timeline/StaticTimeline.d.ts.map +1 -0
- package/build/types/components/timeline/Timeline.d.ts +101 -0
- package/build/types/components/timeline/Timeline.d.ts.map +1 -0
- package/build/types/index.d.ts +38 -0
- package/build/types/index.d.ts.map +1 -0
- package/build/types/utils/common/index.d.ts +5 -0
- package/build/types/utils/common/index.d.ts.map +1 -0
- package/build/types/utils/common/mergeWithoutArrays.d.ts +6 -0
- package/build/types/utils/common/mergeWithoutArrays.d.ts.map +1 -0
- package/build/types/utils/common/randID.d.ts +5 -0
- package/build/types/utils/common/randID.d.ts.map +1 -0
- package/build/types/utils/common/timeoutCallback.d.ts +6 -0
- package/build/types/utils/common/timeoutCallback.d.ts.map +1 -0
- package/build/types/utils/errors.d.ts +3 -0
- package/build/types/utils/errors.d.ts.map +1 -0
- package/build/types/utils/listeners/index.d.ts +4 -0
- package/build/types/utils/listeners/index.d.ts.map +1 -0
- package/build/types/utils/listeners/intersectionObserverSupported.d.ts +2 -0
- package/build/types/utils/listeners/intersectionObserverSupported.d.ts.map +1 -0
- package/build/types/utils/listeners/onScroll.d.ts +10 -0
- package/build/types/utils/listeners/onScroll.d.ts.map +1 -0
- package/build/types/utils/math/boundVal.d.ts +5 -0
- package/build/types/utils/math/boundVal.d.ts.map +1 -0
- package/build/types/utils/math/index.d.ts +5 -0
- package/build/types/utils/math/index.d.ts.map +1 -0
- package/build/types/utils/math/lerp.d.ts +5 -0
- package/build/types/utils/math/lerp.d.ts.map +1 -0
- package/build/types/utils/math/scopeProgress.d.ts +20 -0
- package/build/types/utils/math/scopeProgress.d.ts.map +1 -0
- package/build/types/utils/types/general.d.ts +7 -0
- package/build/types/utils/types/general.d.ts.map +1 -0
- package/build/types/utils/types/utility.d.ts +14 -0
- package/build/types/utils/types/utility.d.ts.map +1 -0
- package/package.json +88 -82
- package/src/cdn/index.js +3 -0
- package/src/sass/base.scss +3 -0
- package/src/sass/components/cursor/_custom-cursor.scss +63 -0
- package/src/sass/components/index.scss +6 -0
- package/src/sass/components/loading/_preloader.scss +15 -0
- package/src/sass/components/scroll/_scrollbar.scss +73 -0
- package/src/sass/components/scroll/_smooth-scroll.scss +17 -0
- package/src/sass/index.scss +3 -0
- package/src/sass/mixins/_scroll.scss +7 -0
- package/{dist/scss → src/sass}/mixins/_transition.scss +8 -4
- package/src/sass/mixins/_viewport.scss +69 -0
- package/src/sass/mixins/index.scss +3 -0
- package/src/ts/app/Application.ts +350 -0
- package/src/ts/app/events/PageLoad.ts +79 -0
- package/src/ts/app/events/Viewport.ts +365 -0
- package/src/ts/base/Callbacks.ts +380 -0
- package/src/ts/base/Component.ts +83 -0
- package/src/ts/base/Module.ts +385 -0
- package/src/ts/base/MutableProp.ts +242 -0
- package/src/ts/base/Plugin.ts +76 -0
- package/src/ts/components/animation-frame/AnimationFrame.ts +264 -0
- package/src/ts/components/canvas/Ctx2D.ts +260 -0
- package/src/ts/components/canvas/Ctx2DPrerender.ts +96 -0
- package/src/ts/components/cursor/CustomCursor.ts +462 -0
- package/src/ts/components/dragger/Dragger.ts +313 -0
- package/src/ts/components/dragger/DraggerDirection.ts +106 -0
- package/src/ts/components/dragger/DraggerMove.ts +114 -0
- package/src/ts/components/loading/Preloader.ts +279 -0
- package/src/ts/components/loading/ProgressPreloader.ts +484 -0
- package/src/ts/components/page/Page.ts +421 -0
- package/src/ts/components/scroll/plugins/SmoothScrollDragPlugin.ts +251 -0
- package/src/ts/components/scroll/plugins/SmoothScrollKeyboardPlugin.ts +166 -0
- package/src/ts/components/scroll/scrollable/ScrollEventsBase.ts +151 -0
- package/src/ts/components/scroll/scrollable/ScrollView.ts +435 -0
- package/src/ts/components/scroll/scrollbar/Bar.ts +364 -0
- package/src/ts/components/scroll/scrollbar/ScrollBar.ts +292 -0
- package/src/ts/components/scroll/smooth-scroll/SmoothScroll.ts +861 -0
- package/src/ts/components/scroll/types.ts +10 -0
- package/src/ts/components/text/SplitText.ts +418 -0
- package/src/ts/components/timeline/StaticTimeline.ts +197 -0
- package/src/ts/components/timeline/Timeline.ts +256 -0
- package/src/ts/index.ts +94 -0
- package/src/ts/utils/common/index.ts +9 -0
- package/src/ts/utils/common/mergeWithoutArrays.ts +20 -0
- package/src/ts/utils/common/randID.ts +9 -0
- package/src/ts/utils/common/timeoutCallback.ts +16 -0
- package/src/ts/utils/errors.ts +6 -0
- package/src/ts/utils/listeners/index.ts +7 -0
- package/src/ts/utils/listeners/intersectionObserverSupported.ts +10 -0
- package/src/ts/utils/listeners/onScroll.ts +56 -0
- package/src/ts/utils/math/boundVal.ts +15 -0
- package/src/ts/utils/math/index.ts +9 -0
- package/src/ts/utils/math/lerp.ts +16 -0
- package/src/ts/utils/math/scopeProgress.ts +23 -0
- package/src/ts/utils/types/general.ts +7 -0
- package/src/ts/utils/types/utility.ts +34 -0
- package/dist/js/AJAXEvent.js +0 -355
- package/dist/js/Application.js +0 -345
- package/dist/js/ColumnsModule.js +0 -392
- package/dist/js/CursorModule.js +0 -390
- package/dist/js/DraggerModule.js +0 -792
- package/dist/js/Event.js +0 -538
- package/dist/js/FilterModule.js +0 -943
- package/dist/js/FormModule.js +0 -706
- package/dist/js/FrameModule.js +0 -229
- package/dist/js/IntervalModule.js +0 -270
- package/dist/js/KeydownModule.js +0 -293
- package/dist/js/LoadEvent.js +0 -106
- package/dist/js/MenuBaseModule.js +0 -292
- package/dist/js/MenuModule.js +0 -265
- package/dist/js/MenuTimelineModule.js +0 -321
- package/dist/js/Module.js +0 -478
- package/dist/js/PageAjaxModule.js +0 -1010
- package/dist/js/PageLoadMediaPlugin.js +0 -285
- package/dist/js/PageModule.js +0 -440
- package/dist/js/PaginationModule.js +0 -961
- package/dist/js/PaginationScrollPlugin.js +0 -209
- package/dist/js/Plugin.js +0 -114
- package/dist/js/PopupModule.js +0 -942
- package/dist/js/PreloaderModule.js +0 -724
- package/dist/js/ResponsiveProp.js +0 -301
- package/dist/js/ScrollAnchorModule.js +0 -554
- package/dist/js/ScrollAnimateModule.js +0 -419
- package/dist/js/ScrollBarPlugin.js +0 -594
- package/dist/js/ScrollDragPlugin.js +0 -396
- package/dist/js/ScrollModule.js +0 -1071
- package/dist/js/ScrollViewModule.js +0 -388
- package/dist/js/SelectModule.js +0 -860
- package/dist/js/SliderCanvasModule.js +0 -733
- package/dist/js/SliderControlsPlugin.js +0 -247
- package/dist/js/SliderCounterPlugin.js +0 -278
- package/dist/js/SliderDotsPlugin.js +0 -270
- package/dist/js/SliderDragSwipePlugin.js +0 -245
- package/dist/js/SliderIntervalPlugin.js +0 -192
- package/dist/js/SliderKeydownPlugin.js +0 -185
- package/dist/js/SliderModule.js +0 -1062
- package/dist/js/SliderWheelPlugin.js +0 -194
- package/dist/js/TextAnimateModule.js +0 -663
- package/dist/js/TextSplitModule.js +0 -785
- package/dist/js/TimelineBaseModule.js +0 -405
- package/dist/js/TimelineModule.js +0 -494
- package/dist/js/URLEvent.js +0 -239
- package/dist/js/ViewportEvent.js +0 -465
- package/dist/js/WheelEventModule.js +0 -295
- package/dist/js/domChildOf.js +0 -46
- package/dist/js/domChildren.js +0 -47
- package/dist/js/domInsertAfter.js +0 -32
- package/dist/js/domRemoveChildren.js +0 -26
- package/dist/js/easing.js +0 -363
- package/dist/js/eventListenerAdd.js +0 -87
- package/dist/js/eventListenerGet.js +0 -49
- package/dist/js/eventListenerRemove.js +0 -36
- package/dist/js/generateId.js +0 -29
- package/dist/js/getBrowserName.js +0 -60
- package/dist/js/getOsName.js +0 -39
- package/dist/js/getVevetProperties.js +0 -22
- package/dist/js/index.js +0 -519
- package/dist/js/mathScopeProgress.js +0 -32
- package/dist/js/mathSpreadScopeProgress.js +0 -35
- package/dist/js/merge.js +0 -33
- package/dist/js/normalizeWheel.js +0 -97
- package/dist/js/text_animate_module_addons/_composite_elementary.js +0 -196
- package/dist/js/text_animate_module_addons/_elementary.js +0 -88
- package/dist/js/timeoutCallback.js +0 -26
- package/dist/js/vevet.js +0 -10
- package/dist/scss/_prefix.scss +0 -1
- package/dist/scss/classes/_clear.scss +0 -5
- package/dist/scss/classes/_col-row.scss +0 -48
- package/dist/scss/classes/_display.scss +0 -65
- package/dist/scss/classes/_document-reset.scss +0 -28
- package/dist/scss/classes/_document.scss +0 -7
- package/dist/scss/classes/_overflow.scss +0 -39
- package/dist/scss/classes/_position.scss +0 -55
- package/dist/scss/classes/_text.scss +0 -24
- package/dist/scss/classes/_transition.scss +0 -22
- package/dist/scss/classes/_wrap.scss +0 -31
- package/dist/scss/classes/index.scss +0 -14
- package/dist/scss/index.scss +0 -3
- package/dist/scss/mixins/_clear.scss +0 -6
- package/dist/scss/mixins/_display.scss +0 -6
- package/dist/scss/mixins/_form.scss +0 -14
- package/dist/scss/mixins/_position.scss +0 -42
- package/dist/scss/mixins/_reset.scss +0 -17
- package/dist/scss/mixins/_responsive.scss +0 -88
- package/dist/scss/mixins/index.scss +0 -7
- package/dist/scss/modules/columns/_settings.scss +0 -1
- package/dist/scss/modules/columns/index.scss +0 -19
- package/dist/scss/modules/cursor/_settings.scss +0 -7
- package/dist/scss/modules/cursor/index.scss +0 -15
- package/dist/scss/modules/form/_settings.scss +0 -15
- package/dist/scss/modules/form/index.scss +0 -57
- package/dist/scss/modules/index.scss +0 -11
- package/dist/scss/modules/menu/_button.scss +0 -58
- package/dist/scss/modules/menu/_menu.scss +0 -25
- package/dist/scss/modules/menu/_settings.scss +0 -23
- package/dist/scss/modules/menu/index.scss +0 -3
- package/dist/scss/modules/pagination/_settings.scss +0 -6
- package/dist/scss/modules/pagination/index.scss +0 -24
- package/dist/scss/modules/popup/_settings.scss +0 -26
- package/dist/scss/modules/popup/index.scss +0 -294
- package/dist/scss/modules/preloader/_settings.scss +0 -3
- package/dist/scss/modules/preloader/index.scss +0 -19
- package/dist/scss/modules/scroll/_settings.scss +0 -22
- package/dist/scss/modules/scroll/index.scss +0 -94
- package/dist/scss/modules/select/_settings.scss +0 -28
- package/dist/scss/modules/select/index.scss +0 -142
- package/dist/scss/modules/slider/_settings.scss +0 -35
- package/dist/scss/modules/slider/index.scss +0 -153
- package/dist/scss/modules/text/_settings.scss +0 -1
- package/dist/scss/modules/text/index.scss +0 -19
- package/dist/types/types.d.ts +0 -18763
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface ScrollableElement {
|
|
2
|
+
scrollTop: number;
|
|
3
|
+
scrollTo(options: ScrollToOptions): void;
|
|
4
|
+
scrollTo(x: number, y: number): void;
|
|
5
|
+
scrollLeft: number;
|
|
6
|
+
scrollWidth: number;
|
|
7
|
+
scrollHeight: number;
|
|
8
|
+
clientWidth: number;
|
|
9
|
+
clientHeight: number;
|
|
10
|
+
}
|
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
import { createElement, selectOne } from 'vevet-dom';
|
|
2
|
+
import { Component, NComponent } from '../../base/Component';
|
|
3
|
+
import { RequiredModuleProp } from '../../utils/types/utility';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export namespace NSplitText {
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Static properties
|
|
11
|
+
*/
|
|
12
|
+
export interface StaticProp extends NComponent.StaticProp {
|
|
13
|
+
/**
|
|
14
|
+
* The text container. You may use a CSS selector or the element itself.
|
|
15
|
+
* @default '#v-split-text'
|
|
16
|
+
*/
|
|
17
|
+
container?: string | Element;
|
|
18
|
+
/**
|
|
19
|
+
* If need to split text into letters.
|
|
20
|
+
* @default true
|
|
21
|
+
*/
|
|
22
|
+
appendLetters?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* If need to split text into lines.
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
appendLines?: boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Changeable properties
|
|
32
|
+
*/
|
|
33
|
+
export interface ChangeableProp extends NComponent.ChangeableProp { }
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Available callbacks
|
|
37
|
+
*/
|
|
38
|
+
export interface CallbacksTypes extends NComponent.CallbacksTypes {
|
|
39
|
+
'split': false;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface Line {
|
|
43
|
+
el: HTMLElement;
|
|
44
|
+
content: string;
|
|
45
|
+
words: NSplitText.Word[];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface Word {
|
|
49
|
+
el: HTMLElement;
|
|
50
|
+
content: string;
|
|
51
|
+
hasNewLine: boolean;
|
|
52
|
+
br?: HTMLBRElement;
|
|
53
|
+
whitespace?: Text;
|
|
54
|
+
letters: NSplitText.Letter[];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface Letter {
|
|
58
|
+
el: HTMLElement;
|
|
59
|
+
content: string;
|
|
60
|
+
word: NSplitText.Word;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Split text into letters, words & lines
|
|
69
|
+
*/
|
|
70
|
+
export class SplitText <
|
|
71
|
+
StaticProp extends NSplitText.StaticProp = NSplitText.StaticProp,
|
|
72
|
+
ChangeableProp extends NSplitText.ChangeableProp = NSplitText.ChangeableProp,
|
|
73
|
+
CallbacksTypes extends NSplitText.CallbacksTypes = NSplitText.CallbacksTypes,
|
|
74
|
+
> extends Component <
|
|
75
|
+
StaticProp,
|
|
76
|
+
ChangeableProp,
|
|
77
|
+
CallbacksTypes
|
|
78
|
+
> {
|
|
79
|
+
protected _getDefaultProp <
|
|
80
|
+
T extends RequiredModuleProp<StaticProp & ChangeableProp>
|
|
81
|
+
> (): T {
|
|
82
|
+
return {
|
|
83
|
+
...super._getDefaultProp(),
|
|
84
|
+
container: `#${this.prefix}`,
|
|
85
|
+
appendLetters: true,
|
|
86
|
+
appendLines: false,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
get prefix () {
|
|
91
|
+
return `${this._app.prefix}split-text`;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Initial text
|
|
97
|
+
*/
|
|
98
|
+
protected _initText: string;
|
|
99
|
+
/**
|
|
100
|
+
* Initial HTML content
|
|
101
|
+
*/
|
|
102
|
+
protected _initHTML: string;
|
|
103
|
+
/**
|
|
104
|
+
* If the text is already split into letters and words
|
|
105
|
+
*/
|
|
106
|
+
protected _isPrimarySplit: boolean;
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Text container
|
|
112
|
+
*/
|
|
113
|
+
get container () {
|
|
114
|
+
return this._container;
|
|
115
|
+
}
|
|
116
|
+
protected _container!: HTMLElement;
|
|
117
|
+
|
|
118
|
+
get letters () {
|
|
119
|
+
return this._letters;
|
|
120
|
+
}
|
|
121
|
+
protected _letters: NSplitText.Letter[];
|
|
122
|
+
|
|
123
|
+
get words () {
|
|
124
|
+
return this._words;
|
|
125
|
+
}
|
|
126
|
+
protected _words: NSplitText.Word[];
|
|
127
|
+
|
|
128
|
+
get lines () {
|
|
129
|
+
return this._lines;
|
|
130
|
+
}
|
|
131
|
+
protected _lines: NSplitText.Line[];
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
constructor (
|
|
136
|
+
initialProp?: (StaticProp & ChangeableProp),
|
|
137
|
+
init = true,
|
|
138
|
+
) {
|
|
139
|
+
super(initialProp, false);
|
|
140
|
+
|
|
141
|
+
// get text container
|
|
142
|
+
if (this.prop.container) {
|
|
143
|
+
const container = selectOne(this.prop.container);
|
|
144
|
+
if (container instanceof HTMLElement) {
|
|
145
|
+
this._container = container;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// add classes
|
|
150
|
+
if (this._container) {
|
|
151
|
+
this._container.classList.add(this.prefix);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// get initial text
|
|
155
|
+
this._initHTML = this._container.innerHTML;
|
|
156
|
+
this._initText = (this._container.innerText || 'no rendered text').trim();
|
|
157
|
+
this._initText = this._initText.replace(/\s+\n/gm, '\n');
|
|
158
|
+
|
|
159
|
+
// set default vars
|
|
160
|
+
this._isPrimarySplit = false;
|
|
161
|
+
this._letters = [];
|
|
162
|
+
this._words = [];
|
|
163
|
+
this._lines = [];
|
|
164
|
+
|
|
165
|
+
// initialize the class
|
|
166
|
+
if (init) {
|
|
167
|
+
this.init();
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
protected _setEvents () {
|
|
172
|
+
super._setEvents();
|
|
173
|
+
|
|
174
|
+
// split the text
|
|
175
|
+
this.splitText();
|
|
176
|
+
if (this.prop.appendLines) {
|
|
177
|
+
this.addViewportCallback('', () => {
|
|
178
|
+
this.splitText();
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Split the text
|
|
187
|
+
*/
|
|
188
|
+
public splitText () {
|
|
189
|
+
// split into words & letters
|
|
190
|
+
if (!this._isPrimarySplit) {
|
|
191
|
+
this.container.innerHTML = '';
|
|
192
|
+
this._splitIntoWords();
|
|
193
|
+
this._splitIntoLetters();
|
|
194
|
+
this._appendWords();
|
|
195
|
+
this._isPrimarySplit = true;
|
|
196
|
+
}
|
|
197
|
+
// split text into lines
|
|
198
|
+
if (this.prop.appendLines) {
|
|
199
|
+
this._splitIntoLines();
|
|
200
|
+
}
|
|
201
|
+
// launch callbacks
|
|
202
|
+
this.callbacks.tbt('split', false);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Split the text into words
|
|
209
|
+
*/
|
|
210
|
+
protected _splitIntoWords () {
|
|
211
|
+
const chars = this._initText.split('');
|
|
212
|
+
|
|
213
|
+
// create words
|
|
214
|
+
let wordIndex = 0;
|
|
215
|
+
chars.forEach((char) => {
|
|
216
|
+
// get an existing word or create a base for a new one
|
|
217
|
+
const currentWord: NSplitText.Word = this._words[wordIndex] || {
|
|
218
|
+
content: '',
|
|
219
|
+
hasNewLine: false,
|
|
220
|
+
el: createElement('span', {
|
|
221
|
+
class: `${this.prefix}__word`,
|
|
222
|
+
}),
|
|
223
|
+
letters: [],
|
|
224
|
+
};
|
|
225
|
+
currentWord.el.style.display = 'inline-block';
|
|
226
|
+
this._words[wordIndex] = currentWord;
|
|
227
|
+
|
|
228
|
+
// get type of the char
|
|
229
|
+
const charCode = char.charCodeAt(0);
|
|
230
|
+
const isWhitespace = charCode === 32 || charCode === 160;
|
|
231
|
+
const isNewLine = charCode === 10;
|
|
232
|
+
|
|
233
|
+
// add elements
|
|
234
|
+
if (isWhitespace) {
|
|
235
|
+
currentWord.whitespace = document.createTextNode(' ');
|
|
236
|
+
}
|
|
237
|
+
if (isNewLine) {
|
|
238
|
+
currentWord.br = createElement('br');
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// update word states
|
|
242
|
+
currentWord.hasNewLine = isNewLine;
|
|
243
|
+
// go to next word if needed
|
|
244
|
+
if (isWhitespace || isNewLine) {
|
|
245
|
+
wordIndex += 1;
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// update contents
|
|
250
|
+
currentWord.content += char;
|
|
251
|
+
if (!this.prop.appendLetters) {
|
|
252
|
+
currentWord.el.innerHTML = currentWord.content;
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Append split words to the container
|
|
259
|
+
*/
|
|
260
|
+
protected _appendWords () {
|
|
261
|
+
this._words.forEach((word) => {
|
|
262
|
+
this.container.appendChild(word.el);
|
|
263
|
+
if (word.whitespace) {
|
|
264
|
+
this.container.appendChild(word.whitespace);
|
|
265
|
+
}
|
|
266
|
+
if (word.br) {
|
|
267
|
+
this.container.appendChild(word.br);
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Remove split words from DOM
|
|
274
|
+
*/
|
|
275
|
+
protected _removeWords () {
|
|
276
|
+
this._words.forEach((word) => {
|
|
277
|
+
word.el.remove();
|
|
278
|
+
if (word.whitespace) {
|
|
279
|
+
word.whitespace.remove();
|
|
280
|
+
}
|
|
281
|
+
if (word.br) {
|
|
282
|
+
word.br.remove();
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Split the text into letters
|
|
291
|
+
*/
|
|
292
|
+
protected _splitIntoLetters () {
|
|
293
|
+
// check if need to have letters
|
|
294
|
+
if (!this.prop.appendLetters) {
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// create letters
|
|
299
|
+
this._words.forEach((word) => {
|
|
300
|
+
const chars = word.content.split('');
|
|
301
|
+
const wordLetters: NSplitText.Letter[] = [];
|
|
302
|
+
chars.forEach((char) => {
|
|
303
|
+
const letter = {
|
|
304
|
+
el: createElement('span', {
|
|
305
|
+
class: `${this.prefix}__letter`,
|
|
306
|
+
html: char,
|
|
307
|
+
}),
|
|
308
|
+
content: char,
|
|
309
|
+
word,
|
|
310
|
+
};
|
|
311
|
+
letter.el.style.display = 'inline-block';
|
|
312
|
+
this._letters.push(letter);
|
|
313
|
+
wordLetters.push(letter);
|
|
314
|
+
});
|
|
315
|
+
word.letters = wordLetters;
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
// append letters
|
|
319
|
+
this._letters.forEach((letter) => {
|
|
320
|
+
letter.word.el.appendChild(letter.el);
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* Split the text into lines
|
|
328
|
+
*/
|
|
329
|
+
protected _splitIntoLines () {
|
|
330
|
+
// first of all, remove all previous lines
|
|
331
|
+
this._removeLines();
|
|
332
|
+
|
|
333
|
+
// create lines
|
|
334
|
+
let currentLine: NSplitText.Line | false = false;
|
|
335
|
+
let prevOffsetTop = Infinity;
|
|
336
|
+
let prevWord: NSplitText.Word | false = false;
|
|
337
|
+
this.words.forEach((word) => {
|
|
338
|
+
// check if need to create a new line
|
|
339
|
+
let isNewLine = false;
|
|
340
|
+
const top = word.el.offsetTop;
|
|
341
|
+
// check if the previous word contains BR
|
|
342
|
+
if (!!prevWord && !!prevWord.br) {
|
|
343
|
+
isNewLine = true;
|
|
344
|
+
} else {
|
|
345
|
+
// otherwise check offset
|
|
346
|
+
isNewLine = top !== prevOffsetTop;
|
|
347
|
+
}
|
|
348
|
+
// update vars
|
|
349
|
+
prevWord = word;
|
|
350
|
+
prevOffsetTop = top;
|
|
351
|
+
|
|
352
|
+
// create new line
|
|
353
|
+
if (isNewLine) {
|
|
354
|
+
currentLine = {
|
|
355
|
+
el: createElement('span', {
|
|
356
|
+
class: `${this.prefix}__line`,
|
|
357
|
+
}),
|
|
358
|
+
content: '',
|
|
359
|
+
words: [],
|
|
360
|
+
};
|
|
361
|
+
currentLine.el.style.display = 'block';
|
|
362
|
+
this._lines.push(currentLine);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// append words
|
|
366
|
+
if (currentLine) {
|
|
367
|
+
currentLine.words.push(word);
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
|
|
371
|
+
// update lines content
|
|
372
|
+
this._lines.forEach((line) => {
|
|
373
|
+
line.content = line.words.map((word) => word.content).join(' ');
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
// append lines
|
|
377
|
+
this._lines.forEach((line) => {
|
|
378
|
+
line.words.forEach((word) => {
|
|
379
|
+
line.el.appendChild(word.el);
|
|
380
|
+
if (word.br) {
|
|
381
|
+
word.br.remove();
|
|
382
|
+
}
|
|
383
|
+
if (word.whitespace) {
|
|
384
|
+
line.el.appendChild(word.whitespace);
|
|
385
|
+
}
|
|
386
|
+
});
|
|
387
|
+
this.container.appendChild(line.el);
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* Remove all lines
|
|
393
|
+
*/
|
|
394
|
+
protected _removeLines () {
|
|
395
|
+
// remove lines
|
|
396
|
+
this._lines.forEach((line) => {
|
|
397
|
+
line.el.remove();
|
|
398
|
+
});
|
|
399
|
+
this._lines = [];
|
|
400
|
+
// and append words
|
|
401
|
+
this._appendWords();
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* Destroy the module
|
|
408
|
+
*/
|
|
409
|
+
protected _destroy () {
|
|
410
|
+
super._destroy();
|
|
411
|
+
|
|
412
|
+
this._lines = [];
|
|
413
|
+
this._words = [];
|
|
414
|
+
this._letters = [];
|
|
415
|
+
|
|
416
|
+
this._container.innerHTML = this._initHTML;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import easingProgress from 'easing-progress';
|
|
2
|
+
import { NApplication } from '../../app/Application';
|
|
3
|
+
import { Component, NComponent } from '../../base/Component';
|
|
4
|
+
import { RequiredModuleProp } from '../../utils/types/utility';
|
|
5
|
+
import scopeProgress from '../../utils/math/scopeProgress';
|
|
6
|
+
import boundVal from '../../utils/math/boundVal';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export namespace NStaticTimeline {
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Static properties
|
|
14
|
+
*/
|
|
15
|
+
export interface StaticProp extends NComponent.StaticProp {
|
|
16
|
+
/**
|
|
17
|
+
* Timeline easing function
|
|
18
|
+
*/
|
|
19
|
+
easing?: NApplication.Prop['easing'];
|
|
20
|
+
/**
|
|
21
|
+
* Timeline scope is used for nested timelines.
|
|
22
|
+
* The first value means that animation will start only when the absolute progress
|
|
23
|
+
* of the parent timeline reaches this value. The second value is
|
|
24
|
+
* the end of animation relatively to the parent timeline. <br>
|
|
25
|
+
* This property should be set for a nested timeline.
|
|
26
|
+
* @default [0, 1]
|
|
27
|
+
*/
|
|
28
|
+
nestedScope?: [number, number];
|
|
29
|
+
/**
|
|
30
|
+
* Define if you want to use easing progress to calculate current progress
|
|
31
|
+
* of nested timelines according to their scope. <br>
|
|
32
|
+
* This property should be set for the parent timeline.
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
35
|
+
useNestedEasingProgress?: boolean;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Changeable properties
|
|
40
|
+
*/
|
|
41
|
+
export interface ChangeableProp extends NComponent.ChangeableProp { }
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Available callbacks
|
|
45
|
+
*/
|
|
46
|
+
export interface ProgressArg {
|
|
47
|
+
progress: number;
|
|
48
|
+
easing: number;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Available callbacks
|
|
53
|
+
*/
|
|
54
|
+
export interface CallbacksTypes extends NComponent.CallbacksTypes {
|
|
55
|
+
'progress': ProgressArg;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* StaticTimeline is the base class for Timeline itself.
|
|
64
|
+
* The difference between the coponents is that StaticTimeline has no animation:
|
|
65
|
+
* no play & pause methods.
|
|
66
|
+
*/
|
|
67
|
+
export class StaticTimeline <
|
|
68
|
+
StaticProp extends NStaticTimeline.StaticProp = NStaticTimeline.StaticProp,
|
|
69
|
+
ChangeableProp extends NStaticTimeline.ChangeableProp = NStaticTimeline.ChangeableProp,
|
|
70
|
+
CallbacksTypes extends NStaticTimeline.CallbacksTypes = NStaticTimeline.CallbacksTypes,
|
|
71
|
+
> extends Component <
|
|
72
|
+
StaticProp,
|
|
73
|
+
ChangeableProp,
|
|
74
|
+
CallbacksTypes
|
|
75
|
+
> {
|
|
76
|
+
/**
|
|
77
|
+
* Get default properties
|
|
78
|
+
*/
|
|
79
|
+
protected _getDefaultProp <
|
|
80
|
+
T extends RequiredModuleProp<StaticProp & ChangeableProp>
|
|
81
|
+
> (): T {
|
|
82
|
+
return {
|
|
83
|
+
...super._getDefaultProp(),
|
|
84
|
+
easing: this._app.prop.easing,
|
|
85
|
+
scope: [0, 1],
|
|
86
|
+
useNestedEasingProgress: false,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
protected _progress: number;
|
|
93
|
+
/**
|
|
94
|
+
* Absolute progress of the timeline
|
|
95
|
+
*/
|
|
96
|
+
get progress () {
|
|
97
|
+
return this._progress;
|
|
98
|
+
}
|
|
99
|
+
set progress (val: number) {
|
|
100
|
+
this._progress = val;
|
|
101
|
+
this._handleProgress();
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
protected _easing: number;
|
|
106
|
+
/**
|
|
107
|
+
* Easing progress of the timeline
|
|
108
|
+
*/
|
|
109
|
+
get easing () {
|
|
110
|
+
return this._easing;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Nested timelines
|
|
115
|
+
*/
|
|
116
|
+
protected _nestedTimelines: StaticTimeline[];
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
constructor (
|
|
121
|
+
initialProp?: (StaticProp & ChangeableProp),
|
|
122
|
+
init = true,
|
|
123
|
+
) {
|
|
124
|
+
super(initialProp, false);
|
|
125
|
+
|
|
126
|
+
// set default vars
|
|
127
|
+
this._progress = 0;
|
|
128
|
+
this._easing = 0;
|
|
129
|
+
this._nestedTimelines = [];
|
|
130
|
+
|
|
131
|
+
if (init) {
|
|
132
|
+
this.init();
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Add a nested timeline
|
|
140
|
+
*/
|
|
141
|
+
public addNestedTimeline (
|
|
142
|
+
tm: StaticTimeline,
|
|
143
|
+
) {
|
|
144
|
+
// add the timeline to the stack
|
|
145
|
+
this._nestedTimelines.push(tm);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Handle progress event
|
|
150
|
+
*/
|
|
151
|
+
protected _handleProgress () {
|
|
152
|
+
// calculate easing progress
|
|
153
|
+
this._easing = easingProgress(this._progress, this.prop.easing);
|
|
154
|
+
// launch progress events
|
|
155
|
+
this._callbacks.tbt('progress', {
|
|
156
|
+
progress: this._progress,
|
|
157
|
+
easing: this._easing,
|
|
158
|
+
});
|
|
159
|
+
// render
|
|
160
|
+
this._renderNestedTimelines();
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Render nested timelines
|
|
165
|
+
*/
|
|
166
|
+
protected _renderNestedTimelines () {
|
|
167
|
+
const { length } = this._nestedTimelines;
|
|
168
|
+
if (length === 0) {
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
// vars
|
|
172
|
+
const progressForNested = this.prop.useNestedEasingProgress ? this.easing : this.progress;
|
|
173
|
+
// render nested timelines
|
|
174
|
+
for (let index = 0, l = length; index < l; index += 1) {
|
|
175
|
+
const tm = this._nestedTimelines[index];
|
|
176
|
+
// calculate progress of this very timeline
|
|
177
|
+
const tmProgress = boundVal(
|
|
178
|
+
scopeProgress(progressForNested, tm.prop.nestedScope),
|
|
179
|
+
[0, 1],
|
|
180
|
+
);
|
|
181
|
+
tm.progress = tmProgress;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Destroy the animation frame
|
|
189
|
+
*/
|
|
190
|
+
protected _destroy () {
|
|
191
|
+
super._destroy();
|
|
192
|
+
// destroy nested timelines
|
|
193
|
+
this._nestedTimelines.forEach((tm) => {
|
|
194
|
+
tm.destroy();
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
}
|