1 line
3.6 KiB
JSON
1 line
3.6 KiB
JSON
{"ast":null,"code":"function easeInOutSin(time) {\n return (1 + Math.sin(Math.PI * time - Math.PI / 2)) / 2;\n}\nexport default function animate(property, element, to, options = {}, cb = () => {}) {\n const {\n ease = easeInOutSin,\n duration = 300 // standard\n } = options;\n let start = null;\n const from = element[property];\n let cancelled = false;\n const cancel = () => {\n cancelled = true;\n };\n const step = timestamp => {\n if (cancelled) {\n cb(new Error('Animation cancelled'));\n return;\n }\n if (start === null) {\n start = timestamp;\n }\n const time = Math.min(1, (timestamp - start) / duration);\n element[property] = ease(time) * (to - from) + from;\n if (time >= 1) {\n requestAnimationFrame(() => {\n cb(null);\n });\n return;\n }\n requestAnimationFrame(step);\n };\n if (from === to) {\n cb(new Error('Element already at target position'));\n return cancel;\n }\n requestAnimationFrame(step);\n return cancel;\n}","map":{"version":3,"names":["easeInOutSin","time","Math","sin","PI","animate","property","element","to","options","cb","ease","duration","start","from","cancelled","cancel","step","timestamp","Error","min","requestAnimationFrame"],"sources":["/home/gnx/Desktop/ETB/ETB-FrontEnd/node_modules/@mui/material/internal/animate.js"],"sourcesContent":["function easeInOutSin(time) {\n return (1 + Math.sin(Math.PI * time - Math.PI / 2)) / 2;\n}\nexport default function animate(property, element, to, options = {}, cb = () => {}) {\n const {\n ease = easeInOutSin,\n duration = 300 // standard\n } = options;\n let start = null;\n const from = element[property];\n let cancelled = false;\n const cancel = () => {\n cancelled = true;\n };\n const step = timestamp => {\n if (cancelled) {\n cb(new Error('Animation cancelled'));\n return;\n }\n if (start === null) {\n start = timestamp;\n }\n const time = Math.min(1, (timestamp - start) / duration);\n element[property] = ease(time) * (to - from) + from;\n if (time >= 1) {\n requestAnimationFrame(() => {\n cb(null);\n });\n return;\n }\n requestAnimationFrame(step);\n };\n if (from === to) {\n cb(new Error('Element already at target position'));\n return cancel;\n }\n requestAnimationFrame(step);\n return cancel;\n}"],"mappings":"AAAA,SAASA,YAAYA,CAACC,IAAI,EAAE;EAC1B,O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