UNPKG

@square/maker

Version:

Maker Design System by Square

2 lines 4.19 kB
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("popmotion"),require("stylefire"));else if("function"==typeof define&&define.amd)define(["popmotion","stylefire"],t);else{var n="object"==typeof exports?t(require("popmotion"),require("stylefire")):t(e.popmotion,e.stylefire);for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(this,(function(e,t){return(()=>{"use strict";var n={922:t=>{t.exports=e},543:e=>{e.exports=t}},o={};function r(e){var t=o[e];if(void 0!==t)return t.exports;var s=o[e]={exports:{}};return n[e](s,s.exports,r),s.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};return(()=>{r.r(s),r.d(s,{mobileMinWidth:()=>o,tabletMinWidth:()=>p,desktopMinWidth:()=>i,type:()=>m,stiffness:()=>a,damping:()=>l,mass:()=>f,springDelay:()=>d,spring:()=>c,springSubtle:()=>u,springBounce:()=>y,animateUp:()=>C,animateDown:()=>g,toStyle:()=>U,styleFactory:()=>F,fadeInFn:()=>M,delayedFadeInFn:()=>O,fadeOutFn:()=>w,springUpFn:()=>D,springDownFn:()=>q,springLeftFn:()=>P,springRightFn:()=>T,floatUpFn:()=>_,delayedFloatUpFn:()=>B,staggeredFloatUpFn:()=>I,floatDownFn:()=>W,springUpBounceFn:()=>k,springDownBounceFn:()=>L});var e=r(543),t=r.n(e),n=r(922);const o=0,p=840,i=1200,m="spring",a=600,l=60,f=1,d=200,c={type:m,stiffness:a,damping:l,mass:f},u={type:m,stiffness:400,damping:40,mass:f},y={type:m,stiffness:400,damping:30,mass:1.5},C={from:0,to:100},g={from:100,to:0};function U(e,t,n,o,r){return{[o]:"".concat(e/100*(n-t)+t).concat(r)}}function F(e,t,n,o){return r=>U(r,e,t,n,o)}const b=F(0,100,"opacity","%"),x=F(0,100,"y","%"),v=F(0,100,"x","%"),j=F(40,0,"y","px"),S=e=>({...b(e),...j(e)}),h=(e,t)=>{const n=F(t,0,"y","px");return{...b(e),...n(e)}};function M({element:e,onComplete:o}){const r=t()(e),s=b,p=C;r.set(s(p.from)),r.render(),(0,n.animate)({...p,...c,onUpdate(e){r.set(s(e))},onComplete:o})}function O({element:e,onComplete:o}){const r=t()(e),s=b,p=C;r.set(s(p.from)),r.render(),setTimeout((()=>{(0,n.animate)({...p,...c,onUpdate(e){r.set(s(e))},onComplete:o})}),d)}function w({element:e,onComplete:o}){const r=t()(e),s=b,p=g;r.set(s(p.from)),r.render(),(0,n.animate)({...g,...c,onUpdate(e){r.set(s(e))},onComplete:o})}function D({element:e,onComplete:o}){const r=t()(e),s=x,p=g;r.set(s(p.from)),r.render(),(0,n.animate)({...p,...c,onUpdate(e){r.set(s(e))},onComplete:o})}function q({element:e,onComplete:o}){const r=t()(e),s=x,p=C;r.set(s(p.from)),r.render(),(0,n.animate)({...p,...c,onUpdate(e){r.set(s(e))},onComplete:o})}function P({element:e,onComplete:o}){const r=t()(e),s=v,p=g;r.set(s(p.from)),r.render(),(0,n.animate)({...p,...c,onUpdate(e){r.set(s(e))},onComplete:o})}function T({element:e,onComplete:o}){const r=t()(e),s=v,p=C;r.set(s(p.from)),r.render(),(0,n.animate)({...p,...c,onUpdate(e){r.set(s(e))},onComplete:o})}function _({element:e,onComplete:o}){const r=t()(e),s=S,p=C;r.set(s(p.from)),r.render(),(0,n.animate)({...p,...c,onUpdate(e){r.set(s(e))},onComplete:o})}function B({element:e,onComplete:o}){const r=t()(e),s=S,p=C;r.set(s(p.from)),r.render(),setTimeout((()=>{(0,n.animate)({...p,...c,onUpdate(e){r.set(s(e))},onComplete:o})}),d)}function I({element:e,onComplete:o}){const r=t()(e),s=h,p=C,i=20+5*e.dataset.loadIndex;r.set(s(p.from)),r.render(),(0,n.animate)({...p,...u,onUpdate(e){r.set(s(e,i))},onComplete:o})}function W({element:e,onComplete:o}){const r=t()(e),s=S,p=g;r.set(s(p.from)),r.render(),(0,n.animate)({...p,...c,onUpdate(e){r.set(s(e))},onComplete:o})}function k({element:e,onComplete:o}){const r=t()(e),s=x,p=g;r.set(s(p.from)),r.render(),(0,n.animate)({...p,...y,onUpdate(e){r.set(s(e))},onComplete:o})}function L({element:e,onComplete:o}){const r=t()(e),s=x,p=C;r.set(s(p.from)),r.render(),(0,n.animate)({...p,...y,onUpdate(e){r.set(s(e))},onComplete:o})}})(),s})()})); //# sourceMappingURL=transitions.js.map