<!DOCTYPE html>
<html lang="th">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Happy Birthday Mom ❤️</title>
<link href="https://fonts.googleapis.com/css2?family=Mitr:wght@300;400;500;600&family=Itim&display=swap" rel="stylesheet">
<style>
:root {
--bg-color: #ffe6f2;
--main-pink: #ff99cc;
--dark-pink: #ff66a3;
--soft-white: #fff0f5;
--text-color: #803d5c;
--shadow: 0 8px 20px rgba(255, 102, 163, 0.2);
}
 
* {
box-sizing: border-box;
user-select: none;
-webkit-user-select: none;
}
 
body {
margin: 0;
padding: 0;
font-family: 'Itim', 'Mitr', cursive, sans-serif;
background: linear-gradient(135deg, #ffe6f2 0%, #fff0f5 50%, #ffe0eb 100%);
color: var(--text-color);
overflow-x: hidden;
min-height: 100vh;
}
 
/* 🎀 UI Elements & Animations */
.bounce-btn {
background: linear-gradient(180deg, #ffb3d9, #ff66a3);
color: white;
border: 3px solid #ffffff;
padding: 12px 28px;
font-size: 1.2rem;
font-family: 'Mitr', sans-serif;
border-radius: 30px;
cursor: pointer;
box-shadow: var(--shadow);
transition: all 0.2s ease;
animation: pulse 2s infinite;
}
 
.bounce-btn:hover {
transform: scale(1.08);
background: linear-gradient(180deg, #ff80bf, #ff3385);
}
 
.bounce-btn:active {
transform: scale(0.95);
}
 
@keyframes pulse {
0%, 100% { transform: scale(1); }
50% { transform: scale(1.05); }
}
 
/* 🎁 1. หน้าเริ่มต้น (Gift) */
#screen-gift {
position: fixed;
inset: 0;
background: #ffe6f0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
z-index: 100;
}
 
.gift-box {
position: relative;
width: 140px;
height: 140px;
cursor: pointer;
animation: bounce 1.5s infinite alternate;
}
 
.gift-body {
width: 100%;
height: 100px;
background: #ff80bf;
position: absolute;
bottom: 0;
border-radius: 15px;
border: 4px solid #fff;
box-shadow: var(--shadow);
}
 
.gift-lid {
width: 110%;
height: 35px;
background: #ff4d94;
position: absolute;
top: 10px;
left: -5%;
border-radius: 10px;
border: 4px solid #fff;
transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
z-index: 2;
}
 
.gift-ribbon {
position: absolute;
width: 25px;
height: 100%;
background: #ffffff;
left: 50%;
transform: translateX(-50%);
}
 
.gift-bow {
position: absolute;
top: -20px;
left: 50%;
transform: translateX(-50%);
font-size: 40px;
z-index: 3;
}
 
.gift-box.open .gift-lid {
transform: translateY(-80px) rotate(-15deg);
}
 
/* 🌸 2. หน้าโหลด (Loading) */
#screen-loading {
position: fixed;
inset: 0;
background: rgba(255, 230, 242, 0.95);
display: none;
flex-direction: column;
justify-content: center;
align-items: center;
z-index: 90;
}
 
.cloud {
font-size: 60px;
animation: floatCloud 3s ease-in-out infinite alternate;
}
 
@keyframes floatCloud {
0% { transform: translateY(0px) scale(1); }
100% { transform: translateY(-20px) scale(1.1); }
}
 
.twinkle-star {
position: absolute;
animation: twinkle 1s infinite alternate;
}
 
@keyframes twinkle {
0% { opacity: 0.3; transform: scale(0.8); }
100% { opacity: 1; transform: scale(1.2); }
}
 
/* 🏠 หน้าหลัก Main Container */
#main-content {
display: none;
max-width: 800px;
margin: 0 auto;
padding: 20px;
padding-bottom: 100px;
}
 
/* 💌 3. จดหมาย */
.envelope-container {
background: #fff;
border-radius: 20px;
padding: 25px;
margin: 30px 0;
border: 3px dashed #ff99cc;
box-shadow: var(--shadow);
position: relative;
}
 
.letter-text {
font-size: 1.2rem;
line-height: 1.8;
color: #662244;
min-height: 120px;
white-space: pre-wrap;
}
 
/* 📸 4. รูปภาพ โพลารอยด์ */
.gallery {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 20px;
margin: 40px 0;
}
 
