Construction Hero Background Video
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>Construction Services Hero</title> <link href="https://fonts.googleapis.com/css2?family=Oswald:wght@500;700&family=Poppins:wght@400;600&display=swap" rel="stylesheet"> </head> <body> <section class="hero"> <!-- Construction site video --> <video autoplay muted loop> <source src="https://cdn.pixabay.com/video/2016/07/08/3741-174188012_tiny.mp4" type="video/mp4"> </video> <div class="overlay"></div> <div class="hero-content"> <h1>Building Dreams, Creating Future</h1> <p>Professional construction services with modern technology, strong foundations, and innovative designs.</p> <button>Get a Quote</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; } /* Dark overlay */ .overlay { position: absolute; inset: 0; background: rgba(0,0,0,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: 15px; box-shadow: 0 10px 25px rgba(0,0,0,0.5); max-width: 750px; } .hero-content h1 { font-family: 'Oswald', sans-serif; font-size: 3.5rem; text-transform: uppercase; margin-bottom: 20px; color: #ffdd57; } .hero-content p { font-size: 1.1rem; margin-bottom: 25px; color: #f1f1f1; } .hero-content button { padding: 14px 35px; font-size: 1rem; font-weight: 600; color: #fff; background: linear-gradient(135deg, #ffb703, #fb8500); 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.4); } @media(max-width: 768px) { .hero-content h1 {font-size: 2.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