Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu.../js/dist
File: components.js
const type = target.types[i];
[20000] Fix | Delete
const originIndex = origin.indexes[type][pointers[type]];
[20001] Fix | Delete
const originValue = (_a = origin.values[originIndex]) !== null && _a !== void 0 ? _a : 0;
[20002] Fix | Delete
orderedOrigin[i] = originValue;
[20003] Fix | Delete
pointers[type]++;
[20004] Fix | Delete
}
[20005] Fix | Delete
return orderedOrigin;
[20006] Fix | Delete
}
[20007] Fix | Delete
const mixComplex = (origin, target) => {
[20008] Fix | Delete
const template = complex.createTransformer(target);
[20009] Fix | Delete
const originStats = analyseComplexValue(origin);
[20010] Fix | Delete
const targetStats = analyseComplexValue(target);
[20011] Fix | Delete
const canInterpolate = originStats.indexes.var.length === targetStats.indexes.var.length &&
[20012] Fix | Delete
originStats.indexes.color.length === targetStats.indexes.color.length &&
[20013] Fix | Delete
originStats.indexes.number.length >= targetStats.indexes.number.length;
[20014] Fix | Delete
if (canInterpolate) {
[20015] Fix | Delete
if ((invisibleValues.has(origin) &&
[20016] Fix | Delete
!targetStats.values.length) ||
[20017] Fix | Delete
(invisibleValues.has(target) &&
[20018] Fix | Delete
!originStats.values.length)) {
[20019] Fix | Delete
return mixVisibility(origin, target);
[20020] Fix | Delete
}
[20021] Fix | Delete
return pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template);
[20022] Fix | Delete
}
[20023] Fix | Delete
else {
[20024] Fix | Delete
warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`);
[20025] Fix | Delete
return mixImmediate(origin, target);
[20026] Fix | Delete
}
[20027] Fix | Delete
};
[20028] Fix | Delete
[20029] Fix | Delete
[20030] Fix | Delete
[20031] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/mix/index.mjs
[20032] Fix | Delete
[20033] Fix | Delete
[20034] Fix | Delete
[20035] Fix | Delete
function mix(from, to, p) {
[20036] Fix | Delete
if (typeof from === "number" &&
[20037] Fix | Delete
typeof to === "number" &&
[20038] Fix | Delete
typeof p === "number") {
[20039] Fix | Delete
return mixNumber(from, to, p);
[20040] Fix | Delete
}
[20041] Fix | Delete
const mixer = getMixer(from);
[20042] Fix | Delete
return mixer(from, to);
[20043] Fix | Delete
}
[20044] Fix | Delete
[20045] Fix | Delete
[20046] Fix | Delete
[20047] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/interpolate.mjs
[20048] Fix | Delete
[20049] Fix | Delete
[20050] Fix | Delete
[20051] Fix | Delete
[20052] Fix | Delete
[20053] Fix | Delete
[20054] Fix | Delete
[20055] Fix | Delete
function createMixers(output, ease, customMixer) {
[20056] Fix | Delete
const mixers = [];
[20057] Fix | Delete
const mixerFactory = customMixer || mix;
[20058] Fix | Delete
const numMixers = output.length - 1;
[20059] Fix | Delete
for (let i = 0; i < numMixers; i++) {
[20060] Fix | Delete
let mixer = mixerFactory(output[i], output[i + 1]);
[20061] Fix | Delete
if (ease) {
[20062] Fix | Delete
const easingFunction = Array.isArray(ease) ? ease[i] || noop_noop : ease;
[20063] Fix | Delete
mixer = pipe(easingFunction, mixer);
[20064] Fix | Delete
}
[20065] Fix | Delete
mixers.push(mixer);
[20066] Fix | Delete
}
[20067] Fix | Delete
return mixers;
[20068] Fix | Delete
}
[20069] Fix | Delete
/**
[20070] Fix | Delete
* Create a function that maps from a numerical input array to a generic output array.
[20071] Fix | Delete
*
[20072] Fix | Delete
* Accepts:
[20073] Fix | Delete
* - Numbers
[20074] Fix | Delete
* - Colors (hex, hsl, hsla, rgb, rgba)
[20075] Fix | Delete
* - Complex (combinations of one or more numbers or strings)
[20076] Fix | Delete
*
[20077] Fix | Delete
* ```jsx
[20078] Fix | Delete
* const mixColor = interpolate([0, 1], ['#fff', '#000'])
[20079] Fix | Delete
*
[20080] Fix | Delete
* mixColor(0.5) // 'rgba(128, 128, 128, 1)'
[20081] Fix | Delete
* ```
[20082] Fix | Delete
*
[20083] Fix | Delete
* TODO Revist this approach once we've moved to data models for values,
[20084] Fix | Delete
* probably not needed to pregenerate mixer functions.
[20085] Fix | Delete
*
[20086] Fix | Delete
* @public
[20087] Fix | Delete
*/
[20088] Fix | Delete
function interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) {
[20089] Fix | Delete
const inputLength = input.length;
[20090] Fix | Delete
errors_invariant(inputLength === output.length, "Both input and output ranges must be the same length");
[20091] Fix | Delete
/**
[20092] Fix | Delete
* If we're only provided a single input, we can just make a function
[20093] Fix | Delete
* that returns the output.
[20094] Fix | Delete
*/
[20095] Fix | Delete
if (inputLength === 1)
[20096] Fix | Delete
return () => output[0];
[20097] Fix | Delete
if (inputLength === 2 && input[0] === input[1])
[20098] Fix | Delete
return () => output[1];
[20099] Fix | Delete
// If input runs highest -> lowest, reverse both arrays
[20100] Fix | Delete
if (input[0] > input[inputLength - 1]) {
[20101] Fix | Delete
input = [...input].reverse();
[20102] Fix | Delete
output = [...output].reverse();
[20103] Fix | Delete
}
[20104] Fix | Delete
const mixers = createMixers(output, ease, mixer);
[20105] Fix | Delete
const numMixers = mixers.length;
[20106] Fix | Delete
const interpolator = (v) => {
[20107] Fix | Delete
let i = 0;
[20108] Fix | Delete
if (numMixers > 1) {
[20109] Fix | Delete
for (; i < input.length - 2; i++) {
[20110] Fix | Delete
if (v < input[i + 1])
[20111] Fix | Delete
break;
[20112] Fix | Delete
}
[20113] Fix | Delete
}
[20114] Fix | Delete
const progressInRange = progress(input[i], input[i + 1], v);
[20115] Fix | Delete
return mixers[i](progressInRange);
[20116] Fix | Delete
};
[20117] Fix | Delete
return isClamp
[20118] Fix | Delete
? (v) => interpolator(clamp_clamp(input[0], input[inputLength - 1], v))
[20119] Fix | Delete
: interpolator;
[20120] Fix | Delete
}
[20121] Fix | Delete
[20122] Fix | Delete
[20123] Fix | Delete
[20124] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/offsets/fill.mjs
[20125] Fix | Delete
[20126] Fix | Delete
[20127] Fix | Delete
[20128] Fix | Delete
function fillOffset(offset, remaining) {
[20129] Fix | Delete
const min = offset[offset.length - 1];
[20130] Fix | Delete
for (let i = 1; i <= remaining; i++) {
[20131] Fix | Delete
const offsetProgress = progress(0, remaining, i);
[20132] Fix | Delete
offset.push(mixNumber(min, 1, offsetProgress));
[20133] Fix | Delete
}
[20134] Fix | Delete
}
[20135] Fix | Delete
[20136] Fix | Delete
[20137] Fix | Delete
[20138] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/offsets/default.mjs
[20139] Fix | Delete
[20140] Fix | Delete
[20141] Fix | Delete
function defaultOffset(arr) {
[20142] Fix | Delete
const offset = [0];
[20143] Fix | Delete
fillOffset(offset, arr.length - 1);
[20144] Fix | Delete
return offset;
[20145] Fix | Delete
}
[20146] Fix | Delete
[20147] Fix | Delete
[20148] Fix | Delete
[20149] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/offsets/time.mjs
[20150] Fix | Delete
function convertOffsetToTimes(offset, duration) {
[20151] Fix | Delete
return offset.map((o) => o * duration);
[20152] Fix | Delete
}
[20153] Fix | Delete
[20154] Fix | Delete
[20155] Fix | Delete
[20156] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/generators/keyframes.mjs
[20157] Fix | Delete
[20158] Fix | Delete
[20159] Fix | Delete
[20160] Fix | Delete
[20161] Fix | Delete
[20162] Fix | Delete
[20163] Fix | Delete
[20164] Fix | Delete
function defaultEasing(values, easing) {
[20165] Fix | Delete
return values.map(() => easing || easeInOut).splice(0, values.length - 1);
[20166] Fix | Delete
}
[20167] Fix | Delete
function keyframes_keyframes({ duration = 300, keyframes: keyframeValues, times, ease = "easeInOut", }) {
[20168] Fix | Delete
/**
[20169] Fix | Delete
* Easing functions can be externally defined as strings. Here we convert them
[20170] Fix | Delete
* into actual functions.
[20171] Fix | Delete
*/
[20172] Fix | Delete
const easingFunctions = isEasingArray(ease)
[20173] Fix | Delete
? ease.map(easingDefinitionToFunction)
[20174] Fix | Delete
: easingDefinitionToFunction(ease);
[20175] Fix | Delete
/**
[20176] Fix | Delete
* This is the Iterator-spec return value. We ensure it's mutable rather than using a generator
[20177] Fix | Delete
* to reduce GC during animation.
[20178] Fix | Delete
*/
[20179] Fix | Delete
const state = {
[20180] Fix | Delete
done: false,
[20181] Fix | Delete
value: keyframeValues[0],
[20182] Fix | Delete
};
[20183] Fix | Delete
/**
[20184] Fix | Delete
* Create a times array based on the provided 0-1 offsets
[20185] Fix | Delete
*/
[20186] Fix | Delete
const absoluteTimes = convertOffsetToTimes(
[20187] Fix | Delete
// Only use the provided offsets if they're the correct length
[20188] Fix | Delete
// TODO Maybe we should warn here if there's a length mismatch
[20189] Fix | Delete
times && times.length === keyframeValues.length
[20190] Fix | Delete
? times
[20191] Fix | Delete
: defaultOffset(keyframeValues), duration);
[20192] Fix | Delete
const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, {
[20193] Fix | Delete
ease: Array.isArray(easingFunctions)
[20194] Fix | Delete
? easingFunctions
[20195] Fix | Delete
: defaultEasing(keyframeValues, easingFunctions),
[20196] Fix | Delete
});
[20197] Fix | Delete
return {
[20198] Fix | Delete
calculatedDuration: duration,
[20199] Fix | Delete
next: (t) => {
[20200] Fix | Delete
state.value = mapTimeToKeyframe(t);
[20201] Fix | Delete
state.done = t >= duration;
[20202] Fix | Delete
return state;
[20203] Fix | Delete
},
[20204] Fix | Delete
};
[20205] Fix | Delete
}
[20206] Fix | Delete
[20207] Fix | Delete
[20208] Fix | Delete
[20209] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/generators/utils/calc-duration.mjs
[20210] Fix | Delete
/**
[20211] Fix | Delete
* Implement a practical max duration for keyframe generation
[20212] Fix | Delete
* to prevent infinite loops
[20213] Fix | Delete
*/
[20214] Fix | Delete
const maxGeneratorDuration = 20000;
[20215] Fix | Delete
function calcGeneratorDuration(generator) {
[20216] Fix | Delete
let duration = 0;
[20217] Fix | Delete
const timeStep = 50;
[20218] Fix | Delete
let state = generator.next(duration);
[20219] Fix | Delete
while (!state.done && duration < maxGeneratorDuration) {
[20220] Fix | Delete
duration += timeStep;
[20221] Fix | Delete
state = generator.next(duration);
[20222] Fix | Delete
}
[20223] Fix | Delete
return duration >= maxGeneratorDuration ? Infinity : duration;
[20224] Fix | Delete
}
[20225] Fix | Delete
[20226] Fix | Delete
[20227] Fix | Delete
[20228] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/animators/drivers/driver-frameloop.mjs
[20229] Fix | Delete
[20230] Fix | Delete
[20231] Fix | Delete
[20232] Fix | Delete
const frameloopDriver = (update) => {
[20233] Fix | Delete
const passTimestamp = ({ timestamp }) => update(timestamp);
[20234] Fix | Delete
return {
[20235] Fix | Delete
start: () => frame_frame.update(passTimestamp, true),
[20236] Fix | Delete
stop: () => cancelFrame(passTimestamp),
[20237] Fix | Delete
/**
[20238] Fix | Delete
* If we're processing this frame we can use the
[20239] Fix | Delete
* framelocked timestamp to keep things in sync.
[20240] Fix | Delete
*/
[20241] Fix | Delete
now: () => (frameData.isProcessing ? frameData.timestamp : time.now()),
[20242] Fix | Delete
};
[20243] Fix | Delete
};
[20244] Fix | Delete
[20245] Fix | Delete
[20246] Fix | Delete
[20247] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/animators/MainThreadAnimation.mjs
[20248] Fix | Delete
[20249] Fix | Delete
[20250] Fix | Delete
[20251] Fix | Delete
[20252] Fix | Delete
[20253] Fix | Delete
[20254] Fix | Delete
[20255] Fix | Delete
[20256] Fix | Delete
[20257] Fix | Delete
[20258] Fix | Delete
[20259] Fix | Delete
[20260] Fix | Delete
[20261] Fix | Delete
[20262] Fix | Delete
const generators = {
[20263] Fix | Delete
decay: inertia,
[20264] Fix | Delete
inertia: inertia,
[20265] Fix | Delete
tween: keyframes_keyframes,
[20266] Fix | Delete
keyframes: keyframes_keyframes,
[20267] Fix | Delete
spring: spring,
[20268] Fix | Delete
};
[20269] Fix | Delete
const percentToProgress = (percent) => percent / 100;
[20270] Fix | Delete
/**
[20271] Fix | Delete
* Animation that runs on the main thread. Designed to be WAAPI-spec in the subset of
[20272] Fix | Delete
* features we expose publically. Mostly the compatibility is to ensure visual identity
[20273] Fix | Delete
* between both WAAPI and main thread animations.
[20274] Fix | Delete
*/
[20275] Fix | Delete
class MainThreadAnimation extends BaseAnimation {
[20276] Fix | Delete
constructor({ KeyframeResolver: KeyframeResolver$1 = KeyframeResolver, ...options }) {
[20277] Fix | Delete
super(options);
[20278] Fix | Delete
/**
[20279] Fix | Delete
* The time at which the animation was paused.
[20280] Fix | Delete
*/
[20281] Fix | Delete
this.holdTime = null;
[20282] Fix | Delete
/**
[20283] Fix | Delete
* The time at which the animation was started.
[20284] Fix | Delete
*/
[20285] Fix | Delete
this.startTime = null;
[20286] Fix | Delete
/**
[20287] Fix | Delete
* The time at which the animation was cancelled.
[20288] Fix | Delete
*/
[20289] Fix | Delete
this.cancelTime = null;
[20290] Fix | Delete
/**
[20291] Fix | Delete
* The current time of the animation.
[20292] Fix | Delete
*/
[20293] Fix | Delete
this.currentTime = 0;
[20294] Fix | Delete
/**
[20295] Fix | Delete
* Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.
[20296] Fix | Delete
*/
[20297] Fix | Delete
this.playbackSpeed = 1;
[20298] Fix | Delete
/**
[20299] Fix | Delete
* The state of the animation to apply when the animation is resolved. This
[20300] Fix | Delete
* allows calls to the public API to control the animation before it is resolved,
[20301] Fix | Delete
* without us having to resolve it first.
[20302] Fix | Delete
*/
[20303] Fix | Delete
this.pendingPlayState = "running";
[20304] Fix | Delete
this.state = "idle";
[20305] Fix | Delete
/**
[20306] Fix | Delete
* This method is bound to the instance to fix a pattern where
[20307] Fix | Delete
* animation.stop is returned as a reference from a useEffect.
[20308] Fix | Delete
*/
[20309] Fix | Delete
this.stop = () => {
[20310] Fix | Delete
this.resolver.cancel();
[20311] Fix | Delete
this.isStopped = true;
[20312] Fix | Delete
if (this.state === "idle")
[20313] Fix | Delete
return;
[20314] Fix | Delete
this.teardown();
[20315] Fix | Delete
const { onStop } = this.options;
[20316] Fix | Delete
onStop && onStop();
[20317] Fix | Delete
};
[20318] Fix | Delete
const { name, motionValue, keyframes } = this.options;
[20319] Fix | Delete
const onResolved = (resolvedKeyframes, finalKeyframe) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe);
[20320] Fix | Delete
if (name && motionValue && motionValue.owner) {
[20321] Fix | Delete
this.resolver = motionValue.owner.resolveKeyframes(keyframes, onResolved, name, motionValue);
[20322] Fix | Delete
}
[20323] Fix | Delete
else {
[20324] Fix | Delete
this.resolver = new KeyframeResolver$1(keyframes, onResolved, name, motionValue);
[20325] Fix | Delete
}
[20326] Fix | Delete
this.resolver.scheduleResolve();
[20327] Fix | Delete
}
[20328] Fix | Delete
initPlayback(keyframes$1) {
[20329] Fix | Delete
const { type = "keyframes", repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = this.options;
[20330] Fix | Delete
const generatorFactory = generators[type] || keyframes_keyframes;
[20331] Fix | Delete
/**
[20332] Fix | Delete
* If our generator doesn't support mixing numbers, we need to replace keyframes with
[20333] Fix | Delete
* [0, 100] and then make a function that maps that to the actual keyframes.
[20334] Fix | Delete
*
[20335] Fix | Delete
* 100 is chosen instead of 1 as it works nicer with spring animations.
[20336] Fix | Delete
*/
[20337] Fix | Delete
let mapPercentToKeyframes;
[20338] Fix | Delete
let mirroredGenerator;
[20339] Fix | Delete
if (generatorFactory !== keyframes_keyframes &&
[20340] Fix | Delete
typeof keyframes$1[0] !== "number") {
[20341] Fix | Delete
if (false) {}
[20342] Fix | Delete
mapPercentToKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1]));
[20343] Fix | Delete
keyframes$1 = [0, 100];
[20344] Fix | Delete
}
[20345] Fix | Delete
const generator = generatorFactory({ ...this.options, keyframes: keyframes$1 });
[20346] Fix | Delete
/**
[20347] Fix | Delete
* If we have a mirror repeat type we need to create a second generator that outputs the
[20348] Fix | Delete
* mirrored (not reversed) animation and later ping pong between the two generators.
[20349] Fix | Delete
*/
[20350] Fix | Delete
if (repeatType === "mirror") {
[20351] Fix | Delete
mirroredGenerator = generatorFactory({
[20352] Fix | Delete
...this.options,
[20353] Fix | Delete
keyframes: [...keyframes$1].reverse(),
[20354] Fix | Delete
velocity: -velocity,
[20355] Fix | Delete
});
[20356] Fix | Delete
}
[20357] Fix | Delete
/**
[20358] Fix | Delete
* If duration is undefined and we have repeat options,
[20359] Fix | Delete
* we need to calculate a duration from the generator.
[20360] Fix | Delete
*
[20361] Fix | Delete
* We set it to the generator itself to cache the duration.
[20362] Fix | Delete
* Any timeline resolver will need to have already precalculated
[20363] Fix | Delete
* the duration by this step.
[20364] Fix | Delete
*/
[20365] Fix | Delete
if (generator.calculatedDuration === null) {
[20366] Fix | Delete
generator.calculatedDuration = calcGeneratorDuration(generator);
[20367] Fix | Delete
}
[20368] Fix | Delete
const { calculatedDuration } = generator;
[20369] Fix | Delete
const resolvedDuration = calculatedDuration + repeatDelay;
[20370] Fix | Delete
const totalDuration = resolvedDuration * (repeat + 1) - repeatDelay;
[20371] Fix | Delete
return {
[20372] Fix | Delete
generator,
[20373] Fix | Delete
mirroredGenerator,
[20374] Fix | Delete
mapPercentToKeyframes,
[20375] Fix | Delete
calculatedDuration,
[20376] Fix | Delete
resolvedDuration,
[20377] Fix | Delete
totalDuration,
[20378] Fix | Delete
};
[20379] Fix | Delete
}
[20380] Fix | Delete
onPostResolved() {
[20381] Fix | Delete
const { autoplay = true } = this.options;
[20382] Fix | Delete
this.play();
[20383] Fix | Delete
if (this.pendingPlayState === "paused" || !autoplay) {
[20384] Fix | Delete
this.pause();
[20385] Fix | Delete
}
[20386] Fix | Delete
else {
[20387] Fix | Delete
this.state = this.pendingPlayState;
[20388] Fix | Delete
}
[20389] Fix | Delete
}
[20390] Fix | Delete
tick(timestamp, sample = false) {
[20391] Fix | Delete
const { resolved } = this;
[20392] Fix | Delete
// If the animations has failed to resolve, return the final keyframe.
[20393] Fix | Delete
if (!resolved) {
[20394] Fix | Delete
const { keyframes } = this.options;
[20395] Fix | Delete
return { done: true, value: keyframes[keyframes.length - 1] };
[20396] Fix | Delete
}
[20397] Fix | Delete
const { finalKeyframe, generator, mirroredGenerator, mapPercentToKeyframes, keyframes, calculatedDuration, totalDuration, resolvedDuration, } = resolved;
[20398] Fix | Delete
if (this.startTime === null)
[20399] Fix | Delete
return generator.next(0);
[20400] Fix | Delete
const { delay, repeat, repeatType, repeatDelay, onUpdate } = this.options;
[20401] Fix | Delete
/**
[20402] Fix | Delete
* requestAnimationFrame timestamps can come through as lower than
[20403] Fix | Delete
* the startTime as set by performance.now(). Here we prevent this,
[20404] Fix | Delete
* though in the future it could be possible to make setting startTime
[20405] Fix | Delete
* a pending operation that gets resolved here.
[20406] Fix | Delete
*/
[20407] Fix | Delete
if (this.speed > 0) {
[20408] Fix | Delete
this.startTime = Math.min(this.startTime, timestamp);
[20409] Fix | Delete
}
[20410] Fix | Delete
else if (this.speed < 0) {
[20411] Fix | Delete
this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime);
[20412] Fix | Delete
}
[20413] Fix | Delete
// Update currentTime
[20414] Fix | Delete
if (sample) {
[20415] Fix | Delete
this.currentTime = timestamp;
[20416] Fix | Delete
}
[20417] Fix | Delete
else if (this.holdTime !== null) {
[20418] Fix | Delete
this.currentTime = this.holdTime;
[20419] Fix | Delete
}
[20420] Fix | Delete
else {
[20421] Fix | Delete
// Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 =
[20422] Fix | Delete
// 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for
[20423] Fix | Delete
// example.
[20424] Fix | Delete
this.currentTime =
[20425] Fix | Delete
Math.round(timestamp - this.startTime) * this.speed;
[20426] Fix | Delete
}
[20427] Fix | Delete
// Rebase on delay
[20428] Fix | Delete
const timeWithoutDelay = this.currentTime - delay * (this.speed >= 0 ? 1 : -1);
[20429] Fix | Delete
const isInDelayPhase = this.speed >= 0
[20430] Fix | Delete
? timeWithoutDelay < 0
[20431] Fix | Delete
: timeWithoutDelay > totalDuration;
[20432] Fix | Delete
this.currentTime = Math.max(timeWithoutDelay, 0);
[20433] Fix | Delete
// If this animation has finished, set the current time to the total duration.
[20434] Fix | Delete
if (this.state === "finished" && this.holdTime === null) {
[20435] Fix | Delete
this.currentTime = totalDuration;
[20436] Fix | Delete
}
[20437] Fix | Delete
let elapsed = this.currentTime;
[20438] Fix | Delete
let frameGenerator = generator;
[20439] Fix | Delete
if (repeat) {
[20440] Fix | Delete
/**
[20441] Fix | Delete
* Get the current progress (0-1) of the animation. If t is >
[20442] Fix | Delete
* than duration we'll get values like 2.5 (midway through the
[20443] Fix | Delete
* third iteration)
[20444] Fix | Delete
*/
[20445] Fix | Delete
const progress = Math.min(this.currentTime, totalDuration) / resolvedDuration;
[20446] Fix | Delete
/**
[20447] Fix | Delete
* Get the current iteration (0 indexed). For instance the floor of
[20448] Fix | Delete
* 2.5 is 2.
[20449] Fix | Delete
*/
[20450] Fix | Delete
let currentIteration = Math.floor(progress);
[20451] Fix | Delete
/**
[20452] Fix | Delete
* Get the current progress of the iteration by taking the remainder
[20453] Fix | Delete
* so 2.5 is 0.5 through iteration 2
[20454] Fix | Delete
*/
[20455] Fix | Delete
let iterationProgress = progress % 1.0;
[20456] Fix | Delete
/**
[20457] Fix | Delete
* If iteration progress is 1 we count that as the end
[20458] Fix | Delete
* of the previous iteration.
[20459] Fix | Delete
*/
[20460] Fix | Delete
if (!iterationProgress && progress >= 1) {
[20461] Fix | Delete
iterationProgress = 1;
[20462] Fix | Delete
}
[20463] Fix | Delete
iterationProgress === 1 && currentIteration--;
[20464] Fix | Delete
currentIteration = Math.min(currentIteration, repeat + 1);
[20465] Fix | Delete
/**
[20466] Fix | Delete
* Reverse progress if we're not running in "normal" direction
[20467] Fix | Delete
*/
[20468] Fix | Delete
const isOddIteration = Boolean(currentIteration % 2);
[20469] Fix | Delete
if (isOddIteration) {
[20470] Fix | Delete
if (repeatType === "reverse") {
[20471] Fix | Delete
iterationProgress = 1 - iterationProgress;
[20472] Fix | Delete
if (repeatDelay) {
[20473] Fix | Delete
iterationProgress -= repeatDelay / resolvedDuration;
[20474] Fix | Delete
}
[20475] Fix | Delete
}
[20476] Fix | Delete
else if (repeatType === "mirror") {
[20477] Fix | Delete
frameGenerator = mirroredGenerator;
[20478] Fix | Delete
}
[20479] Fix | Delete
}
[20480] Fix | Delete
elapsed = clamp_clamp(0, 1, iterationProgress) * resolvedDuration;
[20481] Fix | Delete
}
[20482] Fix | Delete
/**
[20483] Fix | Delete
* If we're in negative time, set state as the initial keyframe.
[20484] Fix | Delete
* This prevents delay: x, duration: 0 animations from finishing
[20485] Fix | Delete
* instantly.
[20486] Fix | Delete
*/
[20487] Fix | Delete
const state = isInDelayPhase
[20488] Fix | Delete
? { done: false, value: keyframes[0] }
[20489] Fix | Delete
: frameGenerator.next(elapsed);
[20490] Fix | Delete
if (mapPercentToKeyframes) {
[20491] Fix | Delete
state.value = mapPercentToKeyframes(state.value);
[20492] Fix | Delete
}
[20493] Fix | Delete
let { done } = state;
[20494] Fix | Delete
if (!isInDelayPhase && calculatedDuration !== null) {
[20495] Fix | Delete
done =
[20496] Fix | Delete
this.speed >= 0
[20497] Fix | Delete
? this.currentTime >= totalDuration
[20498] Fix | Delete
: this.currentTime <= 0;
[20499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function