MCPcopy Create free account
hub / github.com/bendc/animateplus / getDeviation

Function getDeviation

animateplus.js:71–84  ·  view source on GitHub ↗
(blur, {easing}, curve)

Source from the content-addressed store, hash-verified

69};
70
71const getDeviation = (blur, {easing}, curve) => {
72 const progress = blur * curve;
73 const out = blur - progress;
74 const deviation = (() => {
75 if (easing == "linear")
76 return blur;
77 if (easing.startsWith("in-out"))
78 return (curve < .5 ? progress : out) * 2;
79 if (easing.startsWith("in"))
80 return progress;
81 return out;
82 })();
83 return Math.max(0, deviation);
84};
85
86const setDeviation = ({blur, gaussian, easing}, curve) => {
87 const values = blurs.axes.map(axis => getDeviation(blur[axis], easing, curve));

Callers 1

setDeviationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected