iiab-tools/apk/controller/app/src/main/assets/index.html

108 lines
3.9 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Safe Pocket Web</title>
<style>
/* Reseteo básico y fondo */
body {
margin: 0; padding: 0;
background-color: #F4F7F6;
font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
min-height: 100vh;
display: flex; flex-direction: column;
justify-content: center; align-items: center;
}
/* Contenedor de botones */
.menu-container {
width: 80%; display: flex;
flex-direction: column; gap: 20px;
}
/* Estilo de los botones */
.btn {
display: flex; align-items: center; justify-content: center;
padding: 18px; border-radius: 14px; text-decoration: none;
font-size: 20px; font-weight: bold;
box-shadow: 0 4px 10px rgba(0,0,0,0.15);
transition: transform 0.1s, box-shadow 0.1s;
}
.btn:active { transform: scale(0.96); box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
/* Colores */
.btn-books { background-color: #00BCD4; color: #FFFFFF; }
.btn-kiwix { background-color: #FF9800; color: #FFFFFF; }
.btn-kolibri { background-color: #FFD54F; color: #333333; }
.btn-maps { background-color: #4CAF50; color: #FFFFFF; }
.btn-matomo { background-color: #1976D2; color: #FFFFFF; }
.btn span { margin-right: 12px; font-size: 26px; }
/* --- NUEVO: ESTILOS DEL SPINNER Y OVERLAY --- */
#loadingOverlay {
display: none; /* Oculto por defecto */
position: fixed; top: 0; left: 0; width: 100%; height: 100%;
background-color: rgba(244, 247, 246, 0.85); /* Fondo difuminado */
z-index: 9999; /* Por encima de todo */
flex-direction: column; justify-content: center; align-items: center;
}
.spinner {
width: 50px; height: 50px;
border: 6px solid #E0E0E0;
border-top: 6px solid #1976D2; /* Azul elegante */
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.loading-text {
margin-top: 15px; font-size: 18px; font-weight: bold; color: #333;
}
</style>
</head>
<body>
<div id="loadingOverlay">
<div class="spinner"></div>
<div class="loading-text" id="loadingText">Cargando...</div>
</div>
<div class="menu-container">
<a href="http://box/books" class="btn btn-books"><span>📖</span> Books</a>
<a href="http://box/kiwix" class="btn btn-kiwix"><span>🥝</span> Kiwix</a>
<a href="http://box/kolibri" class="btn btn-kolibri"><span>📚</span> Kolibri</a>
<a href="http://box/maps" class="btn btn-maps"><span>🗺️</span> Maps</a>
<a href="http://box/matomo" class="btn btn-matomo"><span>📊</span> Matomo</a>
</div>
<script>
const overlay = document.getElementById('loadingOverlay');
const textLabel = document.getElementById('loadingText');
const buttons = document.querySelectorAll('.btn');
// 1. Mostrar el spinner al hacer clic
buttons.forEach(btn => {
btn.addEventListener('click', function(e) {
// Extraemos el texto del botón (ej. "Kolibri") para hacerlo personalizado
const appName = this.innerText.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]|\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F]/g, '').trim();
textLabel.innerText = 'Abriendo ' + appName + '...';
// Mostramos la pantalla de carga
overlay.style.display = 'flex';
});
});
// 2. Ocultar el spinner si el usuario regresa con el botón "Atrás"
window.addEventListener('pageshow', function(event) {
overlay.style.display = 'none';
});
</script>
</body>
</html>