@algolia/autocomplete-js
Version:
Fast and fully-featured autocomplete JavaScript library.
21 lines • 1.1 kB
JavaScript
export var LoadingIcon = function LoadingIcon(_ref) {
var environment = _ref.environment;
var element = environment.document.createElementNS('http://www.w3.org/2000/svg', 'svg');
element.setAttribute('class', 'aa-LoadingIcon');
element.setAttribute('viewBox', '0 0 100 100');
element.setAttribute('width', '20');
element.setAttribute('height', '20');
element.innerHTML = "<circle\n cx=\"50\"\n cy=\"50\"\n fill=\"none\"\n r=\"35\"\n stroke=\"currentColor\"\n stroke-dasharray=\"164.93361431346415 56.97787143782138\"\n stroke-width=\"6\"\n>\n <animateTransform\n attributeName=\"transform\"\n type=\"rotate\"\n repeatCount=\"indefinite\"\n dur=\"1s\"\n values=\"0 50 50;90 50 50;180 50 50;360 50 50\"\n keyTimes=\"0;0.40;0.65;1\"\n />\n</circle>";
var pauseAnimations = function pauseAnimations() {
// Wait until the element is in the DOM.
if (!element.parentElement) {
setTimeout(pauseAnimations, 0);
return;
}
element.pauseAnimations();
};
if ('pauseAnimations' in element) {
pauseAnimations();
}
return element;
};