Add loader

This commit is contained in:
Julia Radzhabova
2020-12-16 19:55:01 +03:00
parent a27acea166
commit 0766f89ec4
2 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,29 @@
.asc-plugin-loader {
position: absolute;
left: 50%;
top: 50%;
margin-top: -10px;
z-index: 10000;
line-height: 20px;
background-image: none;
background-color: transparent;
color: #444444;
transform: translate(-50%, 0);
}
.asc-plugin-loader .asc-loader-image {
background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCI+PGNpcmNsZSBjeD0iMTAiIGN5PSIxMCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjNDQ0IiBzdHJva2Utd2lkdGg9IjEuNSIgcj0iNy4yNSIgc3Ryb2tlLWRhc2hhcnJheT0iMTYwJSwgNDAlIiAvPjwvc3ZnPg==);
height: 20px;
width: 20px;
float: left;
margin-top: -1px;
animation-duration: .8s;
animation-name: slidein;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
.asc-plugin-loader .asc-loader-title {
font-size: 13px;
padding-left: 25px;
}

View File

@ -0,0 +1,11 @@
/**
*
* var loader = showLoader(document.getElementById("parent-id"))
* loader.remove()
*
*/
showLoader = function (parent, text) {
var loader = $('<div class="asc-plugin-loader" ><div class="asc-loader-image"></div><div class="asc-loader-title">' + (text || 'Loading') + '</div></div>');
$(parent).append(loader);
return loader;
};