-
-
Notifications
You must be signed in to change notification settings - Fork 764
/
spinner.styles.ts
63 lines (53 loc) 路 1.19 KB
/
spinner.styles.ts
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
58
59
60
61
62
63
import { css } from 'lit';
import componentStyles from '../../styles/component.styles';
export default css`
${componentStyles}
:host {
--track-width: 2px;
--track-color: rgb(var(--sl-color-neutral-500) / 20%);
--indicator-color: rgb(var(--sl-color-primary-600));
--speed: 2.5s;
display: inline-flex;
width: 1em;
height: 1em;
}
.spinner {
flex: 1 1 auto;
height: 100%;
width: 100%;
}
.spinner__track,
.spinner__indicator {
fill: none;
stroke-width: var(--track-width);
r: calc(0.5em - var(--track-width) / 2);
cx: 0.5em;
cy: 0.5em;
transform-origin: 50% 50%;
}
.spinner__track {
stroke: var(--track-color);
transform-origin: 0% 0%;
}
.spinner__indicator {
stroke: var(--indicator-color);
stroke-linecap: round;
transform-origin: 50% 50%;
transform: rotate(90deg);
animation: spin var(--speed) linear infinite;
}
@keyframes spin {
0% {
stroke-dasharray: 0.2em 3em;
transform: rotate(0deg);
}
50% {
stroke-dasharray: 2.2em 3em;
transform: rotate(450deg);
}
100% {
stroke-dasharray: 0.2em 3em;
transform: rotate(1080deg);
}
}
`;