Responsive Website Template Using HTML, CSS, and JavaScript (With Animation & Dropdown Navbar)

Responsive Website Template with HTML, CSS, and JavaScript (With AOS Animation & Canvas Effects)

Creating a modern, responsive, and visually appealing website has become easier with HTML, CSS, and JavaScript. In this guide, we’ll walk through a beautiful website template that includes a navigation bar, dropdown menu, animated hero section, call-to-action button, and dynamic canvas background. This code is perfect for anyone learning front-end development or looking for a ready-to-use website design.

🌐 What Does This Website Template Include?

This responsive HTML, CSS, and JavaScript website includes the following features:

✅ 1. Navigation Bar with Dropdown Menu

  • A sticky navbar built using HTML and CSS Flexbox.
  • Dropdown menu with hover effects for Services, Portfolio, and Blog links.
  • Fully responsive with a hamburger menu for mobile devices.

✅ 2. Hero Section with Animated Background

  • A hero title with AOS (Animate on Scroll) effects.
  • A call-to-action button (CTA) encouraging visitors to "Get Started".
  • A dynamic canvas animation that creates floating circular shapes for an interactive look.

✅ 3. Features Section

  • Three feature cards with icons (🚀 💡 🌎).
  • Smooth flip-left animations powered by AOS.
  • Great way to highlight services or unique selling points.

✅ 4. Responsive Design

  • Built with CSS media queries to ensure a perfect layout on mobile, tablet, and desktop.
  • The hamburger menu toggle works seamlessly with JavaScript.
  • Minimal design for fast loading speed.

✅ 5. Footer with Branding

  • Simple and clean footer design with copyright.
  • Space for social media links to boost online presence.

🛠️ Technologies Used in This Website Code

This project uses core web technologies along with a lightweight animation library:

  • HTML5 → For structure and semantic elements.
  • CSS3 → For styling, gradients, flexbox layout, dropdown menu, and responsive design.
  • JavaScript (Vanilla JS) → For canvas animation, mobile menu toggle, and interactivity.
  • AOS (Animate On Scroll Library) → For scroll-triggered animations.
  • Canvas API → For drawing and animating floating circles in the background.

🚀 Why Use This Template?

This responsive website template is ideal for:

  • Portfolio websites – Showcase projects with smooth animations.
  • Business websites – Highlight services, features, and CTA.
  • Learning projects – Great for beginners practicing responsive design.
  • Landing pages – Attract attention with animations and canvas effects.

🌐 Social Media Icons



<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Your Website Home</title>
    <link rel="stylesheet" href="https://unpkg.com/aos@2.3.1/dist/aos.css">
    <style>
        body {
            margin: 0;
            font-family: 'Segoe UI', Arial, sans-serif;
            background: linear-gradient(120deg, #fffbe7 0%, #d4ffe7 100%);
        }
        /* Navbar */
        
        .navbar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1rem 2rem;
            background: rgba(255, 255, 255, 0.6);
            box-shadow: 0 1px 10px rgba(0, 0, 0, 0.03);
            position: relative;
            z-index: 100;
        }
        
        .navbar .logo {
            font-weight: bold;
            font-size: 1.3rem;
        }
        
        .nav-links {
            display: flex;
            align-items: center;
            gap: 1rem;
        }
        
        .nav-links a {
            text-decoration: none;
            color: #333;
            font-weight: 500;
            padding: 0.5rem 0.8rem;
            transition: color 0.3s ease;
        }
        
        .nav-links a:hover {
            color: #21bfae;
        }
        /* Dropdown */
        
        .dropdown {
            position: relative;
        }
        
        .dropdown-btn {
            cursor: pointer;
            font-weight: 500;
            padding: 0.5rem 0.8rem;
        }
        
        .dropdown-content {
            position: absolute;
            top: 120%;
            left: 0;
            background: #fff;
            min-width: 180px;
            border-radius: 0.5rem;
            box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
            opacity: 0;
            visibility: hidden;
            transform: translateY(15px);
            transition: all 0.35s ease;
        }
        
        .dropdown-content a {
            display: block;
            padding: 0.7rem 1rem;
            text-decoration: none;
            color: #333;
            border-bottom: 1px solid #f2f2f2;
            transition: background 0.3s ease;
        }
        
        .dropdown-content a:last-child {
            border-bottom: none;
        }
        
        .dropdown-content a:hover {
            background: #f9f9f9;
            color: #21bfae;
        }
        
        .dropdown:hover .dropdown-content {
            opacity: 1;
            visibility: visible;
            transform: translateY(0px);
        }
        /* hamburger*/
        
        .hamburger {
            display: none;
            flex-direction: column;
            cursor: pointer;
            gap: 5px;
        }
        
        .hamburger span {
            display: block;
            width: 25px;
            height: 3px;
            background-color: #333;
            border-radius: 3px;
            transition: 0.3s;
        }
        /*Mobile Menu */
        
        .mobile-menu {
            display: none;
            flex-direction: column;
            background: #fff;
            position: absolute;
            top: 100%;
            right: 0;
            width: 220px;
            padding: 1rem;
            border-radius: 0.5rem;
            box-shadow: o 5px 20px rgba(0, 0, 0, 0.08);
            transform: translateY(-20px);
            opacity: 0;
            visibility: hidden;
            transition: all 0.35s ease;
            z-index: 99;
        }
        
        .mobile-menu.show {
            display: flex;
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }
        
        .mobile-menu a {
            padding: 0.7rem 0;
            border-bottom: 1px solid #f2f2f2;
            text-decoration: none;
            color: #333;
        }
        
        .mobile-menu a:last-child {
            border-bottom: none;
        }
        /*Hero*/
        
        .hero {
            text-align: center;
            padding: 8rem 2rem 3rem 2rem;
            position: relative;
        }
        
        .hero-title {
            font-size: 3rem;
            font-weight: bold;
            margin-bottom: 1rem;
        }
        
        .cta {
            margin-top: 2rem;
            padding: 1rem 2.5rem;
            font-size: 1.3rem;
            background: #21bfae;
            color: #fff;
            border: none;
            border-radius: 3rem;
            cursor: pointer;
            transition: 0.3s;
        }
        
        .cta:hover {
            background: #179c8c;
        }
        
        .animated-shapes {
            position: absolute;
            top: 10%;
            left: 5%;
            width: 90vw;
            height: 300px;
            z-index: -1;
        }
        
        .features {
            display: flex;
            justify-content: center;
            gap: 2rem;
            margin: 4rem 1rem;
            flex-wrap: wrap;
        }
        
        .feature {
            background: #fff;
            padding: 2rem 1rem;
            border-radius: 1rem;
            box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
            width: 240 px;
        }
        
        footer {
            text-align: center;
            margin-top: 6rem;
            padding: 2rem 0;
            font-size: 1rem;
            color: #666;
        }
        /*Responsive*/
        
        @media (max-width: 768px) {
            .nav-links.desktop {
                display: none;
            }
            .hamburger {
                display: flex;
            }
        }
    </style>

