Elementor Countdown to Christmas

Today, we’re making a stunning Christmas countdown timer. This festive countdown creates excitement with its falling snowflakes and vibrant design. Visitors feel the holiday spirit instantly, captivated by the smooth animations.

We will use Elementor free version. No Elementor pro. No extra plugins. Just clean HTML with CSS and JavaScript. It is also fully responsive. So feel free to use it on your landing page.

no elementor pro - no extra plugins

The timer ticks down dynamically, building anticipation for Christmas. It’s a visual treat that leaves a joyful impression. You can place it in your hero section for maximum impact or add it to your e-commerce page to boost holiday sales.

🎄 Countdown to Christmas! 🎄

00

days

00

hours

00

minutes

00

seconds

Here are the steps to integrate it into your Elementor website:

  1. Create three HTML blocks.
  2. Paste the separate codes in each block.

HTML

<div class="wputopia-countdown-wrapper">
    <h1 class="wputopia-title">🎄 Countdown to Christmas! 🎄</h1>

    <div class="wputopia-countdown-container">
        <div class="wputopia-time">
            <h1 class="wputopia-number" id="wputopia-days">00</h1>
            <small class="wputopia-label">days</small>
        </div>
        <div class="wputopia-time">
            <h1 class="wputopia-number" id="wputopia-hours">00</h1>
            <small class="wputopia-label">hours</small>
        </div>
        <div class="wputopia-time">
            <h1 class="wputopia-number" id="wputopia-minutes">00</h1>
            <small class="wputopia-label">minutes</small>
        </div>
        <div class="wputopia-time">
            <h1 class="wputopia-number" id="wputopia-seconds">00</h1>
            <small class="wputopia-label">seconds</small>
        </div>
    </div>
</div>

CSS

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
   <style>
        @import url('https://fonts.googleapis.com/css?family=Muli&display=swap');

        .wputopia-countdown-wrapper {
            color: #fff;
            text-align: center;
            font-family: 'Muli', sans-serif;
            background:#323975;
            padding: 25px 0;
            width: 100%;
            min-height: 300px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            position: relative;
            overflow: hidden;
        }

        .wputopia-snowflake {
            color: #fff;
            position: absolute;
            top: -20px;
            animation: wputopia-fall linear forwards;
        }

        @keyframes wputopia-fall {
            to {
                transform: translateY(300px);
            }
        }

        .wputopia-countdown-wrapper * {
            box-sizing: border-box;
        }

        .wputopia-title {
            color: #fff;
            margin-bottom: 20px;
            font-size: 3rem;
            padding: 0 20px;
            text-align: center;
            font-weight: bold;
        }

        .wputopia-countdown-container {
            display: flex;
            justify-content: center;
        }

        .wputopia-time {
            display: flex;
            font-size: 1.5em;
            flex-direction: column;
            margin: 0 15px;
            min-width: 80px;
        }

        .wputopia-number {
            margin-bottom: 0;
            color: #fff;
        }

        .wputopia-label {
            color: #ccc;
        }

        /* Consolidated Media Queries */
        @media screen and (max-width: 768px) {
            .wputopia-title {
                font-size: 2rem;
            }

            .wputopia-time {
                font-size: 1em;
                margin: 0 10px;
                min-width: 60px;
            }
        }

        @media screen and (max-width: 480px) {
            .wputopia-title {
                font-size: 2.2rem;
            }

            .wputopia-time {
                font-size: 1.3em;
                margin: 0 8px;
                min-width: 50px;
            }

            .wputopia-countdown-wrapper {
                padding: 15px 0;
                min-height: 300px;
            }
        }


    </style>

JS

<script src="https://unpkg.com/wordpress-dev-necessary/dist/necessary.min.js"></script>
 <script>
        //<![CDATA[
        (function() {
            const wrapper = document.querySelector('.wputopia-countdown-wrapper');
            function getChristmasDate() {
                const now = new Date();
                const christmas = new Date(now.getFullYear(), 11, 25); // Month is 0-based, so 11 is December
                
                // If Christmas has passed this year, target next year's Christmas
                if (now > christmas) {
                    christmas.setFullYear(christmas.getFullYear() + 1);
                }
                
                return christmas;
            }
            
            const endTime = getChristmasDate();
            const daysEl = document.getElementById('wputopia-days');
            const hoursEl = document.getElementById('wputopia-hours');
            const minutesEl = document.getElementById('wputopia-minutes');
            const secondsEl = document.getElementById('wputopia-seconds');

            function updateCountdown() {
                try {
                    const startTime = new Date();
                    const diff = endTime - startTime;
                    const days = Math.floor(diff / 1000 / 60 / 60 / 24);
                    const hours = Math.floor(diff / 1000 / 60 / 60) % 24;
                    const minutes = Math.floor(diff / 1000 / 60) % 60;
                    const seconds = Math.floor(diff / 1000) % 60;
                    
                    daysEl.innerHTML = days;
                    hoursEl.innerHTML = hours < 10 ? '0'+hours : hours;
                    minutesEl.innerHTML = minutes < 10 ? '0'+minutes : minutes;
                    secondsEl.innerHTML = seconds < 10 ? '0'+seconds : seconds;
                } catch (error) {
                    console.error('Error updating countdown:', error);
                }
            }

            function createSnowFlake() {
                const snow_flake = document.createElement('i');
                snow_flake.classList.add('fas', 'fa-snowflake', 'wputopia-snowflake');
                snow_flake.style.left = Math.random() * wrapper.offsetWidth + 'px';
                snow_flake.style.opacity = Math.random();
                snow_flake.style.fontSize = Math.random() * 10 + 10 + 'px';
                
                const animationDuration = (Math.random() * 2 + 1.5);
                snow_flake.style.animationDuration = animationDuration + 's';
                
                wrapper.appendChild(snow_flake);
                
                setTimeout(() => {
                    snow_flake.remove();
                }, animationDuration * 1000);
            }

            // Initialize countdown immediately and set interval
            updateCountdown();
            setInterval(updateCountdown, 1000);

            // Initialize snowflakes
            const snowflakeInterval = window.innerWidth <= 768 ? 200 : 50;
            setInterval(createSnowFlake, snowflakeInterval);

            // Social panel functionality
            const floating_btn = wrapper.querySelector('.wputopia-floating-btn');
            const close_btn = wrapper.querySelector('.wputopia-close-btn');
            const social_panel_container = wrapper.querySelector('.wputopia-social-panel-container');

            if (floating_btn) {
                if (close_btn) {
                    if (social_panel_container) {
                        floating_btn.addEventListener('click', () => {
                            social_panel_container.classList.toggle('visible');
                        });

                        close_btn.addEventListener('click', () => {
                            social_panel_container.classList.remove('visible');
                        });
                    }
                }
            }
        })();
        //]]>
    </script>

That’s it. Easy-peasy.

If you like it, don’t forget to like and comment, so I can send you the file.

Support My Work

If you enjoy my content, consider buying me a coffee or shopping through my Rakuten link to support me!

Victor

Founder of WPUtopia.com🕵️I would appreciate it if you could leave me a comment!

Send Message

Chat with me

Start a Conversation

Hi! Let's connect on your preferred platform.