How to use the @popmotion/popcorn.mix function in @popmotion/popcorn

To help you get started, we’ve selected a few @popmotion/popcorn examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Popmotion / popmotion / packages / popmotion / src / compositors / crossfade.ts View on Github external
update: ([va, vb]: [number, number]) => {
        observer.update(mix(va, vb, balance));
      }
    });
github framer / motion / src / behaviours / use-draggable.ts View on Github external
const applyOverdrag = (
    origin: number,
    current: number,
    dragElastic: boolean | number
) => {
    const dragFactor = typeof dragElastic === "number" ? dragElastic : 0.35
    return mix(origin, current, dragFactor)
}
github framer / motion / src / behaviours / use-drag.ts View on Github external
function applyOverdrag(
    origin: number,
    current: number,
    dragElastic: boolean | number
) {
    const dragFactor = typeof dragElastic === "number" ? dragElastic : 0.35
    return mix(origin, current, dragFactor)
}
github Popmotion / popmotion / packages / popmotion / src / transformers.ts View on Github external
export const steps = (st: number, min = 0, max = 1) => (v: number) => {
  const current = progress(min, max, v);
  return mix(min, max, stepProgress(st, current));
};
github framer / motion / dev / examples / viewportScroll.tsx View on Github external
const randomInt = (min, max) => Math.round(mix(min, max, Math.random()))
const generateParagraphLength = () => randomInt(10, 40)
github framer / motion / dev / examples / heightAutoWithRotateAndScale.tsx View on Github external
const randomInt = (min, max) => Math.round(mix(min, max, Math.random()))
const generateParagraphLength = () => randomInt(5, 20)
github Andarist / use-smooth-scroll / src / index.js View on Github external
map(p => {
              recyclable[2] = mix(start, target, easing(p))
              return recyclable
            }),
            takeUntil(