vevet 3.19.2 → 4.0.0-beta.0
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/README.md +81 -18
- package/lib/cjs/{Application → Vevet}/events/createOnPageLoad/index.js +7 -7
- package/lib/cjs/Vevet/events/createOnPageLoad/index.js.map +1 -0
- package/lib/cjs/Vevet/events/createOnPageLoad/types.js.map +1 -0
- package/lib/cjs/{Application → Vevet}/events/createViewport/index.js +19 -25
- package/lib/cjs/Vevet/events/createViewport/index.js.map +1 -0
- package/lib/cjs/Vevet/events/createViewport/types.js.map +1 -0
- package/lib/cjs/Vevet/exported.js +3 -0
- package/lib/cjs/Vevet/exported.js.map +1 -0
- package/lib/cjs/Vevet/global.js +3 -0
- package/lib/cjs/Vevet/global.js.map +1 -0
- package/lib/cjs/Vevet/index.js +94 -0
- package/lib/cjs/Vevet/index.js.map +1 -0
- package/lib/cjs/{Application → Vevet}/types.js.map +1 -1
- package/lib/cjs/{utils/internal → Vevet/utils}/fetchWebpSupport.js +1 -1
- package/lib/cjs/Vevet/utils/fetchWebpSupport.js.map +1 -0
- package/lib/cjs/Vevet/utils/getDeviceInfo.js.map +1 -0
- package/lib/cjs/base/Callbacks/index.js +65 -48
- package/lib/cjs/base/Callbacks/index.js.map +1 -1
- package/lib/cjs/base/Component/index.js +15 -4
- package/lib/cjs/base/Component/index.js.map +1 -1
- package/lib/cjs/base/Module/index.js +118 -64
- package/lib/cjs/base/Module/index.js.map +1 -1
- package/lib/cjs/base/MutableProps/index.js +30 -55
- package/lib/cjs/base/MutableProps/index.js.map +1 -1
- package/lib/cjs/base/Plugin/index.js +20 -1
- package/lib/cjs/base/Plugin/index.js.map +1 -1
- package/lib/cjs/components/AnimationFrame/index.js +14 -21
- package/lib/cjs/components/AnimationFrame/index.js.map +1 -1
- package/lib/cjs/components/Ctx2D/index.js +40 -25
- package/lib/cjs/components/Ctx2D/index.js.map +1 -1
- package/lib/cjs/components/Ctx2DPrerender/index.js +17 -7
- package/lib/cjs/components/Ctx2DPrerender/index.js.map +1 -1
- package/lib/cjs/components/CustomCursor/index.js +75 -51
- package/lib/cjs/components/CustomCursor/index.js.map +1 -1
- package/lib/cjs/components/{SmoothScroll → CustomScroll}/AnimatonFrame.js +2 -2
- package/lib/cjs/components/{SmoothScroll → CustomScroll}/AnimatonFrame.js.map +1 -1
- package/lib/cjs/components/{SmoothScroll → CustomScroll}/Elements.js +9 -9
- package/lib/cjs/components/{SmoothScroll → CustomScroll}/Elements.js.map +1 -1
- package/lib/cjs/components/{SmoothScroll → CustomScroll}/index.js +72 -66
- package/lib/cjs/components/CustomScroll/index.js.map +1 -0
- package/lib/cjs/components/CustomScroll/types.js.map +1 -0
- package/lib/cjs/components/{SmoothScrollDragPlugin → CustomScrollDragPlugin}/index.js +45 -44
- package/lib/cjs/components/CustomScrollDragPlugin/index.js.map +1 -0
- package/lib/cjs/components/CustomScrollDragPlugin/types.js.map +1 -0
- package/lib/cjs/components/{SmoothScrollKeyboardPlugin → CustomScrollKeyboardPlugin}/index.js +51 -47
- package/lib/cjs/components/CustomScrollKeyboardPlugin/index.js.map +1 -0
- package/lib/cjs/components/CustomScrollKeyboardPlugin/types.js.map +1 -0
- package/lib/cjs/components/DraggerBase/index.js +74 -26
- package/lib/cjs/components/DraggerBase/index.js.map +1 -1
- package/lib/cjs/components/DraggerDirection/index.js +12 -6
- package/lib/cjs/components/DraggerDirection/index.js.map +1 -1
- package/lib/cjs/components/DraggerMove/index.js +44 -13
- package/lib/cjs/components/DraggerMove/index.js.map +1 -1
- package/lib/cjs/components/Marquee/index.js +240 -160
- package/lib/cjs/components/Marquee/index.js.map +1 -1
- package/lib/cjs/components/Preloader/index.js +45 -16
- package/lib/cjs/components/Preloader/index.js.map +1 -1
- package/lib/cjs/components/ProgressPreloader/index.js +79 -41
- package/lib/cjs/components/ProgressPreloader/index.js.map +1 -1
- package/lib/cjs/components/ProgressPreloader/utils/preloadCustomElement.js +12 -1
- package/lib/cjs/components/ProgressPreloader/utils/preloadCustomElement.js.map +1 -1
- package/lib/cjs/components/ScrollBar/Bar/index.js +90 -36
- package/lib/cjs/components/ScrollBar/Bar/index.js.map +1 -1
- package/lib/cjs/components/ScrollBar/index.js +59 -20
- package/lib/cjs/components/ScrollBar/index.js.map +1 -1
- package/lib/cjs/components/ScrollView/index.js +56 -20
- package/lib/cjs/components/ScrollView/index.js.map +1 -1
- package/lib/cjs/components/SectionScrollProgress/index.js +68 -31
- package/lib/cjs/components/SectionScrollProgress/index.js.map +1 -1
- package/lib/cjs/components/SlideProgress/index.js +72 -38
- package/lib/cjs/components/SlideProgress/index.js.map +1 -1
- package/lib/cjs/components/SplitText/index.js +52 -23
- package/lib/cjs/components/SplitText/index.js.map +1 -1
- package/lib/cjs/components/SplitText/utils/splitBase.js +6 -1
- package/lib/cjs/components/SplitText/utils/splitBase.js.map +1 -1
- package/lib/cjs/components/SplitText/utils/wrapLetters.js +11 -3
- package/lib/cjs/components/SplitText/utils/wrapLetters.js.map +1 -1
- package/lib/cjs/components/SplitText/utils/wrapLines.js +11 -5
- package/lib/cjs/components/SplitText/utils/wrapLines.js.map +1 -1
- package/lib/cjs/components/SplitText/utils/wrapWords.js +13 -2
- package/lib/cjs/components/SplitText/utils/wrapWords.js.map +1 -1
- package/lib/cjs/components/Timeline/index.js +77 -21
- package/lib/cjs/components/Timeline/index.js.map +1 -1
- package/lib/cjs/components/index.js +4 -4
- package/lib/cjs/components/index.js.map +1 -1
- package/lib/cjs/index.js +10 -3
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/types/index.js +19 -0
- package/lib/cjs/types/index.js.map +1 -0
- package/lib/cjs/utils/common/PCancelable.js +16 -0
- package/lib/cjs/utils/common/PCancelable.js.map +1 -1
- package/lib/cjs/utils/common/normalizedTimeoutCallback.js +19 -4
- package/lib/cjs/utils/common/normalizedTimeoutCallback.js.map +1 -1
- package/lib/cjs/utils/common/objectKeys.js +11 -1
- package/lib/cjs/utils/common/objectKeys.js.map +1 -1
- package/lib/cjs/utils/common/pickObjectProps.js +14 -2
- package/lib/cjs/utils/common/pickObjectProps.js.map +1 -1
- package/lib/cjs/utils/common/times.js +12 -3
- package/lib/cjs/utils/common/times.js.map +1 -1
- package/lib/cjs/utils/common/uid.js +4 -2
- package/lib/cjs/utils/common/uid.js.map +1 -1
- package/lib/cjs/utils/image/load.js +3 -3
- package/lib/cjs/utils/image/load.js.map +1 -1
- package/lib/cjs/utils/image/pathsToProps.js +12 -5
- package/lib/cjs/utils/image/pathsToProps.js.map +1 -1
- package/lib/cjs/utils/image/sizesToSrcSet.js +7 -3
- package/lib/cjs/utils/image/sizesToSrcSet.js.map +1 -1
- package/lib/cjs/utils/internal/getApp.js +12 -0
- package/lib/cjs/utils/internal/getApp.js.map +1 -1
- package/lib/cjs/utils/listeners/isIntersectionObserverSupported.js +1 -1
- package/lib/cjs/utils/listeners/onResize.js +13 -12
- package/lib/cjs/utils/listeners/onResize.js.map +1 -1
- package/lib/cjs/utils/math/clamp.js +10 -5
- package/lib/cjs/utils/math/clamp.js.map +1 -1
- package/lib/cjs/utils/math/clampScope.js +8 -1
- package/lib/cjs/utils/math/clampScope.js.map +1 -1
- package/lib/cjs/utils/math/easing.js +6 -2
- package/lib/cjs/utils/math/easing.js.map +1 -1
- package/lib/cjs/utils/math/inScope.js +6 -3
- package/lib/cjs/utils/math/inScope.js.map +1 -1
- package/lib/cjs/utils/math/lerp.js +11 -3
- package/lib/cjs/utils/math/lerp.js.map +1 -1
- package/lib/cjs/utils/math/normalizeNestedScope.js +12 -3
- package/lib/cjs/utils/math/normalizeNestedScope.js.map +1 -1
- package/lib/cjs/utils/math/scoped.js +18 -7
- package/lib/cjs/utils/math/scoped.js.map +1 -1
- package/lib/cjs/utils/math/spreadScope.js +17 -3
- package/lib/cjs/utils/math/spreadScope.js.map +1 -1
- package/lib/cjs/utils/math/wrap.js +9 -3
- package/lib/cjs/utils/math/wrap.js.map +1 -1
- package/lib/cjs/utils/scroll/getScrollValues.js +13 -1
- package/lib/cjs/utils/scroll/getScrollValues.js.map +1 -1
- package/lib/cjs/utils/scroll/isPageScrolling.js +30 -0
- package/lib/cjs/utils/scroll/isPageScrolling.js.map +1 -1
- package/lib/cjs/utils/scroll/normalizeWheel.js +7 -2
- package/lib/cjs/utils/scroll/normalizeWheel.js.map +1 -1
- package/lib/cjs/utils/scroll/onScroll.js +14 -7
- package/lib/cjs/utils/scroll/onScroll.js.map +1 -1
- package/lib/cjs/utils/scroll/scrollTo.js +8 -7
- package/lib/cjs/utils/scroll/scrollTo.js.map +1 -1
- package/lib/cjs/utils/scroll/scrollToElement.js +8 -6
- package/lib/cjs/utils/scroll/scrollToElement.js.map +1 -1
- package/lib/cjs/version.js +1 -1
- package/lib/esm/{Application → Vevet}/events/createOnPageLoad/index.js +7 -7
- package/lib/esm/Vevet/events/createOnPageLoad/index.js.map +1 -0
- package/lib/esm/Vevet/events/createOnPageLoad/types.js.map +1 -0
- package/lib/esm/{Application → Vevet}/events/createViewport/index.js +20 -26
- package/lib/esm/Vevet/events/createViewport/index.js.map +1 -0
- package/lib/esm/Vevet/events/createViewport/types.js.map +1 -0
- package/lib/esm/Vevet/exported.js +2 -0
- package/lib/esm/Vevet/exported.js.map +1 -0
- package/lib/esm/Vevet/global.js +2 -0
- package/lib/esm/Vevet/global.js.map +1 -0
- package/lib/esm/Vevet/index.js +72 -0
- package/lib/esm/Vevet/index.js.map +1 -0
- package/lib/esm/{Application → Vevet}/types.js.map +1 -1
- package/lib/esm/{utils/internal → Vevet/utils}/fetchWebpSupport.js +1 -1
- package/lib/esm/Vevet/utils/fetchWebpSupport.js.map +1 -0
- package/lib/esm/Vevet/utils/getDeviceInfo.js.map +1 -0
- package/lib/esm/base/Callbacks/index.js +66 -48
- package/lib/esm/base/Callbacks/index.js.map +1 -1
- package/lib/esm/base/Component/index.js +15 -4
- package/lib/esm/base/Component/index.js.map +1 -1
- package/lib/esm/base/Module/index.js +119 -65
- package/lib/esm/base/Module/index.js.map +1 -1
- package/lib/esm/base/MutableProps/index.js +35 -60
- package/lib/esm/base/MutableProps/index.js.map +1 -1
- package/lib/esm/base/Plugin/index.js +20 -1
- package/lib/esm/base/Plugin/index.js.map +1 -1
- package/lib/esm/components/AnimationFrame/index.js +14 -21
- package/lib/esm/components/AnimationFrame/index.js.map +1 -1
- package/lib/esm/components/Ctx2D/index.js +40 -25
- package/lib/esm/components/Ctx2D/index.js.map +1 -1
- package/lib/esm/components/Ctx2DPrerender/index.js +17 -7
- package/lib/esm/components/Ctx2DPrerender/index.js.map +1 -1
- package/lib/esm/components/CustomCursor/index.js +75 -51
- package/lib/esm/components/CustomCursor/index.js.map +1 -1
- package/lib/esm/components/{SmoothScroll → CustomScroll}/AnimatonFrame.js +2 -2
- package/lib/esm/components/{SmoothScroll → CustomScroll}/AnimatonFrame.js.map +1 -1
- package/lib/esm/components/{SmoothScroll → CustomScroll}/Elements.js +8 -8
- package/lib/esm/components/{SmoothScroll → CustomScroll}/Elements.js.map +1 -1
- package/lib/esm/components/{SmoothScroll → CustomScroll}/index.js +30 -24
- package/lib/esm/components/CustomScroll/index.js.map +1 -0
- package/lib/esm/components/CustomScroll/types.js.map +1 -0
- package/lib/esm/components/{SmoothScrollDragPlugin → CustomScrollDragPlugin}/index.js +28 -27
- package/lib/esm/components/CustomScrollDragPlugin/index.js.map +1 -0
- package/lib/esm/components/CustomScrollDragPlugin/types.js.map +1 -0
- package/lib/esm/components/{SmoothScrollKeyboardPlugin → CustomScrollKeyboardPlugin}/index.js +37 -33
- package/lib/esm/components/CustomScrollKeyboardPlugin/index.js.map +1 -0
- package/lib/esm/components/CustomScrollKeyboardPlugin/types.js.map +1 -0
- package/lib/esm/components/DraggerBase/index.js +74 -28
- package/lib/esm/components/DraggerBase/index.js.map +1 -1
- package/lib/esm/components/DraggerDirection/index.js +12 -6
- package/lib/esm/components/DraggerDirection/index.js.map +1 -1
- package/lib/esm/components/DraggerMove/index.js +44 -13
- package/lib/esm/components/DraggerMove/index.js.map +1 -1
- package/lib/esm/components/Marquee/index.js +220 -161
- package/lib/esm/components/Marquee/index.js.map +1 -1
- package/lib/esm/components/Preloader/index.js +45 -16
- package/lib/esm/components/Preloader/index.js.map +1 -1
- package/lib/esm/components/ProgressPreloader/index.js +79 -40
- package/lib/esm/components/ProgressPreloader/index.js.map +1 -1
- package/lib/esm/components/ProgressPreloader/utils/preloadCustomElement.js +12 -1
- package/lib/esm/components/ProgressPreloader/utils/preloadCustomElement.js.map +1 -1
- package/lib/esm/components/ScrollBar/Bar/index.js +89 -32
- package/lib/esm/components/ScrollBar/Bar/index.js.map +1 -1
- package/lib/esm/components/ScrollBar/index.js +49 -15
- package/lib/esm/components/ScrollBar/index.js.map +1 -1
- package/lib/esm/components/ScrollView/index.js +56 -20
- package/lib/esm/components/ScrollView/index.js.map +1 -1
- package/lib/esm/components/SectionScrollProgress/index.js +68 -31
- package/lib/esm/components/SectionScrollProgress/index.js.map +1 -1
- package/lib/esm/components/SlideProgress/index.js +72 -38
- package/lib/esm/components/SlideProgress/index.js.map +1 -1
- package/lib/esm/components/SplitText/index.js +52 -23
- package/lib/esm/components/SplitText/index.js.map +1 -1
- package/lib/esm/components/SplitText/utils/splitBase.js +6 -1
- package/lib/esm/components/SplitText/utils/splitBase.js.map +1 -1
- package/lib/esm/components/SplitText/utils/wrapLetters.js +11 -3
- package/lib/esm/components/SplitText/utils/wrapLetters.js.map +1 -1
- package/lib/esm/components/SplitText/utils/wrapLines.js +11 -5
- package/lib/esm/components/SplitText/utils/wrapLines.js.map +1 -1
- package/lib/esm/components/SplitText/utils/wrapWords.js +13 -2
- package/lib/esm/components/SplitText/utils/wrapWords.js.map +1 -1
- package/lib/esm/components/Timeline/index.js +70 -22
- package/lib/esm/components/Timeline/index.js.map +1 -1
- package/lib/esm/components/index.js +4 -4
- package/lib/esm/components/index.js.map +1 -1
- package/lib/esm/index.js +9 -3
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/types/index.js +3 -0
- package/lib/esm/types/index.js.map +1 -0
- package/lib/esm/utils/common/PCancelable.js +16 -0
- package/lib/esm/utils/common/PCancelable.js.map +1 -1
- package/lib/esm/utils/common/normalizedTimeoutCallback.js +19 -4
- package/lib/esm/utils/common/normalizedTimeoutCallback.js.map +1 -1
- package/lib/esm/utils/common/objectKeys.js +11 -1
- package/lib/esm/utils/common/objectKeys.js.map +1 -1
- package/lib/esm/utils/common/pickObjectProps.js +14 -2
- package/lib/esm/utils/common/pickObjectProps.js.map +1 -1
- package/lib/esm/utils/common/times.js +12 -3
- package/lib/esm/utils/common/times.js.map +1 -1
- package/lib/esm/utils/common/uid.js +4 -2
- package/lib/esm/utils/common/uid.js.map +1 -1
- package/lib/esm/utils/image/load.js +3 -3
- package/lib/esm/utils/image/load.js.map +1 -1
- package/lib/esm/utils/image/pathsToProps.js +12 -5
- package/lib/esm/utils/image/pathsToProps.js.map +1 -1
- package/lib/esm/utils/image/sizesToSrcSet.js +7 -3
- package/lib/esm/utils/image/sizesToSrcSet.js.map +1 -1
- package/lib/esm/utils/internal/getApp.js +12 -0
- package/lib/esm/utils/internal/getApp.js.map +1 -1
- package/lib/esm/utils/listeners/isIntersectionObserverSupported.js +1 -1
- package/lib/esm/utils/listeners/onResize.js +11 -12
- package/lib/esm/utils/listeners/onResize.js.map +1 -1
- package/lib/esm/utils/math/clamp.js +10 -5
- package/lib/esm/utils/math/clamp.js.map +1 -1
- package/lib/esm/utils/math/clampScope.js +8 -1
- package/lib/esm/utils/math/clampScope.js.map +1 -1
- package/lib/esm/utils/math/easing.js +6 -2
- package/lib/esm/utils/math/easing.js.map +1 -1
- package/lib/esm/utils/math/inScope.js +6 -3
- package/lib/esm/utils/math/inScope.js.map +1 -1
- package/lib/esm/utils/math/lerp.js +11 -3
- package/lib/esm/utils/math/lerp.js.map +1 -1
- package/lib/esm/utils/math/normalizeNestedScope.js +12 -3
- package/lib/esm/utils/math/normalizeNestedScope.js.map +1 -1
- package/lib/esm/utils/math/scoped.js +17 -6
- package/lib/esm/utils/math/scoped.js.map +1 -1
- package/lib/esm/utils/math/spreadScope.js +17 -3
- package/lib/esm/utils/math/spreadScope.js.map +1 -1
- package/lib/esm/utils/math/wrap.js +9 -3
- package/lib/esm/utils/math/wrap.js.map +1 -1
- package/lib/esm/utils/scroll/getScrollValues.js +13 -1
- package/lib/esm/utils/scroll/getScrollValues.js.map +1 -1
- package/lib/esm/utils/scroll/isPageScrolling.js +30 -0
- package/lib/esm/utils/scroll/isPageScrolling.js.map +1 -1
- package/lib/esm/utils/scroll/normalizeWheel.js +7 -2
- package/lib/esm/utils/scroll/normalizeWheel.js.map +1 -1
- package/lib/esm/utils/scroll/onScroll.js +14 -7
- package/lib/esm/utils/scroll/onScroll.js.map +1 -1
- package/lib/esm/utils/scroll/scrollTo.js +8 -7
- package/lib/esm/utils/scroll/scrollTo.js.map +1 -1
- package/lib/esm/utils/scroll/scrollToElement.js +8 -6
- package/lib/esm/utils/scroll/scrollToElement.js.map +1 -1
- package/lib/esm/version.js +1 -1
- package/lib/styles/base.scss +0 -2
- package/lib/styles/components/CustomCursor.scss +7 -7
- package/{src/styles/components/SmoothScroll.scss → lib/styles/components/CustomScroll.scss} +3 -3
- package/lib/styles/components/Preloader.scss +1 -1
- package/lib/styles/components/ScrollBar.scss +4 -4
- package/lib/styles/components/index.scss +1 -1
- package/lib/styles/index.scss +0 -1
- package/lib/types/Vevet/events/createOnPageLoad/index.d.ts +3 -0
- package/lib/types/Vevet/events/createOnPageLoad/index.d.ts.map +1 -0
- package/lib/types/Vevet/events/createOnPageLoad/types.d.ts +20 -0
- package/lib/types/Vevet/events/createOnPageLoad/types.d.ts.map +1 -0
- package/lib/types/Vevet/events/createViewport/index.d.ts +4 -0
- package/lib/types/Vevet/events/createViewport/index.d.ts.map +1 -0
- package/lib/types/Vevet/events/createViewport/types.d.ts +85 -0
- package/lib/types/Vevet/events/createViewport/types.d.ts.map +1 -0
- package/lib/types/Vevet/exported.d.ts +6 -0
- package/lib/types/Vevet/exported.d.ts.map +1 -0
- package/lib/types/Vevet/global.d.ts +51 -0
- package/lib/types/Vevet/global.d.ts.map +1 -0
- package/lib/types/Vevet/index.d.ts +4 -0
- package/lib/types/Vevet/index.d.ts.map +1 -0
- package/lib/types/Vevet/types.d.ts +43 -0
- package/lib/types/Vevet/types.d.ts.map +1 -0
- package/lib/types/Vevet/utils/fetchWebpSupport.d.ts +3 -0
- package/lib/types/Vevet/utils/fetchWebpSupport.d.ts.map +1 -0
- package/lib/types/Vevet/utils/getDeviceInfo.d.ts.map +1 -0
- package/lib/types/base/Callbacks/index.d.ts +67 -46
- package/lib/types/base/Callbacks/index.d.ts.map +1 -1
- package/lib/types/base/Callbacks/types.d.ts +46 -14
- package/lib/types/base/Callbacks/types.d.ts.map +1 -1
- package/lib/types/base/Component/index.d.ts +19 -5
- package/lib/types/base/Component/index.d.ts.map +1 -1
- package/lib/types/base/Component/types.d.ts +15 -3
- package/lib/types/base/Component/types.d.ts.map +1 -1
- package/lib/types/base/Module/index.d.ts +124 -74
- package/lib/types/base/Module/index.d.ts.map +1 -1
- package/lib/types/base/Module/types.d.ts +29 -3
- package/lib/types/base/Module/types.d.ts.map +1 -1
- package/lib/types/base/MutableProps/index.d.ts +34 -77
- package/lib/types/base/MutableProps/index.d.ts.map +1 -1
- package/lib/types/base/MutableProps/types.d.ts +14 -8
- package/lib/types/base/MutableProps/types.d.ts.map +1 -1
- package/lib/types/base/Plugin/index.d.ts +24 -1
- package/lib/types/base/Plugin/index.d.ts.map +1 -1
- package/lib/types/base/Plugin/types.d.ts +11 -0
- package/lib/types/base/Plugin/types.d.ts.map +1 -1
- package/lib/types/components/AnimationFrame/index.d.ts +20 -18
- package/lib/types/components/AnimationFrame/index.d.ts.map +1 -1
- package/lib/types/components/AnimationFrame/types.d.ts +18 -3
- package/lib/types/components/AnimationFrame/types.d.ts.map +1 -1
- package/lib/types/components/Ctx2D/index.d.ts +37 -15
- package/lib/types/components/Ctx2D/index.d.ts.map +1 -1
- package/lib/types/components/Ctx2D/types.d.ts +40 -13
- package/lib/types/components/Ctx2D/types.d.ts.map +1 -1
- package/lib/types/components/Ctx2DPrerender/index.d.ts +13 -4
- package/lib/types/components/Ctx2DPrerender/index.d.ts.map +1 -1
- package/lib/types/components/Ctx2DPrerender/types.d.ts +13 -2
- package/lib/types/components/Ctx2DPrerender/types.d.ts.map +1 -1
- package/lib/types/components/CustomCursor/index.d.ts +59 -36
- package/lib/types/components/CustomCursor/index.d.ts.map +1 -1
- package/lib/types/components/CustomCursor/types.d.ts +52 -12
- package/lib/types/components/CustomCursor/types.d.ts.map +1 -1
- package/lib/types/components/{SmoothScroll → CustomScroll}/AnimatonFrame.d.ts.map +1 -1
- package/lib/types/components/{SmoothScroll → CustomScroll}/Elements.d.ts +3 -3
- package/lib/types/components/{SmoothScroll → CustomScroll}/Elements.d.ts.map +1 -1
- package/lib/types/components/{SmoothScroll → CustomScroll}/index.d.ts +46 -32
- package/lib/types/components/CustomScroll/index.d.ts.map +1 -0
- package/lib/types/components/CustomScroll/types.d.ts +137 -0
- package/lib/types/components/CustomScroll/types.d.ts.map +1 -0
- package/lib/types/components/CustomScrollDragPlugin/index.d.ts +62 -0
- package/lib/types/components/CustomScrollDragPlugin/index.d.ts.map +1 -0
- package/lib/types/components/CustomScrollDragPlugin/types.d.ts +52 -0
- package/lib/types/components/CustomScrollDragPlugin/types.d.ts.map +1 -0
- package/lib/types/components/CustomScrollKeyboardPlugin/index.d.ts +47 -0
- package/lib/types/components/CustomScrollKeyboardPlugin/index.d.ts.map +1 -0
- package/lib/types/components/CustomScrollKeyboardPlugin/types.d.ts +16 -0
- package/lib/types/components/{SmoothScrollKeyboardPlugin → CustomScrollKeyboardPlugin}/types.d.ts.map +1 -1
- package/lib/types/components/DraggerBase/index.d.ts +93 -28
- package/lib/types/components/DraggerBase/index.d.ts.map +1 -1
- package/lib/types/components/DraggerBase/types.d.ts +21 -3
- package/lib/types/components/DraggerBase/types.d.ts.map +1 -1
- package/lib/types/components/DraggerDirection/index.d.ts +6 -2
- package/lib/types/components/DraggerDirection/index.d.ts.map +1 -1
- package/lib/types/components/DraggerDirection/types.d.ts +15 -1
- package/lib/types/components/DraggerDirection/types.d.ts.map +1 -1
- package/lib/types/components/DraggerMove/index.d.ts +38 -8
- package/lib/types/components/DraggerMove/index.d.ts.map +1 -1
- package/lib/types/components/DraggerMove/types.d.ts +15 -2
- package/lib/types/components/DraggerMove/types.d.ts.map +1 -1
- package/lib/types/components/Marquee/index.d.ts +59 -36
- package/lib/types/components/Marquee/index.d.ts.map +1 -1
- package/lib/types/components/Marquee/types.d.ts +18 -8
- package/lib/types/components/Marquee/types.d.ts.map +1 -1
- package/lib/types/components/Preloader/index.d.ts +52 -15
- package/lib/types/components/Preloader/index.d.ts.map +1 -1
- package/lib/types/components/Preloader/types.d.ts +16 -5
- package/lib/types/components/Preloader/types.d.ts.map +1 -1
- package/lib/types/components/ProgressPreloader/index.d.ts +85 -25
- package/lib/types/components/ProgressPreloader/index.d.ts.map +1 -1
- package/lib/types/components/ProgressPreloader/types.d.ts +51 -14
- package/lib/types/components/ProgressPreloader/types.d.ts.map +1 -1
- package/lib/types/components/ProgressPreloader/utils/preloadCustomElement.d.ts +3 -0
- package/lib/types/components/ProgressPreloader/utils/preloadCustomElement.d.ts.map +1 -1
- package/lib/types/components/ScrollBar/Bar/index.d.ts +81 -16
- package/lib/types/components/ScrollBar/Bar/index.d.ts.map +1 -1
- package/lib/types/components/ScrollBar/Bar/types.d.ts +38 -16
- package/lib/types/components/ScrollBar/Bar/types.d.ts.map +1 -1
- package/lib/types/components/ScrollBar/index.d.ts +49 -12
- package/lib/types/components/ScrollBar/index.d.ts.map +1 -1
- package/lib/types/components/ScrollBar/types.d.ts +8 -6
- package/lib/types/components/ScrollBar/types.d.ts.map +1 -1
- package/lib/types/components/ScrollView/index.d.ts +65 -21
- package/lib/types/components/ScrollView/index.d.ts.map +1 -1
- package/lib/types/components/SectionScrollProgress/index.d.ts +83 -28
- package/lib/types/components/SectionScrollProgress/index.d.ts.map +1 -1
- package/lib/types/components/SectionScrollProgress/types.d.ts +15 -6
- package/lib/types/components/SectionScrollProgress/types.d.ts.map +1 -1
- package/lib/types/components/SlideProgress/index.d.ts +59 -24
- package/lib/types/components/SlideProgress/index.d.ts.map +1 -1
- package/lib/types/components/SlideProgress/types.d.ts +24 -15
- package/lib/types/components/SlideProgress/types.d.ts.map +1 -1
- package/lib/types/components/SplitText/index.d.ts +64 -18
- package/lib/types/components/SplitText/index.d.ts.map +1 -1
- package/lib/types/components/SplitText/types.d.ts +36 -8
- package/lib/types/components/SplitText/types.d.ts.map +1 -1
- package/lib/types/components/SplitText/utils/splitBase.d.ts +3 -1
- package/lib/types/components/SplitText/utils/splitBase.d.ts.map +1 -1
- package/lib/types/components/SplitText/utils/wrapLetters.d.ts +3 -1
- package/lib/types/components/SplitText/utils/wrapLetters.d.ts.map +1 -1
- package/lib/types/components/SplitText/utils/wrapLines.d.ts +3 -1
- package/lib/types/components/SplitText/utils/wrapLines.d.ts.map +1 -1
- package/lib/types/components/SplitText/utils/wrapWords.d.ts +3 -1
- package/lib/types/components/SplitText/utils/wrapWords.d.ts.map +1 -1
- package/lib/types/components/Timeline/index.d.ts +69 -21
- package/lib/types/components/Timeline/index.d.ts.map +1 -1
- package/lib/types/components/Timeline/types.d.ts +32 -7
- package/lib/types/components/Timeline/types.d.ts.map +1 -1
- package/lib/types/components/index.d.ts +4 -4
- package/lib/types/components/index.d.ts.map +1 -1
- package/lib/types/index.d.ts +9 -2
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/types/index.d.ts +3 -0
- package/lib/types/types/index.d.ts.map +1 -0
- package/lib/types/types/utility.d.ts +2 -3
- package/lib/types/types/utility.d.ts.map +1 -1
- package/lib/types/utils/common/PCancelable.d.ts +16 -0
- package/lib/types/utils/common/PCancelable.d.ts.map +1 -1
- package/lib/types/utils/common/normalizedTimeoutCallback.d.ts +19 -4
- package/lib/types/utils/common/normalizedTimeoutCallback.d.ts.map +1 -1
- package/lib/types/utils/common/objectKeys.d.ts +11 -1
- package/lib/types/utils/common/objectKeys.d.ts.map +1 -1
- package/lib/types/utils/common/pickObjectProps.d.ts +14 -2
- package/lib/types/utils/common/pickObjectProps.d.ts.map +1 -1
- package/lib/types/utils/common/times.d.ts +12 -3
- package/lib/types/utils/common/times.d.ts.map +1 -1
- package/lib/types/utils/common/uid.d.ts +4 -2
- package/lib/types/utils/common/uid.d.ts.map +1 -1
- package/lib/types/utils/image/load.d.ts +8 -5
- package/lib/types/utils/image/load.d.ts.map +1 -1
- package/lib/types/utils/image/pathsToProps.d.ts +10 -4
- package/lib/types/utils/image/pathsToProps.d.ts.map +1 -1
- package/lib/types/utils/image/sizesToSrcSet.d.ts +7 -3
- package/lib/types/utils/image/sizesToSrcSet.d.ts.map +1 -1
- package/lib/types/utils/internal/getApp.d.ts +9 -1
- package/lib/types/utils/internal/getApp.d.ts.map +1 -1
- package/lib/types/utils/listeners/isIntersectionObserverSupported.d.ts +1 -1
- package/lib/types/utils/listeners/onResize.d.ts +11 -12
- package/lib/types/utils/listeners/onResize.d.ts.map +1 -1
- package/lib/types/utils/math/clamp.d.ts +7 -2
- package/lib/types/utils/math/clamp.d.ts.map +1 -1
- package/lib/types/utils/math/clampScope.d.ts +8 -1
- package/lib/types/utils/math/clampScope.d.ts.map +1 -1
- package/lib/types/utils/math/easing.d.ts +4 -1
- package/lib/types/utils/math/easing.d.ts.map +1 -1
- package/lib/types/utils/math/inScope.d.ts +5 -2
- package/lib/types/utils/math/inScope.d.ts.map +1 -1
- package/lib/types/utils/math/lerp.d.ts +10 -2
- package/lib/types/utils/math/lerp.d.ts.map +1 -1
- package/lib/types/utils/math/normalizeNestedScope.d.ts +12 -3
- package/lib/types/utils/math/normalizeNestedScope.d.ts.map +1 -1
- package/lib/types/utils/math/scoped.d.ts +16 -5
- package/lib/types/utils/math/scoped.d.ts.map +1 -1
- package/lib/types/utils/math/spreadScope.d.ts +17 -3
- package/lib/types/utils/math/spreadScope.d.ts.map +1 -1
- package/lib/types/utils/math/wrap.d.ts +9 -3
- package/lib/types/utils/math/wrap.d.ts.map +1 -1
- package/lib/types/utils/scroll/getScrollValues.d.ts +13 -1
- package/lib/types/utils/scroll/getScrollValues.d.ts.map +1 -1
- package/lib/types/utils/scroll/isPageScrolling.d.ts +20 -0
- package/lib/types/utils/scroll/isPageScrolling.d.ts.map +1 -1
- package/lib/types/utils/scroll/normalizeWheel.d.ts +10 -2
- package/lib/types/utils/scroll/normalizeWheel.d.ts.map +1 -1
- package/lib/types/utils/scroll/onScroll.d.ts +10 -5
- package/lib/types/utils/scroll/onScroll.d.ts.map +1 -1
- package/lib/types/utils/scroll/scrollTo.d.ts +12 -9
- package/lib/types/utils/scroll/scrollTo.d.ts.map +1 -1
- package/lib/types/utils/scroll/scrollToElement.d.ts +9 -7
- package/lib/types/utils/scroll/scrollToElement.d.ts.map +1 -1
- package/lib/types/version.d.ts +1 -1
- package/package.json +6 -7
- package/src/{Application → Vevet}/events/createOnPageLoad/index.ts +8 -8
- package/src/Vevet/events/createOnPageLoad/types.ts +21 -0
- package/src/{Application → Vevet}/events/createViewport/index.ts +33 -35
- package/src/{Application → Vevet}/events/createViewport/stories/index.tsx +7 -5
- package/src/Vevet/events/createViewport/types.ts +93 -0
- package/src/Vevet/exported.ts +15 -0
- package/src/Vevet/global.ts +51 -0
- package/src/Vevet/index.ts +98 -0
- package/src/{Application → Vevet}/stories/index.tsx +2 -2
- package/src/Vevet/types.ts +48 -0
- package/src/base/Callbacks/index.ts +70 -51
- package/src/base/Callbacks/types.ts +53 -14
- package/src/base/Component/index.ts +19 -5
- package/src/base/Component/types.ts +15 -3
- package/src/base/Module/index.ts +125 -78
- package/src/base/Module/types.ts +32 -3
- package/src/base/MutableProps/index.ts +44 -73
- package/src/base/MutableProps/types.ts +15 -8
- package/src/base/Plugin/index.ts +24 -1
- package/src/base/Plugin/types.ts +11 -0
- package/src/components/AnimationFrame/index.ts +21 -28
- package/src/components/AnimationFrame/types.ts +23 -3
- package/src/components/Ctx2D/index.ts +46 -34
- package/src/components/Ctx2D/types.ts +53 -13
- package/src/components/Ctx2DPrerender/index.ts +18 -7
- package/src/components/Ctx2DPrerender/types.ts +13 -2
- package/src/components/CustomCursor/index.ts +85 -60
- package/src/components/CustomCursor/stories/index.tsx +0 -3
- package/src/components/CustomCursor/types.ts +63 -12
- package/src/components/{SmoothScroll → CustomScroll}/AnimatonFrame.ts +2 -2
- package/src/components/{SmoothScroll → CustomScroll}/Elements.ts +14 -14
- package/src/components/{SmoothScroll → CustomScroll}/index.ts +61 -44
- package/src/components/{SmoothScroll → CustomScroll}/stories/Default.tsx +8 -8
- package/src/components/{SmoothScroll → CustomScroll}/stories/WithHorizontal.tsx +9 -9
- package/src/components/{SmoothScroll → CustomScroll}/stories/WithInnerLerp.tsx +9 -9
- package/src/components/{SmoothScroll → CustomScroll}/stories/index.stories.tsx +1 -1
- package/src/components/CustomScroll/types.ts +165 -0
- package/src/components/{SmoothScrollDragPlugin → CustomScrollDragPlugin}/index.ts +41 -41
- package/src/components/{SmoothScrollDragPlugin → CustomScrollDragPlugin}/stories/index.stories.tsx +1 -1
- package/src/components/{SmoothScrollDragPlugin → CustomScrollDragPlugin}/stories/index.tsx +10 -10
- package/src/components/CustomScrollDragPlugin/types.ts +59 -0
- package/src/components/{SmoothScrollKeyboardPlugin → CustomScrollKeyboardPlugin}/index.ts +47 -43
- package/src/components/{SmoothScrollKeyboardPlugin → CustomScrollKeyboardPlugin}/stories/index.stories.tsx +1 -1
- package/src/components/{SmoothScrollKeyboardPlugin → CustomScrollKeyboardPlugin}/stories/index.tsx +10 -10
- package/src/components/{SmoothScrollKeyboardPlugin → CustomScrollKeyboardPlugin}/types.ts +6 -2
- package/src/components/DraggerBase/index.ts +101 -37
- package/src/components/DraggerBase/types.ts +25 -3
- package/src/components/DraggerDirection/index.ts +12 -6
- package/src/components/DraggerDirection/types.ts +18 -1
- package/src/components/DraggerMove/index.ts +44 -13
- package/src/components/DraggerMove/types.ts +17 -2
- package/src/components/Marquee/index.ts +255 -186
- package/src/components/Marquee/stories/index.tsx +16 -2
- package/src/components/Marquee/types.ts +18 -8
- package/src/components/Preloader/index.ts +56 -20
- package/src/components/Preloader/types.ts +18 -5
- package/src/components/ProgressPreloader/index.ts +104 -48
- package/src/components/ProgressPreloader/types.ts +65 -14
- package/src/components/ProgressPreloader/utils/preloadCustomElement.ts +13 -2
- package/src/components/ScrollBar/Bar/index.ts +112 -62
- package/src/components/ScrollBar/Bar/types.ts +46 -17
- package/src/components/ScrollBar/index.ts +65 -20
- package/src/components/ScrollBar/stories/{WithSmoothScrollComponent.tsx → WithCustomScrollComponent.tsx} +5 -5
- package/src/components/ScrollBar/stories/index.stories.tsx +3 -3
- package/src/components/ScrollBar/types.ts +10 -6
- package/src/components/ScrollView/index.ts +73 -27
- package/src/components/ScrollView/stories/index.tsx +5 -2
- package/src/components/SectionScrollProgress/index.ts +97 -41
- package/src/components/SectionScrollProgress/stories/WithCustomScroll.tsx +6 -6
- package/src/components/SectionScrollProgress/types.ts +19 -6
- package/src/components/SlideProgress/index.ts +78 -45
- package/src/components/SlideProgress/types.ts +24 -15
- package/src/components/SplitText/index.ts +71 -31
- package/src/components/SplitText/types.ts +48 -8
- package/src/components/SplitText/utils/splitBase.ts +6 -2
- package/src/components/SplitText/utils/wrapLetters.ts +11 -3
- package/src/components/SplitText/utils/wrapLines.ts +11 -5
- package/src/components/SplitText/utils/wrapWords.ts +14 -3
- package/src/components/Timeline/index.ts +98 -26
- package/src/components/Timeline/stories/index.stories.tsx +0 -5
- package/src/components/Timeline/types.ts +37 -7
- package/src/components/index.ts +4 -4
- package/src/index.ts +14 -4
- package/src/styles/base.scss +0 -2
- package/src/styles/components/CustomCursor.scss +7 -7
- package/{lib/styles/components/SmoothScroll.scss → src/styles/components/CustomScroll.scss} +3 -3
- package/src/styles/components/Preloader.scss +1 -1
- package/src/styles/components/ScrollBar.scss +4 -4
- package/src/styles/components/index.scss +1 -1
- package/src/styles/index.scss +0 -1
- package/src/types/index.ts +2 -0
- package/src/types/utility.ts +2 -2
- package/src/utils/common/PCancelable.ts +17 -0
- package/src/utils/common/normalizedTimeoutCallback.ts +19 -4
- package/src/utils/common/objectKeys.ts +12 -2
- package/src/utils/common/pickObjectProps.ts +16 -4
- package/src/utils/common/times.ts +12 -3
- package/src/utils/common/uid.ts +5 -3
- package/src/utils/image/load.ts +9 -4
- package/src/utils/image/pathsToProps.ts +12 -5
- package/src/utils/image/sizesToSrcSet.ts +7 -3
- package/src/utils/internal/getApp.ts +25 -0
- package/src/utils/listeners/isIntersectionObserverSupported.ts +1 -1
- package/src/utils/listeners/onResize.ts +16 -21
- package/src/utils/math/clamp.ts +10 -5
- package/src/utils/math/clampScope.ts +9 -2
- package/src/utils/math/easing.ts +6 -2
- package/src/utils/math/inScope.ts +6 -3
- package/src/utils/math/lerp.ts +11 -3
- package/src/utils/math/normalizeNestedScope.ts +12 -3
- package/src/utils/math/scoped.ts +17 -6
- package/src/utils/math/spreadScope.ts +17 -3
- package/src/utils/math/wrap.ts +9 -3
- package/src/utils/scroll/getScrollValues.ts +13 -1
- package/src/utils/scroll/isPageScrolling.ts +31 -0
- package/src/utils/scroll/normalizeWheel.ts +10 -2
- package/src/utils/scroll/onScroll.ts +18 -11
- package/src/utils/scroll/scrollTo.ts +16 -10
- package/src/utils/scroll/scrollToElement.ts +9 -7
- package/src/version.ts +1 -1
- package/lib/cjs/Application/events/createOnPageLoad/index.js.map +0 -1
- package/lib/cjs/Application/events/createOnPageLoad/types.js.map +0 -1
- package/lib/cjs/Application/events/createViewport/index.js.map +0 -1
- package/lib/cjs/Application/events/createViewport/types.js.map +0 -1
- package/lib/cjs/Application/index.js +0 -222
- package/lib/cjs/Application/index.js.map +0 -1
- package/lib/cjs/components/BaseTimeline/index.js +0 -125
- package/lib/cjs/components/BaseTimeline/index.js.map +0 -1
- package/lib/cjs/components/BaseTimeline/types.js.map +0 -1
- package/lib/cjs/components/SmoothScroll/index.js.map +0 -1
- package/lib/cjs/components/SmoothScroll/types.js.map +0 -1
- package/lib/cjs/components/SmoothScrollDragPlugin/index.js.map +0 -1
- package/lib/cjs/components/SmoothScrollDragPlugin/types.js.map +0 -1
- package/lib/cjs/components/SmoothScrollKeyboardPlugin/index.js.map +0 -1
- package/lib/cjs/components/SmoothScrollKeyboardPlugin/types.js +0 -3
- package/lib/cjs/components/SmoothScrollKeyboardPlugin/types.js.map +0 -1
- package/lib/cjs/utils/internal/fetchWebpSupport.js.map +0 -1
- package/lib/cjs/utils/internal/getDeviceInfo.js.map +0 -1
- package/lib/cjs/vevet.js +0 -6
- package/lib/cjs/vevet.js.map +0 -1
- package/lib/esm/Application/events/createOnPageLoad/index.js.map +0 -1
- package/lib/esm/Application/events/createOnPageLoad/types.js.map +0 -1
- package/lib/esm/Application/events/createViewport/index.js.map +0 -1
- package/lib/esm/Application/events/createViewport/types.js.map +0 -1
- package/lib/esm/Application/index.js +0 -134
- package/lib/esm/Application/index.js.map +0 -1
- package/lib/esm/components/BaseTimeline/index.js +0 -75
- package/lib/esm/components/BaseTimeline/index.js.map +0 -1
- package/lib/esm/components/BaseTimeline/types.js.map +0 -1
- package/lib/esm/components/SmoothScroll/index.js.map +0 -1
- package/lib/esm/components/SmoothScroll/types.js.map +0 -1
- package/lib/esm/components/SmoothScrollDragPlugin/index.js.map +0 -1
- package/lib/esm/components/SmoothScrollDragPlugin/types.js.map +0 -1
- package/lib/esm/components/SmoothScrollKeyboardPlugin/index.js.map +0 -1
- package/lib/esm/components/SmoothScrollKeyboardPlugin/types.js +0 -2
- package/lib/esm/components/SmoothScrollKeyboardPlugin/types.js.map +0 -1
- package/lib/esm/utils/internal/fetchWebpSupport.js.map +0 -1
- package/lib/esm/utils/internal/getDeviceInfo.js.map +0 -1
- package/lib/esm/vevet.js +0 -3
- package/lib/esm/vevet.js.map +0 -1
- package/lib/styles/globals/index.scss +0 -18
- package/lib/types/Application/events/createOnPageLoad/index.d.ts +0 -5
- package/lib/types/Application/events/createOnPageLoad/index.d.ts.map +0 -1
- package/lib/types/Application/events/createOnPageLoad/types.d.ts +0 -5
- package/lib/types/Application/events/createOnPageLoad/types.d.ts.map +0 -1
- package/lib/types/Application/events/createViewport/index.d.ts +0 -20
- package/lib/types/Application/events/createViewport/index.d.ts.map +0 -1
- package/lib/types/Application/events/createViewport/types.d.ts +0 -52
- package/lib/types/Application/events/createViewport/types.d.ts.map +0 -1
- package/lib/types/Application/index.d.ts +0 -89
- package/lib/types/Application/index.d.ts.map +0 -1
- package/lib/types/Application/types.d.ts +0 -41
- package/lib/types/Application/types.d.ts.map +0 -1
- package/lib/types/components/BaseTimeline/index.d.ts +0 -40
- package/lib/types/components/BaseTimeline/index.d.ts.map +0 -1
- package/lib/types/components/BaseTimeline/types.d.ts +0 -34
- package/lib/types/components/BaseTimeline/types.d.ts.map +0 -1
- package/lib/types/components/SmoothScroll/index.d.ts.map +0 -1
- package/lib/types/components/SmoothScroll/types.d.ts +0 -105
- package/lib/types/components/SmoothScroll/types.d.ts.map +0 -1
- package/lib/types/components/SmoothScrollDragPlugin/index.d.ts +0 -50
- package/lib/types/components/SmoothScrollDragPlugin/index.d.ts.map +0 -1
- package/lib/types/components/SmoothScrollDragPlugin/types.d.ts +0 -39
- package/lib/types/components/SmoothScrollDragPlugin/types.d.ts.map +0 -1
- package/lib/types/components/SmoothScrollKeyboardPlugin/index.d.ts +0 -31
- package/lib/types/components/SmoothScrollKeyboardPlugin/index.d.ts.map +0 -1
- package/lib/types/components/SmoothScrollKeyboardPlugin/types.d.ts +0 -12
- package/lib/types/utils/internal/fetchWebpSupport.d.ts +0 -3
- package/lib/types/utils/internal/fetchWebpSupport.d.ts.map +0 -1
- package/lib/types/utils/internal/getDeviceInfo.d.ts.map +0 -1
- package/lib/types/vevet.d.ts +0 -3
- package/lib/types/vevet.d.ts.map +0 -1
- package/src/Application/events/createOnPageLoad/types.ts +0 -5
- package/src/Application/events/createViewport/types.ts +0 -55
- package/src/Application/index.ts +0 -204
- package/src/Application/types.ts +0 -41
- package/src/components/BaseTimeline/index.ts +0 -123
- package/src/components/BaseTimeline/stories/Basic.tsx +0 -65
- package/src/components/BaseTimeline/stories/Nested.tsx +0 -108
- package/src/components/BaseTimeline/stories/index.stories.tsx +0 -16
- package/src/components/BaseTimeline/types.ts +0 -36
- package/src/components/SmoothScroll/types.ts +0 -114
- package/src/components/SmoothScrollDragPlugin/types.ts +0 -40
- package/src/components/Timeline/stories/Nested.tsx +0 -135
- package/src/styles/globals/index.scss +0 -18
- package/src/vevet.ts +0 -4
- /package/lib/cjs/{Application → Vevet}/events/createOnPageLoad/types.js +0 -0
- /package/lib/cjs/{Application → Vevet}/events/createViewport/types.js +0 -0
- /package/lib/cjs/{Application → Vevet}/types.js +0 -0
- /package/lib/cjs/{utils/internal → Vevet/utils}/getDeviceInfo.js +0 -0
- /package/lib/cjs/components/{BaseTimeline → CustomScroll}/types.js +0 -0
- /package/lib/cjs/components/{SmoothScroll → CustomScrollDragPlugin}/types.js +0 -0
- /package/lib/cjs/components/{SmoothScrollDragPlugin → CustomScrollKeyboardPlugin}/types.js +0 -0
- /package/lib/esm/{Application → Vevet}/events/createOnPageLoad/types.js +0 -0
- /package/lib/esm/{Application → Vevet}/events/createViewport/types.js +0 -0
- /package/lib/esm/{Application → Vevet}/types.js +0 -0
- /package/lib/esm/{utils/internal → Vevet/utils}/getDeviceInfo.js +0 -0
- /package/lib/esm/components/{BaseTimeline → CustomScroll}/types.js +0 -0
- /package/lib/esm/components/{SmoothScroll → CustomScrollDragPlugin}/types.js +0 -0
- /package/lib/esm/components/{SmoothScrollDragPlugin → CustomScrollKeyboardPlugin}/types.js +0 -0
- /package/lib/types/{utils/internal → Vevet/utils}/getDeviceInfo.d.ts +0 -0
- /package/lib/types/components/{SmoothScroll → CustomScroll}/AnimatonFrame.d.ts +0 -0
- /package/src/{Application → Vevet}/events/.eslintrc +0 -0
- /package/src/{Application → Vevet}/events/createViewport/stories/index.stories.tsx +0 -0
- /package/src/{Application → Vevet}/stories/index.stories.tsx +0 -0
- /package/src/{utils/internal → Vevet/utils}/fetchWebpSupport.ts +0 -0
- /package/src/{utils/internal → Vevet/utils}/getDeviceInfo.ts +0 -0
|
@@ -4,41 +4,49 @@ import { TOnResizeTarget } from '@/utils/listeners/onResize';
|
|
|
4
4
|
export namespace NSplitText {
|
|
5
5
|
export interface IStaticProps extends NComponent.IStaticProps {
|
|
6
6
|
/**
|
|
7
|
-
* The text container
|
|
7
|
+
* The text container where the content will be split.
|
|
8
|
+
* Can be a CSS selector (string) or an actual HTML element.
|
|
8
9
|
*/
|
|
9
10
|
container: string | Element;
|
|
11
|
+
|
|
10
12
|
/**
|
|
11
|
-
*
|
|
13
|
+
* Specifies whether the text should be split into individual letters.
|
|
12
14
|
* @default true
|
|
13
15
|
*/
|
|
14
16
|
hasLetters?: boolean;
|
|
17
|
+
|
|
15
18
|
/**
|
|
16
|
-
*
|
|
19
|
+
* Specifies whether the text should be split into lines.
|
|
17
20
|
* @default false
|
|
18
21
|
*/
|
|
19
22
|
hasLines?: boolean;
|
|
23
|
+
|
|
20
24
|
/**
|
|
21
|
-
*
|
|
25
|
+
* HTML tag to wrap each letter.
|
|
22
26
|
* @default `span`
|
|
23
27
|
*/
|
|
24
28
|
letterTag?: keyof HTMLElementTagNameMap;
|
|
29
|
+
|
|
25
30
|
/**
|
|
26
|
-
*
|
|
31
|
+
* HTML tag to wrap each word.
|
|
27
32
|
* @default `span`
|
|
28
33
|
*/
|
|
29
34
|
wordTag?: keyof HTMLElementTagNameMap;
|
|
35
|
+
|
|
30
36
|
/**
|
|
31
|
-
*
|
|
37
|
+
* HTML tag to wrap each line.
|
|
32
38
|
* @default `span`
|
|
33
39
|
*/
|
|
34
40
|
lineTag?: keyof HTMLElementTagNameMap;
|
|
41
|
+
|
|
35
42
|
/**
|
|
36
|
-
*
|
|
43
|
+
* Determines the viewport target for resizing behavior.
|
|
37
44
|
* @default 'any'
|
|
38
45
|
*/
|
|
39
46
|
viewportTarget?: TOnResizeTarget;
|
|
47
|
+
|
|
40
48
|
/**
|
|
41
|
-
*
|
|
49
|
+
* Debounce timeout for the resize event in milliseconds.
|
|
42
50
|
* @default 0
|
|
43
51
|
*/
|
|
44
52
|
resizeDebounce?: number;
|
|
@@ -47,23 +55,55 @@ export namespace NSplitText {
|
|
|
47
55
|
export interface IChangeableProps extends NComponent.IChangeableProps {}
|
|
48
56
|
|
|
49
57
|
export interface ICallbacksTypes extends NComponent.ICallbacksTypes {
|
|
58
|
+
/**
|
|
59
|
+
* Fired before the text is split.
|
|
60
|
+
*/
|
|
50
61
|
beforeSplit: undefined;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Fired after the text has been split.
|
|
65
|
+
*/
|
|
51
66
|
split: undefined;
|
|
52
67
|
}
|
|
53
68
|
|
|
54
69
|
export interface ILine {
|
|
70
|
+
/**
|
|
71
|
+
* HTML element representing a single line of split text.
|
|
72
|
+
*/
|
|
55
73
|
element: HTMLElement;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Array of word objects within the line.
|
|
77
|
+
*/
|
|
56
78
|
words: NSplitText.IWord[];
|
|
57
79
|
}
|
|
58
80
|
|
|
59
81
|
export interface IWord {
|
|
82
|
+
/**
|
|
83
|
+
* HTML element representing a single word.
|
|
84
|
+
*/
|
|
60
85
|
element: HTMLElement;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* The text content of the word.
|
|
89
|
+
*/
|
|
61
90
|
text: string;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Array of letter objects within the word.
|
|
94
|
+
*/
|
|
62
95
|
letters: NSplitText.ILetter[];
|
|
63
96
|
}
|
|
64
97
|
|
|
65
98
|
export interface ILetter {
|
|
99
|
+
/**
|
|
100
|
+
* HTML element representing a single letter.
|
|
101
|
+
*/
|
|
66
102
|
element: HTMLElement;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* The text content of the letter.
|
|
106
|
+
*/
|
|
67
107
|
text: string;
|
|
68
108
|
}
|
|
69
109
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable no-param-reassign */
|
|
2
1
|
import { NSplitText } from '../types';
|
|
3
2
|
import { wrapLetters } from './wrapLetters';
|
|
4
3
|
import { wrapWords } from './wrapWords';
|
|
@@ -12,7 +11,9 @@ interface IProps {
|
|
|
12
11
|
wordTag: keyof HTMLElementTagNameMap;
|
|
13
12
|
}
|
|
14
13
|
|
|
15
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* Splits text in the container into words and optionally into letters.
|
|
16
|
+
*/
|
|
16
17
|
export function splitBase({
|
|
17
18
|
container,
|
|
18
19
|
letterClassName,
|
|
@@ -21,8 +22,10 @@ export function splitBase({
|
|
|
21
22
|
letterTag,
|
|
22
23
|
wordTag,
|
|
23
24
|
}: IProps) {
|
|
25
|
+
// Clone the container to manipulate the DOM without affecting the original
|
|
24
26
|
const helper = container.cloneNode(true) as HTMLElement;
|
|
25
27
|
|
|
28
|
+
// Wrap the text into words
|
|
26
29
|
const words = wrapWords({
|
|
27
30
|
container: helper,
|
|
28
31
|
classname: wordClassName,
|
|
@@ -31,6 +34,7 @@ export function splitBase({
|
|
|
31
34
|
|
|
32
35
|
const letters: NSplitText.ILetter[] = [];
|
|
33
36
|
|
|
37
|
+
// If enabled, wrap words into letters
|
|
34
38
|
if (hasLetters) {
|
|
35
39
|
const wrappedLetters = wrapLetters({
|
|
36
40
|
words,
|
|
@@ -6,10 +6,13 @@ interface IProps {
|
|
|
6
6
|
tagName: keyof HTMLElementTagNameMap;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Wraps each letter in every word inside the container with the specified HTML tag and class name.
|
|
11
|
+
*/
|
|
10
12
|
export function wrapLetters({ words, classname, tagName }: IProps) {
|
|
11
13
|
const letters: NSplitText.ILetter[] = [];
|
|
12
14
|
|
|
15
|
+
// Iterate over each word to wrap its letters
|
|
13
16
|
words.forEach((word) => {
|
|
14
17
|
const textNode = word.element.childNodes[0];
|
|
15
18
|
const text = textNode.textContent;
|
|
@@ -18,22 +21,27 @@ export function wrapLetters({ words, classname, tagName }: IProps) {
|
|
|
18
21
|
return;
|
|
19
22
|
}
|
|
20
23
|
|
|
21
|
-
|
|
24
|
+
// Split the word into individual letters
|
|
25
|
+
const splitLetters = text.split('');
|
|
22
26
|
|
|
23
|
-
|
|
27
|
+
splitLetters.forEach((splitLetter) => {
|
|
28
|
+
// Create a new element for each letter
|
|
24
29
|
const element = document.createElement(tagName);
|
|
25
30
|
element.style.display = 'inline-block';
|
|
26
31
|
element.classList.add(classname);
|
|
27
32
|
element.appendChild(document.createTextNode(splitLetter));
|
|
28
33
|
|
|
34
|
+
// Append the letter element to the word's container
|
|
29
35
|
word.element.appendChild(element);
|
|
30
36
|
|
|
31
37
|
const letter: NSplitText.ILetter = { element, text: splitLetter };
|
|
32
38
|
|
|
39
|
+
// Add the letter to the word's letters array and the global letters array
|
|
33
40
|
word.letters.push(letter);
|
|
34
41
|
letters.push(letter);
|
|
35
42
|
});
|
|
36
43
|
|
|
44
|
+
// Remove the original text node after wrapping the letters
|
|
37
45
|
textNode.remove();
|
|
38
46
|
});
|
|
39
47
|
|
|
@@ -13,6 +13,9 @@ interface ILine extends NSplitText.ILine {
|
|
|
13
13
|
nodes: Node[];
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Recursively retrieves the top parent element of a given element within a container.
|
|
18
|
+
*/
|
|
16
19
|
function getTopParent(ref: Element | null, topParent: Element): Element {
|
|
17
20
|
if (ref?.parentElement === topParent) {
|
|
18
21
|
return ref;
|
|
@@ -21,13 +24,15 @@ function getTopParent(ref: Element | null, topParent: Element): Element {
|
|
|
21
24
|
return getTopParent(ref?.parentElement ?? null, topParent);
|
|
22
25
|
}
|
|
23
26
|
|
|
24
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* Wraps each word in the container into lines, based on their vertical position.
|
|
29
|
+
*/
|
|
25
30
|
export function wrapLines({ container, words, className, tagName }: IProps) {
|
|
26
31
|
const lines: ILine[] = [];
|
|
27
32
|
let lineIndex = -1;
|
|
28
33
|
let prevTop = Infinity;
|
|
29
34
|
|
|
30
|
-
//
|
|
35
|
+
// Create lines by wrapping words
|
|
31
36
|
words.forEach((word) => {
|
|
32
37
|
const currentTop = Math.round(word.element.getBoundingClientRect().top);
|
|
33
38
|
const topParent = getTopParent(word.element, container);
|
|
@@ -56,14 +61,14 @@ export function wrapLines({ container, words, className, tagName }: IProps) {
|
|
|
56
61
|
}
|
|
57
62
|
});
|
|
58
63
|
|
|
59
|
-
//
|
|
64
|
+
// Append line elements to the container
|
|
60
65
|
lines.forEach((line) => {
|
|
61
66
|
container.insertBefore(line.element, line.nodes[0]);
|
|
62
67
|
|
|
63
68
|
line.element.append(...line.nodes);
|
|
64
69
|
});
|
|
65
70
|
|
|
66
|
-
//
|
|
71
|
+
// Hide any extra <br> elements after lines
|
|
67
72
|
const hiddenBr: HTMLBRElement[] = [];
|
|
68
73
|
lines.forEach((line) => {
|
|
69
74
|
const nextSibling = line.element.nextElementSibling;
|
|
@@ -73,13 +78,14 @@ export function wrapLines({ container, words, className, tagName }: IProps) {
|
|
|
73
78
|
}
|
|
74
79
|
});
|
|
75
80
|
|
|
76
|
-
//
|
|
81
|
+
// Associate words with the corresponding lines
|
|
77
82
|
lines.forEach((line) => {
|
|
78
83
|
line.words.push(
|
|
79
84
|
...words.filter((word) => childOf(word.element, line.element)),
|
|
80
85
|
);
|
|
81
86
|
});
|
|
82
87
|
|
|
88
|
+
// Destroy method to undo the line wrapping
|
|
83
89
|
const destroy = () => {
|
|
84
90
|
hiddenBr.forEach((br) => {
|
|
85
91
|
br.style.display = '';
|
|
@@ -1,19 +1,25 @@
|
|
|
1
|
+
/* eslint-disable no-param-reassign */
|
|
1
2
|
import { NSplitText } from '../types';
|
|
2
3
|
|
|
3
|
-
/* eslint-disable no-param-reassign */
|
|
4
4
|
interface IProps {
|
|
5
5
|
container: ChildNode;
|
|
6
6
|
classname: string;
|
|
7
7
|
tagName: keyof HTMLElementTagNameMap;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Wraps each word inside the container in an HTML element with the specified tag and class.
|
|
12
|
+
*/
|
|
11
13
|
export function wrapWords({ container, classname, tagName }: IProps) {
|
|
12
|
-
const whitespace = String.fromCharCode(32);
|
|
14
|
+
const whitespace = String.fromCharCode(32); // ASCII for space
|
|
13
15
|
|
|
14
16
|
const words: NSplitText.IWord[] = [];
|
|
15
17
|
|
|
18
|
+
/**
|
|
19
|
+
* Recursively processes each child node within the container to wrap words.
|
|
20
|
+
*/
|
|
16
21
|
function recursive(node: ChildNode) {
|
|
22
|
+
// If the node is an element, process its children
|
|
17
23
|
if (node instanceof HTMLElement) {
|
|
18
24
|
if (node.tagName !== 'BR') {
|
|
19
25
|
node.style.display = 'inline-block';
|
|
@@ -25,11 +31,13 @@ export function wrapWords({ container, classname, tagName }: IProps) {
|
|
|
25
31
|
return;
|
|
26
32
|
}
|
|
27
33
|
|
|
34
|
+
// If the node is a text node, split it into words
|
|
28
35
|
if (node.nodeType === 3) {
|
|
29
36
|
const nodeParent = node.parentElement;
|
|
30
37
|
const text = node.nodeValue ?? '';
|
|
31
38
|
const splitWords = text.split(whitespace);
|
|
32
39
|
|
|
40
|
+
// Handle case where node contains only whitespace
|
|
33
41
|
if (text === whitespace) {
|
|
34
42
|
nodeParent?.insertBefore(document.createTextNode(whitespace), node);
|
|
35
43
|
node.remove();
|
|
@@ -37,6 +45,7 @@ export function wrapWords({ container, classname, tagName }: IProps) {
|
|
|
37
45
|
return;
|
|
38
46
|
}
|
|
39
47
|
|
|
48
|
+
// Wrap each word in an element and insert it into the DOM
|
|
40
49
|
splitWords.forEach((splitWord, index) => {
|
|
41
50
|
if (splitWord) {
|
|
42
51
|
const element = document.createElement(tagName);
|
|
@@ -49,6 +58,7 @@ export function wrapWords({ container, classname, tagName }: IProps) {
|
|
|
49
58
|
nodeParent?.insertBefore(element, node);
|
|
50
59
|
}
|
|
51
60
|
|
|
61
|
+
// Add a space between words, except after the last word
|
|
52
62
|
if (index < splitWords.length - 1) {
|
|
53
63
|
nodeParent?.insertBefore(document.createTextNode(whitespace), node);
|
|
54
64
|
}
|
|
@@ -58,6 +68,7 @@ export function wrapWords({ container, classname, tagName }: IProps) {
|
|
|
58
68
|
}
|
|
59
69
|
}
|
|
60
70
|
|
|
71
|
+
// Begin processing the container
|
|
61
72
|
recursive(container);
|
|
62
73
|
|
|
63
74
|
return words;
|
|
@@ -1,53 +1,102 @@
|
|
|
1
|
-
import { clamp } from '@/utils/math';
|
|
2
|
-
import { BaseTimeline } from '../BaseTimeline';
|
|
1
|
+
import { clamp, easing } from '@/utils/math';
|
|
3
2
|
import { NTimeline } from './types';
|
|
3
|
+
import { getApp } from '@/utils/internal/getApp';
|
|
4
|
+
import { Component as ComponentClass } from '@/base/Component';
|
|
4
5
|
|
|
5
6
|
export type { NTimeline };
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
|
-
* Animation timeline
|
|
9
|
+
* Animation timeline that handles time-based animations with progress, easing, play, reverse, and pause functionality.
|
|
9
10
|
*/
|
|
10
11
|
export class Timeline<
|
|
11
12
|
StaticProps extends NTimeline.IStaticProps = NTimeline.IStaticProps,
|
|
12
13
|
ChangeableProps extends
|
|
13
14
|
NTimeline.IChangeableProps = NTimeline.IChangeableProps,
|
|
14
15
|
CallbacksTypes extends NTimeline.ICallbacksTypes = NTimeline.ICallbacksTypes,
|
|
15
|
-
> extends
|
|
16
|
+
> extends ComponentClass<StaticProps, ChangeableProps, CallbacksTypes> {
|
|
16
17
|
protected _getDefaultProps() {
|
|
17
18
|
return {
|
|
18
19
|
...super._getDefaultProps(),
|
|
20
|
+
easing: getApp().props.easing,
|
|
21
|
+
isDestroyedOnEnd: false,
|
|
19
22
|
duration: 1000,
|
|
20
|
-
shouldDestroyOnEnd: false,
|
|
21
23
|
};
|
|
22
24
|
}
|
|
23
25
|
|
|
24
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* Global timeline progress, from 0 (start) to 1 (end).
|
|
28
|
+
*/
|
|
29
|
+
protected _p: number;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Global timeline progress. Can be manually set, triggering updates.
|
|
33
|
+
*/
|
|
34
|
+
get p() {
|
|
35
|
+
return this._p;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
set p(val: number) {
|
|
39
|
+
this._p = val;
|
|
40
|
+
|
|
41
|
+
this._handleProgressUpdate();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Eased progress of the timeline, calculated based on the easing function.
|
|
46
|
+
*/
|
|
47
|
+
protected _e: number;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Eased progress, which applies the easing function to the global progress.
|
|
51
|
+
*/
|
|
52
|
+
get e() {
|
|
53
|
+
return this._e;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Stores the requestAnimationFrame ID for the ongoing animation.
|
|
58
|
+
*/
|
|
25
59
|
protected _raf?: number;
|
|
26
60
|
|
|
27
|
-
/**
|
|
61
|
+
/**
|
|
62
|
+
* Stores the time of the last animation frame.
|
|
63
|
+
*/
|
|
28
64
|
protected _rafTime: number;
|
|
29
65
|
|
|
30
|
-
/**
|
|
66
|
+
/**
|
|
67
|
+
* Indicates if the timeline is currently playing.
|
|
68
|
+
*/
|
|
31
69
|
get isPlaying() {
|
|
32
70
|
return typeof this._raf !== 'undefined';
|
|
33
71
|
}
|
|
34
72
|
|
|
35
|
-
/**
|
|
73
|
+
/**
|
|
74
|
+
* Indicates if the timeline is playing in reverse.
|
|
75
|
+
*/
|
|
36
76
|
protected _isReversed: boolean;
|
|
37
77
|
|
|
38
|
-
/**
|
|
78
|
+
/**
|
|
79
|
+
* Returns whether the timeline is reversed.
|
|
80
|
+
*/
|
|
39
81
|
get isReversed() {
|
|
40
82
|
return this._isReversed;
|
|
41
83
|
}
|
|
42
84
|
|
|
43
|
-
/**
|
|
85
|
+
/**
|
|
86
|
+
* Indicates if the timeline is paused.
|
|
87
|
+
*/
|
|
44
88
|
protected _isPaused: boolean;
|
|
45
89
|
|
|
46
|
-
/**
|
|
90
|
+
/**
|
|
91
|
+
* Returns whether the timeline is paused.
|
|
92
|
+
*/
|
|
47
93
|
get isPaused() {
|
|
48
94
|
return this._isPaused;
|
|
49
95
|
}
|
|
50
96
|
|
|
97
|
+
/**
|
|
98
|
+
* Returns the duration of the timeline, ensuring a minimum duration of 1 ms.
|
|
99
|
+
*/
|
|
51
100
|
get duration() {
|
|
52
101
|
return Math.max(this.props.duration, 1);
|
|
53
102
|
}
|
|
@@ -55,7 +104,9 @@ export class Timeline<
|
|
|
55
104
|
constructor(initialProps?: StaticProps & ChangeableProps, canInit = true) {
|
|
56
105
|
super(initialProps, false);
|
|
57
106
|
|
|
58
|
-
//
|
|
107
|
+
// Set default variables
|
|
108
|
+
this._p = 0;
|
|
109
|
+
this._e = 0;
|
|
59
110
|
this._raf = undefined;
|
|
60
111
|
this._rafTime = 0;
|
|
61
112
|
this._isReversed = false;
|
|
@@ -66,7 +117,10 @@ export class Timeline<
|
|
|
66
117
|
}
|
|
67
118
|
}
|
|
68
119
|
|
|
69
|
-
/**
|
|
120
|
+
/**
|
|
121
|
+
* Plays the timeline, advancing progress from its current state toward completion.
|
|
122
|
+
* Will not play if the timeline has already been destroyed or has fully completed.
|
|
123
|
+
*/
|
|
70
124
|
public play() {
|
|
71
125
|
if (this.isDestroyed || this.p === 1) {
|
|
72
126
|
return;
|
|
@@ -81,7 +135,10 @@ export class Timeline<
|
|
|
81
135
|
}
|
|
82
136
|
}
|
|
83
137
|
|
|
84
|
-
/**
|
|
138
|
+
/**
|
|
139
|
+
* Reverses the timeline, moving progress from its current state toward the start.
|
|
140
|
+
* Will not reverse if the timeline has already been destroyed or is at the start.
|
|
141
|
+
*/
|
|
85
142
|
public reverse() {
|
|
86
143
|
if (this.isDestroyed || this.p === 0) {
|
|
87
144
|
return;
|
|
@@ -96,7 +153,9 @@ export class Timeline<
|
|
|
96
153
|
}
|
|
97
154
|
}
|
|
98
155
|
|
|
99
|
-
/**
|
|
156
|
+
/**
|
|
157
|
+
* Pauses the timeline's progress, stopping the animation at its current state.
|
|
158
|
+
*/
|
|
100
159
|
public pause() {
|
|
101
160
|
if (this.isDestroyed) {
|
|
102
161
|
return;
|
|
@@ -110,7 +169,9 @@ export class Timeline<
|
|
|
110
169
|
this._raf = undefined;
|
|
111
170
|
}
|
|
112
171
|
|
|
113
|
-
/**
|
|
172
|
+
/**
|
|
173
|
+
* Resets the timeline to the beginning (progress = 0).
|
|
174
|
+
*/
|
|
114
175
|
public reset() {
|
|
115
176
|
if (this.isDestroyed) {
|
|
116
177
|
return;
|
|
@@ -120,7 +181,9 @@ export class Timeline<
|
|
|
120
181
|
this.p = 0;
|
|
121
182
|
}
|
|
122
183
|
|
|
123
|
-
/**
|
|
184
|
+
/**
|
|
185
|
+
* Starts the animation process, updating the timeline's progress based on elapsed time.
|
|
186
|
+
*/
|
|
124
187
|
protected _animate() {
|
|
125
188
|
if (this.isPaused) {
|
|
126
189
|
return;
|
|
@@ -128,17 +191,17 @@ export class Timeline<
|
|
|
128
191
|
|
|
129
192
|
const { isReversed } = this;
|
|
130
193
|
|
|
131
|
-
//
|
|
194
|
+
// Calculate time difference between frames
|
|
132
195
|
const currentTime = Date.now();
|
|
133
196
|
const frameDiff = Math.abs(this._rafTime - currentTime);
|
|
134
197
|
this._rafTime = currentTime;
|
|
135
198
|
|
|
136
|
-
//
|
|
199
|
+
// Calculate current progress
|
|
137
200
|
const progressIterator = frameDiff / this.duration / (isReversed ? -1 : 1);
|
|
138
201
|
const progressTarget = clamp(this.p + progressIterator, [0, 1]);
|
|
139
202
|
this.p = progressTarget;
|
|
140
203
|
|
|
141
|
-
//
|
|
204
|
+
// End animation if progress reaches start or end
|
|
142
205
|
if (
|
|
143
206
|
(progressTarget === 1 && !isReversed) ||
|
|
144
207
|
(progressTarget === 0 && isReversed)
|
|
@@ -150,13 +213,20 @@ export class Timeline<
|
|
|
150
213
|
return;
|
|
151
214
|
}
|
|
152
215
|
|
|
153
|
-
//
|
|
216
|
+
// Continue animation
|
|
154
217
|
this._raf = window.requestAnimationFrame(this._animate.bind(this));
|
|
155
218
|
}
|
|
156
219
|
|
|
157
|
-
/**
|
|
220
|
+
/**
|
|
221
|
+
* Handles updates to the timeline's progress and triggers associated callbacks.
|
|
222
|
+
*/
|
|
158
223
|
protected _handleProgressUpdate() {
|
|
159
|
-
|
|
224
|
+
this._e = easing(this._p, this.props.easing);
|
|
225
|
+
|
|
226
|
+
this.callbacks.tbt('progress', {
|
|
227
|
+
p: this._p,
|
|
228
|
+
e: this._e,
|
|
229
|
+
});
|
|
160
230
|
|
|
161
231
|
if (this.p === 0) {
|
|
162
232
|
this.callbacks.tbt('start', undefined);
|
|
@@ -167,13 +237,15 @@ export class Timeline<
|
|
|
167
237
|
if (this.p === 1) {
|
|
168
238
|
this.callbacks.tbt('end', undefined);
|
|
169
239
|
|
|
170
|
-
if (this.props.
|
|
240
|
+
if (this.props.isDestroyedOnEnd) {
|
|
171
241
|
this.destroy();
|
|
172
242
|
}
|
|
173
243
|
}
|
|
174
244
|
}
|
|
175
245
|
|
|
176
|
-
/**
|
|
246
|
+
/**
|
|
247
|
+
* Destroys the timeline, pausing any ongoing animation and cleaning up resources.
|
|
248
|
+
*/
|
|
177
249
|
protected _destroy() {
|
|
178
250
|
this.pause();
|
|
179
251
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Meta, StoryFn } from '@storybook/react';
|
|
3
3
|
import { Basic } from './Basic';
|
|
4
|
-
import { Nested } from './Nested';
|
|
5
4
|
|
|
6
5
|
const meta: Meta = {
|
|
7
6
|
title: 'Components/Timeline',
|
|
@@ -10,7 +9,3 @@ const meta: Meta = {
|
|
|
10
9
|
export default meta;
|
|
11
10
|
|
|
12
11
|
export const Default: StoryFn<typeof Basic> = (props) => <Basic {...props} />;
|
|
13
|
-
|
|
14
|
-
export const WithNested: StoryFn<typeof Nested> = (props) => (
|
|
15
|
-
<Nested {...props} />
|
|
16
|
-
);
|
|
@@ -1,24 +1,54 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NComponent } from '@/base/Component';
|
|
2
|
+
import { IVevetProps } from '@/src/Vevet/types';
|
|
2
3
|
|
|
3
4
|
export namespace NTimeline {
|
|
4
|
-
export interface IStaticProps extends
|
|
5
|
+
export interface IStaticProps extends NComponent.IStaticProps {
|
|
5
6
|
/**
|
|
6
|
-
*
|
|
7
|
+
* Easing function for the timeline animation.
|
|
8
|
+
*/
|
|
9
|
+
easing?: IVevetProps['easing'];
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Whether to destroy the timeline when the animation ends.
|
|
7
13
|
* @default false
|
|
8
14
|
*/
|
|
9
|
-
|
|
15
|
+
isDestroyedOnEnd?: boolean;
|
|
10
16
|
}
|
|
11
17
|
|
|
12
|
-
export interface IChangeableProps extends
|
|
18
|
+
export interface IChangeableProps extends NComponent.IChangeableProps {
|
|
13
19
|
/**
|
|
14
|
-
*
|
|
20
|
+
* Duration of the timeline animation in milliseconds.
|
|
15
21
|
* @default 1000
|
|
16
22
|
*/
|
|
17
23
|
duration?: number;
|
|
18
24
|
}
|
|
19
25
|
|
|
20
|
-
export interface ICallbacksTypes extends
|
|
26
|
+
export interface ICallbacksTypes extends NComponent.ICallbacksTypes {
|
|
27
|
+
/**
|
|
28
|
+
* Triggered when the timeline starts.
|
|
29
|
+
*/
|
|
21
30
|
start: undefined;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Triggered during timeline progress updates.
|
|
34
|
+
*/
|
|
35
|
+
progress: IProgressParameter;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Triggered when the timeline reaches the end.
|
|
39
|
+
*/
|
|
22
40
|
end: undefined;
|
|
23
41
|
}
|
|
42
|
+
|
|
43
|
+
export interface IProgressParameter {
|
|
44
|
+
/**
|
|
45
|
+
* Current progress of the timeline, ranging from 0 to 1.
|
|
46
|
+
*/
|
|
47
|
+
p: number;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Eased progress value based on the easing function.
|
|
51
|
+
*/
|
|
52
|
+
e: number;
|
|
53
|
+
}
|
|
24
54
|
}
|
package/src/components/index.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export * from './AnimationFrame';
|
|
2
|
-
export * from './BaseTimeline';
|
|
3
2
|
export * from './Ctx2D';
|
|
4
3
|
export * from './Ctx2DPrerender';
|
|
5
4
|
export * from './CustomCursor';
|
|
5
|
+
export * from './DraggerBase';
|
|
6
6
|
export * from './DraggerDirection';
|
|
7
7
|
export * from './DraggerMove';
|
|
8
8
|
export * from './Marquee';
|
|
@@ -12,8 +12,8 @@ export * from './ScrollBar';
|
|
|
12
12
|
export * from './ScrollView';
|
|
13
13
|
export * from './SectionScrollProgress';
|
|
14
14
|
export * from './SlideProgress';
|
|
15
|
-
export * from './
|
|
16
|
-
export * from './
|
|
17
|
-
export * from './
|
|
15
|
+
export * from './CustomScroll';
|
|
16
|
+
export * from './CustomScrollDragPlugin';
|
|
17
|
+
export * from './CustomScrollKeyboardPlugin';
|
|
18
18
|
export * from './SplitText';
|
|
19
19
|
export * from './Timeline';
|
package/src/index.ts
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
import { getApp } from './utils/internal/getApp';
|
|
2
|
+
import { IVevet } from './Vevet/global';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Vevet Application
|
|
6
|
+
*
|
|
7
|
+
* @see {@linkcode IVevet}
|
|
8
|
+
*/
|
|
9
|
+
export const vevet = (
|
|
10
|
+
typeof window !== 'undefined' ? getApp() : undefined
|
|
11
|
+
) as IVevet;
|
|
12
|
+
|
|
13
|
+
export * from './Vevet/exported';
|
|
4
14
|
|
|
5
|
-
export * from './
|
|
15
|
+
export * from './utils';
|
|
6
16
|
|
|
7
17
|
export * from './base';
|
|
8
18
|
|
|
9
19
|
export * from './components';
|
|
10
20
|
|
|
11
|
-
|
|
21
|
+
export * from './types';
|
package/src/styles/base.scss
CHANGED