PWA Frabe angepasst + Namen farblich gemacht

This commit is contained in:
Honey committed 2026-02-12 12:40:14 +01:00
1 parent a6734c2c86
commit 279f910b3e
4 files changed
+12 -9

No files matched your search

+2 -2
View File
@@ -19,7 +19,7 @@
<!-- Android Specific --> <!-- Android Specific -->
<meta name="mobile-web-app-capable" content="yes" /> <meta name="mobile-web-app-capable" content="yes" />
<title>Wer zahlt?</title> <title>Who Pays?</title>
<script src="https://cdn.tailwindcss.com"></script> <script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="style.css" /> <link rel="stylesheet" href="style.css" />
@@ -74,7 +74,7 @@
/> />
<div <div
id="personName" id="personName"
class="text-3xl font-semibold text-blue-800 transition-all duration-500" class="text-3xl font-semibold transition-all duration-500"
> >
Lädt ... Lädt ...
</div> </div>
+4 -4
View File
@@ -1,12 +1,12 @@
{ {
"name": "Wer zahlt? - Who Pays", "name": "WhoPays? Who's turn is it",
"short_name": "WhoPays", "short_name": "WhoPays",
"description": "Entscheide spielerisch, wer zahlt", "description": "Battle on who's gonna pay.",
"start_url": "/", "start_url": "/",
"scope": "/", "scope": "/",
"display": "standalone", "display": "standalone",
"background_color": "#fef3c7", "background_color": "#5F9EA0",
"theme_color": "#ec4899", "theme_color": "#556B2F",
"orientation": "portrait-primary", "orientation": "portrait-primary",
"categories": ["utilities", "lifestyle"], "categories": ["utilities", "lifestyle"],
"icons": [ "icons": [
+4 -1
View File
@@ -66,6 +66,7 @@ function setBackgroundAndImage(person, animate = true) {
const file = person === "A" ? "img/a.png" : "img/b.png"; const file = person === "A" ? "img/a.png" : "img/b.png";
const label = person === "A" ? "Lumpia" : "Pierogi"; const label = person === "A" ? "Lumpia" : "Pierogi";
const bgImage = person === "A" ? "url('img/bgA.jpg')" : "url('img/bgB.jpg')"; const bgImage = person === "A" ? "url('img/bgA.jpg')" : "url('img/bgB.jpg')";
const nameColor = person === "A" ? "#2ecc71" : "#e74c3c"; // Grün für A, Rot für B
// Set background immediately (smooth transition via CSS) // Set background immediately (smooth transition via CSS)
document.body.style.backgroundImage = bgImage; document.body.style.backgroundImage = bgImage;
@@ -75,10 +76,11 @@ function setBackgroundAndImage(person, animate = true) {
if (animate) { if (animate) {
img.classList.add("rotate"); img.classList.add("rotate");
// Change image and name in the middle of rotation // Change image, name and color in the middle of rotation
setTimeout(() => { setTimeout(() => {
img.src = file; img.src = file;
nameEl.textContent = label; nameEl.textContent = label;
nameEl.style.color = nameColor;
}, 300); // Half of rotation duration }, 300); // Half of rotation duration
// Remove rotation class after animation // Remove rotation class after animation
@@ -89,6 +91,7 @@ function setBackgroundAndImage(person, animate = true) {
// First load - no animation // First load - no animation
img.src = file; img.src = file;
nameEl.textContent = label; nameEl.textContent = label;
nameEl.style.color = nameColor;
} }
} }
+2 -2
View File
@@ -39,8 +39,8 @@
} }
#personName { #personName {
will-change: opacity; will-change: opacity, color;
transition: opacity 0.3s ease; transition: opacity 0.3s ease, color 0.3s ease;
} }
/* Background transition */ /* Background transition */