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
|
@@ -1,663 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _TextSplitModule2 = _interopRequireDefault(require("./TextSplitModule"));
|
|
11
|
-
|
|
12
|
-
var _merge = _interopRequireDefault(require("./merge"));
|
|
13
|
-
|
|
14
|
-
var _TimelineModule = _interopRequireDefault(require("./TimelineModule"));
|
|
15
|
-
|
|
16
|
-
var _mathScopeProgress = _interopRequireDefault(require("./mathScopeProgress"));
|
|
17
|
-
|
|
18
|
-
var _easing = _interopRequireDefault(require("./easing"));
|
|
19
|
-
|
|
20
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
|
|
22
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
23
|
-
|
|
24
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
25
|
-
|
|
26
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
27
|
-
|
|
28
|
-
function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }
|
|
29
|
-
|
|
30
|
-
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
|
31
|
-
|
|
32
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
33
|
-
|
|
34
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
35
|
-
|
|
36
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
37
|
-
|
|
38
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
39
|
-
|
|
40
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
41
|
-
|
|
42
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
43
|
-
|
|
44
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
45
|
-
|
|
46
|
-
var isarray = require("isarray");
|
|
47
|
-
|
|
48
|
-
var elementary = require("./text_animate_module_addons/_elementary");
|
|
49
|
-
|
|
50
|
-
var composite_elementary = require("./text_animate_module_addons/_composite_elementary");
|
|
51
|
-
/**
|
|
52
|
-
* @classdesc Animation of text. <br>
|
|
53
|
-
* Available types of animation by default:
|
|
54
|
-
* <ul>
|
|
55
|
-
* <li>letter</li>
|
|
56
|
-
* <li>word</li>
|
|
57
|
-
* <li>wordletter</li>
|
|
58
|
-
* <li>line</li>
|
|
59
|
-
* <li>lineletter</li>
|
|
60
|
-
* <li>lineword</li>
|
|
61
|
-
* </ul>
|
|
62
|
-
* Available targets:
|
|
63
|
-
* <ul>
|
|
64
|
-
* <li>resize - when window is resizes.</li>
|
|
65
|
-
* <li>split - when the text is splitted into letters, words & lines. Argument - {@linkcode Vevet.TextSplitModule.Elements}</li>
|
|
66
|
-
* </ul>
|
|
67
|
-
* <br><br> <b>import {TextAnimateModule} from 'vevet';</b>
|
|
68
|
-
*
|
|
69
|
-
* @class
|
|
70
|
-
* @memberof Vevet
|
|
71
|
-
* @augments Vevet.TextSplitModule
|
|
72
|
-
* @requires Vevet.TimelineModule
|
|
73
|
-
*/
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
var TextAnimateModule = /*#__PURE__*/function (_TextSplitModule) {
|
|
77
|
-
_inherits(TextAnimateModule, _TextSplitModule);
|
|
78
|
-
|
|
79
|
-
var _super = _createSuper(TextAnimateModule);
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* @memberof Vevet.TextAnimateModule
|
|
83
|
-
* @typedef {object} Properties
|
|
84
|
-
* @augments Vevet.TextSplitModule.Properties
|
|
85
|
-
*/
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* @alias Vevet.TextAnimateModule
|
|
89
|
-
*
|
|
90
|
-
* @param {Vevet.TextAnimateModule.Properties} [data]
|
|
91
|
-
*/
|
|
92
|
-
function TextAnimateModule(data) {
|
|
93
|
-
_classCallCheck(this, TextAnimateModule);
|
|
94
|
-
|
|
95
|
-
return _super.call(this, data);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
_createClass(TextAnimateModule, [{
|
|
99
|
-
key: "prefix",
|
|
100
|
-
get: function get() {
|
|
101
|
-
return "".concat(this._v.prefix, "text");
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* @member Vevet.TextAnimateModule#prop
|
|
105
|
-
* @memberof Vevet.TextAnimateModule
|
|
106
|
-
* @readonly
|
|
107
|
-
* @type {Vevet.TextAnimateModule.Properties}
|
|
108
|
-
*/
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* @member Vevet.TextAnimateModule#_prop
|
|
112
|
-
* @memberof Vevet.TextAnimateModule
|
|
113
|
-
* @protected
|
|
114
|
-
* @type {Vevet.TextAnimateModule.Properties}
|
|
115
|
-
*/
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* @function Vevet.TextAnimateModule#changeProp
|
|
119
|
-
* @memberof Vevet.TextAnimateModule
|
|
120
|
-
* @param {Vevet.TextAnimateModule.Properties} [prop]
|
|
121
|
-
*/
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* @description If animation in process.
|
|
125
|
-
* @readonly
|
|
126
|
-
* @type {boolean}
|
|
127
|
-
*/
|
|
128
|
-
|
|
129
|
-
}, {
|
|
130
|
-
key: "playing",
|
|
131
|
-
get: function get() {
|
|
132
|
-
return this._playing;
|
|
133
|
-
} // Extra Constructor
|
|
134
|
-
|
|
135
|
-
}, {
|
|
136
|
-
key: "_extra",
|
|
137
|
-
value: function _extra() {
|
|
138
|
-
/**
|
|
139
|
-
* @description If animation in process.
|
|
140
|
-
* @protected
|
|
141
|
-
* @member {boolean}
|
|
142
|
-
*/
|
|
143
|
-
this._playing = false;
|
|
144
|
-
/**
|
|
145
|
-
* @description Timeline
|
|
146
|
-
* @protected
|
|
147
|
-
* @member {false|Vevet.TimelineModule}
|
|
148
|
-
*/
|
|
149
|
-
|
|
150
|
-
this._timeline = false; // split text
|
|
151
|
-
|
|
152
|
-
_get(_getPrototypeOf(TextAnimateModule.prototype), "_extra", this).call(this);
|
|
153
|
-
} // Resize & Split
|
|
154
|
-
|
|
155
|
-
}, {
|
|
156
|
-
key: "_resize",
|
|
157
|
-
value: function _resize() {
|
|
158
|
-
var _this = this;
|
|
159
|
-
|
|
160
|
-
setTimeout(function () {
|
|
161
|
-
_this._resizeText();
|
|
162
|
-
}, this._prop.resizeTimeout);
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* @description Resize text
|
|
166
|
-
* @protected
|
|
167
|
-
*/
|
|
168
|
-
|
|
169
|
-
}, {
|
|
170
|
-
key: "_resizeText",
|
|
171
|
-
value: function _resizeText() {
|
|
172
|
-
var _this2 = this;
|
|
173
|
-
|
|
174
|
-
if (this._playing) {
|
|
175
|
-
this._timeline.add({
|
|
176
|
-
target: 'end',
|
|
177
|
-
do: function _do() {
|
|
178
|
-
_this2._resizeFunc();
|
|
179
|
-
},
|
|
180
|
-
once: true
|
|
181
|
-
});
|
|
182
|
-
} else {
|
|
183
|
-
this._resizeFunc();
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* @memberof Vevet.TextAnimateModule
|
|
188
|
-
* @typedef {object} Settings
|
|
189
|
-
* @property {Array<'letter'|'word'|'wordletter'|'line'|'lineletter'|'lineword'>} [types=['letter']] - Types of animation. All types of animation can be combined! See the types at the top.
|
|
190
|
-
* @property {number} [durationElement=250] - Duration of animation of each element according to the chosen type of animation.
|
|
191
|
-
* @property {boolean} [durationAuto=true] - Defines if the total duration will be calculated accorging to the totalamount of elements.
|
|
192
|
-
* @property {number} [duration=2500] - Total duration of the animation (will be taken into account only if durationAuto is false).
|
|
193
|
-
* @property {string|Array<number>|Function} [easing=linear] - Easing function of the Timeline.
|
|
194
|
-
* @property {string|Array<number>|Function} [easingEl] - Easing function of elements. The default value is equal to {@linkcode Vevet.Application#easing}.
|
|
195
|
-
* @property {Array<Vevet.TextAnimateModule.SettingStyle>} [letter] - Array of actions to change styles of each element. Fill it if one of your types is 'letter'.
|
|
196
|
-
* @property {Array<Vevet.TextAnimateModule.SettingStyle>} [word] - Array of actions to change styles of each element. Fill it if one of your types is 'word'.
|
|
197
|
-
* @property {Array<Vevet.TextAnimateModule.SettingStyle>} [line] - Array of actions to change styles of each word in the line. Fill it if one of your types is 'line'.
|
|
198
|
-
* @property {number} [shift=0.2] - Shift in animation chain between elements. F.e., if 0.2 then the animation of the second element will start after 80% of animation of the first element passed.
|
|
199
|
-
* @property {number} [shiftLine=0.2] - Almost the same as the previous value, though it is active for the 'line' type only.
|
|
200
|
-
* @property {boolean} [reverse=false] - Defines if the chain of animation of the elements will be reversed. It is not the same as {@linkcode Vevet.TimelineModule}.
|
|
201
|
-
* @property {boolean} [reverseComposite=false] - Defines if the chain of animation of parent elements will be reversed. It is actual only for composite types of animation.
|
|
202
|
-
* @property {boolean} [shuffle=false] - If true, the chain of animation of the elements will be chaotic.
|
|
203
|
-
* @property {boolean} [center=false] - If animation must start from center. Not available for 'lineletter' & 'lineword'.
|
|
204
|
-
* @property {Array<Vevet.TextAnimateModule.SettingCallback>} [callbacks] - Callbacks on the animation process.
|
|
205
|
-
*/
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* @memberof Vevet.TextAnimateModule
|
|
209
|
-
* @callback _styleCallback
|
|
210
|
-
* @param {Vevet.TextAnimateModule.StyleArgument} data
|
|
211
|
-
* @returns {string}
|
|
212
|
-
*/
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
* @memberof Vevet.TextAnimateModule
|
|
216
|
-
* @typedef {object} SettingStyle
|
|
217
|
-
* @property {Array<number>} [scope=[0,1]] - Scope of the animation for each element. It defines the edges of the animation line. Numbers from 0 to 1 are available. F.e., [0, 1].
|
|
218
|
-
* @property {string} [property] - The name of a css property to be changed. You can even skip it if you want to. F.e. you need to create a scramble-text-animation. In this case, you, perhaps will not need to change any css properties, though the "value" could be used as a callback for other changes.
|
|
219
|
-
* @property {Vevet.TextAnimateModule._styleCallback} value - A new value of the property. The function will recieve an object {@linkcode Vevet.TextAnimateModule.StyleArgument} as an argument and must return a new value for the property.
|
|
220
|
-
* @property {boolean} [remove=false] - Defines if we need to remove a css property after its animation is proceeded.
|
|
221
|
-
*/
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
* @memberof Vevet.TextAnimateModule
|
|
225
|
-
* @typedef {object} StyleArgument
|
|
226
|
-
* @property {number} p - Current progress of animation.
|
|
227
|
-
* @property {number} e - Current progress of animation according to 'easingEl' function.
|
|
228
|
-
* @property {number} position - Position of the element in the animation stack.
|
|
229
|
-
* @property {number} total - Total amount of elements in the animation.
|
|
230
|
-
* @property {HTMLElement} el - The element to be animated.
|
|
231
|
-
*/
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
* @memberof Vevet.TextAnimateModule
|
|
235
|
-
* @typedef {object} SettingCallback
|
|
236
|
-
* @property {number} target - The moment of the animation line at which the callback will be launched.
|
|
237
|
-
* @property {string} do - The callback itself. Each callback wil receive an object !!!!!!!! as an argument.
|
|
238
|
-
*/
|
|
239
|
-
|
|
240
|
-
/**
|
|
241
|
-
* @description Start the animation.
|
|
242
|
-
*
|
|
243
|
-
* @param {Vevet.TextAnimateModule.Settings} data - Settings of the animation.
|
|
244
|
-
*
|
|
245
|
-
* @returns {Vevet.TimelineModule|false} Returns an object if the animation is launched and false if not.
|
|
246
|
-
*/
|
|
247
|
-
|
|
248
|
-
}, {
|
|
249
|
-
key: "play",
|
|
250
|
-
value: function play(data) {
|
|
251
|
-
// check if already playing
|
|
252
|
-
if (this._playing) {
|
|
253
|
-
return this._timeline;
|
|
254
|
-
} // properties
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
var prop = {
|
|
258
|
-
types: ['letter'],
|
|
259
|
-
durationElement: 250,
|
|
260
|
-
durationAuto: true,
|
|
261
|
-
duration: 2500,
|
|
262
|
-
easing: 'linear',
|
|
263
|
-
easingEl: this._vp.easing,
|
|
264
|
-
letter: [],
|
|
265
|
-
word: [],
|
|
266
|
-
line: [],
|
|
267
|
-
shift: .2,
|
|
268
|
-
shiftLine: .2,
|
|
269
|
-
reverse: false,
|
|
270
|
-
reverseComposite: false,
|
|
271
|
-
shuffle: false,
|
|
272
|
-
center: false,
|
|
273
|
-
callbacks: []
|
|
274
|
-
};
|
|
275
|
-
prop = (0, _merge.default)(prop, data); // merge style settings
|
|
276
|
-
|
|
277
|
-
prop.letter = this._mergeSettingStyle(prop.letter);
|
|
278
|
-
prop.word = this._mergeSettingStyle(prop.word);
|
|
279
|
-
prop.line = this._mergeSettingStyle(prop.line); // define animation prototype & get data for each type
|
|
280
|
-
|
|
281
|
-
var infos = [];
|
|
282
|
-
|
|
283
|
-
for (var i = 0; i < prop.types.length; i++) {
|
|
284
|
-
var type = prop.types[i],
|
|
285
|
-
prototype = type;
|
|
286
|
-
|
|
287
|
-
if (type === 'letter' || type === 'word' || type === 'line') {
|
|
288
|
-
prototype = 'elementary';
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
if (type === 'lineletter' || type === 'lineword' || type === 'wordletter') {
|
|
292
|
-
prototype = 'composite_elementary';
|
|
293
|
-
} // launch for type
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
if (typeof this["animate_".concat(prototype)] != "undefined") {
|
|
297
|
-
infos.push(this["animate_".concat(prototype)](prop, type));
|
|
298
|
-
}
|
|
299
|
-
} // check if there are types
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
if (infos.length === 0) {
|
|
303
|
-
return false;
|
|
304
|
-
} // calculate how much time for each type
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
var animationInfo = this._calcTypesTime(infos); // launch animation
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
this._timeline = this._animate(animationInfo, prop); // return object timeline if animation launched
|
|
311
|
-
|
|
312
|
-
return this._timeline;
|
|
313
|
-
}
|
|
314
|
-
/**
|
|
315
|
-
* @description Merge style settings
|
|
316
|
-
* @protected
|
|
317
|
-
* @param {Array<Vevet.TextAnimateModule.SettingStyle>} arr
|
|
318
|
-
*/
|
|
319
|
-
|
|
320
|
-
}, {
|
|
321
|
-
key: "_mergeSettingStyle",
|
|
322
|
-
value: function _mergeSettingStyle(arr) {
|
|
323
|
-
for (var i = 0; i < arr.length; i++) {
|
|
324
|
-
var el = arr[i];
|
|
325
|
-
|
|
326
|
-
if (typeof el.scope == 'undefined') {
|
|
327
|
-
el.scope = [0, 1];
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
if (typeof el.remove == 'undefined') {
|
|
331
|
-
el.remove = false;
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
return arr;
|
|
336
|
-
}
|
|
337
|
-
/**
|
|
338
|
-
* @description Calculate animation time.
|
|
339
|
-
*
|
|
340
|
-
* @protected
|
|
341
|
-
*
|
|
342
|
-
* @param {object} data - Play properties + el.
|
|
343
|
-
*/
|
|
344
|
-
|
|
345
|
-
}, {
|
|
346
|
-
key: "_animationInfo",
|
|
347
|
-
value: function _animationInfo(data) {
|
|
348
|
-
// get total amount of elements and the elements themselves
|
|
349
|
-
var amount = data.el.length,
|
|
350
|
-
el = data.el.slice(); // get duration
|
|
351
|
-
|
|
352
|
-
var duration = data.duration; // intervals of time
|
|
353
|
-
|
|
354
|
-
var timelines = []; // calculate custom duration if auto
|
|
355
|
-
|
|
356
|
-
if (data.durationAuto) {
|
|
357
|
-
// calculate duration
|
|
358
|
-
var durationFull = amount * data.durationElement,
|
|
359
|
-
shiftsDuration = (amount - 1) * data.shift * data.durationElement;
|
|
360
|
-
duration = durationFull - shiftsDuration; // get timelines
|
|
361
|
-
|
|
362
|
-
for (var i = 0; i < amount; i++) {
|
|
363
|
-
var startTime = data.durationElement * (1 - data.shift) * i,
|
|
364
|
-
endTime = startTime + data.durationElement;
|
|
365
|
-
timelines.push({
|
|
366
|
-
start: startTime / duration,
|
|
367
|
-
end: endTime / duration
|
|
368
|
-
});
|
|
369
|
-
}
|
|
370
|
-
} // calculate duration of each element if duration not auto
|
|
371
|
-
else {
|
|
372
|
-
var time = 1 / (amount - data.shift * (amount - 1));
|
|
373
|
-
|
|
374
|
-
for (var _i = 0; _i < amount; _i++) {
|
|
375
|
-
var start = time * (1 - data.shift) * _i,
|
|
376
|
-
end = start + time;
|
|
377
|
-
timelines.push({
|
|
378
|
-
start: start,
|
|
379
|
-
end: end
|
|
380
|
-
});
|
|
381
|
-
}
|
|
382
|
-
} // elements to durations
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
for (var _i2 = 0; _i2 < timelines.length; _i2++) {
|
|
386
|
-
timelines[_i2].el = el[_i2];
|
|
387
|
-
} // return object of data
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
return {
|
|
391
|
-
duration: duration,
|
|
392
|
-
timelines: timelines,
|
|
393
|
-
styles: data.styles
|
|
394
|
-
};
|
|
395
|
-
}
|
|
396
|
-
/**
|
|
397
|
-
* @description Calculate how much time for each type of animation
|
|
398
|
-
*
|
|
399
|
-
* @protected
|
|
400
|
-
*
|
|
401
|
-
* @param {Array<object>} data - Animation data from _animationInfo.
|
|
402
|
-
*/
|
|
403
|
-
|
|
404
|
-
}, {
|
|
405
|
-
key: "_calcTypesTime",
|
|
406
|
-
value: function _calcTypesTime(data) {
|
|
407
|
-
// get durations from each type
|
|
408
|
-
var durations = [];
|
|
409
|
-
|
|
410
|
-
for (var i = 0; i < data.length; i++) {
|
|
411
|
-
durations.push(data[i].duration);
|
|
412
|
-
} // get maximum duration
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
var durationMax = Math.max.apply(Math, durations); // get scope of animations for each type
|
|
416
|
-
|
|
417
|
-
for (var _i3 = 0; _i3 < data.length; _i3++) {
|
|
418
|
-
data[_i3].scope = [0, data[_i3].duration / durationMax];
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
return {
|
|
422
|
-
animations: data,
|
|
423
|
-
duration: durationMax
|
|
424
|
-
};
|
|
425
|
-
}
|
|
426
|
-
/**
|
|
427
|
-
* @description Launch main animation.
|
|
428
|
-
*
|
|
429
|
-
* @protected
|
|
430
|
-
*
|
|
431
|
-
* @param {object} data - Animation data.
|
|
432
|
-
* @param {Vevet.TextAnimateModule.Settings} prop - Settings of the animation.
|
|
433
|
-
*/
|
|
434
|
-
|
|
435
|
-
}, {
|
|
436
|
-
key: "_animate",
|
|
437
|
-
value: function _animate(data, prop) {
|
|
438
|
-
var _this3 = this;
|
|
439
|
-
|
|
440
|
-
// create timeline animation
|
|
441
|
-
var timeline = new _TimelineModule.default(); // add progress callbacks for style
|
|
442
|
-
|
|
443
|
-
timeline.add({
|
|
444
|
-
target: 'progress',
|
|
445
|
-
do: this._animateTypes.bind(this, data, prop)
|
|
446
|
-
}); // add progress callbacks
|
|
447
|
-
|
|
448
|
-
var callbacks = prop.callbacks.slice();
|
|
449
|
-
|
|
450
|
-
for (var i = 0; i < callbacks.length; i++) {
|
|
451
|
-
callbacks[i].proceeded = false;
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
timeline.add({
|
|
455
|
-
target: 'progress',
|
|
456
|
-
do: this._callbacks.bind(this, callbacks)
|
|
457
|
-
});
|
|
458
|
-
timeline.add({
|
|
459
|
-
target: 'end',
|
|
460
|
-
do: function _do() {
|
|
461
|
-
_this3._playing = false;
|
|
462
|
-
}
|
|
463
|
-
}); // launch timeline
|
|
464
|
-
|
|
465
|
-
this._playing = true;
|
|
466
|
-
timeline.play({
|
|
467
|
-
duration: data.duration,
|
|
468
|
-
easing: prop.easing
|
|
469
|
-
}); // return timeline
|
|
470
|
-
|
|
471
|
-
return timeline;
|
|
472
|
-
}
|
|
473
|
-
/**
|
|
474
|
-
* @description Launch main animation.
|
|
475
|
-
*
|
|
476
|
-
* @protected
|
|
477
|
-
*
|
|
478
|
-
* @param {object} data - Animation data.
|
|
479
|
-
* @param {Vevet.TextAnimateModule.Settings} prop - Settings of the animation.
|
|
480
|
-
* @param {Vevet.TimelineModule.Data} p - Current progress.
|
|
481
|
-
*/
|
|
482
|
-
|
|
483
|
-
}, {
|
|
484
|
-
key: "_animateTypes",
|
|
485
|
-
value: function _animateTypes(data, prop, p) {
|
|
486
|
-
// launch types if it is time for thm
|
|
487
|
-
var types = data.animations;
|
|
488
|
-
|
|
489
|
-
for (var i = 0; i < types.length; i++) {
|
|
490
|
-
// get progress
|
|
491
|
-
var progress = 0;
|
|
492
|
-
var scope = types[i].scope;
|
|
493
|
-
|
|
494
|
-
if (p.se >= scope[0] & p.se <= scope[1]) {
|
|
495
|
-
progress = (0, _mathScopeProgress.default)(p.se, scope);
|
|
496
|
-
} else if (p.se > scope[1]) {
|
|
497
|
-
progress = 1;
|
|
498
|
-
} // launch type
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
this._animateType(progress, types[i], prop);
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
/**
|
|
505
|
-
* @description Animate elements in each type.
|
|
506
|
-
*
|
|
507
|
-
* @protected
|
|
508
|
-
*
|
|
509
|
-
* @param {number} p - Current progress.
|
|
510
|
-
* @param {object} data - Animation data.
|
|
511
|
-
* @param {Vevet.TextAnimateModule.Settings} prop - Settings of the animation.
|
|
512
|
-
*/
|
|
513
|
-
|
|
514
|
-
}, {
|
|
515
|
-
key: "_animateType",
|
|
516
|
-
value: function _animateType(p, data, prop) {
|
|
517
|
-
// go thru elements and animate them if needed
|
|
518
|
-
for (var i = 0; i < data.timelines.length; i++) {
|
|
519
|
-
// get progress
|
|
520
|
-
var progress = 0,
|
|
521
|
-
elTimeline = data.timelines[i];
|
|
522
|
-
|
|
523
|
-
if (p >= elTimeline.start & p <= elTimeline.end) {
|
|
524
|
-
progress = (0, _mathScopeProgress.default)(p, [elTimeline.start, elTimeline.end]);
|
|
525
|
-
} else if (p > elTimeline.end) {
|
|
526
|
-
progress = 1;
|
|
527
|
-
} // data obj
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
var obj = {
|
|
531
|
-
styles: data.styles,
|
|
532
|
-
p: progress,
|
|
533
|
-
prop: prop,
|
|
534
|
-
position: i,
|
|
535
|
-
total: data.timelines.length
|
|
536
|
-
},
|
|
537
|
-
el = elTimeline.el; // animate elements // animate words if type is line
|
|
538
|
-
|
|
539
|
-
if (!isarray(el)) {
|
|
540
|
-
this._animateTypeChildren(Object.assign(obj, {
|
|
541
|
-
el: el
|
|
542
|
-
}));
|
|
543
|
-
} else {
|
|
544
|
-
for (var a = 0; a < el.length; a++) {
|
|
545
|
-
this._animateTypeChildren(Object.assign(obj, {
|
|
546
|
-
el: el[a]
|
|
547
|
-
}));
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
/**
|
|
553
|
-
* @description Animate children according to the type of animation
|
|
554
|
-
* @protected
|
|
555
|
-
* @param {object} obj
|
|
556
|
-
*/
|
|
557
|
-
|
|
558
|
-
}, {
|
|
559
|
-
key: "_animateTypeChildren",
|
|
560
|
-
value: function _animateTypeChildren(obj) {
|
|
561
|
-
this._animateEl({
|
|
562
|
-
el: obj.el,
|
|
563
|
-
styles: obj.styles,
|
|
564
|
-
p: obj.p,
|
|
565
|
-
prop: obj.prop,
|
|
566
|
-
position: obj.position,
|
|
567
|
-
total: obj.total
|
|
568
|
-
});
|
|
569
|
-
}
|
|
570
|
-
/**
|
|
571
|
-
* @description Animate element.
|
|
572
|
-
*
|
|
573
|
-
* @protected
|
|
574
|
-
*
|
|
575
|
-
* @param {object} data - Animation data.
|
|
576
|
-
*/
|
|
577
|
-
|
|
578
|
-
}, {
|
|
579
|
-
key: "_animateEl",
|
|
580
|
-
value: function _animateEl(data) {
|
|
581
|
-
// absolute progress for each element
|
|
582
|
-
var p = data.p; // get current element
|
|
583
|
-
|
|
584
|
-
var el = data.el.el; // get properties
|
|
585
|
-
|
|
586
|
-
var prop = data.prop; // go thru all styles
|
|
587
|
-
|
|
588
|
-
for (var i = 0; i < data.styles.length; i++) {
|
|
589
|
-
// get styles
|
|
590
|
-
var style = data.styles[i],
|
|
591
|
-
scope = style.scope,
|
|
592
|
-
property = style.property,
|
|
593
|
-
value = style.value,
|
|
594
|
-
remove = style.remove; // get progress
|
|
595
|
-
|
|
596
|
-
var progress = 0,
|
|
597
|
-
easingProgress = 0;
|
|
598
|
-
|
|
599
|
-
if (p >= scope[0] & p <= scope[1]) {
|
|
600
|
-
progress = (0, _mathScopeProgress.default)(p, scope);
|
|
601
|
-
easingProgress = (0, _easing.default)(progress, prop.easingEl);
|
|
602
|
-
} else if (p > scope[1]) {
|
|
603
|
-
progress = 1;
|
|
604
|
-
easingProgress = 1;
|
|
605
|
-
} // apply styles
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
var resetStyles = false;
|
|
609
|
-
|
|
610
|
-
if (progress == 1 & remove) {
|
|
611
|
-
resetStyles = true;
|
|
612
|
-
}
|
|
613
|
-
|
|
614
|
-
if (!resetStyles) {
|
|
615
|
-
var val = value({
|
|
616
|
-
p: progress,
|
|
617
|
-
e: easingProgress,
|
|
618
|
-
position: data.position,
|
|
619
|
-
total: data.total,
|
|
620
|
-
el: el
|
|
621
|
-
});
|
|
622
|
-
|
|
623
|
-
if (property) {
|
|
624
|
-
el.style[property] = val;
|
|
625
|
-
}
|
|
626
|
-
} else {
|
|
627
|
-
if (property) {
|
|
628
|
-
el.style[property] = '';
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
}
|
|
633
|
-
/**
|
|
634
|
-
* @description Launch callbacks.
|
|
635
|
-
*
|
|
636
|
-
* @protected
|
|
637
|
-
*
|
|
638
|
-
* @param {Array<Vevet.TextAnimateModule.SettingCallback>} callbacks - Array of callbacks.
|
|
639
|
-
* @param {Vevet.TimelineModule.Data} p - Settings of the animation.
|
|
640
|
-
*/
|
|
641
|
-
|
|
642
|
-
}, {
|
|
643
|
-
key: "_callbacks",
|
|
644
|
-
value: function _callbacks(callbacks, p) {
|
|
645
|
-
for (var i = 0; i < callbacks.length; i++) {
|
|
646
|
-
var c = callbacks[i]; // if it is time for callbacks
|
|
647
|
-
|
|
648
|
-
if (p.se >= c.target) {
|
|
649
|
-
if (!c.proceeded) {
|
|
650
|
-
c.proceeded = true;
|
|
651
|
-
c.do();
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
}]);
|
|
657
|
-
|
|
658
|
-
return TextAnimateModule;
|
|
659
|
-
}(_TextSplitModule2.default);
|
|
660
|
-
|
|
661
|
-
exports.default = TextAnimateModule;
|
|
662
|
-
TextAnimateModule.prototype.animate_elementary = elementary;
|
|
663
|
-
TextAnimateModule.prototype.animate_composite_elementary = composite_elementary;
|