Socket
Socket
Sign inDemoInstall

@motionone/generators

Package Overview
Dependencies
Maintainers
2
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@motionone/generators - npm Package Compare versions

Comparing version 10.16.3 to 10.16.4

2

dist/size-glide.js

@@ -1,1 +0,1 @@

const e=e=>1e3*e,t=e=>e/1e3;function r(e,t,r){const a=Math.max(t-5,0);return n=r-e(a),(s=t-a)?n*(1e3/s):0;var n,s}const a=100,n=10,s=1;const c=({stiffness:e=a,damping:c=n,mass:o=s,from:h=0,to:d=1,velocity:i=0,restSpeed:u=2,restDistance:M=.5}={})=>{i=i?t(i):0;const g={done:!1,hasReachedTarget:!1,current:h,target:d},v=d-h,f=Math.sqrt(e/o)/1e3,p=((e=a,t=n,r=s)=>t/(2*Math.sqrt(e*r)))(e,c,o);let m;if(p<1){const e=f*Math.sqrt(1-p*p);m=t=>d-Math.exp(-p*f*t)*((p*f*v-i)/e*Math.sin(e*t)+v*Math.cos(e*t))}else m=e=>d-Math.exp(-f*e)*(v+(f*v-i)*e);return e=>{g.current=m(e);const t=0===e?i:r(m,e,g.current),a=Math.abs(t)<=u,n=Math.abs(d-g.current)<=M;var s,c,o;return g.done=a&&n,g.hasReachedTarget=(s=h,c=d,o=g.current,s<c&&o>=c||s>c&&o<=c),g}},o=({from:t=0,velocity:a=0,power:n=.8,decay:s=.325,bounceDamping:o,bounceStiffness:h,changeTarget:d,min:i,max:u,restDistance:M=.5,restSpeed:g})=>{s=e(s);const v={hasReachedTarget:!1,done:!1,current:t,target:t},f=e=>void 0===i?u:void 0===u||Math.abs(i-e)<Math.abs(u-e)?i:u;let p=n*a;const m=t+p,l=void 0===d?m:d(m);v.target=l,l!==m&&(p=l-t);const b=e=>-p*Math.exp(-e/s),x=e=>l+b(e),T=e=>{const t=b(e),r=x(e);v.done=Math.abs(t)<=M,v.current=v.done?l:r};let R,y;const D=e=>{var t;(t=v.current,void 0!==i&&t<i||void 0!==u&&t>u)&&(R=e,y=c({from:v.current,to:f(v.current),velocity:r(x,e,v.current),damping:o,stiffness:h,restDistance:M,restSpeed:g}))};return D(0),e=>{let t=!1;return y||void 0!==R||(t=!0,T(e),D(e)),void 0!==R&&e>R?(v.hasReachedTarget=!0,y(e-R)):(v.hasReachedTarget=!1,!t&&T(e),v)}};export{o as glide};
const t=t=>1e3*t,e=t=>t/1e3;function r(t,e,r){const a=Math.max(e-5,0);return n=r-t(a),(s=e-a)?n*(1e3/s):0;var n,s}const a=100,n=10,s=1;const c=({stiffness:t=a,damping:c=n,mass:o=s,from:h=0,to:d=1,velocity:i=0,restSpeed:u,restDistance:M}={})=>{i=i?e(i):0;const g={done:!1,hasReachedTarget:!1,current:h,target:d},v=d-h,f=Math.sqrt(t/o)/1e3,p=((t=a,e=n,r=s)=>e/(2*Math.sqrt(t*r)))(t,c,o),m=Math.abs(v)<5;let b;if(u||(u=m?.01:2),M||(M=m?.005:.5),p<1){const t=f*Math.sqrt(1-p*p);b=e=>d-Math.exp(-p*f*e)*((p*f*v-i)/t*Math.sin(t*e)+v*Math.cos(t*e))}else b=t=>d-Math.exp(-f*t)*(v+(f*v-i)*t);return t=>{g.current=b(t);const e=0===t?i:r(b,t,g.current),a=Math.abs(e)<=u,n=Math.abs(d-g.current)<=M;var s,c,o;return g.done=a&&n,g.hasReachedTarget=(s=h,c=d,o=g.current,s<c&&o>=c||s>c&&o<=c),g}},o=({from:e=0,velocity:a=0,power:n=.8,decay:s=.325,bounceDamping:o,bounceStiffness:h,changeTarget:d,min:i,max:u,restDistance:M=.5,restSpeed:g})=>{s=t(s);const v={hasReachedTarget:!1,done:!1,current:e,target:e},f=t=>void 0===i?u:void 0===u||Math.abs(i-t)<Math.abs(u-t)?i:u;let p=n*a;const m=e+p,b=void 0===d?m:d(m);v.target=b,b!==m&&(p=b-e);const l=t=>-p*Math.exp(-t/s),x=t=>b+l(t),T=t=>{const e=l(t),r=x(t);v.done=Math.abs(e)<=M,v.current=v.done?b:r};let R,y;const D=t=>{var e;(e=v.current,void 0!==i&&e<i||void 0!==u&&e>u)&&(R=t,y=c({from:v.current,to:f(v.current),velocity:r(x,t,v.current),damping:o,stiffness:h,restDistance:M,restSpeed:g}))};return D(0),t=>{let e=!1;return y||void 0!==R||(e=!0,T(t),D(t)),void 0!==R&&t>R?(v.hasReachedTarget=!0,y(t-R)):(v.hasReachedTarget=!1,!e&&T(t),v)}};export{o as glide};

