Design: Combine CodePen 4-flap pocket geometry with majestic slide-out animation

This commit is contained in:
kobold-ai
2026-09-21 19:50:44 +02:00
parent 8c4768747b
commit ea5bc12e21
4 changed files with 305 additions and 272 deletions
+4
View File
@@ -251,10 +251,12 @@ function saveRecentQuestions(ids) {
function breakSealAndOpenLetter() {
const envelope = document.getElementById("envelope");
const scene = document.getElementById("envelopeScene");
if (!envelope || envelope.classList.contains("envelope-opened")) return;
playSound('magic');
envelope.classList.add("envelope-opened");
if (scene) scene.classList.add("envelope-opened");
// Start background music if enabled or first click
const bgm = document.getElementById("bgm");
@@ -289,9 +291,11 @@ function breakSealAndOpenLetter() {
function closeLetter() {
const envelope = document.getElementById("envelope");
const scene = document.getElementById("envelopeScene");
if (!envelope) return;
envelope.classList.remove("envelope-opened");
if (scene) scene.classList.remove("envelope-opened");
const breakSealBtn = document.getElementById("breakSealBtn");
const startBtn = document.getElementById("startBtn");