first commit
This commit is contained in:
9
node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.mjs
generated
vendored
Normal file
9
node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.mjs
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import { fillOffset } from './fill.mjs';
|
||||
|
||||
function defaultOffset(arr) {
|
||||
const offset = [0];
|
||||
fillOffset(offset, arr.length - 1);
|
||||
return offset;
|
||||
}
|
||||
|
||||
export { defaultOffset };
|
||||
12
node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.mjs
generated
vendored
Normal file
12
node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.mjs
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { progress } from 'motion-utils';
|
||||
import { mixNumber } from '../../../utils/mix/number.mjs';
|
||||
|
||||
function fillOffset(offset, remaining) {
|
||||
const min = offset[offset.length - 1];
|
||||
for (let i = 1; i <= remaining; i++) {
|
||||
const offsetProgress = progress(0, remaining, i);
|
||||
offset.push(mixNumber(min, 1, offsetProgress));
|
||||
}
|
||||
}
|
||||
|
||||
export { fillOffset };
|
||||
5
node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.mjs
generated
vendored
Normal file
5
node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.mjs
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
function convertOffsetToTimes(offset, duration) {
|
||||
return offset.map((o) => o * duration);
|
||||
}
|
||||
|
||||
export { convertOffsetToTimes };
|
||||
Reference in New Issue
Block a user