2026-02-21 09:53:31 -05:00
|
|
|
<script setup lang="ts">
|
2026-03-01 15:13:27 -05:00
|
|
|
import { ref } from 'vue'
|
|
|
|
|
import { useRouter } from 'vue-router'
|
2026-03-01 12:15:08 -05:00
|
|
|
import { useI18n } from 'vue-i18n'
|
2026-03-01 15:13:27 -05:00
|
|
|
import LoginForm from '../components/auth/LoginForm.vue'
|
|
|
|
|
import RegisterForm from '../components/auth/RegisterForm.vue'
|
2026-02-21 09:53:31 -05:00
|
|
|
|
2026-03-01 14:28:25 -05:00
|
|
|
const { t } = useI18n()
|
2026-02-23 19:31:47 -05:00
|
|
|
const router = useRouter()
|
2026-03-01 15:13:27 -05:00
|
|
|
const isLogin = ref(true)
|
2026-02-23 19:31:47 -05:00
|
|
|
|
2026-03-01 15:13:27 -05:00
|
|
|
const toggleAuth = () => {
|
|
|
|
|
isLogin.value = !isLogin.value
|
|
|
|
|
}
|
2026-02-21 09:53:31 -05:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
2026-02-22 18:04:52 -05:00
|
|
|
<div class="auth-page">
|
2026-03-01 15:13:27 -05:00
|
|
|
<!-- Fondo Decorativo -->
|
|
|
|
|
<div class="bg-decoration">
|
|
|
|
|
<div class="circle circle-1"></div>
|
|
|
|
|
<div class="circle circle-2"></div>
|
|
|
|
|
</div>
|
2026-02-22 18:04:52 -05:00
|
|
|
|
2026-03-01 15:13:27 -05:00
|
|
|
<!-- Contenido Principal -->
|
|
|
|
|
<div class="auth-container">
|
|
|
|
|
<!-- Botón Volver -->
|
|
|
|
|
<button @click="router.push('/')" class="back-btn">
|
2026-02-24 10:46:17 -05:00
|
|
|
<span class="material-icons">arrow_back</span>
|
2026-03-01 15:13:27 -05:00
|
|
|
<span>{{ t('auth.back') }}</span>
|
2026-02-24 10:46:17 -05:00
|
|
|
</button>
|
|
|
|
|
|
2026-02-22 18:04:52 -05:00
|
|
|
<div class="auth-card">
|
2026-03-01 15:13:27 -05:00
|
|
|
<!-- Header con Logo -->
|
|
|
|
|
<header class="auth-header">
|
|
|
|
|
<img src="@/assets/logo.png" alt="SIBU Logo" class="auth-logo" />
|
|
|
|
|
<p class="auth-subtitle">{{ t('auth.brandingSubtitle') }}</p>
|
|
|
|
|
</header>
|
|
|
|
|
|
|
|
|
|
<!-- Selector de Pestañas -->
|
|
|
|
|
<nav class="auth-tabs">
|
|
|
|
|
<button
|
|
|
|
|
class="tab-btn"
|
|
|
|
|
:class="{ active: isLogin }"
|
2026-02-22 18:04:52 -05:00
|
|
|
@click="isLogin = true"
|
|
|
|
|
>
|
2026-03-01 12:15:08 -05:00
|
|
|
{{ t('auth.loginTab') }}
|
2026-02-22 18:04:52 -05:00
|
|
|
</button>
|
2026-03-01 15:13:27 -05:00
|
|
|
<button
|
|
|
|
|
class="tab-btn"
|
|
|
|
|
:class="{ active: !isLogin }"
|
2026-02-22 18:04:52 -05:00
|
|
|
@click="isLogin = false"
|
|
|
|
|
>
|
2026-03-01 12:15:08 -05:00
|
|
|
{{ t('auth.registerTab') }}
|
2026-02-22 18:04:52 -05:00
|
|
|
</button>
|
2026-03-01 15:13:27 -05:00
|
|
|
<div class="tab-indicator" :class="{ 'on-right': !isLogin }"></div>
|
|
|
|
|
</nav>
|
2026-02-22 15:31:02 -05:00
|
|
|
|
2026-03-01 15:13:27 -05:00
|
|
|
<!-- Contenido de Formularios -->
|
|
|
|
|
<div class="auth-body">
|
|
|
|
|
<div v-if="isLogin" class="form-wrapper">
|
2026-03-01 15:00:40 -05:00
|
|
|
<LoginForm @toggle="toggleAuth" />
|
|
|
|
|
</div>
|
2026-03-01 15:13:27 -05:00
|
|
|
<div v-else class="form-wrapper">
|
2026-03-01 15:00:40 -05:00
|
|
|
<RegisterForm @toggle="toggleAuth" @success="isLogin = true" />
|
|
|
|
|
</div>
|
2026-03-01 14:33:10 -05:00
|
|
|
</div>
|
2026-02-22 15:31:02 -05:00
|
|
|
|
2026-03-01 15:13:27 -05:00
|
|
|
<!-- Footer -->
|
|
|
|
|
<footer class="auth-footer">
|
|
|
|
|
<p>{{ t('auth.footer') }}</p>
|
|
|
|
|
</footer>
|
|
|
|
|
</div>
|
2026-02-21 09:53:31 -05:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
2026-02-22 18:04:52 -05:00
|
|
|
.auth-page {
|
|
|
|
|
min-height: 100vh;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
background: var(--bg-primary);
|
2026-03-01 15:13:27 -05:00
|
|
|
padding: 1rem;
|
2026-02-22 18:04:52 -05:00
|
|
|
position: relative;
|
|
|
|
|
overflow: hidden;
|
2026-02-21 09:53:31 -05:00
|
|
|
}
|
|
|
|
|
|
2026-03-01 15:13:27 -05:00
|
|
|
.bg-decoration {
|
2026-02-22 15:31:02 -05:00
|
|
|
position: absolute;
|
2026-03-01 15:13:27 -05:00
|
|
|
top: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|
right: 0;
|
|
|
|
|
bottom: 0;
|
|
|
|
|
z-index: 0;
|
2026-02-22 18:04:52 -05:00
|
|
|
pointer-events: none;
|
2026-02-21 09:53:31 -05:00
|
|
|
}
|
|
|
|
|
|
2026-03-01 15:13:27 -05:00
|
|
|
.circle {
|
|
|
|
|
position: absolute;
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
filter: blur(80px);
|
|
|
|
|
opacity: 0.15;
|
2026-02-21 09:53:31 -05:00
|
|
|
}
|
|
|
|
|
|
2026-03-01 15:13:27 -05:00
|
|
|
.circle-1 {
|
|
|
|
|
width: 400px;
|
|
|
|
|
height: 400px;
|
|
|
|
|
background: var(--active-color);
|
|
|
|
|
top: -100px;
|
|
|
|
|
right: -100px;
|
2026-02-21 09:53:31 -05:00
|
|
|
}
|
|
|
|
|
|
2026-03-01 15:13:27 -05:00
|
|
|
.circle-2 {
|
|
|
|
|
width: 300px;
|
|
|
|
|
height: 300px;
|
|
|
|
|
background: #3b82f6;
|
|
|
|
|
bottom: -50px;
|
|
|
|
|
left: -50px;
|
2026-02-22 18:04:52 -05:00
|
|
|
}
|
2026-02-22 15:31:02 -05:00
|
|
|
|
2026-03-01 15:13:27 -05:00
|
|
|
.auth-container {
|
|
|
|
|
width: 100%;
|
|
|
|
|
max-width: 420px;
|
|
|
|
|
position: relative;
|
|
|
|
|
z-index: 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.back-btn {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 0.5rem;
|
|
|
|
|
background: none;
|
|
|
|
|
border: none;
|
2026-02-22 18:04:52 -05:00
|
|
|
color: var(--text-secondary);
|
2026-03-01 15:13:27 -05:00
|
|
|
font-size: 0.9rem;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
margin-bottom: 1.5rem;
|
|
|
|
|
padding: 0.5rem;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
transition: all 0.2s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.back-btn:hover {
|
|
|
|
|
color: var(--text-primary);
|
|
|
|
|
background: rgba(255,255,255,0.05);
|
2026-02-21 09:53:31 -05:00
|
|
|
}
|
|
|
|
|
|
2026-02-22 18:04:52 -05:00
|
|
|
.auth-card {
|
|
|
|
|
background: var(--bg-secondary);
|
|
|
|
|
border: 1px solid var(--border-color);
|
2026-03-01 15:13:27 -05:00
|
|
|
border-radius: 2rem;
|
|
|
|
|
box-shadow: 0 20px 50px rgba(0,0,0,0.2);
|
2026-02-22 18:04:52 -05:00
|
|
|
overflow: hidden;
|
2026-03-01 15:13:27 -05:00
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
2026-02-21 09:53:31 -05:00
|
|
|
}
|
|
|
|
|
|
2026-03-01 15:13:27 -05:00
|
|
|
.auth-header {
|
|
|
|
|
padding: 2rem 2rem 1rem;
|
|
|
|
|
text-align: center;
|
2026-02-21 09:53:31 -05:00
|
|
|
}
|
|
|
|
|
|
2026-03-01 15:13:27 -05:00
|
|
|
.auth-logo {
|
|
|
|
|
height: 60px;
|
|
|
|
|
margin-bottom: 0.5rem;
|
2026-02-21 09:53:31 -05:00
|
|
|
}
|
|
|
|
|
|
2026-03-01 15:13:27 -05:00
|
|
|
.auth-subtitle {
|
|
|
|
|
font-size: 0.85rem;
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
color: var(--text-secondary);
|
|
|
|
|
text-transform: uppercase;
|
|
|
|
|
letter-spacing: 0.1em;
|
|
|
|
|
margin: 0;
|
2026-02-22 18:04:52 -05:00
|
|
|
}
|
|
|
|
|
|
2026-03-01 15:13:27 -05:00
|
|
|
.auth-tabs {
|
|
|
|
|
position: relative;
|
2026-02-24 20:52:11 -05:00
|
|
|
display: flex;
|
2026-03-01 15:13:27 -05:00
|
|
|
margin: 0 1.5rem;
|
|
|
|
|
background: var(--bg-primary);
|
|
|
|
|
padding: 0.35rem;
|
|
|
|
|
border-radius: 1rem;
|
|
|
|
|
border: 1px solid var(--border-color);
|
2026-02-24 20:52:11 -05:00
|
|
|
}
|
|
|
|
|
|
2026-03-01 15:13:27 -05:00
|
|
|
.tab-btn {
|
|
|
|
|
flex: 1;
|
|
|
|
|
padding: 0.75rem;
|
|
|
|
|
border: none;
|
|
|
|
|
background: none;
|
|
|
|
|
color: var(--text-secondary);
|
|
|
|
|
font-size: 0.85rem;
|
|
|
|
|
font-weight: 800;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
z-index: 1;
|
|
|
|
|
transition: color 0.3s;
|
2026-02-24 20:52:11 -05:00
|
|
|
}
|
|
|
|
|
|
2026-03-01 15:13:27 -05:00
|
|
|
.tab-btn.active {
|
|
|
|
|
color: #101820;
|
2026-02-22 18:04:52 -05:00
|
|
|
}
|
|
|
|
|
|
2026-03-01 15:13:27 -05:00
|
|
|
.tab-indicator {
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 0.35rem;
|
|
|
|
|
bottom: 0.35rem;
|
|
|
|
|
left: 0.35rem;
|
|
|
|
|
width: calc(50% - 0.35rem);
|
|
|
|
|
background: var(--active-color);
|
|
|
|
|
border-radius: 0.75rem;
|
|
|
|
|
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
2026-02-22 18:04:52 -05:00
|
|
|
}
|
|
|
|
|
|
2026-03-01 15:13:27 -05:00
|
|
|
.tab-indicator.on-right {
|
|
|
|
|
transform: translateX(100%);
|
2026-02-22 18:04:52 -05:00
|
|
|
}
|
|
|
|
|
|
2026-03-01 15:13:27 -05:00
|
|
|
.auth-body {
|
|
|
|
|
min-height: 200px;
|
2026-02-24 10:46:17 -05:00
|
|
|
}
|
|
|
|
|
|
2026-03-01 15:13:27 -05:00
|
|
|
.form-wrapper {
|
|
|
|
|
animation: fadeIn 0.4s ease-out;
|
2026-02-24 10:46:17 -05:00
|
|
|
}
|
|
|
|
|
|
2026-03-01 15:13:27 -05:00
|
|
|
@keyframes fadeIn {
|
|
|
|
|
from { opacity: 0; transform: translateY(10px); }
|
|
|
|
|
to { opacity: 1; transform: translateY(0); }
|
2026-02-24 10:46:17 -05:00
|
|
|
}
|
|
|
|
|
|
2026-02-22 18:04:52 -05:00
|
|
|
.auth-footer {
|
2026-03-01 15:13:27 -05:00
|
|
|
padding: 1.5rem;
|
2026-02-22 18:04:52 -05:00
|
|
|
text-align: center;
|
2026-03-01 15:13:27 -05:00
|
|
|
border-top: 1px solid var(--border-color);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.auth-footer p {
|
|
|
|
|
font-size: 0.75rem;
|
2026-02-22 18:04:52 -05:00
|
|
|
color: var(--text-secondary);
|
2026-03-01 15:13:27 -05:00
|
|
|
opacity: 0.6;
|
2026-02-22 18:04:52 -05:00
|
|
|
margin: 0;
|
2026-02-21 09:53:31 -05:00
|
|
|
}
|
|
|
|
|
</style>
|