Files
WhoPays/public/index.html
T
2026-02-12 09:40:21 +01:00

119 lines
3.8 KiB
HTML

<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<link rel="icon" type="image/x-icon" href="icons/icon-192.png">
<!-- PWA Meta Tags -->
<link rel="manifest" href="/manifest.json" />
<meta name="theme-color" content="#ec4899" />
<meta name="mobile-web-app-capable" content="yes" />
<!-- iOS Specific -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="apple-mobile-web-app-title" content="WhoPays" />
<link rel="apple-touch-icon" href="/img/icon-192.png" />
<!-- Android Specific -->
<meta name="mobile-web-app-capable" content="yes" />
<title>Wer zahlt?</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="style.css" />
<style>
/* Preload images to prevent flickering */
body::after {
content: '';
position: absolute;
width: 0;
height: 0;
overflow: hidden;
z-index: -1;
background-image: url('img/a.png'), url('img/b.png'), url('img/bgA.jpg'), url('img/bgB.jpg');
}
/* Smooth background transitions */
body {
background-size: cover;
background-position: center;
transition: background-image 0.6s ease-in-out;
}
/* Hide content until loaded */
.loaded {
opacity: 1;
transition: opacity 0.3s ease-in;
}
.loading {
opacity: 0;
}
</style>
</head>
<body
class="flex flex-col items-center justify-center min-h-screen bg-gradient-to-br from-yellow-50 to-pink-50 text-gray-800 p-4"
>
<div class="text-center space-y-8 w-full max-w-md loading" id="mainContent">
<h1 class="text-4xl font-extrabold drop-shadow-sm tracking-tight">
Who pays?
</h1>
<div
id="statusBox"
class="flex flex-col items-center space-y-4 transition-all duration-500"
>
<img
id="personImg"
src="img/a.png"
alt="Person"
class="w-48 h-48 rounded-full shadow-md border-4 border-white object-cover transition-transform duration-500"
style="display: none;"
/>
<div
id="personName"
class="text-3xl font-semibold text-blue-800 transition-all duration-500"
>
Lädt ...
</div>
</div>
<!-- Reason Input Section -->
<div class="space-y-3">
<input
id="reasonInput"
type="text"
placeholder="Grund (optional) ..."
maxlength="100"
class="w-full px-4 py-3 rounded-xl border-2 border-gray-200 focus:border-pink-400 focus:outline-none text-center transition-all"
/>
<button
id="toggleButton"
class="w-full bg-green-500 hover:bg-green-600 text-white text-xl px-6 py-3 rounded-2xl shadow-md transition-all transform hover:scale-105 active:scale-95"
>
Switch 🔁
</button>
</div>
<!-- Last Reason Display -->
<div id="lastReasonBox" class="hidden bg-white/60 backdrop-blur-sm rounded-xl p-4 shadow-sm">
<p class="text-sm text-gray-600 mb-1">Letzter Grund:</p>
<p id="lastReasonText" class="text-lg font-medium text-gray-800"></p>
</div>
</div>
<script src="script.js"></script>
<script>
// Service Worker Registration
if ("serviceWorker" in navigator) {
navigator.serviceWorker.register("/service-worker.js")
.then(reg => console.log("✅ Service Worker registriert", reg.scope))
.catch(err => console.error("❌ SW Fehler:", err));
}
</script>
</body>
</html>