Cambios implementados: 1. Nginx: - gzip on (compresión JS/CSS/JSON) - Cache headers para assets estáticos (6M) - Proxy buffer tuning (10s connect, 30s read) 2. Frontend catalog.js: - Reemplazados 8x innerHTML += en loops por map+join - Event delegation en breadcrumb y cart (elimina memory leak) - AbortController en apiFetch (evita race conditions) - sessionStorage cache para years-all y brands por modo 3. Frontend templates HTML: - defer en todos los scripts POS (mejora First Paint) 4. Dashboard JS: - innerHTML += fix en dashboard.js y cuentas.js 5. Base de datos: - Índice parcial idx_wi_part_stock_positive en warehouse_inventory 6. Documentación: - docs/performance_audit_2026.md con análisis completo y roadmap Tests: 73/73 pasando (compat + fase3 + fase5 + fase6)
1371 lines
42 KiB
HTML
1371 lines
42 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="es" data-theme="industrial">
|
|
<head>
|
|
<script>/*pos_theme_early*/(function(){var t=localStorage.getItem("pos_theme")||"industrial";document.documentElement.setAttribute("data-theme",t);})()</script>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>Nexus Autoparts — Iniciar Sesión</title>
|
|
<link rel="stylesheet" href="/pos/static/css/tokens.css" />
|
|
<link rel="stylesheet" href="/pos/static/css/pos-glass.css" />
|
|
<link rel="manifest" href="/pos/static/pwa/manifest.json" />
|
|
<meta name="theme-color" content="#F5A623" />
|
|
<style>
|
|
|
|
/* =====================================================================
|
|
RESET & BASE
|
|
===================================================================== */
|
|
|
|
*, *::before, *::after {
|
|
box-sizing: border-box;
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
html, body {
|
|
height: 100%;
|
|
}
|
|
|
|
body {
|
|
font-family: var(--font-body);
|
|
font-size: var(--text-body);
|
|
color: var(--color-text-primary);
|
|
background-color: var(--color-bg-base);
|
|
transition: background-color var(--duration-slow) var(--ease-in-out),
|
|
color var(--duration-slow) var(--ease-in-out);
|
|
min-height: 100vh;
|
|
}
|
|
|
|
/* Modern theme dot-grid on body */
|
|
[data-theme="modern"] body,
|
|
[data-theme="modern"].theme-root {
|
|
background-image: radial-gradient(
|
|
circle,
|
|
var(--dot-grid-color) 1px,
|
|
transparent 1px
|
|
);
|
|
background-size: var(--dot-grid-size) var(--dot-grid-size);
|
|
}
|
|
|
|
button {
|
|
cursor: pointer;
|
|
border: none;
|
|
background: none;
|
|
font-family: inherit;
|
|
}
|
|
|
|
/* =====================================================================
|
|
THEME SWITCHER BAR (sticky top)
|
|
===================================================================== */
|
|
|
|
.theme-bar {
|
|
position: sticky;
|
|
top: 0;
|
|
z-index: var(--z-sticky);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: flex-end;
|
|
gap: var(--space-2);
|
|
padding: var(--space-2) var(--space-6);
|
|
background-color: var(--color-bg-elevated);
|
|
border-bottom: 1px solid var(--color-border);
|
|
box-shadow: var(--shadow-sm);
|
|
transition: background-color var(--duration-slow) var(--ease-in-out),
|
|
border-color var(--duration-slow) var(--ease-in-out);
|
|
}
|
|
|
|
.theme-bar__label {
|
|
font-size: var(--text-caption);
|
|
font-weight: var(--font-weight-semibold);
|
|
letter-spacing: var(--tracking-widest);
|
|
text-transform: uppercase;
|
|
color: var(--color-text-muted);
|
|
margin-right: var(--space-2);
|
|
}
|
|
|
|
.theme-btn {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--space-2);
|
|
padding: var(--space-2) var(--space-4);
|
|
border-radius: var(--radius-full);
|
|
font-size: var(--text-body-sm);
|
|
font-weight: var(--font-weight-semibold);
|
|
color: var(--color-text-secondary);
|
|
border: 1.5px solid var(--color-border);
|
|
background: transparent;
|
|
transition: var(--transition-normal);
|
|
letter-spacing: var(--tracking-wide);
|
|
}
|
|
|
|
.theme-btn:hover {
|
|
color: var(--color-primary);
|
|
border-color: var(--color-primary);
|
|
background: var(--color-primary-muted);
|
|
}
|
|
|
|
.theme-btn.active {
|
|
color: var(--color-text-inverse);
|
|
background: var(--color-primary);
|
|
border-color: var(--color-primary);
|
|
}
|
|
|
|
[data-theme="industrial"] .theme-btn.active {
|
|
color: #000;
|
|
}
|
|
|
|
.theme-btn__dot {
|
|
width: 8px;
|
|
height: 8px;
|
|
border-radius: 50%;
|
|
background: currentColor;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.theme-btn[data-theme-target="industrial"] .theme-btn__dot {
|
|
background: #F5A623;
|
|
}
|
|
|
|
.theme-btn[data-theme-target="industrial"].active .theme-btn__dot {
|
|
background: #000;
|
|
}
|
|
|
|
.theme-btn[data-theme-target="modern"] .theme-btn__dot {
|
|
background: #FF6B35;
|
|
}
|
|
|
|
.theme-btn[data-theme-target="modern"].active .theme-btn__dot {
|
|
background: #fff;
|
|
}
|
|
|
|
/* =====================================================================
|
|
LAYOUT — centered login screen
|
|
===================================================================== */
|
|
|
|
.login-screen {
|
|
min-height: calc(100vh - 49px); /* subtract theme bar height */
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: var(--space-8) var(--space-4);
|
|
}
|
|
|
|
/* =====================================================================
|
|
LOGIN CARD
|
|
===================================================================== */
|
|
|
|
.login-card {
|
|
width: 100%;
|
|
max-width: 480px;
|
|
background: var(--color-bg-elevated);
|
|
border: 1px solid var(--color-border);
|
|
box-shadow: var(--shadow-xl);
|
|
overflow: hidden;
|
|
transition: background-color var(--duration-slow) var(--ease-in-out),
|
|
border-color var(--duration-slow) var(--ease-in-out),
|
|
box-shadow var(--duration-slow) var(--ease-in-out);
|
|
}
|
|
|
|
/* Industrial theme: angular clip-path on the card */
|
|
[data-theme="industrial"] .login-card {
|
|
border-radius: 0;
|
|
clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
|
|
}
|
|
|
|
/* Modern theme: smooth rounded corners */
|
|
[data-theme="modern"] .login-card {
|
|
border-radius: var(--radius-xl);
|
|
}
|
|
|
|
/* =====================================================================
|
|
CARD HEADER — brand / logo
|
|
===================================================================== */
|
|
|
|
.card-header {
|
|
padding: var(--space-8) var(--space-8) var(--space-6);
|
|
text-align: center;
|
|
border-bottom: 1px solid var(--color-border);
|
|
position: relative;
|
|
overflow: hidden;
|
|
}
|
|
|
|
/* Industrial: amber accent bar at top of header */
|
|
[data-theme="industrial"] .card-header::before {
|
|
content: '';
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
height: 3px;
|
|
background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
|
|
}
|
|
|
|
/* Modern: subtle gradient wash */
|
|
[data-theme="modern"] .card-header {
|
|
background: linear-gradient(
|
|
135deg,
|
|
rgba(255, 107, 53, 0.04) 0%,
|
|
rgba(255, 107, 53, 0.01) 100%
|
|
);
|
|
}
|
|
|
|
.brand {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: var(--space-4);
|
|
}
|
|
|
|
.brand-logo {
|
|
width: 52px;
|
|
height: 52px;
|
|
background: var(--color-primary);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-family: var(--font-heading);
|
|
font-size: 1.75rem;
|
|
font-weight: var(--heading-weight-primary);
|
|
color: var(--color-text-inverse);
|
|
flex-shrink: 0;
|
|
transition: background var(--duration-normal) var(--ease-in-out);
|
|
}
|
|
|
|
[data-theme="industrial"] .brand-logo {
|
|
clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
|
|
border-radius: 0;
|
|
}
|
|
|
|
[data-theme="modern"] .brand-logo {
|
|
border-radius: var(--radius-md);
|
|
box-shadow: var(--shadow-md);
|
|
}
|
|
|
|
[data-theme="industrial"] .brand-logo {
|
|
color: #000;
|
|
}
|
|
|
|
.brand-text {
|
|
text-align: left;
|
|
}
|
|
|
|
.brand-name {
|
|
font-family: var(--font-heading);
|
|
font-size: var(--text-h4);
|
|
font-weight: var(--heading-weight-primary);
|
|
color: var(--color-text-primary);
|
|
letter-spacing: var(--heading-tracking-h4);
|
|
line-height: var(--leading-h4);
|
|
text-transform: uppercase;
|
|
}
|
|
|
|
[data-theme="industrial"] .brand-name {
|
|
letter-spacing: var(--tracking-wider);
|
|
}
|
|
|
|
.brand-sub {
|
|
font-family: var(--font-body);
|
|
font-size: var(--text-caption);
|
|
font-weight: var(--font-weight-semibold);
|
|
color: var(--color-text-accent);
|
|
letter-spacing: var(--tracking-widest);
|
|
text-transform: uppercase;
|
|
margin-top: var(--space-1);
|
|
}
|
|
|
|
/* =====================================================================
|
|
CARD BODY
|
|
===================================================================== */
|
|
|
|
.card-body {
|
|
padding: var(--space-6) var(--space-8);
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--space-6);
|
|
}
|
|
|
|
/* =====================================================================
|
|
SECTION LABEL
|
|
===================================================================== */
|
|
|
|
.section-label {
|
|
font-size: var(--text-caption);
|
|
font-weight: var(--font-weight-semibold);
|
|
letter-spacing: var(--tracking-widest);
|
|
text-transform: uppercase;
|
|
color: var(--color-text-muted);
|
|
margin-bottom: var(--space-3);
|
|
}
|
|
|
|
/* =====================================================================
|
|
USER SELECTION
|
|
===================================================================== */
|
|
|
|
.users-section {}
|
|
|
|
.users-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(3, 1fr);
|
|
gap: var(--space-3);
|
|
}
|
|
|
|
.user-avatar-btn {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
gap: var(--space-2);
|
|
padding: var(--space-3) var(--space-2);
|
|
background: var(--color-surface-1);
|
|
border: 1.5px solid var(--color-border);
|
|
cursor: pointer;
|
|
transition: var(--transition-normal);
|
|
position: relative;
|
|
}
|
|
|
|
[data-theme="industrial"] .user-avatar-btn {
|
|
border-radius: 0;
|
|
clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
|
|
}
|
|
|
|
[data-theme="modern"] .user-avatar-btn {
|
|
border-radius: var(--radius-lg);
|
|
}
|
|
|
|
.user-avatar-btn:hover {
|
|
border-color: var(--color-primary);
|
|
background: var(--color-primary-muted);
|
|
transform: translateY(-2px);
|
|
box-shadow: var(--shadow-md);
|
|
}
|
|
|
|
.user-avatar-btn.selected {
|
|
border-color: var(--color-primary);
|
|
background: var(--color-primary-muted);
|
|
box-shadow: var(--shadow-accent);
|
|
}
|
|
|
|
[data-theme="industrial"] .user-avatar-btn.selected {
|
|
background: rgba(245, 166, 35, 0.10);
|
|
}
|
|
|
|
.user-avatar-btn.selected .user-initials {
|
|
background: var(--color-primary);
|
|
color: var(--color-text-inverse);
|
|
}
|
|
|
|
[data-theme="industrial"] .user-avatar-btn.selected .user-initials {
|
|
color: #000;
|
|
}
|
|
|
|
/* Selected check indicator */
|
|
.user-avatar-btn.selected::after {
|
|
content: '✓';
|
|
position: absolute;
|
|
top: 4px;
|
|
right: 6px;
|
|
font-size: 10px;
|
|
font-weight: bold;
|
|
color: var(--color-primary);
|
|
line-height: 1;
|
|
}
|
|
|
|
.user-initials {
|
|
width: 44px;
|
|
height: 44px;
|
|
background: var(--color-surface-2);
|
|
border: 1.5px solid var(--color-border);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-family: var(--font-heading);
|
|
font-size: 0.9rem;
|
|
font-weight: var(--heading-weight-primary);
|
|
color: var(--color-text-secondary);
|
|
letter-spacing: var(--tracking-wide);
|
|
transition: var(--transition-normal);
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
[data-theme="industrial"] .user-initials {
|
|
border-radius: 0;
|
|
clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
|
|
}
|
|
|
|
[data-theme="modern"] .user-initials {
|
|
border-radius: var(--radius-full);
|
|
}
|
|
|
|
.user-name {
|
|
font-size: var(--text-caption);
|
|
font-weight: var(--font-weight-semibold);
|
|
color: var(--color-text-secondary);
|
|
text-align: center;
|
|
line-height: 1.3;
|
|
transition: color var(--duration-normal);
|
|
}
|
|
|
|
.user-avatar-btn.selected .user-name {
|
|
color: var(--color-text-accent);
|
|
}
|
|
|
|
.user-role {
|
|
font-size: 10px;
|
|
color: var(--color-text-muted);
|
|
text-align: center;
|
|
letter-spacing: var(--tracking-wide);
|
|
}
|
|
|
|
/* =====================================================================
|
|
PIN DISPLAY (dots)
|
|
===================================================================== */
|
|
|
|
.pin-section {}
|
|
|
|
.pin-display {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: var(--space-4);
|
|
padding: var(--space-4) var(--space-6);
|
|
background: var(--color-surface-2);
|
|
border: 1.5px solid var(--color-border);
|
|
margin-bottom: var(--space-4);
|
|
transition: border-color var(--duration-normal), box-shadow var(--duration-normal);
|
|
min-height: 64px;
|
|
}
|
|
|
|
[data-theme="industrial"] .pin-display {
|
|
border-radius: 0;
|
|
}
|
|
|
|
[data-theme="modern"] .pin-display {
|
|
border-radius: var(--radius-lg);
|
|
}
|
|
|
|
.pin-display.has-digits {
|
|
border-color: var(--color-border-accent);
|
|
}
|
|
|
|
.pin-display.error {
|
|
border-color: var(--color-error);
|
|
animation: pin-shake 0.4s var(--ease-in-out);
|
|
}
|
|
|
|
@keyframes pin-shake {
|
|
0%, 100% { transform: translateX(0); }
|
|
20% { transform: translateX(-8px); }
|
|
40% { transform: translateX(8px); }
|
|
60% { transform: translateX(-5px); }
|
|
80% { transform: translateX(5px); }
|
|
}
|
|
|
|
.pin-dot {
|
|
width: 14px;
|
|
height: 14px;
|
|
border-radius: 50%;
|
|
border: 2px solid var(--color-border-strong);
|
|
background: transparent;
|
|
transition: all var(--duration-fast) var(--ease-out);
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.pin-dot.filled {
|
|
background: var(--color-primary);
|
|
border-color: var(--color-primary);
|
|
transform: scale(1.1);
|
|
box-shadow: 0 0 8px var(--color-primary);
|
|
}
|
|
|
|
/* PIN placeholder text when no user selected */
|
|
.pin-placeholder {
|
|
font-size: var(--text-body-sm);
|
|
color: var(--color-text-muted);
|
|
font-style: italic;
|
|
}
|
|
|
|
/* =====================================================================
|
|
PIN PAD
|
|
===================================================================== */
|
|
|
|
.pin-pad {
|
|
display: grid;
|
|
grid-template-columns: repeat(3, 1fr);
|
|
gap: var(--space-3);
|
|
}
|
|
|
|
.pin-key {
|
|
position: relative;
|
|
padding: 0;
|
|
height: 64px;
|
|
background: var(--color-surface-2);
|
|
border: 1.5px solid var(--color-border);
|
|
font-family: var(--font-heading);
|
|
font-size: 1.5rem;
|
|
font-weight: var(--heading-weight-primary);
|
|
color: var(--color-text-primary);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
cursor: pointer;
|
|
transition: var(--transition-fast);
|
|
user-select: none;
|
|
-webkit-tap-highlight-color: transparent;
|
|
overflow: hidden;
|
|
}
|
|
|
|
[data-theme="industrial"] .pin-key {
|
|
border-radius: 0;
|
|
letter-spacing: var(--tracking-normal);
|
|
}
|
|
|
|
[data-theme="modern"] .pin-key {
|
|
border-radius: var(--radius-md);
|
|
letter-spacing: var(--tracking-snug);
|
|
}
|
|
|
|
.pin-key:hover {
|
|
background: var(--color-surface-3);
|
|
border-color: var(--color-border-strong);
|
|
transform: translateY(-1px);
|
|
box-shadow: var(--shadow-sm);
|
|
}
|
|
|
|
.pin-key:active {
|
|
transform: translateY(1px) scale(0.97);
|
|
box-shadow: none;
|
|
background: var(--color-primary-muted);
|
|
border-color: var(--color-primary);
|
|
}
|
|
|
|
/* Ripple effect */
|
|
.pin-key::after {
|
|
content: '';
|
|
position: absolute;
|
|
width: 100%;
|
|
height: 100%;
|
|
background: var(--color-primary);
|
|
opacity: 0;
|
|
border-radius: inherit;
|
|
transform: scale(0);
|
|
transition: transform 0.3s var(--ease-out), opacity 0.3s var(--ease-out);
|
|
}
|
|
|
|
.pin-key.ripple::after {
|
|
transform: scale(2.5);
|
|
opacity: 0.12;
|
|
}
|
|
|
|
/* Backspace key */
|
|
.pin-key--backspace {
|
|
font-size: 1.1rem;
|
|
color: var(--color-text-muted);
|
|
}
|
|
|
|
.pin-key--backspace:hover {
|
|
color: var(--color-error);
|
|
border-color: var(--color-error);
|
|
background: rgba(239, 68, 68, 0.06);
|
|
}
|
|
|
|
.pin-key--backspace:active {
|
|
border-color: var(--color-error);
|
|
background: rgba(239, 68, 68, 0.12);
|
|
}
|
|
|
|
/* Enter key */
|
|
.pin-key--enter {
|
|
background: var(--color-primary-muted);
|
|
border-color: var(--color-primary);
|
|
color: var(--color-primary);
|
|
font-size: 1rem;
|
|
font-weight: var(--font-weight-bold);
|
|
letter-spacing: var(--tracking-wide);
|
|
}
|
|
|
|
.pin-key--enter:hover {
|
|
background: var(--color-primary);
|
|
color: var(--color-text-inverse);
|
|
transform: translateY(-1px);
|
|
box-shadow: var(--shadow-md);
|
|
}
|
|
|
|
[data-theme="industrial"] .pin-key--enter:hover {
|
|
color: #000;
|
|
}
|
|
|
|
.pin-key--enter:active {
|
|
background: var(--color-primary-active, var(--color-primary));
|
|
color: var(--color-text-inverse);
|
|
transform: translateY(1px) scale(0.97);
|
|
}
|
|
|
|
/* =====================================================================
|
|
SUBMIT BUTTON
|
|
===================================================================== */
|
|
|
|
.btn-login {
|
|
width: 100%;
|
|
padding: var(--space-4) var(--space-6);
|
|
background: var(--btn-primary-bg);
|
|
color: var(--btn-primary-text);
|
|
border: 1.5px solid var(--btn-primary-border, transparent);
|
|
font-family: var(--font-heading);
|
|
font-size: var(--text-h5);
|
|
font-weight: var(--heading-weight-primary);
|
|
letter-spacing: var(--tracking-wider);
|
|
text-transform: uppercase;
|
|
cursor: pointer;
|
|
transition: var(--transition-normal);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: var(--space-3);
|
|
position: relative;
|
|
overflow: hidden;
|
|
}
|
|
|
|
[data-theme="industrial"] .btn-login {
|
|
border-radius: 0;
|
|
clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
|
|
}
|
|
|
|
[data-theme="modern"] .btn-login {
|
|
border-radius: var(--radius-lg);
|
|
box-shadow: var(--shadow-md);
|
|
}
|
|
|
|
.btn-login:hover:not(:disabled) {
|
|
background: var(--btn-primary-bg-hover);
|
|
transform: translateY(-2px);
|
|
box-shadow: var(--shadow-lg);
|
|
}
|
|
|
|
.btn-login:active:not(:disabled) {
|
|
background: var(--btn-primary-bg-active);
|
|
transform: translateY(0);
|
|
box-shadow: var(--shadow-sm);
|
|
}
|
|
|
|
.btn-login:disabled {
|
|
opacity: 0.45;
|
|
cursor: not-allowed;
|
|
transform: none;
|
|
}
|
|
|
|
.btn-login__icon {
|
|
font-size: 1.1rem;
|
|
line-height: 1;
|
|
}
|
|
|
|
/* =====================================================================
|
|
CARD FOOTER
|
|
===================================================================== */
|
|
|
|
.card-footer {
|
|
padding: var(--space-4) var(--space-8);
|
|
border-top: 1px solid var(--color-border);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: var(--space-4);
|
|
background: var(--color-surface-1);
|
|
transition: background-color var(--duration-slow) var(--ease-in-out),
|
|
border-color var(--duration-slow) var(--ease-in-out);
|
|
}
|
|
|
|
.footer-version {
|
|
font-size: var(--text-caption);
|
|
color: var(--color-text-muted);
|
|
letter-spacing: var(--tracking-wide);
|
|
font-family: var(--font-mono);
|
|
}
|
|
|
|
.footer-status {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--space-2);
|
|
font-size: var(--text-caption);
|
|
color: var(--color-text-muted);
|
|
}
|
|
|
|
.status-dot {
|
|
width: 6px;
|
|
height: 6px;
|
|
border-radius: 50%;
|
|
background: var(--color-success);
|
|
animation: status-pulse 2.5s infinite ease-in-out;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
@keyframes status-pulse {
|
|
0%, 100% { opacity: 1; transform: scale(1); }
|
|
50% { opacity: 0.5; transform: scale(0.85); }
|
|
}
|
|
|
|
/* =====================================================================
|
|
INDUSTRIAL THEME EXTRAS — accent border line on card
|
|
===================================================================== */
|
|
|
|
[data-theme="industrial"] .login-card {
|
|
border-color: #2a2a2a;
|
|
position: relative;
|
|
}
|
|
|
|
[data-theme="industrial"] .login-card::before {
|
|
content: '';
|
|
position: absolute;
|
|
inset: 0;
|
|
pointer-events: none;
|
|
/* Simulated angular highlight on top-left edge */
|
|
border-top: 1px solid rgba(245, 166, 35, 0.15);
|
|
border-left: 1px solid rgba(245, 166, 35, 0.08);
|
|
clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
|
|
z-index: 1;
|
|
}
|
|
|
|
/* =====================================================================
|
|
NOTIFICATION / TOAST for error feedback
|
|
===================================================================== */
|
|
|
|
.toast {
|
|
position: fixed;
|
|
bottom: var(--space-8);
|
|
left: 50%;
|
|
transform: translateX(-50%) translateY(120%);
|
|
background: var(--color-error);
|
|
color: #fff;
|
|
padding: var(--space-3) var(--space-6);
|
|
font-size: var(--text-body-sm);
|
|
font-weight: var(--font-weight-semibold);
|
|
border-radius: var(--radius-full);
|
|
box-shadow: var(--shadow-lg);
|
|
z-index: var(--z-toast);
|
|
transition: transform 0.3s var(--ease-out);
|
|
white-space: nowrap;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.toast.show {
|
|
transform: translateX(-50%) translateY(0);
|
|
}
|
|
|
|
/* =====================================================================
|
|
RESPONSIVE
|
|
===================================================================== */
|
|
|
|
@media (max-width: 640px) {
|
|
.theme-bar {
|
|
padding: var(--space-2) var(--space-4);
|
|
}
|
|
|
|
.theme-bar__label {
|
|
display: none;
|
|
}
|
|
|
|
.login-screen {
|
|
padding: var(--space-4) var(--space-3);
|
|
align-items: flex-start;
|
|
padding-top: var(--space-6);
|
|
}
|
|
|
|
.card-body {
|
|
padding: var(--space-5) var(--space-5);
|
|
gap: var(--space-5);
|
|
}
|
|
|
|
.card-header {
|
|
padding: var(--space-6) var(--space-5) var(--space-5);
|
|
}
|
|
|
|
.card-footer {
|
|
padding: var(--space-3) var(--space-5);
|
|
}
|
|
|
|
.brand-logo {
|
|
width: 44px;
|
|
height: 44px;
|
|
font-size: 1.4rem;
|
|
}
|
|
|
|
.brand-name {
|
|
font-size: 1.25rem;
|
|
}
|
|
|
|
.users-grid {
|
|
grid-template-columns: repeat(3, 1fr);
|
|
gap: var(--space-2);
|
|
}
|
|
|
|
.pin-key {
|
|
height: 56px;
|
|
font-size: 1.35rem;
|
|
}
|
|
|
|
.pin-dot {
|
|
width: 12px;
|
|
height: 12px;
|
|
}
|
|
}
|
|
|
|
@media (max-width: 360px) {
|
|
.users-grid {
|
|
grid-template-columns: repeat(3, 1fr);
|
|
}
|
|
|
|
.user-initials {
|
|
width: 36px;
|
|
height: 36px;
|
|
font-size: 0.75rem;
|
|
}
|
|
|
|
.pin-key {
|
|
height: 50px;
|
|
font-size: 1.2rem;
|
|
}
|
|
}
|
|
|
|
/* =====================================================================
|
|
ACCESSIBILITY
|
|
===================================================================== */
|
|
|
|
.pin-key:focus-visible,
|
|
.user-avatar-btn:focus-visible,
|
|
.theme-btn:focus-visible,
|
|
.btn-login:focus-visible {
|
|
outline: 2px solid var(--color-border-focus);
|
|
outline-offset: 3px;
|
|
}
|
|
|
|
@media (prefers-reduced-motion: reduce) {
|
|
*, *::before, *::after {
|
|
transition-duration: 0.01ms !important;
|
|
animation-duration: 0.01ms !important;
|
|
}
|
|
}
|
|
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<!-- =====================================================================
|
|
THEME SWITCHER BAR
|
|
===================================================================== -->
|
|
<div class="theme-bar" role="toolbar" aria-label="Selector de tema">
|
|
<span class="theme-bar__label">Tema</span>
|
|
<button
|
|
class="theme-btn active"
|
|
data-theme-target="industrial"
|
|
aria-pressed="true"
|
|
title="Tema Industrial (oscuro)"
|
|
>
|
|
<span class="theme-btn__dot" aria-hidden="true"></span>
|
|
Industrial
|
|
</button>
|
|
<button
|
|
class="theme-btn"
|
|
data-theme-target="modern"
|
|
aria-pressed="false"
|
|
title="Tema Moderno (claro)"
|
|
>
|
|
<span class="theme-btn__dot" aria-hidden="true"></span>
|
|
Moderno
|
|
</button>
|
|
</div>
|
|
|
|
<!-- =====================================================================
|
|
LOGIN SCREEN
|
|
===================================================================== -->
|
|
<main class="login-screen" role="main">
|
|
<div class="login-card" role="region" aria-label="Inicio de sesión">
|
|
|
|
<!-- CARD HEADER — Brand -->
|
|
<header class="card-header">
|
|
<div class="brand">
|
|
<div class="brand-logo" aria-hidden="true">N</div>
|
|
<div class="brand-text">
|
|
<div class="brand-name">Nexus Autoparts</div>
|
|
<div class="brand-sub">Sistema de Punto de Venta</div>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
|
|
<!-- CARD BODY -->
|
|
<div class="card-body">
|
|
|
|
<!-- USER SELECTION -->
|
|
<section class="users-section" aria-labelledby="users-label">
|
|
<div class="section-label" id="users-label">Seleccionar usuario</div>
|
|
<div class="users-grid" id="usersGrid" role="radiogroup" aria-label="Usuarios disponibles">
|
|
<!-- Employees loaded dynamically from API -->
|
|
<div style="text-align:center;padding:var(--space-4);color:var(--color-text-muted);">Cargando empleados...</div>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- PIN ENTRY -->
|
|
<section class="pin-section" aria-labelledby="pin-label">
|
|
<div class="section-label" id="pin-label">Ingresa tu PIN</div>
|
|
|
|
<!-- PIN Display dots -->
|
|
<div
|
|
class="pin-display"
|
|
role="status"
|
|
aria-live="polite"
|
|
aria-label="PIN ingresado"
|
|
id="pin-display"
|
|
>
|
|
<span class="pin-placeholder" id="pin-placeholder">Selecciona un usuario</span>
|
|
<span class="pin-dot" data-index="0" style="display:none;" aria-hidden="true"></span>
|
|
<span class="pin-dot" data-index="1" style="display:none;" aria-hidden="true"></span>
|
|
<span class="pin-dot" data-index="2" style="display:none;" aria-hidden="true"></span>
|
|
<span class="pin-dot" data-index="3" style="display:none;" aria-hidden="true"></span>
|
|
<span class="pin-dot" data-index="4" style="display:none;" aria-hidden="true"></span>
|
|
<span class="pin-dot" data-index="5" style="display:none;" aria-hidden="true"></span>
|
|
</div>
|
|
|
|
<!-- PIN Pad 3x4 -->
|
|
<div
|
|
class="pin-pad"
|
|
role="group"
|
|
aria-label="Teclado numérico"
|
|
id="pin-pad"
|
|
>
|
|
<!-- Row 1: 1 2 3 -->
|
|
<button class="pin-key" data-digit="1" aria-label="1" disabled>1</button>
|
|
<button class="pin-key" data-digit="2" aria-label="2" disabled>2</button>
|
|
<button class="pin-key" data-digit="3" aria-label="3" disabled>3</button>
|
|
|
|
<!-- Row 2: 4 5 6 -->
|
|
<button class="pin-key" data-digit="4" aria-label="4" disabled>4</button>
|
|
<button class="pin-key" data-digit="5" aria-label="5" disabled>5</button>
|
|
<button class="pin-key" data-digit="6" aria-label="6" disabled>6</button>
|
|
|
|
<!-- Row 3: 7 8 9 -->
|
|
<button class="pin-key" data-digit="7" aria-label="7" disabled>7</button>
|
|
<button class="pin-key" data-digit="8" aria-label="8" disabled>8</button>
|
|
<button class="pin-key" data-digit="9" aria-label="9" disabled>9</button>
|
|
|
|
<!-- Row 4: Backspace 0 Enter -->
|
|
<button class="pin-key pin-key--backspace" data-action="backspace" aria-label="Borrar último dígito" disabled>
|
|
⌫
|
|
</button>
|
|
<button class="pin-key" data-digit="0" aria-label="0" disabled>0</button>
|
|
<button class="pin-key pin-key--enter" data-action="enter" aria-label="Confirmar PIN" disabled>
|
|
↵
|
|
</button>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- SUBMIT BUTTON -->
|
|
<button class="btn-login" id="btn-login" disabled aria-label="Iniciar sesión">
|
|
<span class="btn-login__icon" aria-hidden="true">→</span>
|
|
Iniciar Sesión
|
|
</button>
|
|
|
|
</div><!-- /card-body -->
|
|
|
|
<!-- CARD FOOTER -->
|
|
<footer class="card-footer">
|
|
<span class="footer-version">v2.4.1 — 2026</span>
|
|
<span class="footer-status" aria-label="Sistema en línea">
|
|
<span class="status-dot" aria-hidden="true"></span>
|
|
Sistema en línea
|
|
</span>
|
|
</footer>
|
|
|
|
</div><!-- /login-card -->
|
|
</main>
|
|
|
|
<!-- Toast notification -->
|
|
<div class="toast" id="toast" role="alert" aria-live="assertive"></div>
|
|
|
|
<!-- =====================================================================
|
|
JAVASCRIPT
|
|
===================================================================== -->
|
|
<script>
|
|
'use strict';
|
|
|
|
/* ------------------------------------------------------------------
|
|
STATE
|
|
------------------------------------------------------------------ */
|
|
const state = {
|
|
selectedUser: null,
|
|
pin: [],
|
|
maxPinLength: 6,
|
|
};
|
|
|
|
/* ------------------------------------------------------------------
|
|
DOM REFS
|
|
------------------------------------------------------------------ */
|
|
const html = document.documentElement;
|
|
const themeBtns = document.querySelectorAll('.theme-btn');
|
|
const userBtns = document.querySelectorAll('.user-avatar-btn');
|
|
const pinDisplay = document.getElementById('pin-display');
|
|
const pinPlaceholder = document.getElementById('pin-placeholder');
|
|
const pinDots = document.querySelectorAll('.pin-dot');
|
|
const pinKeys = document.querySelectorAll('.pin-key');
|
|
const btnLogin = document.getElementById('btn-login');
|
|
const toast = document.getElementById('toast');
|
|
|
|
/* ------------------------------------------------------------------
|
|
THEME SWITCHER
|
|
------------------------------------------------------------------ */
|
|
themeBtns.forEach(btn => {
|
|
btn.addEventListener('click', () => {
|
|
const target = btn.dataset.themeTarget;
|
|
html.dataset.theme = target;
|
|
|
|
// Update button states
|
|
themeBtns.forEach(b => {
|
|
const isActive = b.dataset.themeTarget === target;
|
|
b.classList.toggle('active', isActive);
|
|
b.setAttribute('aria-pressed', isActive.toString());
|
|
});
|
|
|
|
// Body background for modern dot-grid
|
|
// Handled by [data-theme="modern"] body CSS rule
|
|
});
|
|
});
|
|
|
|
/* ------------------------------------------------------------------
|
|
USER SELECTION — handled dynamically in loadEmployees()
|
|
------------------------------------------------------------------ */
|
|
|
|
/* ------------------------------------------------------------------
|
|
PIN PAD LOGIC
|
|
------------------------------------------------------------------ */
|
|
function enablePinPad() {
|
|
pinKeys.forEach(k => {
|
|
k.disabled = false;
|
|
});
|
|
}
|
|
|
|
function disablePinPad() {
|
|
pinKeys.forEach(k => {
|
|
k.disabled = true;
|
|
});
|
|
}
|
|
|
|
pinKeys.forEach(key => {
|
|
key.addEventListener('click', () => {
|
|
if (!state.selectedUser) return;
|
|
|
|
const digit = key.dataset.digit;
|
|
const action = key.dataset.action;
|
|
|
|
if (digit !== undefined) {
|
|
handleDigit(digit, key);
|
|
} else if (action === 'backspace') {
|
|
handleBackspace();
|
|
} else if (action === 'enter') {
|
|
handleEnter();
|
|
}
|
|
});
|
|
});
|
|
|
|
function handleDigit(digit, keyEl) {
|
|
if (state.pin.length >= state.maxPinLength) return;
|
|
|
|
state.pin.push(digit);
|
|
triggerRipple(keyEl);
|
|
updatePinDisplay();
|
|
updateLoginButton();
|
|
}
|
|
|
|
function handleBackspace() {
|
|
if (state.pin.length === 0) return;
|
|
state.pin.pop();
|
|
updatePinDisplay();
|
|
updateLoginButton();
|
|
}
|
|
|
|
function handleEnter() {
|
|
if (state.pin.length === 0) {
|
|
showToast('Ingresa tu PIN para continuar');
|
|
shakePinDisplay();
|
|
return;
|
|
}
|
|
if (state.pin.length < 4) {
|
|
showToast('El PIN debe tener al menos 4 dígitos');
|
|
shakePinDisplay();
|
|
return;
|
|
}
|
|
triggerLogin();
|
|
}
|
|
|
|
/* ------------------------------------------------------------------
|
|
UPDATE PIN DISPLAY DOTS
|
|
------------------------------------------------------------------ */
|
|
function updatePinDisplay() {
|
|
const hasUser = !!state.selectedUser;
|
|
const pinLength = state.pin.length;
|
|
|
|
if (!hasUser) {
|
|
// Show placeholder, hide dots
|
|
pinPlaceholder.style.display = '';
|
|
pinDots.forEach(d => { d.style.display = 'none'; });
|
|
pinDisplay.classList.remove('has-digits', 'error');
|
|
return;
|
|
}
|
|
|
|
// Hide placeholder, show dots
|
|
pinPlaceholder.style.display = 'none';
|
|
pinDots.forEach((dot, i) => {
|
|
dot.style.display = '';
|
|
dot.classList.toggle('filled', i < pinLength);
|
|
});
|
|
|
|
pinDisplay.classList.toggle('has-digits', pinLength > 0);
|
|
}
|
|
|
|
/* ------------------------------------------------------------------
|
|
LOGIN BUTTON STATE
|
|
------------------------------------------------------------------ */
|
|
function updateLoginButton() {
|
|
const canLogin = state.selectedUser && state.pin.length >= 4;
|
|
btnLogin.disabled = !canLogin;
|
|
}
|
|
|
|
/* ------------------------------------------------------------------
|
|
TRIGGER LOGIN (demo)
|
|
------------------------------------------------------------------ */
|
|
// Tenant resolution: subdomain (server-side) > URL param > localStorage
|
|
var _serverTenantId = {{ tenant_id | default('null') | tojson }};
|
|
var _serverTenantName = {{ tenant_name | default('null') | tojson }};
|
|
var _serverSubdomain = {{ tenant_subdomain | default('null') | tojson }};
|
|
|
|
var tenantId = _serverTenantId
|
|
|| new URLSearchParams(window.location.search).get('tenant')
|
|
|| localStorage.getItem('pos_tenant_id')
|
|
|| '11'; // Default tenant — remove in production when multi-tenant selector exists
|
|
|
|
// Show business name from subdomain if available
|
|
if (_serverTenantName) {
|
|
var brandNameEl = document.querySelector('.brand-name');
|
|
var brandSubEl = document.querySelector('.brand-sub');
|
|
if (brandNameEl) brandNameEl.textContent = _serverTenantName;
|
|
if (brandSubEl) brandSubEl.textContent = 'Punto de Venta';
|
|
}
|
|
// Device ID (persistent)
|
|
var deviceId = localStorage.getItem('pos_device_id');
|
|
if (!deviceId) {
|
|
deviceId = 'dev-' + Date.now() + '-' + Math.random().toString(36).substr(2, 9);
|
|
localStorage.setItem('pos_device_id', deviceId);
|
|
}
|
|
|
|
// Auto-redirect if already logged in with valid token
|
|
(function checkExistingSession() {
|
|
var token = localStorage.getItem('pos_token');
|
|
if (token && tenantId) {
|
|
try {
|
|
var payload = JSON.parse(atob(token.split('.')[1]));
|
|
if (payload.exp * 1000 > Date.now() + 30000) {
|
|
window.location.href = '/pos/catalog';
|
|
return;
|
|
}
|
|
} catch(e) {}
|
|
localStorage.removeItem('pos_token');
|
|
}
|
|
})();
|
|
|
|
function triggerLogin() {
|
|
btnLogin.disabled = true;
|
|
btnLogin.innerHTML = '<span class="btn-login__icon" aria-hidden="true">⟳</span> Verificando…';
|
|
|
|
var enteredPin = state.pin.join('');
|
|
|
|
fetch('/pos/api/auth/login', {
|
|
method: 'POST',
|
|
headers: { 'Content-Type': 'application/json' },
|
|
body: JSON.stringify({
|
|
tenant_id: parseInt(tenantId),
|
|
pin: enteredPin,
|
|
device_id: deviceId
|
|
})
|
|
})
|
|
.then(function(res) { return res.json().then(function(d) { return { ok: res.ok, data: d }; }); })
|
|
.then(function(result) {
|
|
if (!result.ok) {
|
|
btnLogin.innerHTML = '<span class="btn-login__icon" aria-hidden="true">→</span> Iniciar Sesión';
|
|
btnLogin.disabled = false;
|
|
btnLogin.style.background = '';
|
|
showToast(result.data.error || 'PIN incorrecto');
|
|
shakePinDisplay();
|
|
setTimeout(function() {
|
|
state.pin = [];
|
|
updatePinDisplay();
|
|
updateLoginButton();
|
|
}, 600);
|
|
return;
|
|
}
|
|
// Success
|
|
localStorage.setItem('pos_token', result.data.token);
|
|
localStorage.setItem('pos_employee', JSON.stringify(result.data.employee));
|
|
localStorage.setItem('pos_tenant_id', tenantId);
|
|
|
|
btnLogin.innerHTML = '<span class="btn-login__icon" aria-hidden="true">✓</span> Bienvenido, ' + result.data.employee.name;
|
|
btnLogin.style.background = 'var(--color-success)';
|
|
showToast('¡Acceso concedido! Redirigiendo…');
|
|
|
|
setTimeout(function() {
|
|
window.location.href = '/pos/catalog';
|
|
}, 1000);
|
|
})
|
|
.catch(function() {
|
|
btnLogin.innerHTML = '<span class="btn-login__icon" aria-hidden="true">→</span> Iniciar Sesión';
|
|
btnLogin.disabled = false;
|
|
showToast('Error de conexión');
|
|
shakePinDisplay();
|
|
setTimeout(function() {
|
|
state.pin = [];
|
|
updatePinDisplay();
|
|
updateLoginButton();
|
|
}, 600);
|
|
});
|
|
}
|
|
|
|
function resetLoginState() {
|
|
state.selectedUser = null;
|
|
state.pin = [];
|
|
|
|
userBtns.forEach(b => {
|
|
b.classList.remove('selected');
|
|
b.setAttribute('aria-checked', 'false');
|
|
});
|
|
|
|
disablePinPad();
|
|
updatePinDisplay();
|
|
updateLoginButton();
|
|
|
|
btnLogin.innerHTML = '<span class="btn-login__icon" aria-hidden="true">→</span> Iniciar Sesión';
|
|
btnLogin.style.background = '';
|
|
}
|
|
|
|
/* ------------------------------------------------------------------
|
|
EFFECTS — shake, ripple, toast
|
|
------------------------------------------------------------------ */
|
|
function shakePinDisplay() {
|
|
pinDisplay.classList.remove('error');
|
|
// Force reflow for re-trigger
|
|
void pinDisplay.offsetWidth;
|
|
pinDisplay.classList.add('error');
|
|
pinDisplay.addEventListener('animationend', () => {
|
|
pinDisplay.classList.remove('error');
|
|
}, { once: true });
|
|
}
|
|
|
|
function triggerRipple(el) {
|
|
el.classList.remove('ripple');
|
|
void el.offsetWidth;
|
|
el.classList.add('ripple');
|
|
el.addEventListener('transitionend', () => {
|
|
el.classList.remove('ripple');
|
|
}, { once: true });
|
|
}
|
|
|
|
let toastTimer = null;
|
|
function showToast(message, duration = 2800) {
|
|
toast.textContent = message;
|
|
toast.classList.add('show');
|
|
clearTimeout(toastTimer);
|
|
toastTimer = setTimeout(() => {
|
|
toast.classList.remove('show');
|
|
}, duration);
|
|
}
|
|
|
|
/* ------------------------------------------------------------------
|
|
KEYBOARD SUPPORT
|
|
------------------------------------------------------------------ */
|
|
document.addEventListener('keydown', e => {
|
|
if (!state.selectedUser) return;
|
|
|
|
const digit = e.key;
|
|
if (/^[0-9]$/.test(digit)) {
|
|
const keyEl = document.querySelector(`.pin-key[data-digit="${digit}"]`);
|
|
handleDigit(digit, keyEl);
|
|
} else if (e.key === 'Backspace') {
|
|
handleBackspace();
|
|
} else if (e.key === 'Enter') {
|
|
handleEnter();
|
|
}
|
|
});
|
|
|
|
/* ------------------------------------------------------------------
|
|
LOAD REAL EMPLOYEES FROM API
|
|
------------------------------------------------------------------ */
|
|
function loadEmployees() {
|
|
if (!tenantId) {
|
|
document.getElementById('usersGrid').innerHTML = '<div style="text-align:center;padding:var(--space-4);color:var(--color-error);">No se especificó tenant. Agrega ?tenant=ID a la URL o usa un subdominio.</div>';
|
|
return;
|
|
}
|
|
// If subdomain is set, the server already knows the tenant — use /employees endpoint
|
|
var empUrl = _serverSubdomain
|
|
? '/pos/api/auth/employees'
|
|
: '/pos/api/auth/employees/' + tenantId;
|
|
fetch(empUrl)
|
|
.then(function(r) { return r.json(); })
|
|
.then(function(data) {
|
|
var grid = document.getElementById('usersGrid');
|
|
var employees = data.data || [];
|
|
if (!employees.length) {
|
|
grid.innerHTML = '<div style="text-align:center;padding:var(--space-4);color:var(--color-text-muted);">No hay empleados registrados.</div>';
|
|
return;
|
|
}
|
|
grid.innerHTML = '';
|
|
employees.forEach(function(emp) {
|
|
var btn = document.createElement('button');
|
|
btn.className = 'user-avatar-btn';
|
|
btn.setAttribute('data-user', emp.initials);
|
|
btn.setAttribute('data-name', emp.name);
|
|
btn.setAttribute('data-role', emp.role_label);
|
|
btn.setAttribute('role', 'radio');
|
|
btn.setAttribute('aria-checked', 'false');
|
|
btn.setAttribute('aria-label', emp.name + ', ' + emp.role_label);
|
|
btn.innerHTML = '<div class="user-initials" aria-hidden="true">' + emp.initials + '</div>'
|
|
+ '<div class="user-name">' + emp.name + '</div>'
|
|
+ '<div class="user-role">' + emp.role_label + '</div>';
|
|
btn.addEventListener('click', function() {
|
|
// Deselect all
|
|
grid.querySelectorAll('.user-avatar-btn').forEach(function(b) {
|
|
b.classList.remove('selected');
|
|
b.setAttribute('aria-checked', 'false');
|
|
});
|
|
// Select this one
|
|
btn.classList.add('selected');
|
|
btn.setAttribute('aria-checked', 'true');
|
|
state.selectedUser = emp.initials;
|
|
state.pin = [];
|
|
enablePinPad();
|
|
updatePinDisplay();
|
|
updateLoginButton();
|
|
});
|
|
grid.appendChild(btn);
|
|
});
|
|
|
|
// If only 1 employee, auto-select
|
|
if (employees.length === 1) {
|
|
grid.querySelector('.user-avatar-btn').click();
|
|
}
|
|
})
|
|
.catch(function() {
|
|
document.getElementById('usersGrid').innerHTML = '<div style="text-align:center;padding:var(--space-4);color:var(--color-error);">Error al cargar empleados.</div>';
|
|
});
|
|
}
|
|
|
|
/* ------------------------------------------------------------------
|
|
INIT
|
|
------------------------------------------------------------------ */
|
|
// Initial state: pin pad disabled, dots hidden
|
|
disablePinPad();
|
|
updatePinDisplay();
|
|
updateLoginButton();
|
|
// Load real employees
|
|
loadEmployees();
|
|
|
|
</script>
|
|
|
|
<script src="/pos/static/js/kiosk.js" defer></script>
|
|
<script src="/pos/static/js/sync-engine.js" defer></script>
|
|
<script>if('serviceWorker' in navigator){navigator.serviceWorker.register('/pos/sw.js',{scope:'/pos/'});}</script>
|
|
|
|
</body>
|
|
</html>
|