UNPKG

hongluan-ui

Version:
63 lines (58 loc) 1.82 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var core = require('@vueuse/core'); const cubic = (value) => { return value ** 3; }; const easeInOutCubic = (value) => value < 0.5 ? cubic(value * 2) / 2 : 1 - cubic((1 - value) * 2) / 2; const setTransform = (transform, mark, newVal) => { const transformStr = transform == null ? void 0 : transform.replace(/,\s+/g, ","); if (!transform) { return newVal; } else { const items = transformStr.split(" "); const idx = items.findIndex((item) => item.indexOf(mark) > -1); if (idx > -1) { items[idx] = newVal; } else { items.push(newVal); } return items.join(" ").trim(); } }; const transitionEndName = function() { if (!core.isClient) return; const body = document.body || document.documentElement, style = body.style; const transEndEventNames = { transition: "transitionend", WebkitTransition: "webkitTransitionEnd", MozTransition: "transitionend", OTransition: "oTransitionEnd otransitionend" }; for (const name in transEndEventNames) { if (typeof style[name] === "string") { return transEndEventNames[name]; } } }(); const animationEndName = function() { if (!core.isClient) return; const body = document.body || document.documentElement, style = body.style; const animEndEventNames = { animation: "animationend", WebkitAnimation: "webkitAnimationEnd" }; for (const name in animEndEventNames) { if (typeof style[name] === "string") { return animEndEventNames[name]; } } }(); exports.animationEndName = animationEndName; exports.cubic = cubic; exports.easeInOutCubic = easeInOutCubic; exports.setTransform = setTransform; exports.transitionEndName = transitionEndName; //# sourceMappingURL=animation.js.map