2FAuth/resources/js/components/Spinner.vue

65 lines
1.7 KiB
Vue
Raw Normal View History

2023-12-01 15:29:26 +01:00
<script setup>
const props = defineProps({
isVisible: Boolean,
type: {
type: String,
default: 'inline'
},
message: {
type: String,
default: 'commons.generating_otp'
}
})
</script>
<template>
2023-12-01 15:29:26 +01:00
<div v-if="isVisible">
<div v-if="type == 'fullscreen'" class="spinner-container">
<div class="spinner-wrapper">
<span id="icnSpinnerFull" class="is-size-1 spinner">
<FontAwesomeIcon :icon="['fas', 'spinner']" spin />
</span>
<span>{{ $t(message) }}</span>
</div>
</div>
<div v-if="type == 'fullscreen-overlay'" class="spinner-overlay-container">
<div class="spinner-wrapper">
<span id="icnSpinnerFull" class="is-size-1 spinner">
<FontAwesomeIcon :icon="['fas', 'spinner']" spin />
</span>
<span>{{ $t(message) }}</span>
</div>
</div>
<FontAwesomeIcon v-else-if="type == 'raw'" :icon="['fas', 'spinner']" spin />
<div v-else class="has-text-centered mt-6">
<span id="icnSpinner" class="is-size-4">
<FontAwesomeIcon :icon="['fas', 'spinner']" spin />
</span>
</div>
</div>
</template>
<style scoped>
2023-12-01 15:29:26 +01:00
.spinner-container,
.spinner-overlay-container {
text-align: center;
2023-12-01 15:29:26 +01:00
z-index: 100000;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
display: flex;
align-items: center;
justify-content: center;
}
2023-12-01 15:29:26 +01:00
.spinner-container,
.spinner-overlay-container {
top: 25%;
height: 50%;
}
.spinner {
display: block;
}
</style>