UNPKG

motion

Version:

The Motion library for the web

22 lines (17 loc) 568 B
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var popmotion = require('popmotion'); function fillOffset(offset, remaining) { const min = offset[offset.length - 1]; for (let i = 1; i <= remaining; i++) { const offsetProgress = popmotion.progress(0, remaining, i); offset.push(popmotion.mix(min, 1, offsetProgress)); } } function defaultOffset(length) { const offset = [0]; fillOffset(offset, length - 1); return offset; } exports.defaultOffset = defaultOffset; exports.fillOffset = fillOffset;