.polaroid {
background: white;
padding: 12px 12px 25px 12px;
border-radius: 10px;
box-shadow: var(--shadow);
cursor: pointer;
transition: transform 0.3s ease;
width: 180px;
text-align: center;
}
 
.polaroid:nth-child(odd) { transform: rotate(-3deg); }
.polaroid:nth-child(even) { transform: rotate(4deg); }
 
.polaroid:hover {
transform: scale(1.1) rotate(0deg) !important;
z-index: 10;
}
 
.polaroid img {
width: 100%;
height: 160px;
object-fit: cover;
border-radius: 6px;
}
 
.polaroid span {
display: block;
margin-top: 8px;
font-size: 0.95rem;
color: #803d5c;
}
 
/* 🎂 5. เค้กวันเกิด */
.cake-section {
text-align: center;
margin: 50px 0;
background: rgba(255, 255, 255, 0.6);
padding: 30px;
border-radius: 30px;
border: 2px solid #fff;
}
 
.cake {
position: relative;
width: 160px;
height: 100px;
background: #ffb3d9;
margin: 40px auto 20px;
border-radius: 20px 20px 0 0;
box-shadow: inset 0 10px 0 #ff80bf;
}
 
.cake::before {
content: '';
position: absolute;
top: -30px;
left: 15%;
width: 70%;
height: 30px;
background: #fff0f5;
border-radius: 15px 15px 0 0;
}
 
.candle {
position: absolute;
top: -60px;
left: 50%;
transform: translateX(-50%);
width: 14px;
height: 35px;
background: repeating-linear-gradient(45deg, #fff, #fff 5px, #ff4d94 5px, #ff4d94 10px);
border-radius: 4px;
}
 
.flame {
position: absolute;
top: -18px;
left: 50%;
transform: translateX(-50%);
width: 14px;
height: 20px;
background: #ff9900;
border-radius: 50% 50% 20% 20%;
box-shadow: 0 0 10px #ff9900;
animation: flicker 0.6s infinite alternate;
}
 
@keyframes flicker {
0% { transform: translateX(-50%) scale(1); }
100% { transform: translateX(-50%) scale(1.2); }
}
 
.flame.off {
display: none;
}
 
/* 🎈 6. เกมลูกโป่ง */
.balloon-game {
text-align: center;
margin: 40px 0;
}
 
.balloon-container {
display: flex;
justify-content: center;
gap: 15px;
margin-top: 20px;
flex-wrap: wrap;
}
 
.balloon {
font-size: 45px;
cursor: pointer;
transition: transform 0.1s ease;
animation: float 2s infinite alternate ease-in-out;
}
 
.balloon:nth-child(2) { animation-delay: 0.3s; }
.balloon:nth-child(3) { animation-delay: 0.6s; }
.balloon:nth-child(4) { animation-delay: 0.9s; }
 
@keyframes float {
0% { transform: translateY(0); }
100% { transform: translateY(-12px); }
}
 
.secret-msg {
display: none;
font-size: 1.8rem;
color: #ff0066;
margin-top: 20px;
animation: bounce 0.8s infinite alternate;
}
 
/* 💖 7. หัวใจลอยตามนิ้ว */
.floating-heart {
position: fixed;
pointer-events: none;
font-size: 24px;
animation: floatUpFade 1.2s forwards ease-out;
z-index: 9999;
}
 
@keyframes floatUpFade {
0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
100% { transform: translate(-50%, -120px) scale(1.3); opacity: 0; }
}
 
/* Modal รูปภาพ */
.modal {
display: none;
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.8);
z-index: 1000;
justify-content: center;
align-items: center;
}
 
.modal img {
max-width: 90%;
max-height: 80vh;
border-radius: 15px;
border: 5px solid white;
}
 
/* 🎁 9. เซอร์ไพรส์สุดท้าย Overlay */
#final-overlay {
display: none;
position: fixed;
inset: 0;
background: rgba(255, 204, 230, 0.95);
z-index: 10000;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
padding: 20px;
}
 
