forked from ShouChenICU/FastSend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FullScreenLoader.vue
96 lines (92 loc) · 1.63 KB
/
FullScreenLoader.vue
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<script setup>
const isFullScreenLoading = useFullScreenLoader()
const loaderElm = ref()
watch(isFullScreenLoading, (isLoad) => {
if (isLoad) {
loaderElm.value.style.display = 'flex'
setTimeout(() => {
loaderElm.value.style.opacity = '1'
}, 1)
} else {
loaderElm.value.style.opacity = '0'
setTimeout(() => {
loaderElm.value.style.display = 'none'
}, 500)
}
})
</script>
<template>
<div class="loader-wrapper" ref="loaderElm">
<div class="loader"></div>
</div>
</template>
<style scoped>
.loader-wrapper {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
position: fixed;
left: 0;
top: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.3);
backdrop-filter: blur(3px);
z-index: 100;
opacity: 1;
transition: opacity 0.5s ease;
}
.loader {
width: 100px;
height: 40px;
--g: radial-gradient(
farthest-side,
transparent calc(95% - 3px),
#fff calc(100% - 3px) 98%,
transparent 101%
)
no-repeat;
background: var(--g), var(--g), var(--g);
background-size: 30px 30px;
animation: l9 1s infinite alternate;
}
@keyframes l9 {
0% {
background-position:
0 50%,
50% 50%,
100% 50%;
}
20% {
background-position:
0 0,
50% 50%,
100% 50%;
}
40% {
background-position:
0 100%,
50% 0,
100% 50%;
}
60% {
background-position:
0 50%,
50% 100%,
100% 0;
}
80% {
background-position:
0 50%,
50% 50%,
100% 100%;
}
100% {
background-position:
0 50%,
50% 50%,
100% 50%;
}
}
</style>