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.
Files changed (27) hide show
  1. package/build/es/app/Application.js +50 -93
  2. package/build/es/app/events/PageLoad.js +3 -7
  3. package/build/es/app/events/Viewport.js +10 -34
  4. package/build/es/base/Callbacks.js +8 -19
  5. package/build/es/base/Component.js +0 -1
  6. package/build/es/base/Module.js +41 -61
  7. package/build/es/base/MutableProp.js +10 -32
  8. package/build/es/base/Plugin.js +0 -1
  9. package/build/es/components/animation-frame/AnimationFrame.js +4 -28
  10. package/build/es/components/canvas/Ctx2D.js +21 -49
  11. package/build/es/components/canvas/Ctx2DPrerender.js +1 -5
  12. package/build/es/components/cursor/CustomCursor.js +25 -58
  13. package/build/es/components/dragger/Dragger.js +20 -41
  14. package/build/es/components/dragger/DraggerDirection.js +1 -4
  15. package/build/es/components/loading/Preloader.js +26 -41
  16. package/build/es/components/loading/ProgressPreloader.js +17 -36
  17. package/build/es/components/page/Page.js +14 -33
  18. package/build/es/components/scroll/plugins/SmoothScrollDragPlugin.js +8 -25
  19. package/build/es/components/scroll/scrollable/ScrollEventsBase.js +15 -22
  20. package/build/es/components/scroll/scrollable/ScrollView.js +8 -29
  21. package/build/es/components/scroll/scrollbar/Bar.js +35 -52
  22. package/build/es/components/scroll/scrollbar/ScrollBar.js +47 -73
  23. package/build/es/components/scroll/smooth-scroll/SmoothScroll.js +55 -135
  24. package/build/es/components/text/SplitText.js +21 -42
  25. package/build/es/components/timeline/StaticTimeline.js +11 -22
  26. package/build/es/components/timeline/Timeline.js +12 -28
  27. package/package.json +2 -2
@@ -8,18 +8,22 @@ import boundVal from '../../utils/math/boundVal';
8
8
  * no play & pause methods.
9
9
  */
10
10
  export class StaticTimeline extends Component {
11
+ constructor(initialProp, init = true) {
12
+ super(initialProp, false);
13
+ // set default vars
14
+ this._progress = 0;
15
+ this._easing = 0;
16
+ this._nestedTimelines = [];
17
+ if (init) {
18
+ this.init();
19
+ }
20
+ }
11
21
  /**
12
22
  * Get default properties
13
23
  */
14
24
  _getDefaultProp() {
15
- return {
16
- ...super._getDefaultProp(),
17
- easing: this._app.prop.easing,
18
- scope: [0, 1],
19
- useNestedEasingProgress: false,
20
- };
25
+ return Object.assign(Object.assign({}, super._getDefaultProp()), { easing: this._app.prop.easing, scope: [0, 1], useNestedEasingProgress: false });
21
26
  }
22
- _progress;
23
27
  /**
24
28
  * Absolute progress of the timeline
25
29
  */
@@ -30,27 +34,12 @@ export class StaticTimeline extends Component {
30
34
  this._progress = val;
31
35
  this._handleProgress();
32
36
  }
33
- _easing;
34
37
  /**
35
38
  * Easing progress of the timeline
36
39
  */
37
40
  get easing() {
38
41
  return this._easing;
39
42
  }
40
- /**
41
- * Nested timelines
42
- */
43
- _nestedTimelines;
44
- constructor(initialProp, init = true) {
45
- super(initialProp, false);
46
- // set default vars
47
- this._progress = 0;
48
- this._easing = 0;
49
- this._nestedTimelines = [];
50
- if (init) {
51
- this.init();
52
- }
53
- }
54
43
  /**
55
44
  * Add a nested timeline
56
45
  */
@@ -4,16 +4,22 @@ import boundVal from '../../utils/math/boundVal';
4
4
  * Timeline is an animation helper.
5
5
  */
6
6
  export class Timeline extends StaticTimeline {
7
+ constructor(initialProp, init = true) {
8
+ super(initialProp, false);
9
+ // set default variables
10
+ this._isPlaying = false;
11
+ this._isReversed = false;
12
+ this._isPaused = false;
13
+ this._animationFrameLastTime = 0;
14
+ if (init) {
15
+ this.init();
16
+ }
17
+ }
7
18
  /**
8
19
  * Get default properties
9
20
  */
10
21
  _getDefaultProp() {
11
- return {
12
- ...super._getDefaultProp(),
13
- duration: 1000,
14
- reset: false,
15
- destroyOnEnd: false,
16
- };
22
+ return Object.assign(Object.assign({}, super._getDefaultProp()), { duration: 1000, reset: false, destroyOnEnd: false });
17
23
  }
18
24
  /**
19
25
  * Check if timeline is playing
@@ -21,40 +27,18 @@ export class Timeline extends StaticTimeline {
21
27
  get isPlaying() {
22
28
  return typeof this._animationFrame !== 'undefined';
23
29
  }
24
- _isPlaying;
25
30
  /**
26
31
  * Check if timeline is reversed
27
32
  */
28
33
  get isReversed() {
29
34
  return this._isReversed;
30
35
  }
31
- _isReversed;
32
36
  /**
33
37
  * Check if timeline is paused
34
38
  */
35
39
  get isPaused() {
36
40
  return this._isPaused;
37
41
  }
38
- _isPaused;
39
- /**
40
- * The animation frame
41
- */
42
- _animationFrame;
43
- /**
44
- * Last time when animationFrame callback has been called
45
- */
46
- _animationFrameLastTime;
47
- constructor(initialProp, init = true) {
48
- super(initialProp, false);
49
- // set default variables
50
- this._isPlaying = false;
51
- this._isReversed = false;
52
- this._isPaused = false;
53
- this._animationFrameLastTime = 0;
54
- if (init) {
55
- this.init();
56
- }
57
- }
58
42
  /**
59
43
  * Play the timeline
60
44
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vevet",
3
- "version": "2.0.1-dev.2",
3
+ "version": "2.0.1-dev.3",
4
4
  "description": "VEVET - A JavaScript library",
5
5
  "browserslist": [
6
6
  "since 2015"
@@ -12,7 +12,7 @@
12
12
  "pages-dev:webpack": "webpack serve --config ./examples-src/webpack/webpack.dev.js",
13
13
  "watch-tsc": "nodemon --watch ./src/ts --ext ts,js --exec \"npm run prepare:es\"",
14
14
  "prepare:all": "npm run prepare:es && npm run prepare:cjs && npm run prepare:cdn",
15
- "prepare:es": "tsc ./src/ts/index.ts --outDir ./build/es --target esNext --module esNext --moduleResolution node --esModuleInterop true --allowSyntheticDefaultImports true --declaration true --declarationDir ./build/types --declarationMap true",
15
+ "prepare:es": "tsc ./src/ts/index.ts --outDir ./build/es --target es6 --module es6 --moduleResolution node --esModuleInterop true --allowSyntheticDefaultImports true --declaration true --declarationDir ./build/types --declarationMap true",
16
16
  "prepare:cjs": "tsc ./src/ts/index.ts --outDir ./build/cjs --target es5 --module commonjs --moduleResolution node --esModuleInterop true --allowSyntheticDefaultImports true",
17
17
  "prepare:cdn": "webpack --config ./config/webpack.cdn.js",
18
18
  "lint:js": "eslint . --ext .ts,.js",