Dance Classes Hero With Video Background
Preview
Edit
Download
Run
Download Options
HTML File
Download as .html file
CSS File
Download as .css file
JavaScript File
Download as .js file
Combined HTML
All code in one HTML file
Project ZIP
All files in a ZIP archive
Cancel
HTML
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Dance Classes Hero Section</title> <link href="https://fonts.googleapis.com/css2?family=Anton&family=Poppins:wght@400;600&display=swap" rel="stylesheet"> </head> <body> <section class="hero"> <!-- Dance background video --> <video autoplay muted loop> <source src="https://cdn.pixabay.com/video/2022/12/07/142038-779071822_tiny.mp4" type="video/mp4"> </video> <div class="overlay"></div> <div class="hero-content"> <h1>Dance Your Heart Out</h1> <p>Join our dance classes and groove to every beat. From Hip-Hop to Salsa, we make learning fun & energetic!</p> <button>Join Now</button> </div> </section> <!-- GSAP Animations --> <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.2/gsap.min.js"></script> </body> </html>
CSS
* {margin: 0; padding: 0; box-sizing: border-box;} body {font-family: 'Poppins', sans-serif; overflow-x: hidden;} .hero { position: relative; height: 100vh; display: flex; align-items: center; justify-content: center; color: #fff; overflow: hidden; } /* Background video */ .hero video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; } /* Gradient overlay */ .overlay { position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,0.7), rgba(255,0,120,0.6)); z-index: -1; } .hero-content { text-align: center; padding: 40px 30px; background: rgba(255,255,255,0.1); backdrop-filter: blur(10px); border-radius: 20px; box-shadow: 0 10px 25px rgba(0,0,0,0.5); max-width: 850px; } .hero-content h1 { font-family: 'Anton', sans-serif; font-size: 3.5rem; font-weight: 600; margin-bottom: 20px; color: #ff61c9; letter-spacing: 2px; text-transform: uppercase; } .hero-content p { font-size: 1.2rem; margin-bottom: 25px; color: #f0f0f0; } .hero-content button { padding: 14px 35px; font-size: 1rem; font-weight: 600; color: #fff; background: linear-gradient(135deg, #ff007f, #ff6f00); border: none; border-radius: 30px; cursor: pointer; transition: 0.3s; } .hero-content button:hover { transform: scale(1.08) rotate(-2deg); box-shadow: 0 5px 20px rgba(255,0,120,0.5); } @media(max-width: 768px) { .hero-content h1 {font-size: 2.3rem;} .hero-content p {font-size: 1rem;} }
JavaScript
gsap.from(".hero-content h1", {y: -100, opacity: 0, duration: 1.2, ease:"bounce.out"}); gsap.from(".hero-content p", {y: 60, opacity: 0, duration: 1, delay: 0.3, ease:"power3.out"});
Output Preview
Desktop
Mobile
Fullscreen