Layout 100%, Notificações, SetupWizard
This commit is contained in:
@@ -30,7 +30,7 @@ const loadingRecovery = ref(false)
|
||||
const recoverySent = ref(false)
|
||||
|
||||
// carrossel
|
||||
const slides = [
|
||||
const SLIDES_FALLBACK = [
|
||||
{
|
||||
title: 'Gestão clínica simplificada',
|
||||
body: 'Agendamentos, prontuários e sessões em um único painel. Foco no que importa: seus pacientes.',
|
||||
@@ -53,6 +53,8 @@ const slides = [
|
||||
},
|
||||
]
|
||||
|
||||
const slides = ref(SLIDES_FALLBACK)
|
||||
|
||||
const currentSlide = ref(0)
|
||||
let slideInterval = null
|
||||
|
||||
@@ -62,7 +64,7 @@ function goToSlide (i) {
|
||||
|
||||
function startCarousel () {
|
||||
slideInterval = setInterval(() => {
|
||||
currentSlide.value = (currentSlide.value + 1) % slides.length
|
||||
currentSlide.value = (currentSlide.value + 1) % slides.value.length
|
||||
}, 4500)
|
||||
}
|
||||
|
||||
@@ -70,6 +72,21 @@ function stopCarousel () {
|
||||
if (slideInterval) clearInterval(slideInterval)
|
||||
}
|
||||
|
||||
async function loadCarouselSlides () {
|
||||
try {
|
||||
const { data, error } = await supabase
|
||||
.from('login_carousel_slides')
|
||||
.select('title, body, icon')
|
||||
.eq('ativo', true)
|
||||
.order('ordem', { ascending: true })
|
||||
if (!error && data && data.length > 0) {
|
||||
slides.value = data
|
||||
}
|
||||
} catch {
|
||||
// mantém fallback
|
||||
}
|
||||
}
|
||||
|
||||
const canSubmit = computed(() => {
|
||||
return !!email.value?.trim() && !!password.value && !loading.value && !loadingRecovery.value
|
||||
})
|
||||
@@ -266,7 +283,9 @@ async function sendRecoveryEmail () {
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
onMounted(async () => {
|
||||
await loadCarouselSlides()
|
||||
|
||||
const preEmail = sessionStorage.getItem('login_prefill_email')
|
||||
const prePass = sessionStorage.getItem('login_prefill_password')
|
||||
|
||||
@@ -332,12 +351,12 @@ onBeforeUnmount(() => {
|
||||
</div>
|
||||
|
||||
<div class="space-y-4">
|
||||
<h2 class="text-3xl xl:text-4xl font-bold text-white leading-tight">
|
||||
{{ slides[currentSlide].title }}
|
||||
</h2>
|
||||
<p class="text-base xl:text-lg text-white/70 leading-relaxed max-w-sm">
|
||||
{{ slides[currentSlide].body }}
|
||||
</p>
|
||||
<div class="text-3xl xl:text-4xl font-bold text-white leading-tight prose prose-invert prose-xl max-w-none"
|
||||
v-html="slides[currentSlide].title"
|
||||
/>
|
||||
<div class="text-base xl:text-lg text-white/70 leading-relaxed max-w-sm prose prose-invert max-w-none"
|
||||
v-html="slides[currentSlide].body"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</Transition>
|
||||
|
||||
Reference in New Issue
Block a user