2023-03-12 15:03:24 +00:00
|
|
|
<template>
|
2023-08-13 17:31:57 +00:00
|
|
|
<div v-if="!showContent" class="min-h-[75vh] w-full flex items-center justify-center">
|
2023-03-13 13:39:07 +00:00
|
|
|
<span id="spinner" />
|
|
|
|
</div>
|
|
|
|
<div v-else>
|
|
|
|
<slot />
|
2023-03-12 15:03:24 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2023-07-27 11:46:05 +00:00
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
props: {
|
|
|
|
showContent: {
|
|
|
|
type: Boolean,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
2023-03-12 15:03:24 +00:00
|
|
|
<style>
|
|
|
|
#spinner:after {
|
|
|
|
--spinner-color: #000;
|
|
|
|
}
|
|
|
|
|
|
|
|
.dark #spinner:after {
|
|
|
|
--spinner-color: #fff;
|
|
|
|
}
|
|
|
|
|
|
|
|
#spinner {
|
|
|
|
display: inline-block;
|
|
|
|
width: 70px;
|
|
|
|
height: 70px;
|
|
|
|
}
|
|
|
|
#spinner:after {
|
|
|
|
content: " ";
|
|
|
|
display: block;
|
|
|
|
width: 54px;
|
|
|
|
height: 54px;
|
|
|
|
margin: 8px;
|
|
|
|
border-radius: 50%;
|
|
|
|
border: 4px solid var(--spinner-color);
|
|
|
|
border-color: var(--spinner-color) transparent var(--spinner-color) transparent;
|
|
|
|
animation: spinner 1.2s linear infinite;
|
|
|
|
}
|
|
|
|
|
|
|
|
@keyframes spinner {
|
|
|
|
0% {
|
|
|
|
transform: rotate(0deg);
|
|
|
|
}
|
|
|
|
100% {
|
|
|
|
transform: rotate(360deg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|