</head>

<body>
    <div class="navbar">
        <div class="logo">MyWebsite</div>

        <!-- Desktop Links -->
        <div class="nav-links desktop">
            <a href="#features">Features</a>
            <a href="#about">About</a>
            <div class="dropdown">
                <span class="dropdown-btn">More ▾</span>
                <div class="dropdown-content">
                    <a href="#services">Services</a>
                    <a href="#portfolio">Portfolio</a>
                    <a href="#blog">Blog</a>
                </div>
            </div>
            <a href="#contact">Contact</a>
        </div>

        <!-- Hamburger for Mobile -->
        <div class="hamburger" id="hamburger">
            <span></span>
            <span></span>
            <span></span>
        </div>

        <!-- Mobile Links (toggle inside navbar) -->
        <div class="mobile-menu" id="mobileMenu">
            <a href="#features">Features</a>
            <a href="#about">About</a>
            <a href="#services">Services</a>
            <a href="#portfolio">Portfolio</a>
            <a href="#blog">Blog</a>
            <a href="#contact">Contact</a>
        </div>
    </div>

    <section class="hero">
        <canvas class="animated-shapes"></canvas>
        <div class="hero-title" data-aos="fade-down">Welcome to <span style="color:#21bfae">Your Website</span></div>
        <div style="font-size:1.1rem;" data-aos="fade-up" data-aos-delay="200">
            Where amazing ideas come to life! Discover our services, features, and more.
        </div>
        <button class="cta" data-aos="zoom-in" data-aos-delay="500">Get Started</button>
    </section>

    <div class="features" id="features">
        <div class="feature" data-aos="flip-left">🚀 Fast and Reliable</div>
        <div class="feature" data-aos="flip-left" data-aos-delay="100">💡 Creative Solutions</div>
        <div class="feature" data-aos="flip-left" data-aos-delay="200">🌎 Global Reach</div>
    </div>

    <footer>
        &copy; 2025 Your Website. Made with love.<br>
        <span style="font-size:0.9rem;">Follow us: @yourwebsite</span>
    </footer>
    <script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script>
    <script>
        AOS.init();

        // Canvas animation
        const canvas = document.querySelector('.animated-shapes');
        const ctx = canvas.getContext('2d');
        let w = canvas.width = window.innerWidth * 0.9;
        let h = canvas.height = 300;
        let circles = Array.from({
            length: 14
        }, () => ({
            x: Math.random() * w,
            y: Math.random() * h,
            r: 20 + Math.random() * 25,
            a: Math.random() * 2 * Math.PI,
            s: 0.005 + Math.random() * 0.01,
            c: `rgba(33,191,174,${0.13 + Math.random() * 0.17})`
        }));

        function draw() {
            ctx.clearRect(0, 0, w, h);
            circles.forEach(c => {
                ctx.beginPath();
                ctx.arc(c.x + Math.cos(c.a) * 10, c.y + Math.sin(c.a) * 8, c.r, 0, 2 * Math.PI);
                ctx.fillStyle = c.c;
                ctx.fill();
                c.a += c.s;
            });
            requestAnimationFrame(draw);
        }
        draw();
        window.addEventListener('resize', () => {
            w = canvas.width = window.innerWidth * 0.9;
            h = canvas.height = 300;
        });

        // Mobile menu toggle
        const hamburger = document.getElementById("hamburger");
        const mobileMenu = document.getElementById("mobileMenu");

        hamburger.addEventListener("click", () => {
            mobileMenu.classList.toggle("show");
        });
    </script>

</body>

</html>




📌 SEO Benefits of This Website Code

  • Responsive design → Improves mobile SEO ranking.
  • Lightweight code → Faster page load speed (Google ranking factor).
  • Clean semantic HTML → Better search engine crawling.
  • Keyword-rich structure → Optimized for “responsive HTML CSS template”, “animated website example”, and “AOS animation website”.

📄 Example Keywords You Can Target

  • Responsive website template with HTML CSS JS
  • Animated hero section with JavaScript
  • HTML CSS dropdown menu with hover effect
  • AOS animation example website
  • Canvas animation in JavaScript
  • Free responsive website code

🎯 Conclusion

This responsive HTML, CSS, and JavaScript template is a powerful starting point for creating stunning websites. With a modern navigation bar, dropdown menus, animated hero section, and canvas effects, it offers both functionality and aesthetics.

Whether you are a student, web developer, or small business owner, you can customize this code to build a professional online presence.

👉 Try this template today and start building your dream website!

🔗