How to create a Dark theme coming soon html template

Features

  • Responsive Design: Works on mobile, tablet, and desktop screens
  • Modern Gradient Background: Eye-catching dark gradient background
  • Dynamic Countdown Timer: Shows days, hours, minutes, and seconds until launch
  • Email Subscription Form: With validation and notification
  • Social Media Links: Using Font Awesome icons
  • Smooth Animations: Fade-in on load and hover effects
  • Clean Typography: Using Google's Poppins font
  • Accessibility: Proper aria-labels for social icons

How to Use


Simply copy and paste the entire code into an HTML file and open it in a browser. The template is ready to use as-is, but you can customize:

  • Change the launch date in the JavaScript (line 224)
  • Update the brand name and logo
  • Modify the description text
  • Add your actual social media links
  • Adjust colors in the CSS to match your brand

The template includes all necessary CDN links for fonts and icons, so no additional files are required.

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Coming Soon</title> <!-- Google Fonts --> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap" rel="stylesheet"> <!-- Font Awesome --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> </head> <body> <div class="container"> <a href="#" class="logo">Brand<span>Name</span></a> <h1>Coming Soon</h1> <p class="description"> We're working hard to bring you something amazing. Stay tuned for our launch! Subscribe to get notified when we go live. </p> <div class="countdown"> <div class="countdown-item"> <div class="countdown-number" id="days">00</div> <div class="countdown-label">Days</div> </div> <div class="countdown-item"> <div class="countdown-number" id="hours">00</div> <div class="countdown-label">Hours</div> </div> <div class="countdown-item"> <div class="countdown-number" id="minutes">00</div> <div class="countdown-label">Minutes</div> </div> <div class="countdown-item"> <div class="countdown-number" id="seconds">00</div> <div class="countdown-label">Seconds</div> </div> </div> <div class="subscribe"> <input type="email" placeholder="Enter your email address"> <button type="submit">Notify Me</button> </div> <div class="social-icons"> <a href="#" aria-label="Twitter"><i class="fab fa-twitter"></i></a> <a href="#" aria-label="Instagram"><i class="fab fa-instagram"></i></a> <a href="#" aria-label="LinkedIn"><i class="fab fa-linkedin-in"></i></a> </div> </div> </body> </html>
CSS provides style to an HTML page. To make the page attractive create a CSS file with the name style.css and remember that you have to make a file with a .css extension.


 /* CSS Reset */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Poppins', sans-serif;
            background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
            color: #fff;
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 20px;
            opacity: 0;
            animation: fadeIn 1s ease-in-out forwards;
        }

        @keyframes fadeIn {
            to {
                opacity: 1;
            }
        }

        .container {
            max-width: 800px;
            width: 100%;
            text-align: center;
            padding: 40px 20px;
        }

        .logo {
            font-size: 2.5rem;
            font-weight: 700;
            margin-bottom: 20px;
            color: #fff;
            text-decoration: none;
            display: inline-block;
        }

        .logo span {
            color: #4cc9f0;
        }

        h1 {
            font-size: 3rem;
            margin-bottom: 20px;
            background: linear-gradient(to right, #4cc9f0, #f72585);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
        }

        .description {
            font-size: 1.2rem;
            line-height: 1.6;
            margin-bottom: 40px;
            max-width: 600px;
            margin-left: auto;
            margin-right: auto;
            opacity: 0.9;
        }

        .countdown {
            display: flex;
            justify-content: center;
            gap: 15px;
            margin-bottom: 40px;
            flex-wrap: wrap;
        }

        .countdown-item {
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
            border-radius: 10px;
            padding: 20px 15px;
            min-width: 100px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
        }

        .countdown-number {
            font-size: 2.5rem;
            font-weight: 700;
            margin-bottom: 5px;
        }

        .countdown-label {
            font-size: 0.9rem;
            opacity: 0.8;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .subscribe {
            max-width: 500px;
            margin: 0 auto 40px;
            position: relative;
        }

        .subscribe input {
            width: 100%;
            padding: 15px 20px;
            border: none;
            border-radius: 50px;
            font-size: 1rem;
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(5px);
            color: #fff;
            outline: none;
            transition: all 0.3s ease;
        }

        .subscribe input::placeholder {
            color: rgba(255, 255, 255, 0.7);
        }

        .subscribe input:focus {
            background: rgba(255, 255, 255, 0.2);
        }

        .subscribe button {
            position: absolute;
            right: 5px;
            top: 5px;
            bottom: 5px;
            padding: 0 25px;
            border: none;
            border-radius: 50px;
            background: linear-gradient(to right, #4cc9f0, #f72585);
            color: #fff;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .subscribe button:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
        }

        .social-icons {
            display: flex;
            justify-content: center;
            gap: 20px;
        }

        .social-icons a {
            color: #fff;
            font-size: 1.5rem;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(5px);
            transition: all 0.3s ease;
            text-decoration: none;
        }

        .social-icons a:hover {
            background: linear-gradient(to right, #4cc9f0, #f72585);
            transform: translateY(-5px);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
        }

        /* Responsive adjustments */
        @media (max-width: 768px) {
            h1 {
                font-size: 2.5rem;
            }

            .description {
                font-size: 1rem;
            }

            .countdown-item {
                min-width: 80px;
                padding: 15px 10px;
            }

            .countdown-number {
                font-size: 2rem;
            }
        }

        @media (max-width: 480px) {
            .logo {
                font-size: 2rem;
            }

            h1 {
                font-size: 2rem;
            }

            .countdown {
                gap: 10px;
            }

            .countdown-item {
                min-width: 70px;
                padding: 10px 5px;
            }

            .countdown-number {
                font-size: 1.5rem;
            }

            .countdown-label {
                font-size: 0.7rem;
            }

            .subscribe button {
                padding: 0 15px;
                font-size: 0.9rem;
            }
        }
JavaScript makes the page work functionally. At last, create a JavaScript file with the name of script.js, and remember that you've got to make a file with a .js extension.


// Set the launch date (YYYY, MM-1, DD, HH, MM, SS)
        const launchDate = new Date(2024, 11, 31, 0, 0, 0).getTime();
        
        // Update the countdown every second
        const countdown = setInterval(function() {
            const now = new Date().getTime();
            const distance = launchDate - now;
            
            // Calculate days, hours, minutes, seconds
            const days = Math.floor(distance / (1000 * 60 * 60 * 24));
            const hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
            const minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
            const seconds = Math.floor((distance % (1000 * 60)) / 1000);
            
            // Display the result
            document.getElementById('days').innerHTML = days.toString().padStart(2, '0');
            document.getElementById('hours').innerHTML = hours.toString().padStart(2, '0');
            document.getElementById('minutes').innerHTML = minutes.toString().padStart(2, '0');
            document.getElementById('seconds').innerHTML = seconds.toString().padStart(2, '0');
            
            // If countdown is finished
            if (distance < 0) {
                clearInterval(countdown);
                document.querySelector('.countdown').innerHTML = '
We\'re Live!
'; } }, 1000); // Email subscription handling document.querySelector('.subscribe button').addEventListener('click', function() { const emailInput = document.querySelector('.subscribe input'); const email = emailInput.value.trim(); if (email && validateEmail(email)) { alert('Thank you for subscribing! We\'ll notify you when we launch.'); emailInput.value = ''; } else { alert('Please enter a valid email address.'); } }); // Email validation function function validateEmail(email) { const re = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; return re.test(email); }
We hope you would like this Calculator using html css and javascript code

Thank you
Learning robo team

إرسال تعليق

Thank you
Learning robo team

Post a Comment (0)

أحدث أقدم
Learning Robo says...
code copied
Welcome