-
-
Notifications
You must be signed in to change notification settings - Fork 289
Expand file tree
/
Copy pathprogress-spinner.html
More file actions
57 lines (51 loc) · 1.22 KB
/
progress-spinner.html
File metadata and controls
57 lines (51 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<template id="progress-spinner-template">
<style>
@import "css/style.css";
:host {
--size: 5rem;
--thickness: 10px;
--color-circle: var(--brand-metallic-bright);
--color-rotor: var(--brand-blue);
display: inline-block;
}
.spinner {
margin: auto;
width: var(--size);
height: var(--size);
border-width: var(--thickness);
border-style: solid;
border-color: var(--color-circle);
border-top-color: var(--color-rotor);
border-radius: 50%;
animation: spin 1.5s linear infinite;
box-sizing: border-box;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
</style>
<div class="spinner"></div>
</template>
<script type="module">
(function () {
const template = document.querySelector("#progress-spinner-template");
customElements.define(
"progress-spinner",
class extends HTMLElement {
constructor() {
super();
}
connectedCallback() {
this.attachShadow({ mode: "open" }).appendChild(
template.content.cloneNode(true)
);
}
}
);
})();
</script>