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,190 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __assign = (this && this.__assign) || function () {
|
|
18
|
+
__assign = Object.assign || function(t) {
|
|
19
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
+
s = arguments[i];
|
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
+
t[p] = s[p];
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
return __assign.apply(this, arguments);
|
|
27
|
+
};
|
|
28
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
29
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
|
+
};
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
exports.Timeline = void 0;
|
|
33
|
+
var StaticTimeline_1 = require("./StaticTimeline");
|
|
34
|
+
var boundVal_1 = __importDefault(require("../../utils/math/boundVal"));
|
|
35
|
+
/**
|
|
36
|
+
* Timeline is an animation helper.
|
|
37
|
+
*/
|
|
38
|
+
var Timeline = /** @class */ (function (_super) {
|
|
39
|
+
__extends(Timeline, _super);
|
|
40
|
+
function Timeline(initialProp, init) {
|
|
41
|
+
if (init === void 0) { init = true; }
|
|
42
|
+
var _this = _super.call(this, initialProp, false) || this;
|
|
43
|
+
// set default variables
|
|
44
|
+
_this._isPlaying = false;
|
|
45
|
+
_this._isReversed = false;
|
|
46
|
+
_this._isPaused = false;
|
|
47
|
+
_this._animationFrameLastTime = 0;
|
|
48
|
+
if (init) {
|
|
49
|
+
_this.init();
|
|
50
|
+
}
|
|
51
|
+
return _this;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Get default properties
|
|
55
|
+
*/
|
|
56
|
+
Timeline.prototype._getDefaultProp = function () {
|
|
57
|
+
return __assign(__assign({}, _super.prototype._getDefaultProp.call(this)), { duration: 1000, reset: false, destroyOnEnd: false });
|
|
58
|
+
};
|
|
59
|
+
Object.defineProperty(Timeline.prototype, "isPlaying", {
|
|
60
|
+
/**
|
|
61
|
+
* Check if timeline is playing
|
|
62
|
+
*/
|
|
63
|
+
get: function () {
|
|
64
|
+
return typeof this._animationFrame !== 'undefined';
|
|
65
|
+
},
|
|
66
|
+
enumerable: false,
|
|
67
|
+
configurable: true
|
|
68
|
+
});
|
|
69
|
+
Object.defineProperty(Timeline.prototype, "isReversed", {
|
|
70
|
+
/**
|
|
71
|
+
* Check if timeline is reversed
|
|
72
|
+
*/
|
|
73
|
+
get: function () {
|
|
74
|
+
return this._isReversed;
|
|
75
|
+
},
|
|
76
|
+
enumerable: false,
|
|
77
|
+
configurable: true
|
|
78
|
+
});
|
|
79
|
+
Object.defineProperty(Timeline.prototype, "isPaused", {
|
|
80
|
+
/**
|
|
81
|
+
* Check if timeline is paused
|
|
82
|
+
*/
|
|
83
|
+
get: function () {
|
|
84
|
+
return this._isPaused;
|
|
85
|
+
},
|
|
86
|
+
enumerable: false,
|
|
87
|
+
configurable: true
|
|
88
|
+
});
|
|
89
|
+
/**
|
|
90
|
+
* Play the timeline
|
|
91
|
+
*/
|
|
92
|
+
Timeline.prototype.play = function () {
|
|
93
|
+
if (this._destroyed) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
if (this.prop.reset && this.progress === 1) {
|
|
97
|
+
this._progress = 0;
|
|
98
|
+
}
|
|
99
|
+
this._isReversed = false;
|
|
100
|
+
this._isPaused = false;
|
|
101
|
+
if (!this.isPlaying) {
|
|
102
|
+
this._animationFrameLastTime = +new Date();
|
|
103
|
+
this._animate();
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Play reversed timeline
|
|
108
|
+
*/
|
|
109
|
+
Timeline.prototype.reverse = function () {
|
|
110
|
+
if (this._destroyed) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
if (this.prop.reset && this.progress === 0) {
|
|
114
|
+
this._progress = 1;
|
|
115
|
+
}
|
|
116
|
+
this._isReversed = true;
|
|
117
|
+
this._isPaused = false;
|
|
118
|
+
if (!this.isPlaying) {
|
|
119
|
+
this._animationFrameLastTime = +new Date();
|
|
120
|
+
this._animate();
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Pause animation
|
|
125
|
+
*/
|
|
126
|
+
Timeline.prototype.pause = function () {
|
|
127
|
+
if (this._destroyed) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
this._isPaused = true;
|
|
131
|
+
if (this._animationFrame) {
|
|
132
|
+
window.cancelAnimationFrame(this._animationFrame);
|
|
133
|
+
}
|
|
134
|
+
this._animationFrame = undefined;
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* Start animation
|
|
138
|
+
*/
|
|
139
|
+
Timeline.prototype._animate = function () {
|
|
140
|
+
// stop if animation is paused
|
|
141
|
+
if (this._isPaused) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
var isReversed = this.isReversed;
|
|
145
|
+
// calculate difference between frames
|
|
146
|
+
var currentTime = +new Date();
|
|
147
|
+
var frameDiff = Math.abs(this._animationFrameLastTime - currentTime);
|
|
148
|
+
this._animationFrameLastTime = currentTime;
|
|
149
|
+
// calculate current progress
|
|
150
|
+
var progressIterator = frameDiff / this.prop.duration / (isReversed ? -1 : 1);
|
|
151
|
+
var progressTarget = boundVal_1.default(this.progress + progressIterator, [0, 1]);
|
|
152
|
+
this.progress = progressTarget;
|
|
153
|
+
// end animation
|
|
154
|
+
if ((progressTarget === 1 && !isReversed)
|
|
155
|
+
|| (progressTarget === 0 && isReversed)) {
|
|
156
|
+
this._isReversed = false;
|
|
157
|
+
this._isPaused = false;
|
|
158
|
+
this._animationFrame = undefined;
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
// continue animation
|
|
162
|
+
this._animationFrame = window.requestAnimationFrame(this._animate.bind(this));
|
|
163
|
+
};
|
|
164
|
+
/**
|
|
165
|
+
* Events on progress
|
|
166
|
+
*/
|
|
167
|
+
Timeline.prototype._handleProgress = function () {
|
|
168
|
+
_super.prototype._handleProgress.call(this);
|
|
169
|
+
var progress = this._progress;
|
|
170
|
+
// launch callbacks
|
|
171
|
+
if (progress === 0) {
|
|
172
|
+
this.callbacks.tbt('start', false);
|
|
173
|
+
}
|
|
174
|
+
else if (progress === 1) {
|
|
175
|
+
this.callbacks.tbt('end', false);
|
|
176
|
+
if (this.prop.destroyOnEnd) {
|
|
177
|
+
this.destroy();
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
/**
|
|
182
|
+
* Destroy the timeline
|
|
183
|
+
*/
|
|
184
|
+
Timeline.prototype._destroy = function () {
|
|
185
|
+
this.pause();
|
|
186
|
+
_super.prototype._destroy.call(this);
|
|
187
|
+
};
|
|
188
|
+
return Timeline;
|
|
189
|
+
}(StaticTimeline_1.StaticTimeline));
|
|
190
|
+
exports.Timeline = Timeline;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.CustomCursor = exports.SplitText = exports.SmoothScrollDragPlugin = exports.SmoothScrollKeyboardPlugin = exports.ScrollView = exports.ScrollEventsBase = exports.ScrollBar = exports.SmoothScroll = exports.Ctx2DPrerender = exports.Ctx2D = exports.DraggerDirection = exports.DraggerMove = exports.Dragger = exports.ProgressPreloader = exports.Preloader = exports.Timeline = exports.StaticTimeline = exports.AnimationFrame = exports.Page = exports.Plugin = exports.Component = exports.Module = exports.MutableProp = exports.Callbacks = exports.PageLoad = exports.Viewport = exports.Application = exports.GeneralTypes = exports.utils = void 0;
|
|
23
|
+
var common = __importStar(require("./utils/common"));
|
|
24
|
+
var listeners = __importStar(require("./utils/listeners"));
|
|
25
|
+
var math = __importStar(require("./utils/math"));
|
|
26
|
+
var GeneralTypes = __importStar(require("./utils/types/general"));
|
|
27
|
+
exports.GeneralTypes = GeneralTypes;
|
|
28
|
+
var Application_1 = require("./app/Application");
|
|
29
|
+
Object.defineProperty(exports, "Application", { enumerable: true, get: function () { return Application_1.Application; } });
|
|
30
|
+
var Viewport_1 = require("./app/events/Viewport");
|
|
31
|
+
Object.defineProperty(exports, "Viewport", { enumerable: true, get: function () { return Viewport_1.Viewport; } });
|
|
32
|
+
var PageLoad_1 = require("./app/events/PageLoad");
|
|
33
|
+
Object.defineProperty(exports, "PageLoad", { enumerable: true, get: function () { return PageLoad_1.PageLoad; } });
|
|
34
|
+
var Callbacks_1 = require("./base/Callbacks");
|
|
35
|
+
Object.defineProperty(exports, "Callbacks", { enumerable: true, get: function () { return Callbacks_1.Callbacks; } });
|
|
36
|
+
var MutableProp_1 = require("./base/MutableProp");
|
|
37
|
+
Object.defineProperty(exports, "MutableProp", { enumerable: true, get: function () { return MutableProp_1.MutableProp; } });
|
|
38
|
+
var Module_1 = require("./base/Module");
|
|
39
|
+
Object.defineProperty(exports, "Module", { enumerable: true, get: function () { return Module_1.Module; } });
|
|
40
|
+
var Component_1 = require("./base/Component");
|
|
41
|
+
Object.defineProperty(exports, "Component", { enumerable: true, get: function () { return Component_1.Component; } });
|
|
42
|
+
var Plugin_1 = require("./base/Plugin");
|
|
43
|
+
Object.defineProperty(exports, "Plugin", { enumerable: true, get: function () { return Plugin_1.Plugin; } });
|
|
44
|
+
var Page_1 = require("./components/page/Page");
|
|
45
|
+
Object.defineProperty(exports, "Page", { enumerable: true, get: function () { return Page_1.Page; } });
|
|
46
|
+
var AnimationFrame_1 = require("./components/animation-frame/AnimationFrame");
|
|
47
|
+
Object.defineProperty(exports, "AnimationFrame", { enumerable: true, get: function () { return AnimationFrame_1.AnimationFrame; } });
|
|
48
|
+
var StaticTimeline_1 = require("./components/timeline/StaticTimeline");
|
|
49
|
+
Object.defineProperty(exports, "StaticTimeline", { enumerable: true, get: function () { return StaticTimeline_1.StaticTimeline; } });
|
|
50
|
+
var Timeline_1 = require("./components/timeline/Timeline");
|
|
51
|
+
Object.defineProperty(exports, "Timeline", { enumerable: true, get: function () { return Timeline_1.Timeline; } });
|
|
52
|
+
var Preloader_1 = require("./components/loading/Preloader");
|
|
53
|
+
Object.defineProperty(exports, "Preloader", { enumerable: true, get: function () { return Preloader_1.Preloader; } });
|
|
54
|
+
var ProgressPreloader_1 = require("./components/loading/ProgressPreloader");
|
|
55
|
+
Object.defineProperty(exports, "ProgressPreloader", { enumerable: true, get: function () { return ProgressPreloader_1.ProgressPreloader; } });
|
|
56
|
+
var Dragger_1 = require("./components/dragger/Dragger");
|
|
57
|
+
Object.defineProperty(exports, "Dragger", { enumerable: true, get: function () { return Dragger_1.Dragger; } });
|
|
58
|
+
var DraggerMove_1 = require("./components/dragger/DraggerMove");
|
|
59
|
+
Object.defineProperty(exports, "DraggerMove", { enumerable: true, get: function () { return DraggerMove_1.DraggerMove; } });
|
|
60
|
+
var DraggerDirection_1 = require("./components/dragger/DraggerDirection");
|
|
61
|
+
Object.defineProperty(exports, "DraggerDirection", { enumerable: true, get: function () { return DraggerDirection_1.DraggerDirection; } });
|
|
62
|
+
var Ctx2D_1 = require("./components/canvas/Ctx2D");
|
|
63
|
+
Object.defineProperty(exports, "Ctx2D", { enumerable: true, get: function () { return Ctx2D_1.Ctx2D; } });
|
|
64
|
+
var Ctx2DPrerender_1 = require("./components/canvas/Ctx2DPrerender");
|
|
65
|
+
Object.defineProperty(exports, "Ctx2DPrerender", { enumerable: true, get: function () { return Ctx2DPrerender_1.Ctx2DPrerender; } });
|
|
66
|
+
var SmoothScroll_1 = require("./components/scroll/smooth-scroll/SmoothScroll");
|
|
67
|
+
Object.defineProperty(exports, "SmoothScroll", { enumerable: true, get: function () { return SmoothScroll_1.SmoothScroll; } });
|
|
68
|
+
var ScrollBar_1 = require("./components/scroll/scrollbar/ScrollBar");
|
|
69
|
+
Object.defineProperty(exports, "ScrollBar", { enumerable: true, get: function () { return ScrollBar_1.ScrollBar; } });
|
|
70
|
+
var ScrollEventsBase_1 = require("./components/scroll/scrollable/ScrollEventsBase");
|
|
71
|
+
Object.defineProperty(exports, "ScrollEventsBase", { enumerable: true, get: function () { return ScrollEventsBase_1.ScrollEventsBase; } });
|
|
72
|
+
var ScrollView_1 = require("./components/scroll/scrollable/ScrollView");
|
|
73
|
+
Object.defineProperty(exports, "ScrollView", { enumerable: true, get: function () { return ScrollView_1.ScrollView; } });
|
|
74
|
+
var SmoothScrollKeyboardPlugin_1 = require("./components/scroll/plugins/SmoothScrollKeyboardPlugin");
|
|
75
|
+
Object.defineProperty(exports, "SmoothScrollKeyboardPlugin", { enumerable: true, get: function () { return SmoothScrollKeyboardPlugin_1.SmoothScrollKeyboardPlugin; } });
|
|
76
|
+
var SmoothScrollDragPlugin_1 = require("./components/scroll/plugins/SmoothScrollDragPlugin");
|
|
77
|
+
Object.defineProperty(exports, "SmoothScrollDragPlugin", { enumerable: true, get: function () { return SmoothScrollDragPlugin_1.SmoothScrollDragPlugin; } });
|
|
78
|
+
var SplitText_1 = require("./components/text/SplitText");
|
|
79
|
+
Object.defineProperty(exports, "SplitText", { enumerable: true, get: function () { return SplitText_1.SplitText; } });
|
|
80
|
+
var CustomCursor_1 = require("./components/cursor/CustomCursor");
|
|
81
|
+
Object.defineProperty(exports, "CustomCursor", { enumerable: true, get: function () { return CustomCursor_1.CustomCursor; } });
|
|
82
|
+
var utils = {
|
|
83
|
+
common: common,
|
|
84
|
+
listeners: listeners,
|
|
85
|
+
math: math,
|
|
86
|
+
};
|
|
87
|
+
exports.utils = utils;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.timeoutCallback = exports.mergeWithoutArrays = exports.randID = void 0;
|
|
7
|
+
var randID_1 = __importDefault(require("./randID"));
|
|
8
|
+
exports.randID = randID_1.default;
|
|
9
|
+
var mergeWithoutArrays_1 = __importDefault(require("./mergeWithoutArrays"));
|
|
10
|
+
exports.mergeWithoutArrays = mergeWithoutArrays_1.default;
|
|
11
|
+
var timeoutCallback_1 = __importDefault(require("./timeoutCallback"));
|
|
12
|
+
exports.timeoutCallback = timeoutCallback_1.default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var lodash_mergewith_1 = __importDefault(require("lodash.mergewith"));
|
|
7
|
+
/**
|
|
8
|
+
* Deep merge of two objects except for arrays.
|
|
9
|
+
* The function doesn't change the "object" and "source".
|
|
10
|
+
*/
|
|
11
|
+
function mergeWithoutArrays(object, source) {
|
|
12
|
+
return lodash_mergewith_1.default(object, source, function (objValue, srcValue) {
|
|
13
|
+
if (Array.isArray(objValue)) {
|
|
14
|
+
return srcValue;
|
|
15
|
+
}
|
|
16
|
+
return undefined;
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
exports.default = mergeWithoutArrays;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* Generate a random ID
|
|
5
|
+
*/
|
|
6
|
+
function randID(prefix) {
|
|
7
|
+
if (prefix === void 0) { prefix = 'id'; }
|
|
8
|
+
var id = +new Date() + "_" + Math.round(Math.random() * 1000);
|
|
9
|
+
return prefix + "_" + id;
|
|
10
|
+
}
|
|
11
|
+
exports.default = randID;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* Launch a function in a certain amount of time
|
|
5
|
+
* If the timeout argument is zero, the callback will be launched synchronously
|
|
6
|
+
*/
|
|
7
|
+
function timeoutCallback(callback, timeout) {
|
|
8
|
+
if (timeout === 0) {
|
|
9
|
+
callback();
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
setTimeout(function () {
|
|
13
|
+
callback();
|
|
14
|
+
}, timeout);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.default = timeoutCallback;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.throwVevetAppError = exports.vevetAppErrorText = void 0;
|
|
4
|
+
exports.vevetAppErrorText = "Vevet.Application does not exist yet. \nCall \"new Vevet.Application()\" before using all the stuff";
|
|
5
|
+
function throwVevetAppError() {
|
|
6
|
+
throw new Error(exports.vevetAppErrorText);
|
|
7
|
+
}
|
|
8
|
+
exports.throwVevetAppError = throwVevetAppError;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.intersectionObserverSupported = exports.onScroll = void 0;
|
|
7
|
+
var onScroll_1 = __importDefault(require("./onScroll"));
|
|
8
|
+
exports.onScroll = onScroll_1.default;
|
|
9
|
+
var intersectionObserverSupported_1 = __importDefault(require("./intersectionObserverSupported"));
|
|
10
|
+
exports.intersectionObserverSupported = intersectionObserverSupported_1.default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
function intersectionObserverSupported() {
|
|
4
|
+
if (!('IntersectionObserver' in window)
|
|
5
|
+
|| !('IntersectionObserverEntry' in window)
|
|
6
|
+
|| !('intersectionRatio' in window.IntersectionObserverEntry.prototype)) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
11
|
+
exports.default = intersectionObserverSupported;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var vevet_dom_1 = require("vevet-dom");
|
|
4
|
+
var SmoothScroll_1 = require("../../components/scroll/smooth-scroll/SmoothScroll");
|
|
5
|
+
/**
|
|
6
|
+
* Add OnScroll event
|
|
7
|
+
*/
|
|
8
|
+
function onScroll(selector, callback) {
|
|
9
|
+
var listeners = [];
|
|
10
|
+
if (selector instanceof SmoothScroll_1.SmoothScroll) {
|
|
11
|
+
selector.addCallback('scroll', function () {
|
|
12
|
+
callback({
|
|
13
|
+
scrollTop: selector.scrollTop,
|
|
14
|
+
scrollLeft: selector.scrollLeft,
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
var outer_1;
|
|
20
|
+
if (typeof selector === 'string') {
|
|
21
|
+
outer_1 = vevet_dom_1.selectOne(selector);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
outer_1 = selector;
|
|
25
|
+
}
|
|
26
|
+
if (outer_1) {
|
|
27
|
+
listeners.push(vevet_dom_1.addEventListener(outer_1, 'scroll', function () {
|
|
28
|
+
var scrollTop = outer_1 instanceof Window
|
|
29
|
+
? outer_1.pageYOffset : outer_1.scrollTop;
|
|
30
|
+
var scrollLeft = outer_1 instanceof Window
|
|
31
|
+
? outer_1.pageXOffset : outer_1.scrollLeft;
|
|
32
|
+
callback({
|
|
33
|
+
scrollTop: scrollTop,
|
|
34
|
+
scrollLeft: scrollLeft,
|
|
35
|
+
});
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
remove: function () {
|
|
41
|
+
listeners.forEach(function (listener) {
|
|
42
|
+
listener.remove();
|
|
43
|
+
});
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
exports.default = onScroll;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* Bound a value between two points
|
|
5
|
+
*/
|
|
6
|
+
function boundVal(val, scope) {
|
|
7
|
+
if (scope === void 0) { scope = [0, 1]; }
|
|
8
|
+
if (val < scope[0]) {
|
|
9
|
+
return scope[0];
|
|
10
|
+
}
|
|
11
|
+
if (val > scope[1]) {
|
|
12
|
+
return scope[1];
|
|
13
|
+
}
|
|
14
|
+
return val;
|
|
15
|
+
}
|
|
16
|
+
exports.default = boundVal;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.scopeProgress = exports.lerp = exports.boundVal = void 0;
|
|
7
|
+
var boundVal_1 = __importDefault(require("./boundVal"));
|
|
8
|
+
exports.boundVal = boundVal_1.default;
|
|
9
|
+
var lerp_1 = __importDefault(require("./lerp"));
|
|
10
|
+
exports.lerp = lerp_1.default;
|
|
11
|
+
var scopeProgress_1 = __importDefault(require("./scopeProgress"));
|
|
12
|
+
exports.scopeProgress = scopeProgress_1.default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* Linear interpolation
|
|
5
|
+
*/
|
|
6
|
+
function lerp(current, target, ease, approximationLeft) {
|
|
7
|
+
if (approximationLeft === void 0) { approximationLeft = 0.001; }
|
|
8
|
+
var val = current * (1 - ease) + target * ease;
|
|
9
|
+
var diff = Math.abs(target - val);
|
|
10
|
+
if (diff <= approximationLeft) {
|
|
11
|
+
return target;
|
|
12
|
+
}
|
|
13
|
+
return val;
|
|
14
|
+
}
|
|
15
|
+
exports.default = lerp;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* Get progress relatively to the scope.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
*
|
|
8
|
+
* scopeProgress(.35, [0, 1]);
|
|
9
|
+
* // => .5
|
|
10
|
+
* scopeProgress(.35, [.25, 1]);
|
|
11
|
+
* // => .133
|
|
12
|
+
*/
|
|
13
|
+
function scopeProgress(
|
|
14
|
+
/**
|
|
15
|
+
* Current progress
|
|
16
|
+
*/
|
|
17
|
+
progress,
|
|
18
|
+
/**
|
|
19
|
+
* Progress scope
|
|
20
|
+
*/
|
|
21
|
+
scope) {
|
|
22
|
+
var result = (progress - scope[0]) / (scope[1] - scope[0]);
|
|
23
|
+
return result;
|
|
24
|
+
}
|
|
25
|
+
exports.default = scopeProgress;
|