/* Floating Sanrio Elements Frame */
.decor-star { position: absolute; color: #ffcc00; font-size: 20px; }
</style>
</head>
<body>
 
<!-- 🎁 1. หน้าเริ่มต้น -->
<div id="screen-gift">
<h2 style="color: #ff4d94; margin-bottom: 30px;">🎀 มีของขวัญมาส่งให้คุณแม่ครับ 🎀</h2>
<div class="gift-box" id="giftBox" onclick="openGift()">
<div class="gift-bow">🎀</div>
<div class="gift-lid">
<div class="gift-ribbon"></div>
</div>
<div class="gift-body">
<div class="gift-ribbon"></div>
</div>
</div>
<p style="margin-top: 30px; color: #ff80bf;">(แตะที่กล่องของขวัญเพื่อเปิด)</p>
</div>
 
<!-- 🌸 2. หน้าโหลด -->
<div id="screen-loading">
<div class="cloud">☁️🎀☁️</div>
<h2 style="color: #ff66a3; margin-top: 20px;">กำลังเตรียมความรักให้คุณแม่...</h2>
<p style="color: #ff99cc;">✨ ✨ ✨</p>
</div>
 
<!-- 🏠 หน้าเนื้อหาหลัก -->
<div id="main-content">
 
<div style="text-align: center; margin-top: 20px;">
<span style="font-size: 3rem;">☁️🌸🎀🌸☁️</span>
<h1 style="color: #ff3385; font-size: 2.2rem; margin: 10px 0;">สุขสันต์วันเกิดครับคุณแม่</h1>
</div>
 
<!-- 💌 3. จดหมาย -->
<div class="envelope-container">
<div style="text-align: center; font-size: 30px; margin-bottom: 10px;">💌</div>
<div class="letter-text" id="typewriter"></div>
</div>
 
<!-- 📸 4. รูปภาพโพลารอยด์ -->
<h2 style="text-align: center; color: #ff4d94; margin-top: 40px;">📸 ความทรงจำแสนอบอุ่น</h2>
<div class="gallery">
<div class="polaroid" onclick="showModal('https://images.unsplash.com/photo-1544005313-94ddf0286df2?auto=format&fit=crop&w=600&q=80')">
<img src="https://images.unsplash.com/photo-1544005313-94ddf0286df2?auto=format&fit=crop&w=600&q=80" alt="Mom 1">
<span>คุณแม่คนเก่ง 💖</span>
</div>
<div class="polaroid" onclick="showModal('https://images.unsplash.com/photo-1511895426328-dc8714191300?auto=format&fit=crop&w=600&q=80')">
<img src="https://images.unsplash.com/photo-1511895426328-dc8714191300?auto=format&fit=crop&w=600&q=80" alt="Mom 2">
<span>รอยยิ้มของคุณแม่ 🌸</span>
</div>
<div class="polaroid" onclick="showModal('https://images.unsplash.com/photo-1516627145497-ae6968895b74?auto=format&fit=crop&w=600&q=80')">
<img src="https://images.unsplash.com/photo-1516627145497-ae6968895b74?auto=format&fit=crop&w=600&q=80" alt="Mom 3">
<span>ครอบครัวอบอุ่น ✨</span>
</div>
</div>
 
<!-- 🎂 5. เป่าเค้ก -->
<div class="cake-section">
<h2 style="color: #ff3385; margin: 0;">🎂 อธิษฐานแล้วเป่าเค้กนะคุณแม่</h2>
<div class="cake">
<div class="candle">
<div class="flame" id="flame"></div>
</div>
</div>
<div id="cake-status" style="font-size: 1.3rem; color: #ff66a3; margin: 15px 0;"> candle flame is burning... </div>
<button class="bounce-btn" onclick="blowCandle()">🌬️ กดเพื่อเป่าเทียน</button>
</div>
 
<!-- 🎈 6. เกมเล็ก ๆ -->
<div class="balloon-game">
<h3 style="color: #ff4d94;">🎈 จิ้มลูกโป่งให้ครบทุกใบเพื่อดูข้อความลับ 🎈</h3>
<div class="balloon-container" id="balloonContainer">
<span class="balloon" onclick="popBalloon(this)">🎈</span>
<span class="balloon" onclick="popBalloon(this)">🎈</span>
<span class="balloon" onclick="popBalloon(this)">🎈</span>
<span class="balloon" onclick="popBalloon(this)">🎈</span>
<span class="balloon" onclick="popBalloon(this)">🎈</span>
</div>
<div class="secret-msg" id="secretMsg">รักแม่ที่สุด ❤️✨</div>
</div>
 
<!-- 🎁 9. เซอร์ไพรส์สุดท้าย -->
<div style="text-align: center; margin: 60px 0 20px;">
<button class="bounce-btn" style="font-size: 1.4rem; padding: 15px 35px;" onclick="showFinalSurprise()">
กดตรงนี้นะคุณแม่ ❤️
</button>
</div>
 
</div>
 
<!-- Modal ขยายรูป -->
<div class="modal" id="imgModal" onclick="closeModal()">
<img id="modalImg" src="" alt="Enlarged">
</div>
 
<!-- 🎁 Overlay เซอร์ไพรส์สุดท้าย -->
<div id="final-overlay">
<h1 style="font-size: 2.5rem; color: #ff0066; margin-bottom: 20px; animation: bounce 1s infinite alternate;">
หนูรักแม่ที่สุด ขอบคุณที่อยู่กับหนูเสมอ ❤️
</h1>
<p style="font-size: 1.5rem; color: #ff66a3;">ขอให้คุณแม่มีความสุข มีสุขภาพร่างกายแข็งแรงทุกๆ วันครับ ✨🌸</p>
<button class="bounce-btn" style="margin-top: 30px;" onclick="closeFinalSurprise()">ปิดหน้าต่าง 🎀</button>
</div>
 
<script>
// --- Web Audio API เสียงสังเคราะห์ (ไม่ต้องใช้ไฟล์ MP3) ---
const AudioContext = window.AudioContext || window.webkitAudioContext;
let audioCtx;
 
function initAudio() {
if (!audioCtx) audioCtx = new AudioContext();
}
 
// เสียง "ป๊อป!" (Pop Sound)
function playPopSound() {
initAudio();
const osc = audioCtx.createOscillator();
const gain = audioCtx.createGain();
osc.type = 'sine';
osc.frequency.setValueAtTime(800, audioCtx.currentTime);
osc.frequency.exponentialRampToValueAtTime(100, audioCtx.currentTime + 0.1);
gain.gain.setValueAtTime(0.5, audioCtx.currentTime);
gain.gain.exponentialRampToValueAtTime(0.01, audioCtx.currentTime + 0.1);
osc.connect(gain);
gain.connect(audioCtx.destination);
osc.start();
osc.stop(audioCtx.currentTime + 0.1);
}
 
// เพลงบรรเลงเบาๆ สไตล์ Music Box
function playBackgroundMelody() {
initAudio();
const notes = [261.63, 329.63, 392.00, 523.25, 440.00, 349.23, 329.63, 293.66];
let step = 0;
setInterval(() => {
if (document.getElementById('main-content').style.display === 'block') {
const osc = audioCtx.createOscillator();
const gain = audioCtx.createGain();
osc.type = 'triangle';
osc.frequency.setValueAtTime(notes[step % notes.length], audioCtx.currentTime);
gain.gain.setValueAtTime(0.08, audioCtx.currentTime);
gain.gain.exponentialRampToValueAtTime(0.001, audioCtx.currentTime + 0.8);
osc.connect(gain);
gain.connect(audioCtx.destination);
osc.start();
osc.stop(audioCtx.currentTime + 0.8);
step++;
}
}, 600);
}
 
// 🎁 1. เปิดกล่องของขวัญ
function openGift() {
playPopSound();
const box = document.getElementById('giftBox');
box.classList.add('open');
 
// พลุหัวใจและกลีบดอกไม้
for (let i = 0; i < 30; i++) {
createParticle(window.innerWidth / 2, window.innerHeight / 2);
}
 
setTimeout(() => {
document.getElementById('screen-gift').style.display = 'none';
document.getElementById('screen-loading').style.display = 'flex';
playBackgroundMelody();
 
// 🌸 2. โหลด 2.5 วินาที
setTimeout(() => {
document.getElementById('screen-loading').style.display = 'none';
document.getElementById('main-content').style.display = 'block';
startTypewriter();
}, 2500);
}, 800);
}
 
// 💌 3. พิมพ์ข้อความจดหมายทีละตัว
const letterMessage = "ถึงคุณแม่ที่รักของหนู...🌸\n\nสุขสันต์วันเกิดนะครับคุณแม่ ขอบคุณสำหรับความรัก ความอบอุ่น และความเอาใจใส่ที่มีให้หนูมาตลอด ขอให้แม่มีความสุขมากๆ สุขภาพแข็งแรง ยิ้มเยอะๆ ในทุกๆ วัน หนูสัญญาว่าจะทำหน้าที่ของตัวเองให้ดีที่สุด และเป็นเด็กดีของคุณแม่เสมอครับ ❤️";
let letterIndex = 0;
 
function startTypewriter() {
const el = document.getElementById('typewriter');
if (letterIndex < letterMessage.length) {
el.textContent += letterMessage.charAt(letterIndex);
letterIndex++;
setTimeout(startTypewriter, 50);
}
}
 
// 📸 4. Modal ขยายรูป
function showModal(src) {
document.getElementById('modalImg').src = src;
document.getElementById('imgModal').style.display = 'flex';
}
function closeModal() {
document.getElementById('imgModal').style.display = 'none';
}
 
// 🎂 5. เป่าเค้ก
let candleBlown = false;
function blowCandle() {
if (candleBlown) return;
candleBlown = true;
playPopSound();
document.getElementById('flame').classList.add('off');
document.getElementById('cake-status').innerHTML = "🎉 Happy Birthday Mom 🎉";
// ปล่อยพลุฉลอง
for (let i = 0; i < 50; i++) {
setTimeout(() => {
createParticle(Math.random() * window.innerWidth, Math.random() * window.innerHeight);
}, i * 30);
}
}
 
// ตรวจจับเสียงไมโครโฟนสำหรับเป่าเค้ก (ถ้าเบราว์เซอร์รองรับ)
if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
navigator.mediaDevices.getUserMedia({ audio: true }).then(stream => {
const audioContext = new AudioContext();
const mic = audioContext.createMediaStreamSource(stream);
const analyser = audioContext.createAnalyser();
analyser.fftSize = 256;
mic.connect(analyser);
const dataArray = new Uint8Array(analyser.frequencyBinCount);
 
function checkBlow() {
analyser.getByteFrequencyData(dataArray);
let average = dataArray.reduce((a, b) => a + b) / dataArray.length;
if (average > 65) { // ค่าความดังจากการเป่า
blowCandle();
}
if (!candleBlown) requestAnimationFrame(checkBlow);
}
checkBlow();
}).catch(() => {
// หากไม่ได้รับอนุญาตใช้ Mic ให้กดปุ่มเป่าตามปกติ
});
}
 
