This commit is contained in:
thednp 2021-11-12 17:58:48 +02:00
parent b70d46d387
commit cd0898b67f
11 changed files with 147 additions and 26 deletions

View file

@ -29,12 +29,41 @@
// link property update function to KUTE.js execution context
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 = {};
// Time.now = now;
var that = window.self || window || {};
Time.now = that.performance.now.bind(that.performance);
Time.now = now$1;
// const that = window.self || window || {};
// Time.now = that.performance.now.bind(that.performance);
var Tick = 0;

File diff suppressed because one or more lines are too long

View file

@ -102,12 +102,41 @@
// link property update function to KUTE.js execution context
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 = {};
// Time.now = now;
var that = window.self || window || {};
Time.now = that.performance.now.bind(that.performance);
Time.now = now$1;
// const that = window.self || window || {};
// Time.now = that.performance.now.bind(that.performance);
var Tick = 0;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

37
dist/kute.esm.js vendored
View file

@ -96,12 +96,41 @@ var Interpolate = {};
// link property update function to KUTE.js execution context
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 = {};
// Time.now = now;
const that = window.self || window || {};
Time.now = that.performance.now.bind(that.performance);
Time.now = now$1;
// const that = window.self || window || {};
// Time.now = that.performance.now.bind(that.performance);
let Tick = 0;

File diff suppressed because one or more lines are too long

37
dist/kute.js vendored
View file

@ -102,12 +102,41 @@
// link property update function to KUTE.js execution context
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 = {};
// Time.now = now;
var that = window.self || window || {};
Time.now = that.performance.now.bind(that.performance);
Time.now = now$1;
// const that = window.self || window || {};
// Time.now = that.performance.now.bind(that.performance);
var Tick = 0;

2
dist/kute.min.js vendored

File diff suppressed because one or more lines are too long

View file

@ -3,12 +3,12 @@ import Tweens from '../objects/tweens.js';
import globalObject from '../objects/globalObject.js';
import Interpolate from '../objects/interpolate.js';
import onStart from '../objects/onStart.js';
// import now from '../objects/now.js';
import now from '../objects/now.js';
const Time = {};
// Time.now = now;
const that = window.self || window || {};
Time.now = that.performance.now.bind(that.performance);
Time.now = now;
// const that = window.self || window || {};
// Time.now = that.performance.now.bind(that.performance);
let Tick = 0;
export { Tick };

View file

@ -18,6 +18,10 @@ declare module "src/objects/onStart" {
var _default: {};
export default _default;
}
declare module "src/objects/now" {
export default now;
let now: any;
}
declare module "src/core/render" {
export function stop(): void;
export default Render;
@ -31,8 +35,9 @@ declare module "src/core/render" {
}
import Tweens from "src/objects/tweens";
namespace Time {
const now: () => number;
export { now };
}
import now from "src/objects/now";
}
declare module "src/objects/supportedProperties" {
var _default: {};