@@ -1,1 +0,1 @@

const t=t=>t/1e3;const e=100,r=10,a=1;const s=({stiffness:s=e,damping:n=r,mass:c=a,from:o=0,to:h=1,velocity:M=0,restSpeed:u=2,restDistance:i=.5}={})=>{M=M?t(M):0;const d={done:!1,hasReachedTarget:!1,current:o,target:h},f=h-o,p=Math.sqrt(s/c)/1e3,g=((t=e,s=r,n=a)=>s/(2*Math.sqrt(t*n)))(s,n,c);let m;if(g<1){const t=p*Math.sqrt(1-g*g);m=e=>h-Math.exp(-g*p*e)*((g*p*f-M)/t*Math.sin(t*e)+f*Math.cos(t*e))}else m=t=>h-Math.exp(-p*t)*(f+(p*f-M)*t);return t=>{d.current=m(t);const e=0===t?M:function(t,e,r){const a=Math.max(e-5,0);return s=r-t(a),(n=e-a)?s*(1e3/n):0;var s,n}(m,t,d.current),r=Math.abs(e)<=u,a=Math.abs(h-d.current)<=i;var s,n,c;return d.done=r&&a,d.hasReachedTarget=(s=o,n=h,c=d.current,s<n&&c>=n||s>n&&c<=n),d}};export{s as spring};
const t=t=>t/1e3;const e=100,r=10,a=1;const s=({stiffness:s=e,damping:n=r,mass:c=a,from:h=0,to:o=1,velocity:M=0,restSpeed:u,restDistance:i}={})=>{M=M?t(M):0;const d={done:!1,hasReachedTarget:!1,current:h,target:o},f=o-h,p=Math.sqrt(s/c)/1e3,g=((t=e,s=r,n=a)=>s/(2*Math.sqrt(t*n)))(s,n,c),m=Math.abs(f)<5;let x;if(u||(u=m?.01:2),i||(i=m?.005:.5),g<1){const t=p*Math.sqrt(1-g*g);x=e=>o-Math.exp(-g*p*e)*((g*p*f-M)/t*Math.sin(t*e)+f*Math.cos(t*e))}else x=t=>o-Math.exp(-p*t)*(f+(p*f-M)*t);return t=>{d.current=x(t);const e=0===t?M:function(t,e,r){const a=Math.max(e-5,0);return s=r-t(a),(n=e-a)?s*(1e3/n):0;var s,n}(x,t,d.current),r=Math.abs(e)<=u,a=Math.abs(o-d.current)<=i;var s,n,c;return d.done=r&&a,d.hasReachedTarget=(s=h,n=o,c=d.current,s<n&&c>=n||s>n&&c<=n),d}};export{s as spring};

