fill.mjs 362 B

123456789101112
  1. import { progress } from 'motion-utils';
  2. import { mixNumber } from '../mix/number.mjs';
  3. function fillOffset(offset, remaining) {
  4. const min = offset[offset.length - 1];
  5. for (let i = 1; i <= remaining; i++) {
  6. const offsetProgress = progress(0, remaining, i);
  7. offset.push(mixNumber(min, 1, offsetProgress));
  8. }
  9. }
  10. export { fillOffset };