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
package/dist/js/AJAXEvent.js
DELETED
|
@@ -1,355 +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 _Event2 = _interopRequireDefault(require("./Event"));
|
|
11
|
-
|
|
12
|
-
var _timeoutCallback = _interopRequireDefault(require("./timeoutCallback"));
|
|
13
|
-
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
17
|
-
|
|
18
|
-
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); } }
|
|
19
|
-
|
|
20
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
21
|
-
|
|
22
|
-
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); }
|
|
23
|
-
|
|
24
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
25
|
-
|
|
26
|
-
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); }; }
|
|
27
|
-
|
|
28
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
29
|
-
|
|
30
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
31
|
-
|
|
32
|
-
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; } }
|
|
33
|
-
|
|
34
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* @classdesc AJAX requests.
|
|
38
|
-
* Available targets:
|
|
39
|
-
* <ul>
|
|
40
|
-
* <li>load - argument {@linkcode Vevet.AJAXEvent.LoadData}</li>
|
|
41
|
-
* <li>loaded - argument {@linkcode Vevet.AJAXEvent.CacheItem}</li>
|
|
42
|
-
* </ul>
|
|
43
|
-
* <br><br> <b>import {AJAXEvent} from 'vevet';</b>
|
|
44
|
-
*
|
|
45
|
-
* @vevetModuleCallback { Vevet.AJAXEvent : load : Vevet.AJAXEvent.LoadData}
|
|
46
|
-
* @vevetModuleCallback { Vevet.AJAXEvent : loaded : Vevet.AJAXEvent.CacheItem }
|
|
47
|
-
*
|
|
48
|
-
* @class
|
|
49
|
-
* @memberof Vevet
|
|
50
|
-
* @augments Vevet.Event
|
|
51
|
-
*/
|
|
52
|
-
var AJAXEvent = /*#__PURE__*/function (_Event) {
|
|
53
|
-
_inherits(AJAXEvent, _Event);
|
|
54
|
-
|
|
55
|
-
var _super = _createSuper(AJAXEvent);
|
|
56
|
-
|
|
57
|
-
function AJAXEvent() {
|
|
58
|
-
_classCallCheck(this, AJAXEvent);
|
|
59
|
-
|
|
60
|
-
return _super.apply(this, arguments);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
_createClass(AJAXEvent, [{
|
|
64
|
-
key: "_extra",
|
|
65
|
-
value: function _extra() {
|
|
66
|
-
/**
|
|
67
|
-
* @description Ajax Requests' Storage.
|
|
68
|
-
* @member {Array<Vevet.AJAXEvent.CacheItem>}
|
|
69
|
-
* @protected
|
|
70
|
-
*/
|
|
71
|
-
this._cache = [];
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* @description Ajax Cache.
|
|
75
|
-
* @readonly
|
|
76
|
-
* @type {Array<Vevet.AJAXEvent.CacheItem>}
|
|
77
|
-
*/
|
|
78
|
-
|
|
79
|
-
}, {
|
|
80
|
-
key: "cache",
|
|
81
|
-
get: function get() {
|
|
82
|
-
return this._cache;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* @memberof Vevet.AJAXEvent
|
|
86
|
-
* @callback _callback
|
|
87
|
-
* @param {Vevet.AJAXEvent.CacheItem} data
|
|
88
|
-
*/
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* @memberof Vevet.AJAXEvent
|
|
92
|
-
* @callback _callback_before
|
|
93
|
-
* @param {XMLHttpRequest} xhr
|
|
94
|
-
*/
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* @memberof Vevet.AJAXEvent
|
|
98
|
-
* @typedef {object} LoadData
|
|
99
|
-
* @property {'post'|'get'} [method=post] Method - post|get.
|
|
100
|
-
* @property {string} [url=window.location.href] Request url.
|
|
101
|
-
* @property {string} [responseType] Response type.
|
|
102
|
-
* @property {object} [data={}] Data to transmit through ajax.
|
|
103
|
-
* @property {boolean} [cache=false] Save in cache.
|
|
104
|
-
* @property {boolean} [async=true] Do the request asynchronously.
|
|
105
|
-
* @property {Vevet.AJAXEvent._callback_before} [before] Before sending the request.
|
|
106
|
-
* @property {Vevet.AJAXEvent._callback} [success] Callback on success.
|
|
107
|
-
* @property {Function} [abort] Callback when aborted.
|
|
108
|
-
* @property {Vevet.AJAXEvent._callback} [error] Callback on error.
|
|
109
|
-
*/
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* @description Load from url.
|
|
113
|
-
*
|
|
114
|
-
* @param {Vevet.AJAXEvent.LoadData} data - Properties.
|
|
115
|
-
*
|
|
116
|
-
* @example
|
|
117
|
-
*
|
|
118
|
-
* ajax.load({
|
|
119
|
-
* url: window.location.href,
|
|
120
|
-
* data: {
|
|
121
|
-
* firstname: 'John',
|
|
122
|
-
* lastname: 'Doe',
|
|
123
|
-
* },
|
|
124
|
-
* method: 'post',
|
|
125
|
-
* cache: true,
|
|
126
|
-
* success: (data) => {
|
|
127
|
-
* console.log(data.xhr.responseText);
|
|
128
|
-
* },
|
|
129
|
-
* error: (data) => {
|
|
130
|
-
* console.log(data.xhr.responseText);
|
|
131
|
-
* },
|
|
132
|
-
* abort: () => {
|
|
133
|
-
* alert("abort");
|
|
134
|
-
* }
|
|
135
|
-
* });
|
|
136
|
-
*
|
|
137
|
-
*/
|
|
138
|
-
|
|
139
|
-
}, {
|
|
140
|
-
key: "load",
|
|
141
|
-
value: function load(data) {
|
|
142
|
-
var prop = {
|
|
143
|
-
method: 'post',
|
|
144
|
-
url: window.location.href,
|
|
145
|
-
responseType: '',
|
|
146
|
-
data: {},
|
|
147
|
-
cache: false,
|
|
148
|
-
async: true,
|
|
149
|
-
before: function before() {},
|
|
150
|
-
success: function success() {},
|
|
151
|
-
abort: function abort() {},
|
|
152
|
-
error: function error() {}
|
|
153
|
-
};
|
|
154
|
-
prop = Object.assign(prop, data); // lowercase method
|
|
155
|
-
|
|
156
|
-
prop.method = prop.method.toUpperCase(); // check if exists in cache
|
|
157
|
-
|
|
158
|
-
if (prop.cache) {
|
|
159
|
-
var cache = this._cacheCheck({
|
|
160
|
-
url: prop.url,
|
|
161
|
-
method: prop.method,
|
|
162
|
-
data: prop.data
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
if (cache) {
|
|
166
|
-
prop.success(cache);
|
|
167
|
-
return;
|
|
168
|
-
}
|
|
169
|
-
} // callback on load
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
this.lbt('load', prop); // launch XHR request
|
|
173
|
-
|
|
174
|
-
this._xhr(prop);
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* @description XHR request.
|
|
178
|
-
* @param {Vevet.AJAXEvent.LoadData} prop - Properties.
|
|
179
|
-
* @protected
|
|
180
|
-
*/
|
|
181
|
-
|
|
182
|
-
}, {
|
|
183
|
-
key: "_xhr",
|
|
184
|
-
value: function _xhr(prop) {
|
|
185
|
-
var _this = this;
|
|
186
|
-
|
|
187
|
-
// data
|
|
188
|
-
var hasCotent = false,
|
|
189
|
-
url = prop.url,
|
|
190
|
-
propData = prop.data,
|
|
191
|
-
canAbort = true;
|
|
192
|
-
|
|
193
|
-
if (prop.method == 'POST') {
|
|
194
|
-
hasCotent = true;
|
|
195
|
-
var arr = [];
|
|
196
|
-
|
|
197
|
-
for (var key in propData) {
|
|
198
|
-
arr.push(key + '=' + encodeURIComponent(propData[key]));
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
propData = arr.join("&");
|
|
202
|
-
} else if (prop.method == 'GET') {
|
|
203
|
-
for (var _key in propData) {
|
|
204
|
-
url = this._v.url.setParam({
|
|
205
|
-
key: _key,
|
|
206
|
-
value: propData[_key],
|
|
207
|
-
push: false,
|
|
208
|
-
url: url
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
} // XHR
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
var xhr = new XMLHttpRequest();
|
|
215
|
-
xhr.open(prop.method, url, prop.async); // Set Headers
|
|
216
|
-
|
|
217
|
-
if (prop.method == 'POST') {
|
|
218
|
-
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
|
|
219
|
-
} // Before sending the request
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
prop.before(xhr); // Response type
|
|
223
|
-
|
|
224
|
-
if (prop.responseType !== '') {
|
|
225
|
-
xhr.responseType = prop.responseType;
|
|
226
|
-
} // Callback Proceeded
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
xhr.onreadystatechange = function () {
|
|
230
|
-
if (xhr.readyState !== 4) {
|
|
231
|
-
return;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
var callbackObj = {
|
|
235
|
-
url: prop.url,
|
|
236
|
-
method: prop.method,
|
|
237
|
-
data: prop.data,
|
|
238
|
-
xhr: xhr
|
|
239
|
-
};
|
|
240
|
-
|
|
241
|
-
if (xhr.status === 200) {
|
|
242
|
-
if (prop.cache) {
|
|
243
|
-
_this._cacheSet(callbackObj);
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
prop.success(callbackObj);
|
|
247
|
-
} else {
|
|
248
|
-
prop.error(callbackObj);
|
|
249
|
-
} // disable abortion
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
canAbort = false; // callback on loaded
|
|
253
|
-
|
|
254
|
-
_this.lbt('loaded', callbackObj);
|
|
255
|
-
}; // Send Ajax
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
xhr.send(hasCotent ? propData : null); // Timeout
|
|
259
|
-
|
|
260
|
-
(0, _timeoutCallback.default)(function () {
|
|
261
|
-
if (canAbort) {
|
|
262
|
-
xhr.onreadystatechange = null;
|
|
263
|
-
xhr.abort();
|
|
264
|
-
prop.abort();
|
|
265
|
-
}
|
|
266
|
-
}, this._vp.ajaxTimeMax);
|
|
267
|
-
}
|
|
268
|
-
/**
|
|
269
|
-
* @description Check if the request exists in cache.
|
|
270
|
-
*
|
|
271
|
-
* @protected
|
|
272
|
-
*
|
|
273
|
-
* @param {object} prop - Request properties, they are not the same as used in the "load" method.
|
|
274
|
-
* @param {string} prop.url - Url of the request.
|
|
275
|
-
* @param {string} prop.method - Method of the request.
|
|
276
|
-
* @param {object} prop.data - Object of data to transmit through ajax.
|
|
277
|
-
*
|
|
278
|
-
* @returns {false|Vevet.AJAXEvent.CacheItem} Returns an object if the request exists in cache and false if it doesn't.
|
|
279
|
-
*/
|
|
280
|
-
|
|
281
|
-
}, {
|
|
282
|
-
key: "_cacheCheck",
|
|
283
|
-
value: function _cacheCheck(prop) {
|
|
284
|
-
var cache = false; // go through all possible variants with the same url
|
|
285
|
-
|
|
286
|
-
for (var i = 0; i < this._cache.length; i++) {
|
|
287
|
-
// get obj
|
|
288
|
-
var obj = this._cache[i]; // compare url
|
|
289
|
-
|
|
290
|
-
if (prop.url != obj.url) {
|
|
291
|
-
continue;
|
|
292
|
-
} // compare method
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
if (prop.method != obj.method) {
|
|
296
|
-
continue;
|
|
297
|
-
} // compare data
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
var length = Object.keys(prop.data).length,
|
|
301
|
-
overlaps = 0;
|
|
302
|
-
|
|
303
|
-
for (var dataKey in obj.data) {
|
|
304
|
-
for (var propKey in prop.data) {
|
|
305
|
-
if (dataKey == propKey & obj.data[dataKey] == prop.data[propKey]) {
|
|
306
|
-
overlaps++;
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
} // set cache value
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
if (overlaps == length) {
|
|
313
|
-
cache = obj;
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
return cache;
|
|
318
|
-
}
|
|
319
|
-
/**
|
|
320
|
-
* @memberof Vevet.AJAXEvent
|
|
321
|
-
* @typedef {object} CacheItem
|
|
322
|
-
* @property {string} url
|
|
323
|
-
* @property {string} method
|
|
324
|
-
* @property {object} data
|
|
325
|
-
* @property {XMLHttpRequest} xhr
|
|
326
|
-
*/
|
|
327
|
-
|
|
328
|
-
/**
|
|
329
|
-
* @description Set cache.
|
|
330
|
-
*
|
|
331
|
-
* @protected
|
|
332
|
-
*
|
|
333
|
-
* @param {Vevet.AJAXEvent.CacheItem} prop - Object with the request data.
|
|
334
|
-
*/
|
|
335
|
-
|
|
336
|
-
}, {
|
|
337
|
-
key: "_cacheSet",
|
|
338
|
-
value: function _cacheSet(prop) {
|
|
339
|
-
this._cache.push(prop);
|
|
340
|
-
}
|
|
341
|
-
/**
|
|
342
|
-
* @description Clear cache.
|
|
343
|
-
*/
|
|
344
|
-
|
|
345
|
-
}, {
|
|
346
|
-
key: "cacheClear",
|
|
347
|
-
value: function cacheClear() {
|
|
348
|
-
this._cache = [];
|
|
349
|
-
}
|
|
350
|
-
}]);
|
|
351
|
-
|
|
352
|
-
return AJAXEvent;
|
|
353
|
-
}(_Event2.default);
|
|
354
|
-
|
|
355
|
-
exports.default = AJAXEvent;
|
package/dist/js/Application.js
DELETED
|
@@ -1,345 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _LoadEvent = _interopRequireDefault(require("./LoadEvent"));
|
|
9
|
-
|
|
10
|
-
var _ViewportEvent = _interopRequireDefault(require("./ViewportEvent"));
|
|
11
|
-
|
|
12
|
-
var _URLEvent = _interopRequireDefault(require("./URLEvent"));
|
|
13
|
-
|
|
14
|
-
var _AJAXEvent = _interopRequireDefault(require("./AJAXEvent"));
|
|
15
|
-
|
|
16
|
-
var _getBrowserName = _interopRequireDefault(require("./getBrowserName"));
|
|
17
|
-
|
|
18
|
-
var _getOsName = _interopRequireDefault(require("./getOsName"));
|
|
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
|
-
/**
|
|
29
|
-
* @classdesc Vevet Application
|
|
30
|
-
* <br><br> <b>import {Application} from 'vevet';</b>
|
|
31
|
-
* @class
|
|
32
|
-
* @memberof Vevet
|
|
33
|
-
*/
|
|
34
|
-
var Application = /*#__PURE__*/function () {
|
|
35
|
-
/**
|
|
36
|
-
* @typedef {object} Vevet.Application.Properties
|
|
37
|
-
* @property {Array<string>} [page=['home']] - An array of page codes.
|
|
38
|
-
* @property {number} [tablet=1199] - Maximum window width for tablets.
|
|
39
|
-
* @property {number} [mobile=899] - Maximum window width for mobiles.
|
|
40
|
-
* @property {string} [prefix=vevet-] - Prefix for modules.
|
|
41
|
-
* @property {string} [prefixData=data-vevet-] - Prefix for data attributes in modules.
|
|
42
|
-
* @property {string} [prefixProp=vevet-] - Prefix for properties in modules.
|
|
43
|
-
* @property {number} [ajaxTimeMax=5000] - Maximum timeout waiting for a response from an ajax request.
|
|
44
|
-
* @property {string|Array<number>|Function} [easing=[.25, .1, .25, 1]] - Easing function that is used in animation as a default value. See {@linkcode Vevet.easing}.
|
|
45
|
-
*/
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* @alias Vevet.Application
|
|
49
|
-
*
|
|
50
|
-
* @param {Vevet.Application.Properties} [data]
|
|
51
|
-
*
|
|
52
|
-
* @example
|
|
53
|
-
* let app = new Vevet.Application({
|
|
54
|
-
* page: ['home', 'nofooter']
|
|
55
|
-
* });
|
|
56
|
-
*/
|
|
57
|
-
function Application() {
|
|
58
|
-
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
59
|
-
|
|
60
|
-
_classCallCheck(this, Application);
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* @type {Vevet.Application.Properties}
|
|
64
|
-
*/
|
|
65
|
-
this.prop = Object.assign(this.defaultProp, data);
|
|
66
|
-
/**
|
|
67
|
-
* @description Application prefix.
|
|
68
|
-
* @type {string}
|
|
69
|
-
* @private
|
|
70
|
-
*/
|
|
71
|
-
|
|
72
|
-
this._prefix = this.prop.prefix; // initialize application
|
|
73
|
-
|
|
74
|
-
this._init();
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* @description Get default properties.
|
|
78
|
-
* @readonly
|
|
79
|
-
* @type {Vevet.Application.Properties}
|
|
80
|
-
*/
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
_createClass(Application, [{
|
|
84
|
-
key: "defaultProp",
|
|
85
|
-
get: function get() {
|
|
86
|
-
return {
|
|
87
|
-
page: ['home'],
|
|
88
|
-
tablet: 1199,
|
|
89
|
-
mobile: 899,
|
|
90
|
-
prefix: "vevet-",
|
|
91
|
-
prefixData: "data-vevet-",
|
|
92
|
-
prefixProp: "vevet-",
|
|
93
|
-
ajaxTimeMax: 5000,
|
|
94
|
-
easing: [.25, .1, .25, 1]
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* @description Document
|
|
99
|
-
* @default document
|
|
100
|
-
* @readonly
|
|
101
|
-
* @type {Document}
|
|
102
|
-
*/
|
|
103
|
-
|
|
104
|
-
}, {
|
|
105
|
-
key: "doc",
|
|
106
|
-
get: function get() {
|
|
107
|
-
return this._doc;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* @description HTML element
|
|
111
|
-
* @default document.documentElement
|
|
112
|
-
* @readonly
|
|
113
|
-
* @type {HTMLElement}
|
|
114
|
-
*/
|
|
115
|
-
|
|
116
|
-
}, {
|
|
117
|
-
key: "html",
|
|
118
|
-
get: function get() {
|
|
119
|
-
return this._html;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* @description Body
|
|
123
|
-
* @default document.body
|
|
124
|
-
* @readonly
|
|
125
|
-
* @type {HTMLElement}
|
|
126
|
-
*/
|
|
127
|
-
|
|
128
|
-
}, {
|
|
129
|
-
key: "body",
|
|
130
|
-
get: function get() {
|
|
131
|
-
return this._body;
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* @description Vevet prefix. See {@linkcode Vevet.Application#prop};
|
|
135
|
-
* @readonly
|
|
136
|
-
* @type {string}
|
|
137
|
-
*/
|
|
138
|
-
|
|
139
|
-
}, {
|
|
140
|
-
key: "prefix",
|
|
141
|
-
get: function get() {
|
|
142
|
-
return this._prefix;
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* @description Easing function that is used in animation as a default value. See {@linkcode Vevet.easing} & {@linkcode Vevet.Application#prop}.
|
|
146
|
-
* @readonly
|
|
147
|
-
* @default [.25, .1, .25, 1]
|
|
148
|
-
* @type {string|Array<number>|Function}
|
|
149
|
-
*/
|
|
150
|
-
|
|
151
|
-
}, {
|
|
152
|
-
key: "easing",
|
|
153
|
-
get: function get() {
|
|
154
|
-
return this.prop.easing;
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* @description Initialize the class
|
|
158
|
-
* @private
|
|
159
|
-
*/
|
|
160
|
-
|
|
161
|
-
}, {
|
|
162
|
-
key: "_init",
|
|
163
|
-
value: function _init() {
|
|
164
|
-
// Define that we're using Vevet
|
|
165
|
-
this._hi();
|
|
166
|
-
/**
|
|
167
|
-
* @type {object}
|
|
168
|
-
* @private
|
|
169
|
-
*/
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
this._doc = document;
|
|
173
|
-
/**
|
|
174
|
-
* @type {HTMLElement}
|
|
175
|
-
* @private
|
|
176
|
-
*/
|
|
177
|
-
|
|
178
|
-
this._html = document.documentElement;
|
|
179
|
-
/**
|
|
180
|
-
* @type {HTMLElement}
|
|
181
|
-
* @private
|
|
182
|
-
*/
|
|
183
|
-
|
|
184
|
-
this._body = document.body;
|
|
185
|
-
/**
|
|
186
|
-
* @type {Array<string>}
|
|
187
|
-
* @private
|
|
188
|
-
*/
|
|
189
|
-
|
|
190
|
-
this._page = [];
|
|
191
|
-
this.page = this.prop.page;
|
|
192
|
-
/**
|
|
193
|
-
* @type {string}
|
|
194
|
-
* @private
|
|
195
|
-
*/
|
|
196
|
-
|
|
197
|
-
this._browser = (0, _getBrowserName.default)();
|
|
198
|
-
/**
|
|
199
|
-
* @type {string}
|
|
200
|
-
* @private
|
|
201
|
-
*/
|
|
202
|
-
|
|
203
|
-
this._os = (0, _getOsName.default)();
|
|
204
|
-
/**
|
|
205
|
-
* @member {Vevet.LoadEvent}
|
|
206
|
-
*/
|
|
207
|
-
|
|
208
|
-
this.load = new _LoadEvent.default({
|
|
209
|
-
v: this
|
|
210
|
-
});
|
|
211
|
-
/**
|
|
212
|
-
* @member {Vevet.ViewportEvent}
|
|
213
|
-
*/
|
|
214
|
-
|
|
215
|
-
this.viewport = new _ViewportEvent.default({
|
|
216
|
-
v: this
|
|
217
|
-
});
|
|
218
|
-
/**
|
|
219
|
-
* @member {Vevet.URLEvent}
|
|
220
|
-
*/
|
|
221
|
-
|
|
222
|
-
this.url = new _URLEvent.default({
|
|
223
|
-
v: this
|
|
224
|
-
});
|
|
225
|
-
/**
|
|
226
|
-
* @member {Vevet.AJAXEvent}
|
|
227
|
-
*/
|
|
228
|
-
|
|
229
|
-
this.ajax = new _AJAXEvent.default({
|
|
230
|
-
v: this
|
|
231
|
-
});
|
|
232
|
-
/**
|
|
233
|
-
* @description An array of existing pages.
|
|
234
|
-
* A new element is added to the array when {@linkcode Vevet.PageModule#create} is called.
|
|
235
|
-
* @type {Array<Vevet.PageModule>}
|
|
236
|
-
*/
|
|
237
|
-
|
|
238
|
-
this.vevetPages = [];
|
|
239
|
-
/**
|
|
240
|
-
* @description The active page. See {@linkcode Vevet.PageModule}.
|
|
241
|
-
* Its value is false when no page is active and {@linkcode Vevet.PageModule}
|
|
242
|
-
* if a page is created through {@linkcode Vevet.PageModule#create}
|
|
243
|
-
* @type {Vevet.PageModule|false}
|
|
244
|
-
*/
|
|
245
|
-
|
|
246
|
-
this.vevetPage = false; // add to the window object
|
|
247
|
-
|
|
248
|
-
window.vevetApplication = this;
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* @description Defines that you're using Vevet.
|
|
252
|
-
* @private
|
|
253
|
-
*/
|
|
254
|
-
|
|
255
|
-
}, {
|
|
256
|
-
key: "_hi",
|
|
257
|
-
value: function _hi() {
|
|
258
|
-
var msg = 'Vevet';
|
|
259
|
-
var style = ['padding: 1rem 1.5rem;', 'background: #5F2580;', "font: 1rem/1 Arial;", 'color: #ffffff;'].join('');
|
|
260
|
-
console.log('%c%s', style, msg);
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* @description Get/Set page names.
|
|
264
|
-
*
|
|
265
|
-
* @param {Array<string>} [val=['home']] - An array with page names.
|
|
266
|
-
* @type {Array<string>}
|
|
267
|
-
*/
|
|
268
|
-
|
|
269
|
-
}, {
|
|
270
|
-
key: "page",
|
|
271
|
-
get: function get() {
|
|
272
|
-
return this._page;
|
|
273
|
-
}
|
|
274
|
-
/**
|
|
275
|
-
* @description Check if page is set.
|
|
276
|
-
*
|
|
277
|
-
* @param {string} [val=''] - A string containing a pagename.
|
|
278
|
-
*
|
|
279
|
-
* @returns {boolean} Returns true if page is set.
|
|
280
|
-
*/
|
|
281
|
-
,
|
|
282
|
-
set: function set(val) {
|
|
283
|
-
if (val === void 0) {
|
|
284
|
-
val = ['home'];
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
// remove old classes
|
|
288
|
-
for (var i = 0; i < this._page.length; i++) {
|
|
289
|
-
this._html.classList.remove("".concat(this._prefix, "page_").concat(this._page[i]));
|
|
290
|
-
} // set classes & push to pages
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
for (var _i = 0; _i < val.length; _i++) {
|
|
294
|
-
this._html.classList.add("".concat(this._prefix, "page_").concat(val[_i]));
|
|
295
|
-
} // replace pages array
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
this._page = val;
|
|
299
|
-
}
|
|
300
|
-
}, {
|
|
301
|
-
key: "pageCheck",
|
|
302
|
-
value: function pageCheck() {
|
|
303
|
-
var val = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
304
|
-
return this._page.includes(val);
|
|
305
|
-
}
|
|
306
|
-
/**
|
|
307
|
-
* @description Get browser name and set it as a class to the HTML element. See {@linkcode Vevet.getBrowserName}
|
|
308
|
-
* @readonly
|
|
309
|
-
* @type {string}
|
|
310
|
-
*/
|
|
311
|
-
|
|
312
|
-
}, {
|
|
313
|
-
key: "browser",
|
|
314
|
-
get: function get() {
|
|
315
|
-
this._html.classList.remove("".concat(this._prefix, "browser_").concat(this._browser));
|
|
316
|
-
|
|
317
|
-
this._browser = (0, _getBrowserName.default)();
|
|
318
|
-
|
|
319
|
-
this._html.classList.add("".concat(this._prefix, "browser_").concat(this._browser));
|
|
320
|
-
|
|
321
|
-
return this._browser;
|
|
322
|
-
}
|
|
323
|
-
/**
|
|
324
|
-
* @description Get the operating system name and set it as a class to the HTML element. See {@linkcode Vevet.getOSName}
|
|
325
|
-
* @readonly
|
|
326
|
-
* @type {string}
|
|
327
|
-
*/
|
|
328
|
-
|
|
329
|
-
}, {
|
|
330
|
-
key: "os",
|
|
331
|
-
get: function get() {
|
|
332
|
-
this._html.classList.remove("".concat(this._prefix, "os_").concat(this._os));
|
|
333
|
-
|
|
334
|
-
this._os = (0, _getOsName.default)();
|
|
335
|
-
|
|
336
|
-
this._html.classList.add("".concat(this._prefix, "os_").concat(this._os));
|
|
337
|
-
|
|
338
|
-
return this._os;
|
|
339
|
-
}
|
|
340
|
-
}]);
|
|
341
|
-
|
|
342
|
-
return Application;
|
|
343
|
-
}();
|
|
344
|
-
|
|
345
|
-
exports.default = Application;
|