-
-
Notifications
You must be signed in to change notification settings - Fork 947
Expand file tree
/
Copy pathLoading.vue
More file actions
64 lines (58 loc) · 1.12 KB
/
Copy pathLoading.vue
File metadata and controls
64 lines (58 loc) · 1.12 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
58
59
60
61
62
63
<template>
<div :class="rootClass">
<div class="loader"/>
</div>
</template>
<script setup>
import { computed } from 'vue'
const props = defineProps({
className: {
type: String,
default: ''
}
})
const rootClass = computed(() => {
return props.className ? `loading ${props.className}` : 'loading'
})
</script>
<style scoped>
.loading {
display: flex;
position: absolute;
flex-direction: row;
align-items: center;
justify-content: center;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 100;
color: var(--vp-c-indigo-1);
}
.loader {
width: 14px;
aspect-ratio: 1;
border-radius: 50%;
background-color: currentColor;
animation: l2 1.5s infinite;
}
@keyframes l2 {
0%,
100% {
transform: translate(-32px);
box-shadow: 0 0 currentColor, 0 0 currentColor;
}
40% {
transform:translate(32px);
box-shadow: -18px 0 currentColor, -36px 0 currentColor;
}
50% {
transform:translate(32px);
box-shadow: 0 0 currentColor, 0 0 currentColor;
}
90% {
transform:translate(-32px);
box-shadow: 18px 0 currentColor, 36px 0 currentColor;
}
}
</style>