Yoga Classes Hero 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>Yoga Classes Hero Section</title> <link href="https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600&family=Poppins:wght@400;600&display=swap" rel="stylesheet"> </head> <body> <section class="hero"> <!-- Yoga background video --> <video autoplay muted loop> <source src="https://cdn.pixabay.com/video/2024/07/04/219499_tiny.mp4" type="video/mp4"> </video> <div class="overlay"></div> <div class="hero-content"> <h1>Find Your Inner Peace</h1> <p>Join our yoga classes to balance your body, mind, and soul. Experience serenity with expert guidance.</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, 91, 65, 0.7), rgba(0, 150, 199, 0.6)); z-index: -1; } .hero-content { text-align: center; padding: 40px 30px; background: rgba(255,255,255,0.12); backdrop-filter: blur(12px); border-radius: 20px; box-shadow: 0 10px 25px rgba(0,0,0,0.5); max-width: 800px; } .hero-content h1 { font-family: 'Playfair Display', serif; font-size: 3rem; font-weight: 600; margin-bottom: 20px; color: #e8fff2; } .hero-content p { font-size: 1.1rem; margin-bottom: 25px; color: #dbfff4; } .hero-content button { padding: 14px 35px; font-size: 1rem; font-weight: 600; color: #fff; background: linear-gradient(135deg, #28a745, #17a2b8); border: none; border-radius: 30px; cursor: pointer; transition: 0.3s; } .hero-content button:hover { transform: scale(1.08); box-shadow: 0 5px 15px rgba(0,0,0,0.3); } @media(max-width: 768px) { .hero-content h1 {font-size: 2rem;} .hero-content p {font-size: 1rem;} }
JavaScript
gsap.from(".hero-content h1", {y: 100, opacity: 0, duration: 1.2, ease:"power4.out"}); gsap.from(".hero-content p", {y: 60, opacity: 0, duration: 1, delay: 0.3, ease:"power3.out"});
Output Preview
Desktop
Mobile
Fullscreen