Feature: Restore closed antique envelope state with 3D flap opening and sliding letter reveal on seal break

This commit is contained in:
kobold-ai
2026-09-21 16:40:02 +02:00
parent 8d8018347c
commit 611a94ab43
4 changed files with 293 additions and 177 deletions
+11 -1
View File
@@ -15,6 +15,8 @@ const UI_TEXT = {
pageTitle: "✨ Magisches Hogwarts-Escape-Quiz ✨",
pageSubtitle: "10 knifflige Rätsel aus der Zauberwelt warten auf dich",
envelopeLetter: "Hogwarts-Schule für Hexerei und Zauberei",
envelopeRecipient: "An den ehrenwerten Zauberschüler",
envelopeLocation: "Auf dem Prüfungspfad • Schloss Hogwarts",
letterSchoolTitle: "Hogwarts-Schule für Hexerei und Zauberei",
letterHeadmaster: "Schulleiter: Albus Dumbledore<br><span>(Großhexenmeister, Träger des Merlin-Ordens Erster Klasse)</span>",
letterSalutation: "Liebe Hexe, lieber Zauberer,",
@@ -52,6 +54,8 @@ const UI_TEXT = {
pageTitle: "✨ Magical Hogwarts Escape Quiz ✨",
pageSubtitle: "10 tricky wizarding world puzzles await you",
envelopeLetter: "Hogwarts School of Witchcraft and Wizardry",
envelopeRecipient: "To the Esteemed Wizarding Student",
envelopeLocation: "On the Path of Trials • Hogwarts Castle",
letterSchoolTitle: "Hogwarts School of Witchcraft and Wizardry",
letterHeadmaster: "Headmaster: Albus Dumbledore<br><span>(Order of Merlin, First Class, Grand Sorc.)</span>",
letterSalutation: "Dear Witch or Wizard,",
@@ -163,9 +167,14 @@ function applyQuizTranslations(lang) {
const letterSignature = document.getElementById("letterSignature");
const letterSignTitle = document.getElementById("letterSignTitle");
const envelopeRecipient = document.getElementById("envelopeRecipient");
const envelopeLocation = document.getElementById("envelopeLocation");
if (pageTitle) pageTitle.innerText = t.pageTitle;
if (pageSubtitle) pageSubtitle.innerText = t.pageSubtitle;
if (envelopeLetter) envelopeLetter.innerText = t.envelopeLetter;
if (envelopeRecipient && t.envelopeRecipient) envelopeRecipient.innerText = t.envelopeRecipient;
if (envelopeLocation && t.envelopeLocation) envelopeLocation.innerText = t.envelopeLocation;
if (letterSchoolTitle && t.letterSchoolTitle) letterSchoolTitle.innerText = t.letterSchoolTitle;
if (letterHeadmaster && t.letterHeadmaster) letterHeadmaster.innerHTML = t.letterHeadmaster;
if (letterSalutation && t.letterSalutation) letterSalutation.innerText = t.letterSalutation;
@@ -252,6 +261,7 @@ async function startGame() {
startBtn.disabled = true;
startBtn.innerText = t.startBtnCasting;
envelope.classList.add("envelope-opened");
playSound('magic');
sessionQuestionIds = [];
// Start background music if enabled or first click
@@ -299,7 +309,7 @@ async function startGame() {
document.getElementById("gameCard").classList.remove("hidden");
startTimer();
renderQuestion(data);
}, 1100);
}, 1800);
} catch (err) {
alert(t.startError + err.message);