Gallery Section
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>Animated Gallery - Yellow Theme</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> </head> <body> <section class="gallery-section"> <div class="container"> <div class="section-title"> <h2>Our Gallery</h2> <p>Explore our stunning collection of work in vibrant yellow-themed designs.</p> </div> <!-- Filter Buttons --> <div class="filter-buttons"> <button class="filter-btn active">All</button> <button class="filter-btn">Design</button> <button class="filter-btn">Photography</button> <button class="filter-btn">Art</button> <button class="filter-btn">Branding</button> </div> <!-- Gallery Grid --> <div class="gallery-grid"> <!-- Item 1 --> <div class="gallery-item"> <img src="https://images.unsplash.com/photo-1493612276216-ee3925520721?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80" alt="Gallery Image" class="gallery-img"> <div class="gallery-overlay"> <h3 class="gallery-title">Creative Design</h3> <span class="gallery-category">Design</span> </div> </div> <!-- Item 2 --> <div class="gallery-item"> <img src="https://images.unsplash.com/photo-1508615070457-7baeba4003ab?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80" alt="Gallery Image" class="gallery-img"> <div class="gallery-overlay"> <h3 class="gallery-title">Sunset Photography</h3> <span class="gallery-category">Photography</span> </div> </div> <!-- Item 3 --> <div class="gallery-item"> <img src="https://images.unsplash.com/photo-1579547945413-497e1b99dac0?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80" alt="Gallery Image" class="gallery-img"> <div class="gallery-overlay"> <h3 class="gallery-title">Abstract Art</h3> <span class="gallery-category">Art</span> </div> </div> <!-- Item 4 --> <div class="gallery-item"> <img src="https://images.unsplash.com/photo-1493612276216-ee3925520721?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80" alt="Gallery Image" class="gallery-img"> <div class="gallery-overlay"> <h3 class="gallery-title">Brand Identity</h3> <span class="gallery-category">Branding</span> </div> </div> <!-- Item 5 --> <div class="gallery-item"> <img src="https://images.unsplash.com/photo-1508615070457-7baeba4003ab?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80" alt="Gallery Image" class="gallery-img"> <div class="gallery-overlay"> <h3 class="gallery-title">Modern Layout</h3> <span class="gallery-category">Design</span> </div> </div> <!-- Item 6 --> <div class="gallery-item"> <img src="https://images.unsplash.com/photo-1579547945413-497e1b99dac0?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80" alt="Gallery Image" class="gallery-img"> <div class="gallery-overlay"> <h3 class="gallery-title">Colorful Patterns</h3> <span class="gallery-category">Art</span> </div> </div> </div> <!-- View More Button --> <div class="view-more"> <a href="#" class="view-more-btn">View More <i class="fas fa-arrow-right"></i></a> </div> </div> </section> </body> </html>
CSS
/* ===== Global Styles ===== */ :root { --primary-yellow: #FFD700; --dark-yellow: #FFC000; --light-yellow: #FFF9C4; --white: #fff; --black: #333; --gray: #777; --shadow: 0 10px 30px rgba(0, 0, 0, 0.1); } * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; } body { background-color: #f9f9f9; color: var(--black); overflow-x: hidden; } .container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; } section { padding: 100px 0; } /* ===== Section Title ===== */ .section-title { text-align: center; margin-bottom: 60px; } .section-title h2 { font-size: 2.8rem; color: var(--black); margin-bottom: 15px; position: relative; display: inline-block; animation: fadeIn 1s ease-out; } .section-title h2::after { content: ''; position: absolute; width: 80px; height: 4px; background: var(--primary-yellow); bottom: -10px; left: 50%; transform: translateX(-50%); } .section-title p { font-size: 1.1rem; color: var(--gray); max-width: 700px; margin: 0 auto; animation: fadeIn 1s ease-out 0.3s both; } /* ===== Gallery Grid ===== */ .gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 25px; margin-top: 40px; } .gallery-item { position: relative; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); transition: all 0.5s ease; animation: fadeInUp 0.8s ease-out; aspect-ratio: 1 / 1; } .gallery-item:nth-child(1) { animation-delay: 0.2s; } .gallery-item:nth-child(2) { animation-delay: 0.4s; } .gallery-item:nth-child(3) { animation-delay: 0.6s; } .gallery-item:nth-child(4) { animation-delay: 0.8s; } .gallery-item:nth-child(5) { animation-delay: 1s; } .gallery-item:nth-child(6) { animation-delay: 1.2s; } .gallery-item:hover { transform: translateY(-10px) scale(1.02); box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2); } .gallery-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; } .gallery-item:hover .gallery-img { transform: scale(1.1); } .gallery-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent); display: flex; flex-direction: column; justify-content: flex-end; padding: 20px; opacity: 0; transition: opacity 0.4s ease; } .gallery-item:hover .gallery-overlay { opacity: 1; } .gallery-title { color: var(--white); font-size: 1.4rem; margin-bottom: 8px; transform: translateY(20px); transition: transform 0.4s ease; } .gallery-category { color: var(--primary-yellow); font-weight: 600; transform: translateY(20px); transition: transform 0.4s ease 0.1s; } .gallery-item:hover .gallery-title, .gallery-item:hover .gallery-category { transform: translateY(0); } /* ===== Filter Buttons ===== */ .filter-buttons { display: flex; justify-content: center; flex-wrap: wrap; gap: 15px; margin-bottom: 40px; } .filter-btn { padding: 10px 25px; background: transparent; border: 2px solid var(--primary-yellow); color: var(--black); border-radius: 30px; font-weight: 600; cursor: pointer; transition: all 0.3s ease; } .filter-btn:hover, .filter-btn.active { background: var(--primary-yellow); color: var(--black); transform: translateY(-3px); } /* ===== View More Button ===== */ .view-more { text-align: center; margin-top: 50px; } .view-more-btn { display: inline-block; padding: 15px 40px; background: var(--primary-yellow); color: var(--black); font-weight: 600; border-radius: 50px; text-decoration: none; transition: all 0.3s ease; box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3); animation: pulse 2s infinite; } .view-more-btn:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(255, 215, 0, 0.4); } /* ===== Animations ===== */ @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } @keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } } @keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } } /* ===== Responsive Adjustments ===== */ @media (max-width: 992px) { .section-title h2 { font-size: 2.4rem; } .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } } @media (max-width: 768px) { section { padding: 80px 0; } .section-title h2 { font-size: 2rem; } .filter-buttons { gap: 10px; } .filter-btn { padding: 8px 18px; font-size: 0.9rem; } } @media (max-width: 576px) { section { padding: 60px 0; } .section-title h2 { font-size: 1.8rem; } .gallery-grid { grid-template-columns: 1fr; } .view-more-btn { padding: 12px 30px; } }
JavaScript
// Simple filter functionality (for demo) document.querySelectorAll('.filter-btn').forEach(btn => { btn.addEventListener('click', () => { document.querySelector('.filter-btn.active').classList.remove('active'); btn.classList.add('active'); }); });
Output Preview
Desktop
Mobile
Fullscreen