@@ -11,3 +11,3 @@ 'use strict';

const spring = ({ stiffness = defaults.defaults.stiffness, damping = defaults.defaults.damping, mass = defaults.defaults.mass, from = 0, to = 1, velocity: velocity$1 = 0.0, restSpeed = 2, restDistance = 0.5, } = {}) => {
const spring = ({ stiffness = defaults.defaults.stiffness, damping = defaults.defaults.damping, mass = defaults.defaults.mass, from = 0, to = 1, velocity: velocity$1 = 0.0, restSpeed, restDistance, } = {}) => {
velocity$1 = velocity$1 ? utils.time.s(velocity$1) : 0.0;

@@ -23,2 +23,5 @@ const state = {

const dampingRatio = utils$1.calcDampingRatio(stiffness, damping, mass);
const isGranularScale = Math.abs(initialDelta) < 5;
restSpeed || (restSpeed = isGranularScale ? 0.01 : 2);
restDistance || (restDistance = isGranularScale ? 0.005 : 0.5);
let resolveSpring;

@@ -25,0 +28,0 @@ if (dampingRatio < 1) {

@@ -7,3 +7,3 @@ import { time } from '@motionone/utils';

const spring = ({ stiffness = defaults.stiffness, damping = defaults.damping, mass = defaults.mass, from = 0, to = 1, velocity = 0.0, restSpeed = 2, restDistance = 0.5, } = {}) => {
const spring = ({ stiffness = defaults.stiffness, damping = defaults.damping, mass = defaults.mass, from = 0, to = 1, velocity = 0.0, restSpeed, restDistance, } = {}) => {
velocity = velocity ? time.s(velocity) : 0.0;

@@ -19,2 +19,5 @@ const state = {

const dampingRatio = calcDampingRatio(stiffness, damping, mass);
const isGranularScale = Math.abs(initialDelta) < 5;
restSpeed || (restSpeed = isGranularScale ? 0.01 : 2);
restDistance || (restDistance = isGranularScale ? 0.005 : 0.5);
let resolveSpring;

@@ -21,0 +24,0 @@ if (dampingRatio < 1) {

@@ -6,3 +6,3 @@ import { time } from "@motionone/utils";

import { calcGeneratorVelocity } from "../utils/velocity";
export const spring = ({ stiffness = defaults.stiffness, damping = defaults.damping, mass = defaults.mass, from = 0, to = 1, velocity = 0.0, restSpeed = 2, restDistance = 0.5, } = {}) => {
export const spring = ({ stiffness = defaults.stiffness, damping = defaults.damping, mass = defaults.mass, from = 0, to = 1, velocity = 0.0, restSpeed, restDistance, } = {}) => {
velocity = velocity ? time.s(velocity) : 0.0;

@@ -18,2 +18,5 @@ const state = {

const dampingRatio = calcDampingRatio(stiffness, damping, mass);
const isGranularScale = Math.abs(initialDelta) < 5;
restSpeed || (restSpeed = isGranularScale ? 0.01 : 2);
restDistance || (restDistance = isGranularScale ? 0.005 : 0.5);
let resolveSpring;

@@ -20,0 +23,0 @@ if (dampingRatio < 1) {

{
"name": "@motionone/generators",
"version": "10.16.3",
"version": "10.16.4",
"description": "A collection of animation generators.",

@@ -32,3 +32,3 @@ "license": "MIT",

],
"gitHead": "f4721014f749ce528145c09386af8584eced4e2a"
"gitHead": "1b73773be02af31fedb8ac4b5d391650d06f4094"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc