fix(ui): center login on mobile, prevent viewport horizontal wiggle and widen desktop chat assistant (v3.8.42)
This commit is contained in:
@@ -433,11 +433,16 @@ body {
|
||||
======================================================= */
|
||||
.auth-wrapper {
|
||||
min-height: 100vh;
|
||||
min-height: 100dvh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 1.5rem;
|
||||
background: var(--app-bg);
|
||||
width: 100%;
|
||||
max-width: 100vw;
|
||||
overflow-x: hidden;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.auth-card {
|
||||
@@ -448,9 +453,32 @@ body {
|
||||
box-shadow: 0 16px 40px rgba(0, 0, 0, 0.1);
|
||||
max-width: 460px;
|
||||
width: 100%;
|
||||
margin: auto !important;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
transition: transform 0.25s ease, box-shadow 0.25s ease;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@media (max-width: 576px) {
|
||||
.auth-wrapper {
|
||||
min-height: 100vh !important;
|
||||
min-height: 100dvh !important;
|
||||
padding: 1rem 0.85rem !important;
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
justify-content: center !important;
|
||||
}
|
||||
.auth-card {
|
||||
margin: auto !important;
|
||||
width: 100% !important;
|
||||
max-width: 100% !important;
|
||||
border-left: 1px solid var(--card-border) !important;
|
||||
border-right: 1px solid var(--card-border) !important;
|
||||
border-top: 5px solid var(--brand-primary) !important;
|
||||
border-radius: 20px !important;
|
||||
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
|
||||
}
|
||||
}
|
||||
|
||||
[data-bs-theme="dark"] .auth-card {
|
||||
|
||||
@@ -66,14 +66,41 @@
|
||||
|
||||
function getWelcomeMessage(role, name) {
|
||||
const greeting = name ? `¡Hola, ${name}!` : '¡Hola!';
|
||||
if (role === 'admin') {
|
||||
return `${greeting} Soy **UdeCi**, tu tutor de Edu-Space para Administración y Gobierno del Sistema. ¿En qué te puedo ayudar hoy?`;
|
||||
} else if (role === 'bedelia') {
|
||||
return `${greeting} Soy **UdeCi**, tu asistente de soporte para Bedelía. Puedo orientarte en el circuito de 9 pasos, resolución de conflictos y reservas.`;
|
||||
} else if (role === 'docente') {
|
||||
return `${greeting} Soy **UdeCi**, tu tutor docente. Puedo orientarte sobre asignaciones de aulas, comisiones y el Libro de Calificaciones.`;
|
||||
return `## ${greeting}\n¿Cómo puedo ayudarte?`;
|
||||
}
|
||||
|
||||
function getDefaultOptions(role) {
|
||||
const r = (role || '').toLowerCase();
|
||||
if (r.includes('alumno') || r.includes('estudiante')) {
|
||||
return [
|
||||
"¿Dónde curso hoy y qué aula me toca?",
|
||||
"¿Cuáles son mis calificaciones y notas?",
|
||||
"¿Qué convenios y descuentos tengo vigentes?"
|
||||
];
|
||||
} else if (r.includes('docente') || r.includes('profesor') || r.includes('teacher')) {
|
||||
return [
|
||||
"¿Qué comisiones y horarios tengo asignados hoy?",
|
||||
"¿Cómo registro calificaciones en el acta?",
|
||||
"¿Cómo solicitar una nueva reserva de aula?"
|
||||
];
|
||||
} else if (r.includes('bedelia')) {
|
||||
return [
|
||||
"¿Cuáles son los 9 pasos del flujo de Bedelía?",
|
||||
"¿Cómo resuelvo un conflicto áulico o de aforo?",
|
||||
"¿Cómo agrego un nuevo convenio o beneficio?"
|
||||
];
|
||||
} else if (r.includes('recepcion')) {
|
||||
return [
|
||||
"¿Cómo verificar una credencial digital QR?",
|
||||
"¿Cómo buscar a un alumno por documento?",
|
||||
"¿Cómo consultar las clases presenciales de hoy?"
|
||||
];
|
||||
} else {
|
||||
return `${greeting} Soy **UdeCi**, tu tutor virtual de cursada. Puedo orientarte sobre aulas, horarios y notas. ¿En qué te puedo ayudar?`;
|
||||
return [
|
||||
"¿Cómo agrego un nuevo convenio comercial?",
|
||||
"¿Cómo funciona el escáner de recepción QR?",
|
||||
"¿Cómo optimizar aulas con el algoritmo genético?"
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,7 +197,19 @@
|
||||
if (options && options.length > 0) {
|
||||
optionsHtml = '<div class="ai-msg-options">';
|
||||
options.forEach(opt => {
|
||||
optionsHtml += `<button type="button" class="ai-option-btn" data-query="${opt}">${opt}</button>`;
|
||||
let iconClass = 'bi-chat-left-dots';
|
||||
const optLower = opt.toLowerCase();
|
||||
if (optLower.includes('aula') || optLower.includes('curso') || optLower.includes('donde') || optLower.includes('espacio')) iconClass = 'bi-door-closed';
|
||||
else if (optLower.includes('nota') || optLower.includes('calificaci') || optLower.includes('acta')) iconClass = 'bi-award';
|
||||
else if (optLower.includes('descuento') || optLower.includes('beneficio') || optLower.includes('convenio')) iconClass = 'bi-tag';
|
||||
else if (optLower.includes('reserva') || optLower.includes('horario') || optLower.includes('clase')) iconClass = 'bi-calendar3';
|
||||
else if (optLower.includes('qr') || optLower.includes('credencial') || optLower.includes('verificar') || optLower.includes('documento')) iconClass = 'bi-qr-code';
|
||||
else if (optLower.includes('paso') || optLower.includes('flujo') || optLower.includes('bedelia') || optLower.includes('genetico')) iconClass = 'bi-diagram-3';
|
||||
|
||||
optionsHtml += `<button type="button" class="ai-option-btn" data-query="${opt}">
|
||||
<i class="bi ${iconClass}"></i>
|
||||
<span class="flex-grow-1">${opt}</span>
|
||||
</button>`;
|
||||
});
|
||||
optionsHtml += '</div>';
|
||||
}
|
||||
@@ -459,16 +498,16 @@
|
||||
sessionStorage.removeItem(getStorageKey());
|
||||
const messagesContainer = document.getElementById('aiChatMessages');
|
||||
if (messagesContainer) messagesContainer.innerHTML = '';
|
||||
appendMessage('assistant', getWelcomeMessage(role, name), [], false);
|
||||
appendMessage('assistant', getWelcomeMessage(role, name), getDefaultOptions(role), false);
|
||||
});
|
||||
}
|
||||
|
||||
// Cargar historial previo o bienvenida
|
||||
// Cargar historial previo o bienvenida con sugerencias
|
||||
const history = loadHistory();
|
||||
if (history.length > 0) {
|
||||
history.forEach(msg => appendMessage(msg.role, msg.content, msg.options || [], false, msg.timeStr));
|
||||
} else {
|
||||
appendMessage('assistant', getWelcomeMessage(role, name), [], false);
|
||||
appendMessage('assistant', getWelcomeMessage(role, name), getDefaultOptions(role), false);
|
||||
}
|
||||
|
||||
// Atajo Enter en desktop
|
||||
|
||||
Reference in New Issue
Block a user