Add loading indicator

This commit is contained in:
Stanislav Romanov 2022-09-19 10:54:45 +03:00
parent b936e2ec20
commit ed7f9fbabf
5 changed files with 51 additions and 0 deletions

View file

@ -71,6 +71,26 @@
}
}
.loading-indicator {
display: flex;
min-height: 100vh;
svg {
@apply fill-base-2;
margin: auto;
animation: loading-indicator 0.45s infinite linear;
@keyframes loading-indicator {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(359deg);
}
}
}
}
body {
&.sidebar-is-opened {
overflow: hidden;

View file

@ -0,0 +1,11 @@
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
loadingIndicatorRemover() {
const el = document.querySelector('.loading-indicator');
if (el) {
el.parentNode.removeChild(el);
}
}
}

View file

@ -14,6 +14,12 @@
{{content-for "head-footer"}}
</head>
<body>
<div class="loading-indicator">
<svg width="80" height="80" viewBox="0 0 24 24" role="img">
<path d="M12,4V2A10,10 0 0,0 2,12H4A8,8 0 0,1 12,4Z"/>
</svg>
</div>
{{content-for "body"}}
<script src="{{rootURL}}assets/vendor.js"></script>

View file

@ -1,3 +1,5 @@
{{this.loadingIndicatorRemover}}
{{outlet}}
<ToastsContainer />

View file

@ -0,0 +1,12 @@
import { module, test } from 'qunit';
import { setupTest } from 'meiliadmin/tests/helpers';
module('Unit | Controller | application', function (hooks) {
setupTest(hooks);
// TODO: Replace this with your real tests.
test('it exists', function (assert) {
let controller = this.owner.lookup('controller:application');
assert.ok(controller);
});
});