@urso/core 0.7.5 → 0.7.6
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/js/index.js +1 -1
- package/package.json +1 -1
- package/src/js/app.js +23 -0
- package/src/js/extra/_info.js +0 -1
- package/src/js/extra/setTimeout.js +0 -7
package/package.json
CHANGED
package/src/js/app.js
CHANGED
|
@@ -6,6 +6,9 @@ class App {
|
|
|
6
6
|
this.setup = this.setup.bind(this);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* global init
|
|
11
|
+
*/
|
|
9
12
|
setup() {
|
|
10
13
|
this.sayHello();
|
|
11
14
|
|
|
@@ -32,6 +35,7 @@ class App {
|
|
|
32
35
|
|
|
33
36
|
//Extra
|
|
34
37
|
Urso.browserEvents = Urso.getInstance('Extra.BrowserEvents');
|
|
38
|
+
this._addTimeouts();
|
|
35
39
|
|
|
36
40
|
//libs
|
|
37
41
|
Urso.cache = Urso.getInstance('Lib.Cache'); //all assets cache
|
|
@@ -67,13 +71,32 @@ class App {
|
|
|
67
71
|
});
|
|
68
72
|
}
|
|
69
73
|
|
|
74
|
+
/**
|
|
75
|
+
* log engine name and its version
|
|
76
|
+
*/
|
|
70
77
|
sayHello() {
|
|
71
78
|
console.log(`%c ${String.fromCodePoint(0x1F43B)} Urso ${this.version} `, 'background: #222; color: #bada55');
|
|
72
79
|
}
|
|
73
80
|
|
|
81
|
+
/**
|
|
82
|
+
* run default scene
|
|
83
|
+
*/
|
|
74
84
|
run() {
|
|
75
85
|
Urso.scenes.display(Urso.config.defaultScene);
|
|
76
86
|
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* add Urso.setTimeout && Urso.clearTimeout functions. It will helps to manage time
|
|
90
|
+
*/
|
|
91
|
+
_addTimeouts() {
|
|
92
|
+
Urso.setTimeout = (callback, delay) => {
|
|
93
|
+
return gsap.delayedCall(delay / 1000, callback);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
Urso.clearTimeout = (tween) => {
|
|
97
|
+
tween.kill();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
77
100
|
}
|
|
78
101
|
|
|
79
102
|
module.exports = App;
|
package/src/js/extra/_info.js
CHANGED