// 🎈 6. เกมกดลูกโป่ง
let poppedCount = 0;
function popBalloon(element) {
if (element.style.visibility === 'hidden') return;
playPopSound();
element.style.visibility = 'hidden';
poppedCount++;
if (poppedCount >= 5) {
document.getElementById('secretMsg').style.display = 'block';
}
}
 
// 💖 7. หัวใจลอยตามนิ้ว/เคอร์เซอร์
function createHeart(x, y) {
const heart = document.createElement('div');
heart.className = 'floating-heart';
heart.innerHTML = ['💖', '🌸', '✨', '🎀', '💗'][Math.floor(Math.random() * 5)];
heart.style.left = x + 'px';
heart.style.top = y + 'px';
document.body.appendChild(heart);
setTimeout(() => heart.remove(), 1200);
}
 
window.addEventListener('mousemove', (e) => {
if (Math.random() < 0.15) createHeart(e.clientX, e.clientY);
});
 
window.addEventListener('touchmove', (e) => {
if (Math.random() < 0.2) createHeart(e.touches[0].clientX, e.touches[0].clientY);
});
 
// ฟังก์ชันสร้าง Particle สำหรับระเบิดความสุข
function createParticle(x, y) {
const p = document.createElement('div');
p.className = 'floating-heart';
p.innerHTML = ['💖', '🌸', '✨', '🎉', '💛', '🎀'][Math.floor(Math.random() * 6)];
p.style.left = x + 'px';
p.style.top = y + 'px';
p.style.fontSize = (Math.random() * 20 + 20) + 'px';
document.body.appendChild(p);
setTimeout(() => p.remove(), 1500);
}
 
// 🎁 9. เซอร์ไพรส์สุดท้าย
function showFinalSurprise() {
playPopSound();
document.getElementById('final-overlay').style.display = 'flex';
// ปล่อยหัวใจเต็มหน้าจอ
for (let i = 0; i < 40; i++) {
setTimeout(() => {
createParticle(Math.random() * window.innerWidth, Math.random() * window.innerHeight);
}, i * 40);
}
}
 
function closeFinalSurprise() {
document.getElementById('final-overlay').style.display = 'none';
}
</script>
</body>
</html>