vevet 2.0.1-dev.2 → 2.0.1-dev.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/es/app/Application.js +50 -93
- package/build/es/app/events/PageLoad.js +3 -7
- package/build/es/app/events/Viewport.js +10 -34
- package/build/es/base/Callbacks.js +8 -19
- package/build/es/base/Component.js +0 -1
- package/build/es/base/Module.js +41 -61
- package/build/es/base/MutableProp.js +10 -32
- package/build/es/base/Plugin.js +0 -1
- package/build/es/components/animation-frame/AnimationFrame.js +4 -28
- package/build/es/components/canvas/Ctx2D.js +21 -49
- package/build/es/components/canvas/Ctx2DPrerender.js +1 -5
- package/build/es/components/cursor/CustomCursor.js +25 -58
- package/build/es/components/dragger/Dragger.js +20 -41
- package/build/es/components/dragger/DraggerDirection.js +1 -4
- package/build/es/components/loading/Preloader.js +26 -41
- package/build/es/components/loading/ProgressPreloader.js +17 -36
- package/build/es/components/page/Page.js +14 -33
- package/build/es/components/scroll/plugins/SmoothScrollDragPlugin.js +8 -25
- package/build/es/components/scroll/scrollable/ScrollEventsBase.js +15 -22
- package/build/es/components/scroll/scrollable/ScrollView.js +8 -29
- package/build/es/components/scroll/scrollbar/Bar.js +35 -52
- package/build/es/components/scroll/scrollbar/ScrollBar.js +47 -73
- package/build/es/components/scroll/smooth-scroll/SmoothScroll.js +55 -135
- package/build/es/components/text/SplitText.js +21 -42
- package/build/es/components/timeline/StaticTimeline.js +11 -22
- package/build/es/components/timeline/Timeline.js +12 -28
- package/package.json +2 -2
|
@@ -7,77 +7,6 @@ import { PageLoad } from './events/PageLoad';
|
|
|
7
7
|
* Vevet Application
|
|
8
8
|
*/
|
|
9
9
|
export class Application {
|
|
10
|
-
/**
|
|
11
|
-
* Application properties.
|
|
12
|
-
*/
|
|
13
|
-
_prop;
|
|
14
|
-
/**
|
|
15
|
-
* Application properties.
|
|
16
|
-
*/
|
|
17
|
-
get prop() {
|
|
18
|
-
return this._prop;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Default properties.
|
|
22
|
-
*/
|
|
23
|
-
get defaultProp() {
|
|
24
|
-
return {
|
|
25
|
-
tablet: 1199,
|
|
26
|
-
phone: 899,
|
|
27
|
-
prefix: 'v-',
|
|
28
|
-
easing: [0.25, 0.1, 0.25, 1],
|
|
29
|
-
viewportResizeTimeout: 0,
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Vevet prefix.
|
|
34
|
-
*/
|
|
35
|
-
_prefix;
|
|
36
|
-
get prefix() {
|
|
37
|
-
return this._prefix;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* If is phone
|
|
41
|
-
*/
|
|
42
|
-
_isPhone;
|
|
43
|
-
get isPhone() {
|
|
44
|
-
return this._isPhone;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* If tablet
|
|
48
|
-
*/
|
|
49
|
-
_isTablet;
|
|
50
|
-
get isTablet() {
|
|
51
|
-
return this._isTablet;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* If mobile device
|
|
55
|
-
*/
|
|
56
|
-
_isMobile;
|
|
57
|
-
get isMobile() {
|
|
58
|
-
return this._isMobile;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* If desktop device
|
|
62
|
-
*/
|
|
63
|
-
_isDesktop;
|
|
64
|
-
get isDesktop() {
|
|
65
|
-
return this._isDesktop;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* OS name
|
|
69
|
-
*/
|
|
70
|
-
_osName;
|
|
71
|
-
get osName() {
|
|
72
|
-
return this._osName;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* OS name
|
|
76
|
-
*/
|
|
77
|
-
_browserName;
|
|
78
|
-
get browserName() {
|
|
79
|
-
return this._browserName;
|
|
80
|
-
}
|
|
81
10
|
/**
|
|
82
11
|
* @example
|
|
83
12
|
* const app = Application({
|
|
@@ -85,15 +14,20 @@ export class Application {
|
|
|
85
14
|
* });
|
|
86
15
|
*/
|
|
87
16
|
constructor(data = {}) {
|
|
17
|
+
/**
|
|
18
|
+
* Pages (instances)
|
|
19
|
+
*/
|
|
20
|
+
this._pages = [];
|
|
21
|
+
/**
|
|
22
|
+
* Current Page (instance).
|
|
23
|
+
*/
|
|
24
|
+
this._page = false;
|
|
88
25
|
// check if the application already exists
|
|
89
26
|
if (window.vevetApp) {
|
|
90
27
|
throw new Error('Vevet Application already exists!');
|
|
91
28
|
}
|
|
92
29
|
// set defaults
|
|
93
|
-
this._prop = {
|
|
94
|
-
...this.defaultProp,
|
|
95
|
-
...data,
|
|
96
|
-
};
|
|
30
|
+
this._prop = Object.assign(Object.assign({}, this.defaultProp), data);
|
|
97
31
|
this._prefix = this.prop.prefix;
|
|
98
32
|
// initialize the application
|
|
99
33
|
// Define that you're using Vevet
|
|
@@ -113,7 +47,7 @@ export class Application {
|
|
|
113
47
|
// get browser info
|
|
114
48
|
const browserData = detect();
|
|
115
49
|
// get OS name
|
|
116
|
-
if (browserData
|
|
50
|
+
if (browserData === null || browserData === void 0 ? void 0 : browserData.os) {
|
|
117
51
|
const osName = browserData.os.split(' ')[0].toLowerCase();
|
|
118
52
|
this.html.classList.add(`${this.prefix}os-${osName}`);
|
|
119
53
|
this._osName = osName;
|
|
@@ -122,7 +56,7 @@ export class Application {
|
|
|
122
56
|
this._osName = '';
|
|
123
57
|
}
|
|
124
58
|
// get browser name
|
|
125
|
-
if (browserData
|
|
59
|
+
if (browserData === null || browserData === void 0 ? void 0 : browserData.name) {
|
|
126
60
|
const browserName = browserData.name.toLowerCase();
|
|
127
61
|
this.html.classList.add(`${this.prefix}browser-${browserName}`);
|
|
128
62
|
this._browserName = browserName;
|
|
@@ -135,6 +69,45 @@ export class Application {
|
|
|
135
69
|
this._pageLoad = new PageLoad();
|
|
136
70
|
this._viewport = new Viewport();
|
|
137
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Application properties.
|
|
74
|
+
*/
|
|
75
|
+
get prop() {
|
|
76
|
+
return this._prop;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Default properties.
|
|
80
|
+
*/
|
|
81
|
+
get defaultProp() {
|
|
82
|
+
return {
|
|
83
|
+
tablet: 1199,
|
|
84
|
+
phone: 899,
|
|
85
|
+
prefix: 'v-',
|
|
86
|
+
easing: [0.25, 0.1, 0.25, 1],
|
|
87
|
+
viewportResizeTimeout: 0,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
get prefix() {
|
|
91
|
+
return this._prefix;
|
|
92
|
+
}
|
|
93
|
+
get isPhone() {
|
|
94
|
+
return this._isPhone;
|
|
95
|
+
}
|
|
96
|
+
get isTablet() {
|
|
97
|
+
return this._isTablet;
|
|
98
|
+
}
|
|
99
|
+
get isMobile() {
|
|
100
|
+
return this._isMobile;
|
|
101
|
+
}
|
|
102
|
+
get isDesktop() {
|
|
103
|
+
return this._isDesktop;
|
|
104
|
+
}
|
|
105
|
+
get osName() {
|
|
106
|
+
return this._osName;
|
|
107
|
+
}
|
|
108
|
+
get browserName() {
|
|
109
|
+
return this._browserName;
|
|
110
|
+
}
|
|
138
111
|
/**
|
|
139
112
|
* Get document element.
|
|
140
113
|
*/
|
|
@@ -153,10 +126,6 @@ export class Application {
|
|
|
153
126
|
get body() {
|
|
154
127
|
return document.body;
|
|
155
128
|
}
|
|
156
|
-
/**
|
|
157
|
-
* Pages (instances)
|
|
158
|
-
*/
|
|
159
|
-
_pages = [];
|
|
160
129
|
/**
|
|
161
130
|
* Get an array of existing pages.
|
|
162
131
|
* A new element is added to the array when {@linkcode Vevet.Page.create} is called.
|
|
@@ -164,10 +133,6 @@ export class Application {
|
|
|
164
133
|
get pages() {
|
|
165
134
|
return this._pages;
|
|
166
135
|
}
|
|
167
|
-
/**
|
|
168
|
-
* Current Page (instance).
|
|
169
|
-
*/
|
|
170
|
-
_page = false;
|
|
171
136
|
/**
|
|
172
137
|
* Get the current page instance.
|
|
173
138
|
*/
|
|
@@ -212,10 +177,6 @@ export class Application {
|
|
|
212
177
|
});
|
|
213
178
|
});
|
|
214
179
|
}
|
|
215
|
-
/**
|
|
216
|
-
* Page Load Callbacks
|
|
217
|
-
*/
|
|
218
|
-
_pageLoad;
|
|
219
180
|
get pageLoad() {
|
|
220
181
|
return this._pageLoad;
|
|
221
182
|
}
|
|
@@ -229,10 +190,6 @@ export class Application {
|
|
|
229
190
|
});
|
|
230
191
|
});
|
|
231
192
|
}
|
|
232
|
-
/**
|
|
233
|
-
* Viewport Callbacks
|
|
234
|
-
*/
|
|
235
|
-
_viewport;
|
|
236
193
|
get viewport() {
|
|
237
194
|
return this._viewport;
|
|
238
195
|
}
|
|
@@ -3,18 +3,14 @@ import { Callbacks } from '../../base/Callbacks';
|
|
|
3
3
|
* Callbacks on page loaded.
|
|
4
4
|
*/
|
|
5
5
|
export class PageLoad extends Callbacks {
|
|
6
|
-
/**
|
|
7
|
-
* If the page is loaded.
|
|
8
|
-
*/
|
|
9
|
-
_loaded;
|
|
10
|
-
get loaded() {
|
|
11
|
-
return this._loaded;
|
|
12
|
-
}
|
|
13
6
|
constructor() {
|
|
14
7
|
super(false);
|
|
15
8
|
this._loaded = false;
|
|
16
9
|
this._init();
|
|
17
10
|
}
|
|
11
|
+
get loaded() {
|
|
12
|
+
return this._loaded;
|
|
13
|
+
}
|
|
18
14
|
_setEvents() {
|
|
19
15
|
if (document.readyState === 'complete') {
|
|
20
16
|
this._handleLoaded();
|
|
@@ -22,17 +22,19 @@ var OrientationTypes;
|
|
|
22
22
|
* Here the names of the OS, Browser, and Device are also available. <br>
|
|
23
23
|
*/
|
|
24
24
|
export class Viewport extends Callbacks {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
constructor() {
|
|
26
|
+
super(false);
|
|
27
|
+
this._width = 0;
|
|
28
|
+
this._height = 0;
|
|
29
|
+
this._prevSize = { w: 0, h: 0 };
|
|
30
|
+
this._isDesktop = false;
|
|
31
|
+
this._isTablet = false;
|
|
32
|
+
this._isPhone = false;
|
|
33
|
+
this._init();
|
|
34
|
+
}
|
|
29
35
|
get width() {
|
|
30
36
|
return this._width;
|
|
31
37
|
}
|
|
32
|
-
/**
|
|
33
|
-
* Current Viewport height
|
|
34
|
-
*/
|
|
35
|
-
_height;
|
|
36
38
|
get height() {
|
|
37
39
|
return this._height;
|
|
38
40
|
}
|
|
@@ -48,10 +50,6 @@ export class Viewport extends Callbacks {
|
|
|
48
50
|
get vh() {
|
|
49
51
|
return this.height / 100;
|
|
50
52
|
}
|
|
51
|
-
/**
|
|
52
|
-
* Previous Viewport size
|
|
53
|
-
*/
|
|
54
|
-
_prevSize;
|
|
55
53
|
/**
|
|
56
54
|
* Get previous Viewport size
|
|
57
55
|
*/
|
|
@@ -70,24 +68,12 @@ export class Viewport extends Callbacks {
|
|
|
70
68
|
get isPortrait() {
|
|
71
69
|
return this.width < this.height;
|
|
72
70
|
}
|
|
73
|
-
/**
|
|
74
|
-
* If desktop size
|
|
75
|
-
*/
|
|
76
|
-
_isDesktop;
|
|
77
71
|
get isDesktop() {
|
|
78
72
|
return this._isDesktop;
|
|
79
73
|
}
|
|
80
|
-
/**
|
|
81
|
-
* If tablet size
|
|
82
|
-
*/
|
|
83
|
-
_isTablet;
|
|
84
74
|
get isTablet() {
|
|
85
75
|
return this._isTablet;
|
|
86
76
|
}
|
|
87
|
-
/**
|
|
88
|
-
* If phone size
|
|
89
|
-
*/
|
|
90
|
-
_isPhone;
|
|
91
77
|
get isPhone() {
|
|
92
78
|
return this._isPhone;
|
|
93
79
|
}
|
|
@@ -109,16 +95,6 @@ export class Viewport extends Callbacks {
|
|
|
109
95
|
}
|
|
110
96
|
return this.dpr;
|
|
111
97
|
}
|
|
112
|
-
constructor() {
|
|
113
|
-
super(false);
|
|
114
|
-
this._width = 0;
|
|
115
|
-
this._height = 0;
|
|
116
|
-
this._prevSize = { w: 0, h: 0 };
|
|
117
|
-
this._isDesktop = false;
|
|
118
|
-
this._isTablet = false;
|
|
119
|
-
this._isPhone = false;
|
|
120
|
-
this._init();
|
|
121
|
-
}
|
|
122
98
|
// Extra constructor
|
|
123
99
|
_constructor() {
|
|
124
100
|
super._constructor();
|
|
@@ -3,20 +3,6 @@ import { timeoutCallback, randID } from '../utils/common';
|
|
|
3
3
|
* A class for callbacks' manipulation.
|
|
4
4
|
*/
|
|
5
5
|
export class Callbacks {
|
|
6
|
-
/**
|
|
7
|
-
* Vevet Application
|
|
8
|
-
*/
|
|
9
|
-
_app;
|
|
10
|
-
/**
|
|
11
|
-
* All callbacks
|
|
12
|
-
*/
|
|
13
|
-
_callbacks;
|
|
14
|
-
/**
|
|
15
|
-
* Get all callbacks
|
|
16
|
-
*/
|
|
17
|
-
get callbacks() {
|
|
18
|
-
return this._callbacks;
|
|
19
|
-
}
|
|
20
6
|
/**
|
|
21
7
|
* @example
|
|
22
8
|
* const callback = new Callbacks();
|
|
@@ -29,6 +15,12 @@ export class Callbacks {
|
|
|
29
15
|
this._init();
|
|
30
16
|
}
|
|
31
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Get all callbacks
|
|
20
|
+
*/
|
|
21
|
+
get callbacks() {
|
|
22
|
+
return this._callbacks;
|
|
23
|
+
}
|
|
32
24
|
/**
|
|
33
25
|
* Initialize the class.
|
|
34
26
|
*/
|
|
@@ -64,12 +56,9 @@ export class Callbacks {
|
|
|
64
56
|
const obj = {
|
|
65
57
|
id,
|
|
66
58
|
on: true,
|
|
67
|
-
data: {
|
|
68
|
-
target,
|
|
59
|
+
data: Object.assign({ target,
|
|
69
60
|
// @ts-ignore
|
|
70
|
-
do: func,
|
|
71
|
-
...data,
|
|
72
|
-
},
|
|
61
|
+
do: func }, data),
|
|
73
62
|
};
|
|
74
63
|
this._callbacks.push(obj);
|
|
75
64
|
this._onAdd(id);
|
package/build/es/base/Module.js
CHANGED
|
@@ -7,6 +7,47 @@ import { throwVevetAppError } from '../utils/errors';
|
|
|
7
7
|
* A class for modules.
|
|
8
8
|
*/
|
|
9
9
|
export class Module {
|
|
10
|
+
/**
|
|
11
|
+
* @example
|
|
12
|
+
* const mod = new Module();
|
|
13
|
+
*/
|
|
14
|
+
constructor(
|
|
15
|
+
/**
|
|
16
|
+
* Properties on script start
|
|
17
|
+
*/
|
|
18
|
+
initialProp,
|
|
19
|
+
/**
|
|
20
|
+
* Defines if you need to call {@linkcode Module.init} at the constructor's end.
|
|
21
|
+
* If you want to add responsive properties, set this argument to FALSE.
|
|
22
|
+
*/
|
|
23
|
+
init = true) {
|
|
24
|
+
/**
|
|
25
|
+
* If the module is initialized
|
|
26
|
+
*/
|
|
27
|
+
this._inited = false;
|
|
28
|
+
/**
|
|
29
|
+
* Viewport callbacks
|
|
30
|
+
*/
|
|
31
|
+
this._viewportCallbacks = [];
|
|
32
|
+
// set vars
|
|
33
|
+
if (window.vevetApp) {
|
|
34
|
+
this._app = window.vevetApp;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
throwVevetAppError();
|
|
38
|
+
}
|
|
39
|
+
// set default vars
|
|
40
|
+
this._destroyed = false;
|
|
41
|
+
this._listeners = [];
|
|
42
|
+
// create callbacks
|
|
43
|
+
this._callbacks = new Callbacks();
|
|
44
|
+
// create mutable properties
|
|
45
|
+
const prop = mergeWithoutArrays(this._getDefaultProp(), initialProp || {});
|
|
46
|
+
this._mutableProp = new MutableProp(prop, this._onPropResponsive.bind(this), this._onPropChange.bind(this), this.name);
|
|
47
|
+
if (init) {
|
|
48
|
+
this.init();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
10
51
|
/**
|
|
11
52
|
* Get Default properties (should be extended)
|
|
12
53
|
*/
|
|
@@ -21,28 +62,12 @@ export class Module {
|
|
|
21
62
|
get prop() {
|
|
22
63
|
return this._mutableProp.prop;
|
|
23
64
|
}
|
|
24
|
-
/**
|
|
25
|
-
* Responsive properties
|
|
26
|
-
*/
|
|
27
|
-
_mutableProp;
|
|
28
|
-
/**
|
|
29
|
-
* Module Callbacks
|
|
30
|
-
*/
|
|
31
|
-
_callbacks;
|
|
32
65
|
/**
|
|
33
66
|
* Module Callbacks
|
|
34
67
|
*/
|
|
35
68
|
get callbacks() {
|
|
36
69
|
return this._callbacks;
|
|
37
70
|
}
|
|
38
|
-
/**
|
|
39
|
-
* Module listeners
|
|
40
|
-
*/
|
|
41
|
-
_listeners;
|
|
42
|
-
/**
|
|
43
|
-
* Vevet Application
|
|
44
|
-
*/
|
|
45
|
-
_app;
|
|
46
71
|
/**
|
|
47
72
|
* Module prefix
|
|
48
73
|
*/
|
|
@@ -55,53 +80,12 @@ export class Module {
|
|
|
55
80
|
get name() {
|
|
56
81
|
return this.constructor.name;
|
|
57
82
|
}
|
|
58
|
-
/**
|
|
59
|
-
* If the module is initialized
|
|
60
|
-
*/
|
|
61
|
-
_inited = false;
|
|
62
83
|
get inited() {
|
|
63
84
|
return this._inited;
|
|
64
85
|
}
|
|
65
|
-
/**
|
|
66
|
-
* If the module is destroyed
|
|
67
|
-
*/
|
|
68
|
-
_destroyed;
|
|
69
86
|
get destroyed() {
|
|
70
87
|
return this._destroyed;
|
|
71
88
|
}
|
|
72
|
-
/**
|
|
73
|
-
* @example
|
|
74
|
-
* const mod = new Module();
|
|
75
|
-
*/
|
|
76
|
-
constructor(
|
|
77
|
-
/**
|
|
78
|
-
* Properties on script start
|
|
79
|
-
*/
|
|
80
|
-
initialProp,
|
|
81
|
-
/**
|
|
82
|
-
* Defines if you need to call {@linkcode Module.init} at the constructor's end.
|
|
83
|
-
* If you want to add responsive properties, set this argument to FALSE.
|
|
84
|
-
*/
|
|
85
|
-
init = true) {
|
|
86
|
-
// set vars
|
|
87
|
-
if (window.vevetApp) {
|
|
88
|
-
this._app = window.vevetApp;
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
throwVevetAppError();
|
|
92
|
-
}
|
|
93
|
-
// set default vars
|
|
94
|
-
this._destroyed = false;
|
|
95
|
-
this._listeners = [];
|
|
96
|
-
// create callbacks
|
|
97
|
-
this._callbacks = new Callbacks();
|
|
98
|
-
// create mutable properties
|
|
99
|
-
const prop = mergeWithoutArrays(this._getDefaultProp(), initialProp || {});
|
|
100
|
-
this._mutableProp = new MutableProp(prop, this._onPropResponsive.bind(this), this._onPropChange.bind(this), this.name);
|
|
101
|
-
if (init) {
|
|
102
|
-
this.init();
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
89
|
/**
|
|
106
90
|
* Add responsive rules
|
|
107
91
|
*/
|
|
@@ -182,10 +166,6 @@ export class Module {
|
|
|
182
166
|
_setEvents() {
|
|
183
167
|
// code
|
|
184
168
|
}
|
|
185
|
-
/**
|
|
186
|
-
* Viewport callbacks
|
|
187
|
-
*/
|
|
188
|
-
_viewportCallbacks = [];
|
|
189
169
|
/**
|
|
190
170
|
* Add a viewport callback that will be removed on class destroy
|
|
191
171
|
* {@see Viewport}
|
|
@@ -14,38 +14,6 @@ import { mergeWithoutArrays } from '../utils/common';
|
|
|
14
14
|
* </ul>
|
|
15
15
|
*/
|
|
16
16
|
export class MutableProp {
|
|
17
|
-
_initProp;
|
|
18
|
-
_onResponsive;
|
|
19
|
-
_onChange;
|
|
20
|
-
_name;
|
|
21
|
-
/**
|
|
22
|
-
* Vevet Application.
|
|
23
|
-
*/
|
|
24
|
-
_app;
|
|
25
|
-
/**
|
|
26
|
-
* @description Reference properties.
|
|
27
|
-
* These properties may change only through {@linkcode MutableProp.changeProp}.
|
|
28
|
-
*/
|
|
29
|
-
_refProp;
|
|
30
|
-
/**
|
|
31
|
-
* Current properties.
|
|
32
|
-
* These properties may change both on {@linkcode MutableProp.changeProp} and resize.
|
|
33
|
-
*/
|
|
34
|
-
_prop;
|
|
35
|
-
/**
|
|
36
|
-
* A set of responsive rules
|
|
37
|
-
*/
|
|
38
|
-
_responsiveRules = [];
|
|
39
|
-
/**
|
|
40
|
-
* Get current properties
|
|
41
|
-
*/
|
|
42
|
-
get prop() {
|
|
43
|
-
return this._prop;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Viewport callback
|
|
47
|
-
*/
|
|
48
|
-
_viewportCallback;
|
|
49
17
|
/**
|
|
50
18
|
* @example
|
|
51
19
|
* const static = {
|
|
@@ -84,10 +52,20 @@ export class MutableProp {
|
|
|
84
52
|
this._onResponsive = _onResponsive;
|
|
85
53
|
this._onChange = _onChange;
|
|
86
54
|
this._name = _name;
|
|
55
|
+
/**
|
|
56
|
+
* A set of responsive rules
|
|
57
|
+
*/
|
|
58
|
+
this._responsiveRules = [];
|
|
87
59
|
this._app = window.vevetApp;
|
|
88
60
|
this._refProp = mergeWithoutArrays({}, _initProp);
|
|
89
61
|
this._prop = mergeWithoutArrays({}, _initProp);
|
|
90
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Get current properties
|
|
65
|
+
*/
|
|
66
|
+
get prop() {
|
|
67
|
+
return this._prop;
|
|
68
|
+
}
|
|
91
69
|
/**
|
|
92
70
|
* Add responsive rules
|
|
93
71
|
*/
|
package/build/es/base/Plugin.js
CHANGED
|
@@ -4,29 +4,6 @@ import { boundVal } from '../../utils/math';
|
|
|
4
4
|
* Launch an animation frame with a certain FPS
|
|
5
5
|
*/
|
|
6
6
|
export class AnimationFrame extends Component {
|
|
7
|
-
/**
|
|
8
|
-
* If the frame is launched
|
|
9
|
-
*/
|
|
10
|
-
_isPlaying;
|
|
11
|
-
get isPlaying() {
|
|
12
|
-
return this._isPlaying;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* The animation frame
|
|
16
|
-
*/
|
|
17
|
-
_frame;
|
|
18
|
-
/**
|
|
19
|
-
* Previous frame segment
|
|
20
|
-
*/
|
|
21
|
-
_frameIndex;
|
|
22
|
-
/**
|
|
23
|
-
* Timestamp
|
|
24
|
-
*/
|
|
25
|
-
_timeStamp;
|
|
26
|
-
/**
|
|
27
|
-
* Previous frame duration
|
|
28
|
-
*/
|
|
29
|
-
_prevFrameTime;
|
|
30
7
|
constructor(initialProp, init = true) {
|
|
31
8
|
super(initialProp, false);
|
|
32
9
|
this._isPlaying = false;
|
|
@@ -38,15 +15,14 @@ export class AnimationFrame extends Component {
|
|
|
38
15
|
this.init();
|
|
39
16
|
}
|
|
40
17
|
}
|
|
18
|
+
get isPlaying() {
|
|
19
|
+
return this._isPlaying;
|
|
20
|
+
}
|
|
41
21
|
/**
|
|
42
22
|
* Get default properties
|
|
43
23
|
*/
|
|
44
24
|
_getDefaultProp() {
|
|
45
|
-
return {
|
|
46
|
-
...super._getDefaultProp(),
|
|
47
|
-
fps: 140,
|
|
48
|
-
run: false,
|
|
49
|
-
};
|
|
25
|
+
return Object.assign(Object.assign({}, super._getDefaultProp()), { fps: 140, run: false });
|
|
50
26
|
}
|
|
51
27
|
// Extra constructor
|
|
52
28
|
_constructor() {
|