react-spinners
Version:
A collection of react loading spinners
19 lines (18 loc) • 730 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.createAnimation = void 0;
var createAnimation = function (loaderName, frames, suffix) {
var animationName = "react-spinners-".concat(loaderName, "-").concat(suffix);
if (typeof window == "undefined" || !window.document) {
return animationName;
}
var styleEl = document.createElement("style");
document.head.appendChild(styleEl);
var styleSheet = styleEl.sheet;
var keyFrames = "\n @keyframes ".concat(animationName, " {\n ").concat(frames, "\n }\n ");
if (styleSheet) {
styleSheet.insertRule(keyFrames, 0);
}
return animationName;
};
exports.createAnimation = createAnimation;
;