vevet 2.2.0 → 2.5.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/build/cdn/index.js +1 -1
- package/build/cjs/app/events/Viewport.js +17 -6
- package/build/cjs/components/scroll/section/ScrollSectionProgress.js +261 -0
- package/build/cjs/index.js +5 -1
- package/build/cjs/utils/scroll/getScrollValues.js +20 -0
- package/build/cjs/utils/scroll/index.js +12 -0
- package/build/cjs/utils/scroll/scrollTo.js +41 -0
- package/build/cjs/utils/scroll/scrollToElement.js +39 -0
- package/build/cjs/utils/scroll/to.js +41 -0
- package/build/es/app/events/Viewport.js +16 -6
- package/build/es/components/scroll/section/ScrollSectionProgress.js +181 -0
- package/build/es/index.js +4 -1
- package/build/es/utils/scroll/getScrollValues.js +16 -0
- package/build/es/utils/scroll/index.js +4 -0
- package/build/es/utils/scroll/scrollTo.js +34 -0
- package/build/es/utils/scroll/scrollToElement.js +32 -0
- package/build/es/utils/scroll/to.js +34 -0
- package/build/types/app/events/Viewport.d.ts +9 -1
- package/build/types/app/events/Viewport.d.ts.map +1 -1
- package/build/types/components/scroll/section/ScrollSectionProgress.d.ts +131 -0
- package/build/types/components/scroll/section/ScrollSectionProgress.d.ts.map +1 -0
- package/build/types/components/scroll/types.d.ts +2 -5
- package/build/types/components/scroll/types.d.ts.map +1 -1
- package/build/types/index.d.ts +4 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/utils/scroll/getScrollValues.d.ts +9 -0
- package/build/types/utils/scroll/getScrollValues.d.ts.map +1 -0
- package/build/types/utils/scroll/index.d.ts +5 -0
- package/build/types/utils/scroll/index.d.ts.map +1 -0
- package/build/types/utils/scroll/scrollTo.d.ts +28 -0
- package/build/types/utils/scroll/scrollTo.d.ts.map +1 -0
- package/build/types/utils/scroll/scrollToElement.d.ts +32 -0
- package/build/types/utils/scroll/scrollToElement.d.ts.map +1 -0
- package/build/types/utils/scroll/to.d.ts +28 -0
- package/build/types/utils/scroll/to.d.ts.map +1 -0
- package/build/types/utils/types/general.d.ts +6 -0
- package/build/types/utils/types/general.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/ts/app/events/Viewport.ts +18 -6
- package/src/ts/components/scroll/section/ScrollSectionProgress.ts +344 -0
- package/src/ts/components/scroll/types.ts +3 -5
- package/src/ts/index.ts +4 -0
- package/src/ts/utils/scroll/getScrollValues.ts +20 -0
- package/src/ts/utils/scroll/index.ts +9 -0
- package/src/ts/utils/scroll/scrollTo.ts +65 -0
- package/src/ts/utils/scroll/scrollToElement.ts +74 -0
- package/src/ts/utils/types/general.ts +7 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { selectOne } from 'vevet-dom';
|
|
2
|
+
import onScroll from '../../../utils/listeners/onScroll';
|
|
3
|
+
import { Component } from '../../../base/Component';
|
|
4
|
+
import clampScope from '../../../utils/math/clampScope';
|
|
5
|
+
import getScrollValues from '../../../utils/scroll/getScrollValues';
|
|
6
|
+
/**
|
|
7
|
+
* Elements into viewport
|
|
8
|
+
*/
|
|
9
|
+
export class ScrollSectionProgress extends Component {
|
|
10
|
+
constructor(initialProp, init = true) {
|
|
11
|
+
super(initialProp, false);
|
|
12
|
+
// get scroll container
|
|
13
|
+
if (typeof this.prop.container === 'string') {
|
|
14
|
+
this._scrollContainer = selectOne(this.prop.container);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
this._scrollContainer = this.prop.container;
|
|
18
|
+
}
|
|
19
|
+
// get section element
|
|
20
|
+
if (typeof this.prop.section === 'string') {
|
|
21
|
+
this._section = selectOne(this.prop.section);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
this._section = this.prop.section;
|
|
25
|
+
}
|
|
26
|
+
// set defaults
|
|
27
|
+
this._progress = -0.001;
|
|
28
|
+
this._scopeScroll = [0, 0];
|
|
29
|
+
this._scopeIn = [0, 0];
|
|
30
|
+
this._scopeMove = [0, 0];
|
|
31
|
+
this._scopeOut = [0, 0];
|
|
32
|
+
// initialize the class
|
|
33
|
+
if (init) {
|
|
34
|
+
this.init();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
_getDefaultProp() {
|
|
38
|
+
return Object.assign(Object.assign({}, super._getDefaultProp()), { container: window, updateOnResize: '', resizeTimeout: 0 });
|
|
39
|
+
}
|
|
40
|
+
get scrollContainer() {
|
|
41
|
+
return this._scrollContainer;
|
|
42
|
+
}
|
|
43
|
+
get section() {
|
|
44
|
+
return this._section;
|
|
45
|
+
}
|
|
46
|
+
get scopeScroll() {
|
|
47
|
+
return this._scopeScroll;
|
|
48
|
+
}
|
|
49
|
+
get scopeIn() {
|
|
50
|
+
return this._scopeIn;
|
|
51
|
+
}
|
|
52
|
+
get scopeMove() {
|
|
53
|
+
return this._scopeMove;
|
|
54
|
+
}
|
|
55
|
+
get scopeOut() {
|
|
56
|
+
return this._scopeOut;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Global progress
|
|
60
|
+
*/
|
|
61
|
+
get progress() {
|
|
62
|
+
return this._progress;
|
|
63
|
+
}
|
|
64
|
+
set progress(val) {
|
|
65
|
+
this._progress = val;
|
|
66
|
+
}
|
|
67
|
+
init() {
|
|
68
|
+
super.init();
|
|
69
|
+
}
|
|
70
|
+
// Set Module Events
|
|
71
|
+
_setEvents() {
|
|
72
|
+
super._setEvents();
|
|
73
|
+
// set resize events
|
|
74
|
+
this.addViewportCallback(this.prop.viewportTarget, () => {
|
|
75
|
+
this.resize();
|
|
76
|
+
}, {
|
|
77
|
+
timeout: this.prop.resizeTimeout,
|
|
78
|
+
});
|
|
79
|
+
// resize on page loaded
|
|
80
|
+
this._loadedEvent = this._app.onPageLoaded();
|
|
81
|
+
this._loadedEvent.then(() => {
|
|
82
|
+
this.resize();
|
|
83
|
+
}).catch(() => { });
|
|
84
|
+
// set scroll events
|
|
85
|
+
this._scrollEvent = onScroll({
|
|
86
|
+
container: this.prop.container,
|
|
87
|
+
callback: this._handleScroll.bind(this),
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
_onPropMutate() {
|
|
91
|
+
super._onPropMutate();
|
|
92
|
+
this.resize();
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* 'in' progress
|
|
96
|
+
*/
|
|
97
|
+
get progressIn() {
|
|
98
|
+
return clampScope(this.progress, this.scopeIn) || 0;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* 'out' progress
|
|
102
|
+
*/
|
|
103
|
+
get progressOut() {
|
|
104
|
+
return clampScope(this.progress, this.scopeOut) || 0;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* 'move' progress
|
|
108
|
+
*/
|
|
109
|
+
get progressMove() {
|
|
110
|
+
return clampScope(this.progress, this.scopeMove) || 0;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Handle scroll event
|
|
114
|
+
*/
|
|
115
|
+
_handleScroll() {
|
|
116
|
+
// calculate scopes
|
|
117
|
+
const scrollData = getScrollValues(this.scrollContainer);
|
|
118
|
+
if (!scrollData) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
this._render(scrollData);
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Resize the scene
|
|
125
|
+
*/
|
|
126
|
+
resize() {
|
|
127
|
+
// calculate scopes
|
|
128
|
+
const scrollData = getScrollValues(this.scrollContainer);
|
|
129
|
+
if (!scrollData) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
// get sizes
|
|
133
|
+
const bounding = this.section.getBoundingClientRect();
|
|
134
|
+
const vHeight = this._app.viewport.height;
|
|
135
|
+
// calculate scroll scope
|
|
136
|
+
const inStart = scrollData.scrollTop + bounding.top - vHeight;
|
|
137
|
+
const moveEnd = scrollData.scrollTop + bounding.top + bounding.height;
|
|
138
|
+
const scrollLine = moveEnd - inStart;
|
|
139
|
+
this._scopeScroll = [inStart, moveEnd];
|
|
140
|
+
// calculate scopes
|
|
141
|
+
this._scopeIn = [0, vHeight / scrollLine];
|
|
142
|
+
this._scopeOut = [1 - vHeight / scrollLine, 1];
|
|
143
|
+
this._scopeMove = [this._scopeIn[1], this._scopeOut[0]];
|
|
144
|
+
// launch callbacks
|
|
145
|
+
this.callbacks.tbt('resize', false);
|
|
146
|
+
// render the scene
|
|
147
|
+
this._render(scrollData, true);
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Render the scene
|
|
151
|
+
*/
|
|
152
|
+
_render(scrollData, force = false) {
|
|
153
|
+
const canRender = this._canRender(scrollData, force);
|
|
154
|
+
if (!canRender) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
this.callbacks.tbt('render', false);
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Check if the section can be rendered
|
|
161
|
+
*/
|
|
162
|
+
_canRender(scrollData, force = false) {
|
|
163
|
+
if (!scrollData) {
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
const { scrollTop } = scrollData;
|
|
167
|
+
const prevProgress = this.progress;
|
|
168
|
+
const progress = clampScope(scrollTop, [this._scopeScroll[0], this._scopeScroll[1]]) || 0;
|
|
169
|
+
this.progress = progress;
|
|
170
|
+
return force || (progress !== prevProgress);
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Destroy the module
|
|
174
|
+
*/
|
|
175
|
+
_destroy() {
|
|
176
|
+
var _a, _b;
|
|
177
|
+
super._destroy();
|
|
178
|
+
(_a = this._scrollEvent) === null || _a === void 0 ? void 0 : _a.remove();
|
|
179
|
+
(_b = this._loadedEvent) === null || _b === void 0 ? void 0 : _b.cancel();
|
|
180
|
+
}
|
|
181
|
+
}
|
package/build/es/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as common from './utils/common';
|
|
2
2
|
import * as listeners from './utils/listeners';
|
|
3
3
|
import * as math from './utils/math';
|
|
4
|
+
import * as scroll from './utils/scroll';
|
|
4
5
|
import * as GeneralTypes from './utils/types/general';
|
|
5
6
|
import { Application } from './app/Application';
|
|
6
7
|
import { Viewport } from './app/events/Viewport';
|
|
@@ -28,11 +29,13 @@ import { ScrollEventsBase } from './components/scroll/scrollable/ScrollEventsBas
|
|
|
28
29
|
import { ScrollView } from './components/scroll/scrollable/ScrollView';
|
|
29
30
|
import { SmoothScrollKeyboardPlugin } from './components/scroll/plugins/SmoothScrollKeyboardPlugin';
|
|
30
31
|
import { SmoothScrollDragPlugin } from './components/scroll/plugins/SmoothScrollDragPlugin';
|
|
32
|
+
import { ScrollSectionProgress } from './components/scroll/section/ScrollSectionProgress';
|
|
31
33
|
import { SplitText } from './components/text/SplitText';
|
|
32
34
|
import { CustomCursor } from './components/cursor/CustomCursor';
|
|
33
35
|
const utils = {
|
|
34
36
|
common,
|
|
35
37
|
listeners,
|
|
36
38
|
math,
|
|
39
|
+
scroll,
|
|
37
40
|
};
|
|
38
|
-
export { utils, GeneralTypes, Application, Viewport, PageLoad, Callbacks, MutableProp, Module, Component, Plugin, Page, WheelHandler, AnimationFrame, StaticTimeline, Timeline, Preloader, ProgressPreloader, Dragger, DraggerMove, DraggerDirection, Ctx2D, Ctx2DPrerender, SmoothScroll, ScrollBar, ScrollEventsBase, ScrollView, SmoothScrollKeyboardPlugin, SmoothScrollDragPlugin, SplitText, CustomCursor, };
|
|
41
|
+
export { utils, GeneralTypes, Application, Viewport, PageLoad, Callbacks, MutableProp, Module, Component, Plugin, Page, WheelHandler, AnimationFrame, StaticTimeline, Timeline, Preloader, ProgressPreloader, Dragger, DraggerMove, DraggerDirection, Ctx2D, Ctx2DPrerender, SmoothScroll, ScrollBar, ScrollEventsBase, ScrollView, SmoothScrollKeyboardPlugin, SmoothScrollDragPlugin, ScrollSectionProgress, SplitText, CustomCursor, };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get scroll values of a certain element
|
|
3
|
+
*/
|
|
4
|
+
export default function getScrollValues(selector = window) {
|
|
5
|
+
if (selector) {
|
|
6
|
+
const scrollTop = selector instanceof Window
|
|
7
|
+
? selector.pageYOffset : selector.scrollTop;
|
|
8
|
+
const scrollLeft = selector instanceof Window
|
|
9
|
+
? selector.pageXOffset : selector.scrollLeft;
|
|
10
|
+
return {
|
|
11
|
+
scrollTop,
|
|
12
|
+
scrollLeft,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Timeline } from '../../components/timeline/Timeline';
|
|
2
|
+
import getScrollValues from './getScrollValues';
|
|
3
|
+
/**
|
|
4
|
+
* Scroll to coordinates
|
|
5
|
+
*/
|
|
6
|
+
export default function scrollTo({ container = window, top = 0, left = 0, duration = 250, }) {
|
|
7
|
+
return new Promise((resolve, reject) => {
|
|
8
|
+
// save start values
|
|
9
|
+
const startValues = getScrollValues(container);
|
|
10
|
+
if (startValues) {
|
|
11
|
+
// create animation
|
|
12
|
+
const timeline = new Timeline({
|
|
13
|
+
duration,
|
|
14
|
+
});
|
|
15
|
+
timeline.addCallback('progress', (data) => {
|
|
16
|
+
if (container) {
|
|
17
|
+
container.scrollTo({
|
|
18
|
+
top: startValues.scrollTop
|
|
19
|
+
+ (top - startValues.scrollTop) * data.easing,
|
|
20
|
+
left: startValues.scrollLeft
|
|
21
|
+
+ (left - startValues.scrollLeft) * data.easing,
|
|
22
|
+
behavior: 'auto',
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
timeline.addCallback('end', () => {
|
|
27
|
+
resolve();
|
|
28
|
+
});
|
|
29
|
+
timeline.play();
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
reject();
|
|
33
|
+
});
|
|
34
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { selectOne } from 'vevet-dom';
|
|
2
|
+
import getScrollValues from './getScrollValues';
|
|
3
|
+
import clamp from '../math/clamp';
|
|
4
|
+
import scrollTo from './scrollTo';
|
|
5
|
+
/**
|
|
6
|
+
* Scroll to element
|
|
7
|
+
*/
|
|
8
|
+
export default function scrollToElement({ container = window, el, top = 0, left = 0, duration = 250, }) {
|
|
9
|
+
return new Promise((resolve, reject) => {
|
|
10
|
+
const startValues = getScrollValues(container);
|
|
11
|
+
if (startValues) {
|
|
12
|
+
const element = selectOne(el);
|
|
13
|
+
if (element) {
|
|
14
|
+
const bounding = element.getBoundingClientRect();
|
|
15
|
+
const toTop = clamp(bounding.top + startValues.scrollTop - top, [0, Infinity]);
|
|
16
|
+
const toLeft = clamp(bounding.left + startValues.scrollLeft - left, [0, Infinity]);
|
|
17
|
+
scrollTo({
|
|
18
|
+
container,
|
|
19
|
+
top: toTop,
|
|
20
|
+
left: toLeft,
|
|
21
|
+
duration,
|
|
22
|
+
}).then(() => {
|
|
23
|
+
resolve();
|
|
24
|
+
}).catch(() => {
|
|
25
|
+
reject();
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
reject();
|
|
31
|
+
});
|
|
32
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Timeline } from '../../components/timeline/Timeline';
|
|
2
|
+
import getScrollValues from './getScrollValues';
|
|
3
|
+
/**
|
|
4
|
+
* Scroll to coordinates
|
|
5
|
+
*/
|
|
6
|
+
export default function scrollTo({ container = window, top = 0, left = 0, duration = 250, }) {
|
|
7
|
+
return new Promise((resolve, reject) => {
|
|
8
|
+
// save start values
|
|
9
|
+
const startValues = getScrollValues(container);
|
|
10
|
+
if (startValues) {
|
|
11
|
+
// create animation
|
|
12
|
+
const timeline = new Timeline({
|
|
13
|
+
duration,
|
|
14
|
+
});
|
|
15
|
+
timeline.addCallback('progress', (data) => {
|
|
16
|
+
if (container) {
|
|
17
|
+
container.scrollTo({
|
|
18
|
+
top: startValues.scrollTop
|
|
19
|
+
+ (top - startValues.scrollTop) * data.easing,
|
|
20
|
+
left: startValues.scrollLeft
|
|
21
|
+
+ (left - startValues.scrollLeft) * data.easing,
|
|
22
|
+
behavior: 'auto',
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
timeline.addCallback('end', () => {
|
|
27
|
+
resolve();
|
|
28
|
+
});
|
|
29
|
+
timeline.play();
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
reject();
|
|
33
|
+
});
|
|
34
|
+
}
|
|
@@ -134,6 +134,14 @@ export declare class Viewport extends Callbacks<NViewport.CallbacksTypes> {
|
|
|
134
134
|
/**
|
|
135
135
|
* Launch callbacks on resize.
|
|
136
136
|
*/
|
|
137
|
-
protected _onResize(
|
|
137
|
+
protected _onResize(
|
|
138
|
+
/**
|
|
139
|
+
* force all callbacks
|
|
140
|
+
*/
|
|
141
|
+
force?: boolean): void;
|
|
142
|
+
/**
|
|
143
|
+
* Force launching all callbacks
|
|
144
|
+
*/
|
|
145
|
+
forceResize(): void;
|
|
138
146
|
}
|
|
139
147
|
//# sourceMappingURL=Viewport.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Viewport.d.ts","sourceRoot":"","sources":["../../../../src/ts/app/events/Viewport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAIrD,yBAAiB,SAAS,CAAC;IAEvB;;OAEG;IACH,UAAiB,OAAO;QACpB,YAAY,EAAE,OAAO,CAAC;QACtB,aAAa,EAAE,OAAO,CAAC;QACvB,kBAAkB,EAAE,OAAO,CAAC;KAC/B;IAED;;OAEG;IACH,UAAiB,cAAe,SAAQ,UAAU,CAAC,cAAc;QAC7D;;WAEG;QACH,GAAG,EAAE,OAAO,CAAC;QACb;;WAEG;QACH,GAAG,EAAE,OAAO,CAAC;QACb;;WAEG;QACH,IAAI,EAAE,OAAO,CAAC;QACd;;WAEG;QACH,IAAI,EAAE,OAAO,CAAA;QACb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KAAK,EAAE,MAAM,EAAE;IAenB;;OAEG;IACH,SAAS,CAAC,cAAc;IAQxB;;OAEG;IACH,SAAS,CAAC,SAAS;
|
|
1
|
+
{"version":3,"file":"Viewport.d.ts","sourceRoot":"","sources":["../../../../src/ts/app/events/Viewport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAIrD,yBAAiB,SAAS,CAAC;IAEvB;;OAEG;IACH,UAAiB,OAAO;QACpB,YAAY,EAAE,OAAO,CAAC;QACtB,aAAa,EAAE,OAAO,CAAC;QACvB,kBAAkB,EAAE,OAAO,CAAC;KAC/B;IAED;;OAEG;IACH,UAAiB,cAAe,SAAQ,UAAU,CAAC,cAAc;QAC7D;;WAEG;QACH,GAAG,EAAE,OAAO,CAAC;QACb;;WAEG;QACH,GAAG,EAAE,OAAO,CAAC;QACb;;WAEG;QACH,IAAI,EAAE,OAAO,CAAC;QACd;;WAEG;QACH,IAAI,EAAE,OAAO,CAAA;QACb;;WAEG;QACH,IAAI,EAAE,OAAO,CAAC;QACd;;WAEG;QACH,IAAI,EAAE,OAAO,CAAC;QACd;;WAEG;QACH,EAAE,EAAE,OAAO,CAAC;KACf;CAEJ;AAqBD;;;GAGG;AACH,qBAAa,QAAS,SAAQ,SAAS,CACnC,SAAS,CAAC,cAAc,CAC3B;IACG;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;IACzB,IAAI,KAAK,WAER;IAED;;OAEG;IACH,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC;IAC1B,IAAI,MAAM,WAET;IAED;;OAEG;IACH,IAAI,EAAE,WAEL;IACD;;OAEG;IACH,IAAI,EAAE,WAEL;IAED;;OAEG;IACH,SAAS,CAAC,SAAS,EAAE;QACjB,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;KACb,CAAC;IAEF;;OAEG;IACH,IAAI,QAAQ;;;MAEX;IAED;;OAEG;IACH,IAAI,WAAW,YAEd;IAED;;OAEG;IACH,IAAI,UAAU,YAEb;IAED;;OAEG;IACH,SAAS,CAAC,UAAU,EAAE,OAAO,CAAC;IAC9B,IAAI,SAAS,YAEZ;IAED;;OAEG;IACH,SAAS,CAAC,SAAS,EAAE,OAAO,CAAC;IAC7B,IAAI,QAAQ,YAEX;IAED;;OAEG;IACH,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC5B,IAAI,OAAO,YAEV;IAED;;OAEG;IACH,IAAI,GAAG,WAKN;IAED;;OAEG;IACH,IAAI,eAAe,WAKlB;IAED,SAAS,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;;IAgB9D,SAAS,CAAC,YAAY;IAMtB,SAAS,CAAC,UAAU;IAapB;;OAEG;IACH,SAAS,CAAC,UAAU;IA0BpB;;OAEG;IACH,SAAS,CAAC,cAAc;IA4CxB;;OAEG;IACH,SAAS,CAAC,wBAAwB,CAC9B,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EAAE;IAenB;;OAEG;IACH,SAAS,CAAC,cAAc;IAQxB;;OAEG;IACH,SAAS,CAAC,SAAS;IACf;;OAEG;IACH,KAAK,UAAQ;IA6CjB;;OAEG;IACI,WAAW;CAGrB"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import PCancelable from 'p-cancelable';
|
|
2
|
+
import { IRemovable } from '../../../utils/types/general';
|
|
3
|
+
import { RequiredModuleProp } from '../../../utils/types/utility';
|
|
4
|
+
import { Component, NComponent } from '../../../base/Component';
|
|
5
|
+
import { NViewport } from '../../../app/events/Viewport';
|
|
6
|
+
import { SmoothScroll } from '../smooth-scroll/SmoothScroll';
|
|
7
|
+
import getScrollValues from '../../../utils/scroll/getScrollValues';
|
|
8
|
+
export declare namespace NScrollSectionProgress {
|
|
9
|
+
/**
|
|
10
|
+
* Static properties
|
|
11
|
+
*/
|
|
12
|
+
interface StaticProp extends NComponent.StaticProp {
|
|
13
|
+
/**
|
|
14
|
+
* The scrollable container
|
|
15
|
+
* @default window
|
|
16
|
+
*/
|
|
17
|
+
container?: string | Element | SmoothScroll | Window;
|
|
18
|
+
/**
|
|
19
|
+
* The scrollable element
|
|
20
|
+
*/
|
|
21
|
+
section: string | Element;
|
|
22
|
+
/**
|
|
23
|
+
* Update sizes on resize
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
viewportTarget?: keyof NViewport.CallbacksTypes;
|
|
27
|
+
/**
|
|
28
|
+
* @default 0
|
|
29
|
+
*/
|
|
30
|
+
resizeTimeout?: number;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Changeable properties
|
|
34
|
+
*/
|
|
35
|
+
interface ChangeableProp extends NComponent.ChangeableProp {
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Available callbacks
|
|
39
|
+
*/
|
|
40
|
+
interface CallbacksTypes extends NComponent.CallbacksTypes {
|
|
41
|
+
'render': false;
|
|
42
|
+
'resize': false;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Elements into viewport
|
|
47
|
+
*/
|
|
48
|
+
export declare class ScrollSectionProgress<StaticProp extends NScrollSectionProgress.StaticProp = NScrollSectionProgress.StaticProp, ChangeableProp extends NScrollSectionProgress.ChangeableProp = NScrollSectionProgress.ChangeableProp, CallbacksTypes extends NScrollSectionProgress.CallbacksTypes = NScrollSectionProgress.CallbacksTypes> extends Component<StaticProp, ChangeableProp, CallbacksTypes> {
|
|
49
|
+
protected _getDefaultProp<T extends RequiredModuleProp<StaticProp & ChangeableProp>>(): T;
|
|
50
|
+
/**
|
|
51
|
+
* Scroll container
|
|
52
|
+
*/
|
|
53
|
+
protected _scrollContainer: Element | SmoothScroll | Window;
|
|
54
|
+
get scrollContainer(): Element | Window | SmoothScroll<import("../smooth-scroll/SmoothScroll").NSmoothScroll.StaticProp, import("../smooth-scroll/SmoothScroll").NSmoothScroll.ChangeableProp, import("../smooth-scroll/SmoothScroll").NSmoothScroll.CallbacksTypes>;
|
|
55
|
+
/**
|
|
56
|
+
* Section element
|
|
57
|
+
*/
|
|
58
|
+
protected _section: Element;
|
|
59
|
+
get section(): Element;
|
|
60
|
+
/**
|
|
61
|
+
* Scroll event
|
|
62
|
+
*/
|
|
63
|
+
protected _scrollEvent?: IRemovable;
|
|
64
|
+
/**
|
|
65
|
+
* Loaded event
|
|
66
|
+
*/
|
|
67
|
+
protected _loadedEvent?: PCancelable<any>;
|
|
68
|
+
/**
|
|
69
|
+
* Scrolling scope
|
|
70
|
+
*/
|
|
71
|
+
protected _scopeScroll: [number, number];
|
|
72
|
+
get scopeScroll(): [number, number];
|
|
73
|
+
/**
|
|
74
|
+
* 'In' scope relative to the global progress
|
|
75
|
+
*/
|
|
76
|
+
protected _scopeIn: [number, number];
|
|
77
|
+
protected get scopeIn(): [number, number];
|
|
78
|
+
/**
|
|
79
|
+
* 'Move' scope relative to the global progress
|
|
80
|
+
*/
|
|
81
|
+
protected _scopeMove: [number, number];
|
|
82
|
+
get scopeMove(): [number, number];
|
|
83
|
+
/**
|
|
84
|
+
* 'Move' scope relative to the global progress
|
|
85
|
+
*/
|
|
86
|
+
protected _scopeOut: [number, number];
|
|
87
|
+
get scopeOut(): [number, number];
|
|
88
|
+
protected _progress: number;
|
|
89
|
+
/**
|
|
90
|
+
* Global progress
|
|
91
|
+
*/
|
|
92
|
+
get progress(): number;
|
|
93
|
+
set progress(val: number);
|
|
94
|
+
constructor(initialProp?: (StaticProp & ChangeableProp), init?: boolean);
|
|
95
|
+
init(): void;
|
|
96
|
+
protected _setEvents(): void;
|
|
97
|
+
protected _onPropMutate(): void;
|
|
98
|
+
/**
|
|
99
|
+
* 'in' progress
|
|
100
|
+
*/
|
|
101
|
+
get progressIn(): number;
|
|
102
|
+
/**
|
|
103
|
+
* 'out' progress
|
|
104
|
+
*/
|
|
105
|
+
get progressOut(): number;
|
|
106
|
+
/**
|
|
107
|
+
* 'move' progress
|
|
108
|
+
*/
|
|
109
|
+
get progressMove(): number;
|
|
110
|
+
/**
|
|
111
|
+
* Handle scroll event
|
|
112
|
+
*/
|
|
113
|
+
protected _handleScroll(): void;
|
|
114
|
+
/**
|
|
115
|
+
* Resize the scene
|
|
116
|
+
*/
|
|
117
|
+
resize(): void;
|
|
118
|
+
/**
|
|
119
|
+
* Render the scene
|
|
120
|
+
*/
|
|
121
|
+
protected _render(scrollData: ReturnType<typeof getScrollValues>, force?: boolean): void;
|
|
122
|
+
/**
|
|
123
|
+
* Check if the section can be rendered
|
|
124
|
+
*/
|
|
125
|
+
protected _canRender(scrollData: ReturnType<typeof getScrollValues>, force?: boolean): boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Destroy the module
|
|
128
|
+
*/
|
|
129
|
+
protected _destroy(): void;
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=ScrollSectionProgress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollSectionProgress.d.ts","sourceRoot":"","sources":["../../../../../src/ts/components/scroll/section/ScrollSectionProgress.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAElE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,OAAO,eAAe,MAAM,uCAAuC,CAAC;AAIpE,yBAAiB,sBAAsB,CAAC;IAEpC;;OAEG;IACH,UAAiB,UAAW,SAAQ,UAAU,CAAC,UAAU;QACrD;;;WAGG;QACH,SAAS,CAAC,EAAE,MAAM,GAAG,O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,SAAS,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,SAAS,KAAK,OAAO,qBAEpB;IAED;;OAEG;IACH,SAAS,CAAC,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,IAAI,SAAS,qBAEZ;IAED;;OAEG;IACH,SAAS,CAAC,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,IAAI,QAAQ,qBAEX;IAED,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,IAAI,QAAQ,WAEX;IACD,IAAI,QAAQ,CAAE,GAAG,QAAA,EAEhB;gBAKG,WAAW,CAAC,EAAE,CAAC,UAAU,GAAG,cAAc,CAAC,EAC3C,IAAI,UAAO;IA+BR,IAAI;IAKX,SAAS,CAAC,UAAU;IAuBpB,SAAS,CAAC,aAAa;IAOvB;;OAEG;IACH,IAAI,UAAU,WAKb;IAED;;OAEG;IACH,IAAI,WAAW,WAKd;IAED;;OAEG;IACH,IAAI,YAAY,WAKf;IAID;;OAEG;IACH,SAAS,CAAC,aAAa;IAWvB;;OAEG;IACI,MAAM;IA6Bb;;OAEG;IACH,SAAS,CAAC,OAAO,CACb,UAAU,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,EAC9C,KAAK,UAAQ;IASjB;;OAEG;IACH,SAAS,CAAC,UAAU,CAChB,UAAU,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,EAC9C,KAAK,UAAQ;IAkBjB;;OAEG;IACH,SAAS,CAAC,QAAQ;CAKrB"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
scrollTo(options: ScrollToOptions): void;
|
|
4
|
-
scrollTo(x: number, y: number): void;
|
|
5
|
-
scrollLeft: number;
|
|
1
|
+
import { ScrollLike } from '../../utils/types/general';
|
|
2
|
+
export interface ScrollableElement extends ScrollLike {
|
|
6
3
|
scrollWidth: number;
|
|
7
4
|
scrollHeight: number;
|
|
8
5
|
clientWidth: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/ts/components/scroll/types.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/ts/components/scroll/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD,MAAM,WAAW,iBAAkB,SAAQ,UAAU;IACjD,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACxB"}
|
package/build/types/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as common from './utils/common';
|
|
2
2
|
import * as listeners from './utils/listeners';
|
|
3
3
|
import * as math from './utils/math';
|
|
4
|
+
import * as scroll from './utils/scroll';
|
|
4
5
|
import * as GeneralTypes from './utils/types/general';
|
|
5
6
|
import { Application, NApplication } from './app/Application';
|
|
6
7
|
import { Viewport, NViewport } from './app/events/Viewport';
|
|
@@ -28,12 +29,14 @@ import { ScrollEventsBase, NScrollEventsBase } from './components/scroll/scrolla
|
|
|
28
29
|
import { ScrollView, NScrollView } from './components/scroll/scrollable/ScrollView';
|
|
29
30
|
import { SmoothScrollKeyboardPlugin, NSmoothScrollKeyboardPlugin } from './components/scroll/plugins/SmoothScrollKeyboardPlugin';
|
|
30
31
|
import { SmoothScrollDragPlugin, NSmoothScrollDragPlugin } from './components/scroll/plugins/SmoothScrollDragPlugin';
|
|
32
|
+
import { ScrollSectionProgress, NScrollSectionProgress } from './components/scroll/section/ScrollSectionProgress';
|
|
31
33
|
import { SplitText, NSplitText } from './components/text/SplitText';
|
|
32
34
|
import { CustomCursor, NCustomCursor } from './components/cursor/CustomCursor';
|
|
33
35
|
declare const utils: {
|
|
34
36
|
common: typeof common;
|
|
35
37
|
listeners: typeof listeners;
|
|
36
38
|
math: typeof math;
|
|
39
|
+
scroll: typeof scroll;
|
|
37
40
|
};
|
|
38
|
-
export { utils, GeneralTypes, Application, NApplication, Viewport, NViewport, PageLoad, NPageLoad, Callbacks, NCallbacks, MutableProp, NMutableProp, Module, NModule, Component, NComponent, Plugin, NPlugin, Page, NPage, WheelHandler, NWheelHandler, AnimationFrame, NAnimationFrame, StaticTimeline, NStaticTimeline, Timeline, NTimeline, Preloader, NPreloader, ProgressPreloader, NProgressPreloader, Dragger, NDragger, DraggerMove, NDraggerMove, DraggerDirection, NDraggerDirection, Ctx2D, NCtx2D, Ctx2DPrerender, NCtx2DPrerender, SmoothScroll, NSmoothScroll, ScrollBar, NScrollBar, ScrollEventsBase, NScrollEventsBase, ScrollView, NScrollView, SmoothScrollKeyboardPlugin, NSmoothScrollKeyboardPlugin, SmoothScrollDragPlugin, NSmoothScrollDragPlugin, SplitText, NSplitText, CustomCursor, NCustomCursor, };
|
|
41
|
+
export { utils, GeneralTypes, Application, NApplication, Viewport, NViewport, PageLoad, NPageLoad, Callbacks, NCallbacks, MutableProp, NMutableProp, Module, NModule, Component, NComponent, Plugin, NPlugin, Page, NPage, WheelHandler, NWheelHandler, AnimationFrame, NAnimationFrame, StaticTimeline, NStaticTimeline, Timeline, NTimeline, Preloader, NPreloader, ProgressPreloader, NProgressPreloader, Dragger, NDragger, DraggerMove, NDraggerMove, DraggerDirection, NDraggerDirection, Ctx2D, NCtx2D, Ctx2DPrerender, NCtx2DPrerender, SmoothScroll, NSmoothScroll, ScrollBar, NScrollBar, ScrollEventsBase, NScrollEventsBase, ScrollView, NScrollView, SmoothScrollKeyboardPlugin, NSmoothScrollKeyboardPlugin, SmoothScrollDragPlugin, NSmoothScrollDragPlugin, ScrollSectionProgress, NScrollSectionProgress, SplitText, NSplitText, CustomCursor, NCustomCursor, };
|
|
39
42
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ts/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AACzC,OAAO,KAAK,SAAS,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,IAAI,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ts/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AACzC,OAAO,KAAK,SAAS,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,IAAI,MAAM,cAAc,CAAC;AACrC,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AAEzC,OAAO,KAAK,YAAY,MAAM,uBAAuB,CAAC;AAEtD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAE5E,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAE9F,OAAO,EAAE,cAAc,EA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,YAAY,EACzB,QAAQ,EAAE,SAAS,EACnB,QAAQ,EAAE,SAAS,EAEnB,SAAS,EAAE,UAAU,EACrB,WAAW,EAAE,YAAY,EACzB,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,UAAU,EACrB,MAAM,EAAE,OAAO,EAEf,IAAI,EAAE,KAAK,EAEX,YAAY,EAAE,aAAa,EAE3B,cAAc,EAAE,eAAe,EAE/B,cAAc,EAAE,eAAe,EAC/B,QAAQ,EAAE,SAAS,EAEnB,SAAS,EAAE,UAAU,EACrB,iBAAiB,EAAE,kBAAkB,EAErC,OAAO,EAAE,QAAQ,EACjB,WAAW,EAAE,YAAY,EACzB,gBAAgB,EAAE,iBAAiB,EAEnC,KAAK,EAAE,MAAM,EACb,cAAc,EAAE,eAAe,EAE/B,YAAY,EAAE,aAAa,EAC3B,SAAS,EAAE,UAAU,EACrB,gBAAgB,EAAE,iBAAiB,EACnC,UAAU,EAAE,WAAW,EACvB,0BAA0B,EAAE,2BAA2B,EACvD,sBAAsB,EAAE,uBAAuB,EAC/C,qBAAqB,EAAE,sBAAsB,EAE7C,SAAS,EAAE,UAAU,EAErB,YAAY,EAAE,aAAa,GAC9B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ScrollLike } from '../types/general';
|
|
2
|
+
/**
|
|
3
|
+
* Get scroll values of a certain element
|
|
4
|
+
*/
|
|
5
|
+
export default function getScrollValues(selector?: (Window | Element | ScrollLike | undefined)): {
|
|
6
|
+
scrollTop: number;
|
|
7
|
+
scrollLeft: number;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=getScrollValues.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getScrollValues.d.ts","sourceRoot":"","sources":["../../../../src/ts/utils/scroll/getScrollValues.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CACnC,QAAQ,GAAE,CAAC,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAAU;;;EAajE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ts/utils/scroll/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAC1C,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACH,SAAS,EACT,QAAQ,IAAI,EAAE,EACd,eAAe,IAAI,SAAS,GAC/B,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ScrollLike } from '../types/general';
|
|
2
|
+
interface Props {
|
|
3
|
+
/**
|
|
4
|
+
* @default window
|
|
5
|
+
*/
|
|
6
|
+
container?: Window | Element | ScrollLike;
|
|
7
|
+
/**
|
|
8
|
+
* top padding
|
|
9
|
+
* @default 0
|
|
10
|
+
*/
|
|
11
|
+
top?: number;
|
|
12
|
+
/**
|
|
13
|
+
* left padding
|
|
14
|
+
* @default 0
|
|
15
|
+
*/
|
|
16
|
+
left?: number;
|
|
17
|
+
/**
|
|
18
|
+
* scroll duration
|
|
19
|
+
* @default 250
|
|
20
|
+
*/
|
|
21
|
+
duration?: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Scroll to coordinates
|
|
25
|
+
*/
|
|
26
|
+
export default function scrollTo({ container, top, left, duration, }: Props): Promise<void>;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=scrollTo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scrollTo.d.ts","sourceRoot":"","sources":["../../../../src/ts/utils/scroll/scrollTo.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C,UAAU,KAAK;IACX;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC;IAC1C;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAE,EAC9B,SAAkB,EAClB,GAAO,EACP,IAAQ,EACR,QAAc,GACjB,EAAE,KAAK,iBA8BP"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ScrollLike } from '../types/general';
|
|
2
|
+
interface Props {
|
|
3
|
+
/**
|
|
4
|
+
* @default window
|
|
5
|
+
*/
|
|
6
|
+
container?: Window | Element | ScrollLike;
|
|
7
|
+
/**
|
|
8
|
+
* The target element
|
|
9
|
+
*/
|
|
10
|
+
el: Element | string;
|
|
11
|
+
/**
|
|
12
|
+
* top padding
|
|
13
|
+
* @default 0
|
|
14
|
+
*/
|
|
15
|
+
top?: number;
|
|
16
|
+
/**
|
|
17
|
+
* left padding
|
|
18
|
+
* @default 0
|
|
19
|
+
*/
|
|
20
|
+
left?: number;
|
|
21
|
+
/**
|
|
22
|
+
* scroll duration
|
|
23
|
+
* @default 250
|
|
24
|
+
*/
|
|
25
|
+
duration?: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Scroll to element
|
|
29
|
+
*/
|
|
30
|
+
export default function scrollToElement({ container, el, top, left, duration, }: Props): Promise<void>;
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=scrollToElement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scrollToElement.d.ts","sourceRoot":"","sources":["../../../../src/ts/utils/scroll/scrollToElement.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAK9C,UAAU,KAAK;IACX;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC;IAC1C;;OAEG;IACH,EAAE,EAAE,OAAO,GAAG,MAAM,CAAC;IACrB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAE,EACrC,SAAkB,EAClB,EAAE,EACF,GAAO,EACP,IAAQ,EACR,QAAc,GACjB,EAAE,KAAK,iBAgCP"}
|