index.html

13.12 KB
11/12/2025 12:36
HTML
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Merry Christmas & Happy New Year</title>
    <link href="https://fonts.googleapis.com/css2?family=Mountains+of+Christmas:wght@700&family=Poppins:wght@300;400;600&display=swap" rel="stylesheet">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Poppins', sans-serif;
            background: linear-gradient(135deg, #0f292f, #1a3a4a);
            color: #fff;
            overflow: hidden;
            height: 100vh;
            position: relative;
        }

        .snow-container {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 1;
        }

        .snowflake {
            position: absolute;
            background: #fff;
            border-radius: 50%;
            opacity: 0.9;
            pointer-events: none;
            animation: fall linear infinite;
        }

        @keyframes fall {
            0% {
                transform: translateY(-100px) rotate(0deg);
            }
            100% {
                transform: translateY(calc(100vh + 100px)) rotate(360deg);
            }
        }

        .container {
            position: relative;
            z-index: 2;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100vh;
            text-align: center;
            padding: 2rem;
        }

        .header {
            margin-bottom: 2rem;
        }

        .title {
            font-family: 'Mountains of Christmas', cursive;
            font-size: 5rem;
            color: #ff4d4d;
            text-shadow: 0 0 20px rgba(255, 77, 77, 0.5);
            animation: glow 2s ease-in-out infinite alternate;
        }

        @keyframes glow {
            from {
                text-shadow: 0 0 20px rgba(255, 77, 77, 0.5);
            }
            to {
                text-shadow: 0 0 30px rgba(255, 215, 0, 0.8), 0 0 40px rgba(255, 77, 77, 0.6);
            }
        }

        .subtitle {
            font-size: 1.8rem;
            margin: 1rem 0;
            color: #ffd700;
            opacity: 0;
            transform: translateY(30px);
            animation: fadeUp 1s ease-out 0.5s forwards;
        }

        .message {
            font-size: 1.2rem;
            max-width: 800px;
            margin: 2rem auto;
            line-height: 1.8;
            opacity: 0;
            transform: translateY(30px);
            animation: fadeUp 1s ease-out 1s forwards;
        }

        @keyframes fadeUp {
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .countdown {
            display: flex;
            gap: 2rem;
            margin: 3rem 0;
            flex-wrap: wrap;
            justify-content: center;
        }

        .time-box {
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
            border-radius: 15px;
            padding: 1.5rem 2rem;
            min-width: 120px;
            text-align: center;
            border: 1px solid rgba(255, 255, 255, 0.2);
            opacity: 0;
            transform: scale(0.8);
            animation: popIn 0.6s ease-out forwards;
        }

        .time-box:nth-child(1) { animation-delay: 1.5s; }
        .time-box:nth-child(2) { animation-delay: 1.7s; }
        .time-box:nth-child(3) { animation-delay: 1.9s; }
        .time-box:nth-child(4) { animation-delay: 2.1s; }

        @keyframes popIn {
            to {
                opacity: 1;
                transform: scale(1);
            }
        }

        .number {
            font-size: 3rem;
            font-weight: 600;
            color: #ffd700;
            display: block;
        }

        .label {
            font-size: 0.9rem;
            text-transform: uppercase;
            letter-spacing: 2px;
            color: #ccc;
            margin-top: 0.5rem;
        }

        .tree {
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 300px;
            height: 400px;
            background: linear-gradient(135deg, #0a3d1a, #1a5f2a);
            clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
            z-index: 0;
            opacity: 0;
            animation: treeGrow 2s ease-out 0.3s forwards;
        }

        @keyframes treeGrow {
            from {
                opacity: 0;
                transform: translateX(-50%) scaleY(0);
            }
            to {
                opacity: 1;
                transform: translateX(-50%) scaleY(1);
            }
        }

        .ornament {
            position: absolute;
            width: 20px;
            height: 20px;
            background: radial-gradient(circle at 30% 30%, #fff, #ff4d4d);
            border-radius: 50%;
            animation: twinkle 1.5s infinite alternate;
        }

        @keyframes twinkle {
            from { opacity: 0.7; transform: scale(1); }
            to { opacity: 1; transform: scale(1.2); }
        }

        .star {
            position: absolute;
            top: -30px;
            left: 50%;
            transform: translateX(-50%);
            width: 60px;
            height: 60px;
            background: #ffd700;
            clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
            animation: starPulse 2s infinite;
        }

        @keyframes starPulse {
            0%, 100% { transform: translateX(-50%) scale(1); }
            50% { transform: translateX(-50%) scale(1.1); }
        }

        .btn {
            margin-top: 2rem;
            padding: 1rem 2.5rem;
            background: linear-gradient(45deg, #ff4d4d, #ff8c8c);
            border: none;
            border-radius: 50px;
            color: white;
            font-size: 1.1rem;
            font-weight: 600;
            cursor: pointer;
            box-shadow: 0 10px 20px rgba(255, 77, 77, 0.3);
            transition: all 0.3s ease;
            opacity: 0;
            transform: translateY(30px);
            animation: fadeUp 1s ease-out 2.5s forwards;
        }

        .btn:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 30px rgba(255, 77, 77, 0.4);
        }

        @media (max-width: 768px) {
            .title {
                font-size: 3.5rem;
            }
            .subtitle {
                font-size: 1.4rem;
            }
            .countdown {
                gap: 1rem;
            }
            .time-box {
                padding: 1rem 1.5rem;
                min-width: 90px;
            }
            .number {
                font-size: 2.2rem;
            }
        }
    </style>
</head>
<body>
    <div class="snow-container" id="snowContainer"></div>

    <div class="tree" id="tree">
        <div class="star"></div>
    </div>

    <div class="container">
        <div class="header">
            <h1 class="title">Merry Christmas</h1>
            <p class="subtitle">and Happy New Year 2026</p>
        </div>

        <p class="message">
            ขอให้เทศกาลแห่งความสุขนี้เต็มไปด้วยความอบอุ่น ความรัก และความหวังใหม่<br>
            สุขสันต์วันคริสต์มาส และสวัสดีปีใหม่
        </p>

        <div class="countdown" id="countdown">
            <div class="time-box">
                <span class="number" id="days">00</span>
                <span class="label">Days</span>
            </div>
            <div class="time-box">
                <span class="number" id="hours">00</span>
                <span class="label">Hours</span>
            </div>
            <div class="time-box">
                <span class="number" id="minutes">00</span>
                <span class="label">Minutes</span>
            </div>
            <div class="time-box">
                <span class="number" id="seconds">00</span>
                <span class="label">Seconds</span>
            </div>
        </div>

        <button class="btn" onclick="celebrate()">Celebrate Now!</button>
    </div>

    <script>
        const snowContainer = document.getElementById('snowContainer');
        const tree = document.getElementById('tree');
        const countdownElement = document.getElementById('countdown');

        function createSnowflake() {
            const snowflake = document.createElement('div');
            snowflake.classList.add('snowflake');

            const size = Math.random() * 5 + 3;
            snowflake.style.width = `${size}px`;
            snowflake.style.height = `${size}px`;

            snowflake.style.left = `${Math.random() * 100}%`;
            snowflake.style.animationDuration = `${Math.random() * 5 + 5}s`;
            snowflake.style.animationDelay = `${Math.random() * 5}s`;
            snowflake.style.opacity = Math.random() * 0.5 + 0.5;

            snowContainer.appendChild(snowflake);

            setTimeout(() => {
                snowflake.remove();
            }, 10000);
        }

        function createOrnaments() {
            const ornaments = [
                { top: '15%', left: '45%' },
                { top: '25%', left: '52%' },
                { top: '35%', left: '48%' },
                { top: '45%', left: '55%' },
                { top: '30%', left: '42%' },
                { top: '40%', left: '50%' }
            ];

            ornaments.forEach((pos, i) => {
                const ornament = document.createElement('div');
                ornament.classList.add('ornament');
                ornament.style.top = pos.top;
                ornament.style.left = pos.left;
                ornament.style.animationDelay = `${i * 0.3}s`;
                tree.appendChild(ornament);
            });
        }

        function updateCountdown() {
            const now = new Date();
            const nextYear = now.getFullYear() + 1;
            const newYear = new Date(`January 1, ${nextYear} 00:00:00`);

            const diff = newYear - now;

            if (diff <= 0) {
                document.getElementById('countdown').innerHTML = '<div class="time-box"><span class="number">Happy New Year!</span></div>';
                return;
            }

            const days = Math.floor(diff / (1000 * 60 * 60 * 24));
            const hours = Math.floor((diff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
            const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));
            const seconds = Math.floor((diff % (1000 * 60)) / 1000);

            document.getElementById('days').textContent = days.toString().padStart(2, '0');
            document.getElementById('hours').textContent = hours.toString().padStart(2, '0');
            document.getElementById('minutes').textContent = minutes.toString().padStart(2, '0');
            document.getElementById('seconds').textContent = seconds.toString().padStart(2, '0');
        }

        function celebrate() {
            const colors = ['#ff4d4d', '#ffd700', '#4dff4d', '#4d4dff', '#ff4dff'];
            for (let i = 0; i < 50; i++) {
                setTimeout(() => {
                    const firework = document.createElement('div');
                    firework.style.position = 'fixed';
                    firework.style.width = '6px';
                    firework.style.height = '6px';
                    firework.style.background = colors[Math.floor(Math.random() * colors.length)];
                    firework.style.borderRadius = '50%';
                    firework.style.left = `${Math.random() * 100}vw`;
                    firework.style.top = `${Math.random() * 50}vh`;
                    firework.style.zIndex = '10';
                    firework.style.boxShadow = `0 0 10px ${firework.style.background}`;
                    document.body.appendChild(firework);

                    setTimeout(() => firework.remove(), 1500);
                }, i * 50);
            }
        }

        // Initialize
        window.addEventListener('load', () => {
            setInterval(createSnowflake, 100);
            createOrnaments();
            updateCountdown();
            setInterval(updateCountdown, 1000);

            // Add some random stars in background
            for (let i = 0; i < 50; i++) {
                const star = document.createElement('div');
                star.style.position = 'absolute';
                star.style.width = '2px';
                star.style.height = '2px';
                star.style.background = '#fff';
                star.style.borderRadius = '50%';
                star.style.left = `${Math.random() * 100}%`;
                star.style.top = `${Math.random() * 50}%`;
                star.style.opacity = Math.random() * 0.8 + 0.2;
                star.style.animation = `twinkle ${Math.random() * 3 + 2}s infinite alternate`;
                document.body.appendChild(star);
            }
        });
    </script>
</body>
</html>