@dialpad/dialtone
Version:
Dialpad's Dialtone design system monorepo
29 lines (28 loc) • 1.07 kB
JavaScript
;
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const skeleton_constants = require("../../components/skeleton/skeleton_constants.cjs");
const SkeletonAnimation = {
computed: {
skeletonOffset() {
const skeletonText = this.$refs.skeleton;
if (!skeletonText) {
return this.offset;
}
const { top, height } = skeletonText.getBoundingClientRect();
return top + height / 2;
},
skeletonStyle() {
const style = {};
if (this.skeletonOffset === -1 || !this.animate && this.animationDuration === -1) {
return style;
}
const animationDelay = this.skeletonOffset * skeleton_constants.SKELETON_RIPPLE_DURATION / 1e3;
const animationDuration = this.animationDuration === -1 ? 1e3 : this.animationDuration;
style.animationDelay = `${animationDelay}ms`;
style.animationDuration = `${animationDuration}ms`;
return style;
}
}
};
exports.default = SkeletonAnimation;
//# sourceMappingURL=skeleton.cjs.map