Test
This commit is contained in:
parent
b70d46d387
commit
cd0898b67f
|
@ -29,12 +29,41 @@
|
||||||
// link property update function to KUTE.js execution context
|
// link property update function to KUTE.js execution context
|
||||||
var onStart = {};
|
var onStart = {};
|
||||||
|
|
||||||
// import now from '../objects/now.js';
|
var now;
|
||||||
|
|
||||||
|
// Include a performance.now polyfill.
|
||||||
|
// source https://github.com/tweenjs/tween.js/blob/master/src/Now.ts
|
||||||
|
// In node.js, use process.hrtime.
|
||||||
|
// eslint-disable-next-line
|
||||||
|
// @ts-ignore
|
||||||
|
if (typeof self === 'undefined' && typeof process !== 'undefined' && process.hrtime) {
|
||||||
|
now = function () {
|
||||||
|
// eslint-disable-next-line
|
||||||
|
// @ts-ignore
|
||||||
|
var time = process.hrtime();
|
||||||
|
|
||||||
|
// Convert [seconds, nanoseconds] to milliseconds.
|
||||||
|
return time[0] * 1000 + time[1] / 1000000;
|
||||||
|
};
|
||||||
|
} else if (typeof self !== 'undefined' && self.performance !== undefined && self.performance.now !== undefined) {
|
||||||
|
// In a browser, use self.performance.now if it is available.
|
||||||
|
// This must be bound, because directly assigning this function
|
||||||
|
// leads to an invocation exception in Chrome.
|
||||||
|
now = self.performance.now.bind(self.performance);
|
||||||
|
} else if (typeof Date !== 'undefined' && Date.now) {
|
||||||
|
// Use Date.now if it is available.
|
||||||
|
now = Date.now;
|
||||||
|
} else {
|
||||||
|
// Otherwise, use 'new Date().getTime()'.
|
||||||
|
now = function () { return new Date().getTime(); };
|
||||||
|
}
|
||||||
|
|
||||||
|
var now$1 = now;
|
||||||
|
|
||||||
var Time = {};
|
var Time = {};
|
||||||
// Time.now = now;
|
Time.now = now$1;
|
||||||
var that = window.self || window || {};
|
// const that = window.self || window || {};
|
||||||
Time.now = that.performance.now.bind(that.performance);
|
// Time.now = that.performance.now.bind(that.performance);
|
||||||
|
|
||||||
var Tick = 0;
|
var Tick = 0;
|
||||||
|
|
||||||
|
|
2
demo/src/kute-base.min.js
vendored
2
demo/src/kute-base.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -102,12 +102,41 @@
|
||||||
// link property update function to KUTE.js execution context
|
// link property update function to KUTE.js execution context
|
||||||
var onStart = {};
|
var onStart = {};
|
||||||
|
|
||||||
// import now from '../objects/now.js';
|
var now;
|
||||||
|
|
||||||
|
// Include a performance.now polyfill.
|
||||||
|
// source https://github.com/tweenjs/tween.js/blob/master/src/Now.ts
|
||||||
|
// In node.js, use process.hrtime.
|
||||||
|
// eslint-disable-next-line
|
||||||
|
// @ts-ignore
|
||||||
|
if (typeof self === 'undefined' && typeof process !== 'undefined' && process.hrtime) {
|
||||||
|
now = function () {
|
||||||
|
// eslint-disable-next-line
|
||||||
|
// @ts-ignore
|
||||||
|
var time = process.hrtime();
|
||||||
|
|
||||||
|
// Convert [seconds, nanoseconds] to milliseconds.
|
||||||
|
return time[0] * 1000 + time[1] / 1000000;
|
||||||
|
};
|
||||||
|
} else if (typeof self !== 'undefined' && self.performance !== undefined && self.performance.now !== undefined) {
|
||||||
|
// In a browser, use self.performance.now if it is available.
|
||||||
|
// This must be bound, because directly assigning this function
|
||||||
|
// leads to an invocation exception in Chrome.
|
||||||
|
now = self.performance.now.bind(self.performance);
|
||||||
|
} else if (typeof Date !== 'undefined' && Date.now) {
|
||||||
|
// Use Date.now if it is available.
|
||||||
|
now = Date.now;
|
||||||
|
} else {
|
||||||
|
// Otherwise, use 'new Date().getTime()'.
|
||||||
|
now = function () { return new Date().getTime(); };
|
||||||
|
}
|
||||||
|
|
||||||
|
var now$1 = now;
|
||||||
|
|
||||||
var Time = {};
|
var Time = {};
|
||||||
// Time.now = now;
|
Time.now = now$1;
|
||||||
var that = window.self || window || {};
|
// const that = window.self || window || {};
|
||||||
Time.now = that.performance.now.bind(that.performance);
|
// Time.now = that.performance.now.bind(that.performance);
|
||||||
|
|
||||||
var Tick = 0;
|
var Tick = 0;
|
||||||
|
|
||||||
|
|
2
demo/src/kute-extra.min.js
vendored
2
demo/src/kute-extra.min.js
vendored
File diff suppressed because one or more lines are too long
2
demo/src/kute.min.js
vendored
2
demo/src/kute.min.js
vendored
File diff suppressed because one or more lines are too long
37
dist/kute.esm.js
vendored
37
dist/kute.esm.js
vendored
|
@ -96,12 +96,41 @@ var Interpolate = {};
|
||||||
// link property update function to KUTE.js execution context
|
// link property update function to KUTE.js execution context
|
||||||
var onStart = {};
|
var onStart = {};
|
||||||
|
|
||||||
// import now from '../objects/now.js';
|
let now;
|
||||||
|
|
||||||
|
// Include a performance.now polyfill.
|
||||||
|
// source https://github.com/tweenjs/tween.js/blob/master/src/Now.ts
|
||||||
|
// In node.js, use process.hrtime.
|
||||||
|
// eslint-disable-next-line
|
||||||
|
// @ts-ignore
|
||||||
|
if (typeof self === 'undefined' && typeof process !== 'undefined' && process.hrtime) {
|
||||||
|
now = () => {
|
||||||
|
// eslint-disable-next-line
|
||||||
|
// @ts-ignore
|
||||||
|
const time = process.hrtime();
|
||||||
|
|
||||||
|
// Convert [seconds, nanoseconds] to milliseconds.
|
||||||
|
return time[0] * 1000 + time[1] / 1000000;
|
||||||
|
};
|
||||||
|
} else if (typeof self !== 'undefined' && self.performance !== undefined && self.performance.now !== undefined) {
|
||||||
|
// In a browser, use self.performance.now if it is available.
|
||||||
|
// This must be bound, because directly assigning this function
|
||||||
|
// leads to an invocation exception in Chrome.
|
||||||
|
now = self.performance.now.bind(self.performance);
|
||||||
|
} else if (typeof Date !== 'undefined' && Date.now) {
|
||||||
|
// Use Date.now if it is available.
|
||||||
|
now = Date.now;
|
||||||
|
} else {
|
||||||
|
// Otherwise, use 'new Date().getTime()'.
|
||||||
|
now = () => new Date().getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
var now$1 = now;
|
||||||
|
|
||||||
const Time = {};
|
const Time = {};
|
||||||
// Time.now = now;
|
Time.now = now$1;
|
||||||
const that = window.self || window || {};
|
// const that = window.self || window || {};
|
||||||
Time.now = that.performance.now.bind(that.performance);
|
// Time.now = that.performance.now.bind(that.performance);
|
||||||
|
|
||||||
let Tick = 0;
|
let Tick = 0;
|
||||||
|
|
||||||
|
|
2
dist/kute.esm.min.js
vendored
2
dist/kute.esm.min.js
vendored
File diff suppressed because one or more lines are too long
37
dist/kute.js
vendored
37
dist/kute.js
vendored
|
@ -102,12 +102,41 @@
|
||||||
// link property update function to KUTE.js execution context
|
// link property update function to KUTE.js execution context
|
||||||
var onStart = {};
|
var onStart = {};
|
||||||
|
|
||||||
// import now from '../objects/now.js';
|
var now;
|
||||||
|
|
||||||
|
// Include a performance.now polyfill.
|
||||||
|
// source https://github.com/tweenjs/tween.js/blob/master/src/Now.ts
|
||||||
|
// In node.js, use process.hrtime.
|
||||||
|
// eslint-disable-next-line
|
||||||
|
// @ts-ignore
|
||||||
|
if (typeof self === 'undefined' && typeof process !== 'undefined' && process.hrtime) {
|
||||||
|
now = function () {
|
||||||
|
// eslint-disable-next-line
|
||||||
|
// @ts-ignore
|
||||||
|
var time = process.hrtime();
|
||||||
|
|
||||||
|
// Convert [seconds, nanoseconds] to milliseconds.
|
||||||
|
return time[0] * 1000 + time[1] / 1000000;
|
||||||
|
};
|
||||||
|
} else if (typeof self !== 'undefined' && self.performance !== undefined && self.performance.now !== undefined) {
|
||||||
|
// In a browser, use self.performance.now if it is available.
|
||||||
|
// This must be bound, because directly assigning this function
|
||||||
|
// leads to an invocation exception in Chrome.
|
||||||
|
now = self.performance.now.bind(self.performance);
|
||||||
|
} else if (typeof Date !== 'undefined' && Date.now) {
|
||||||
|
// Use Date.now if it is available.
|
||||||
|
now = Date.now;
|
||||||
|
} else {
|
||||||
|
// Otherwise, use 'new Date().getTime()'.
|
||||||
|
now = function () { return new Date().getTime(); };
|
||||||
|
}
|
||||||
|
|
||||||
|
var now$1 = now;
|
||||||
|
|
||||||
var Time = {};
|
var Time = {};
|
||||||
// Time.now = now;
|
Time.now = now$1;
|
||||||
var that = window.self || window || {};
|
// const that = window.self || window || {};
|
||||||
Time.now = that.performance.now.bind(that.performance);
|
// Time.now = that.performance.now.bind(that.performance);
|
||||||
|
|
||||||
var Tick = 0;
|
var Tick = 0;
|
||||||
|
|
||||||
|
|
2
dist/kute.min.js
vendored
2
dist/kute.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -3,12 +3,12 @@ import Tweens from '../objects/tweens.js';
|
||||||
import globalObject from '../objects/globalObject.js';
|
import globalObject from '../objects/globalObject.js';
|
||||||
import Interpolate from '../objects/interpolate.js';
|
import Interpolate from '../objects/interpolate.js';
|
||||||
import onStart from '../objects/onStart.js';
|
import onStart from '../objects/onStart.js';
|
||||||
// import now from '../objects/now.js';
|
import now from '../objects/now.js';
|
||||||
|
|
||||||
const Time = {};
|
const Time = {};
|
||||||
// Time.now = now;
|
Time.now = now;
|
||||||
const that = window.self || window || {};
|
// const that = window.self || window || {};
|
||||||
Time.now = that.performance.now.bind(that.performance);
|
// Time.now = that.performance.now.bind(that.performance);
|
||||||
|
|
||||||
let Tick = 0;
|
let Tick = 0;
|
||||||
export { Tick };
|
export { Tick };
|
||||||
|
|
7
typescript/index.d.ts
vendored
7
typescript/index.d.ts
vendored
|
@ -18,6 +18,10 @@ declare module "src/objects/onStart" {
|
||||||
var _default: {};
|
var _default: {};
|
||||||
export default _default;
|
export default _default;
|
||||||
}
|
}
|
||||||
|
declare module "src/objects/now" {
|
||||||
|
export default now;
|
||||||
|
let now: any;
|
||||||
|
}
|
||||||
declare module "src/core/render" {
|
declare module "src/core/render" {
|
||||||
export function stop(): void;
|
export function stop(): void;
|
||||||
export default Render;
|
export default Render;
|
||||||
|
@ -31,8 +35,9 @@ declare module "src/core/render" {
|
||||||
}
|
}
|
||||||
import Tweens from "src/objects/tweens";
|
import Tweens from "src/objects/tweens";
|
||||||
namespace Time {
|
namespace Time {
|
||||||
const now: () => number;
|
export { now };
|
||||||
}
|
}
|
||||||
|
import now from "src/objects/now";
|
||||||
}
|
}
|
||||||
declare module "src/objects/supportedProperties" {
|
declare module "src/objects/supportedProperties" {
|
||||||
var _default: {};
|
var _default: {};
|
||||||
|
|
Loading…
Reference in a new issue