package.dist.offset.cjs.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of utils Show documentation
Show all versions of utils Show documentation
A collection of utility functions for animations.
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var mix = require('./mix.cjs.js');
var progress = require('./progress.cjs.js');
function fillOffset(offset, remaining) {
const min = offset[offset.length - 1];
for (let i = 1; i <= remaining; i++) {
const offsetProgress = progress.progress(0, remaining, i);
offset.push(mix.mix(min, 1, offsetProgress));
}
}
function defaultOffset(length) {
const offset = [0];
fillOffset(offset, length - 1);
return offset;
}
exports.defaultOffset = defaultOffset;
exports.fillOffset = fillOffset;