85 lines
1.4 KiB
Vue
85 lines
1.4 KiB
Vue
<script setup lang="ts">
|
|||
|
|
withDefaults(
|
||
|
|
defineProps<{
|
||
|
|
open: boolean;
|
||
|
|
message?: string;
|
||
|
|
/** وقتی true باشد روی مودال هم دیده میشود */
|
||
|
|
nest?: boolean;
|
||
|
|
}>(),
|
||
|
|
{
|
||
|
|
message: 'لطفاً صبر کنید…',
|
||
|
|
nest: false,
|
||
|
|
},
|
||
|
|
);
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<template>
|
||
|
|
<Teleport to="body">
|
||
|
|
<div
|
||
|
|
v-if="open"
|
||
|
|
class="busy-overlay"
|
||
|
|
:class="{ nest }"
|
||
|
|
role="status"
|
||
|
|
aria-live="polite"
|
||
|
|
aria-busy="true"
|
||
|
|
>
|
||
|
|
<div class="card">
|
||
|
|
<span class="spinner" aria-hidden="true" />
|
||
|
|
<p>{{ message }}</p>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</Teleport>
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<style scoped>
|
||
|
|
.busy-overlay {
|
||
|
|
position: fixed;
|
||
|
|
inset: 0;
|
||
|
|
z-index: 90;
|
||
|
|
display: grid;
|
||
|
|
place-items: center;
|
||
|
|
padding: 16px;
|
||
|
|
background: rgba(15, 23, 42, 0.4);
|
||
|
|
backdrop-filter: blur(2px);
|
||
|
|
}
|
||
|
|
|
||
|
|
.busy-overlay.nest {
|
||
|
|
z-index: 110;
|
||
|
|
}
|
||
|
|
|
||
|
|
.card {
|
||
|
|
display: grid;
|
||
|
|
justify-items: center;
|
||
|
|
gap: 0.85rem;
|
||
|
|
min-width: min(18rem, 100%);
|
||
|
|
padding: 1.35rem 1.5rem;
|
||
|
|
border-radius: 16px;
|
||
|
|
background: #fff;
|
||
|
|
box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
|
||
|
|
color: #0f172a;
|
||
|
|
text-align: center;
|
||
|
|
}
|
||
|
|
|
||
|
|
.card p {
|
||
|
|
margin: 0;
|
||
|
|
font-size: 0.95rem;
|
||
|
|
font-weight: 600;
|
||
|
|
line-height: 1.6;
|
||
|
|
}
|
||
|
|
|
||
|
|
.spinner {
|
||
|
|
width: 28px;
|
||
|
|
height: 28px;
|
||
|
|
border: 3px solid #ccfbf1;
|
||
|
|
border-top-color: #0d9488;
|
||
|
|
border-radius: 50%;
|
||
|
|
animation: busy-spin 0.7s linear infinite;
|
||
|
|
}
|
||
|
|
|
||
|
|
@keyframes busy-spin {
|
||
|
|
to {
|
||
|
|
transform: rotate(360deg);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
</style>
|