Property Showcase Slider Template
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>LUXURY ESTATES | Premium Property Showcase</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> <link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800&family=Cormorant+Garamond:wght@400;500;600;700&display=swap" rel="stylesheet"> </head> <body> <div class="parallax-bg" id="parallaxBg"></div> <div class="container"> <header class="main-header"> <div class="logo-container"> <div class="logo-icon"> <i class="fas fa-building"></i> </div> <div> <h1 class="logo-text">LUXURY ESTATES</h1> <p class="tagline">Exclusive Properties Worldwide</p> </div> </div> <div class="header-controls"> <button class="header-btn"> <i class="fas fa-map-marked-alt"></i> Virtual Tour </button> <button class="header-btn primary"> <i class="fas fa-phone-alt"></i> Schedule Viewing </button> </div> </header> <div class="showcase-container"> <!-- Main Property Slider --> <div class="main-slider"> <div class="slider-track" id="sliderTrack"> <!-- Slide 1 --> <div class="property-slide" style="background-image: url('https://images.unsplash.com/photo-1613490493576-7fde63acd811?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1920&q=80');"> <div class="floating-tag">Premium Listing</div> <div class="property-counter" id="propertyCounter">01</div> <div class="slide-content"> <span class="property-badge badge-sale">For Sale</span> <div class="property-price">$1,250,000<span></span></div> <h2 class="property-title">Modern Luxury Villa</h2> <div class="property-location"> <i class="fas fa-map-marker-alt"></i> <span>Malibu, California • Ocean View</span> </div> </div> </div> <!-- Slide 2 --> <div class="property-slide" style="background-image: url('https://images.unsplash.com/photo-1613977257363-707ba9348227?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1920&q=80');"> <div class="floating-tag">Recently Sold</div> <div class="property-counter">02</div> <div class="slide-content"> <span class="property-badge badge-sold">Sold</span> <div class="property-price">$890,000<span></span></div> <h2 class="property-title">Downtown Penthouse</h2> <div class="property-location"> <i class="fas fa-map-marker-alt"></i> <span>Manhattan, New York • Rooftop Garden</span> </div> </div> </div> <!-- Slide 3 --> <div class="property-slide" style="background-image: url('https://images.unsplash.com/photo-1613977257592-4871e5fcd7c4?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1920&q=80');"> <div class="floating-tag">Waterfront Estate</div> <div class="property-counter">03</div> <div class="slide-content"> <span class="property-badge badge-featured">Featured</span> <div class="property-price">$2,350,000<span></span></div> <h2 class="property-title">Lakeside Modern Estate</h2> <div class="property-location"> <i class="fas fa-map-marker-alt"></i> <span>Lake Tahoe, Nevada • Private Beach</span> </div> </div> </div> <!-- Slide 4 --> <div class="property-slide" style="background-image: url('https://images.unsplash.com/photo-1616587226154-91eab0a51dc7?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1920&q=80');"> <div class="floating-tag">Mountain Retreat</div> <div class="property-counter">04</div> <div class="slide-content"> <span class="property-badge badge-sale">For Sale</span> <div class="property-price">$1,750,000<span></span></div> <h2 class="property-title">Contemporary Mountain Retreat</h2> <div class="property-location"> <i class="fas fa-map-marker-alt"></i> <span>Aspen, Colorado • Ski-in/Ski-out</span> </div> </div> </div> <!-- Slide 5 --> <div class="property-slide" style="background-image: url('https://images.unsplash.com/photo-1616594039964-ae9021a400a0?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1920&q=80');"> <div class="floating-tag">Vineyard Estate</div> <div class="property-counter">05</div> <div class="slide-content"> <span class="property-badge badge-sale">For Sale</span> <div class="property-price">$3,200,000<span></span></div> <h2 class="property-title">Mediterranean Villa</h2> <div class="property-location"> <i class="fas fa-map-marker-alt"></i> <span>Napa Valley, California • 10 Acres</span> </div> </div> </div> </div> </div> <!-- Property Details Panel --> <div class="property-details-panel" id="propertyPanel"> <div class="panel-header"> <h3 class="panel-title"><i class="fas fa-info-circle"></i> Property Details</h3> <p id="currentPropertyLocation">Malibu, California</p> </div> <div class="property-stats"> <div class="stat-item"> <div class="stat-value" id="bedroomCount">5</div> <div class="stat-label">Bedrooms</div> </div> <div class="stat-item"> <div class="stat-value" id="bathroomCount">6</div> <div class="stat-label">Bathrooms</div> </div> <div class="stat-item"> <div class="stat-value" id="squareFootage">4,500</div> <div class="stat-label">Square Feet</div> </div> <div class="stat-item"> <div class="stat-value" id="yearBuilt">2021</div> <div class="stat-label">Year Built</div> </div> </div> <p class="property-description" id="propertyDescription"> Stunning contemporary villa featuring panoramic ocean views, infinity pool, and state-of-the-art smart home technology. This property offers the ultimate luxury living experience with premium finishes and attention to detail throughout. </p> <h4 class="panel-title"><i class="fas fa-star"></i> Premium Amenities</h4> <div class="amenities-list"> <div class="amenity-item"> <i class="fas fa-swimming-pool"></i> <span>Infinity Pool</span> </div> <div class="amenity-item"> <i class="fas fa-hot-tub"></i> <span>Outdoor Spa</span> </div> <div class="amenity-item"> <i class="fas fa-wine-bottle"></i> <span>Wine Cellar</span> </div> <div class="amenity-item"> <i class="fas fa-theater-masks"></i> <span>Home Theater</span> </div> <div class="amenity-item"> <i class="fas fa-dumbbell"></i> <span>Gymnasium</span> </div> <div class="amenity-item"> <i class="fas fa-car"></i> <span>Smart Garage</span> </div> </div> <button class="cta-button" id="scheduleButton"> <i class="fas fa-calendar-alt"></i> Schedule Private Tour </button> </div> </div> <!-- Thumbnail Navigation --> <div class="thumbnail-nav"> <div class="thumbnail active" data-index="0"> <img src="https://images.unsplash.com/photo-1613490493576-7fde63acd811?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=300&q=80" alt="Modern Luxury Villa"> <div class="thumbnail-overlay">Villa</div> </div> <div class="thumbnail" data-index="1"> <img src="https://images.unsplash.com/photo-1613977257363-707ba9348227?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=300&q=80" alt="Downtown Penthouse"> <div class="thumbnail-overlay">Penthouse</div> </div> <div class="thumbnail" data-index="2"> <img src="https://images.unsplash.com/photo-1613977257592-4871e5fcd7c4?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=300&q=80" alt="Lakeside Estate"> <div class="thumbnail-overlay">Estate</div> </div> <div class="thumbnail" data-index="3"> <img src="https://images.unsplash.com/photo-1616587226154-91eab0a51dc7?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=300&q=80" alt="Mountain Retreat"> <div class="thumbnail-overlay">Retreat</div> </div> <div class="thumbnail" data-index="4"> <img src="https://images.unsplash.com/photo-1616594039964-ae9021a400a0?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w-300&q=80" alt="Mediterranean Villa"> <div class="thumbnail-overlay">Vineyard</div> </div> </div> <!-- Slider Controls --> <div class="slider-controls"> <button class="nav-btn" id="prevBtn"> <i class="fas fa-chevron-left"></i> </button> <div class="progress-bar"> <div class="progress-fill" id="progressFill"></div> </div> <button class="nav-btn" id="nextBtn"> <i class="fas fa-chevron-right"></i> </button> </div> <div class="footer-info"> <p>© 2023 LUXURY ESTATES. All property images are for demonstration purposes. Virtual tours available upon request.</p> </div> </div> </body> </html>
CSS
:root { --primary: #0a2540; --secondary: #ffd166; --accent: #00a8cc; --light: #f8f9fa; --dark: #1a1a1a; --gray: #8a8d93; --transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1); --shadow-lg: 0 25px 50px rgba(0, 0, 0, 0.15); --shadow-xl: 0 30px 60px rgba(0, 0, 0, 0.25); } * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: 'Montserrat', sans-serif; background: linear-gradient(135deg, #0c1e35 0%, #1a3a5f 100%); color: var(--light); line-height: 1.6; overflow-x: hidden; min-height: 100vh; position: relative; } body::before { content: ''; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: radial-gradient(circle at 20% 50%, rgba(255, 209, 102, 0.05) 0%, transparent 50%), radial-gradient(circle at 80% 20%, rgba(0, 168, 204, 0.05) 0%, transparent 50%); z-index: -1; } .container { max-width: 1600px; margin: 0 auto; padding: 30px; } /* Header */ .main-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 50px; padding: 20px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.1); position: relative; } .logo-container { display: flex; align-items: center; gap: 15px; } .logo-icon { width: 50px; height: 50px; background: var(--secondary); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: var(--primary); transform: rotate(45deg); transition: var(--transition); } .logo-icon:hover { transform: rotate(0); } .logo-text { font-family: 'Cormorant Garamond', serif; font-size: 2.8rem; font-weight: 700; background: linear-gradient(to right, var(--light), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; letter-spacing: 1px; } .tagline { font-size: 1.1rem; color: var(--gray); letter-spacing: 2px; font-weight: 300; text-transform: uppercase; } .header-controls { display: flex; gap: 20px; } .header-btn { background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); color: white; padding: 12px 25px; border-radius: 30px; font-weight: 500; cursor: pointer; transition: var(--transition); backdrop-filter: blur(10px); display: flex; align-items: center; gap: 10px; } .header-btn:hover { background: rgba(255, 255, 255, 0.2); transform: translateY(-3px); } .header-btn.primary { background: var(--secondary); color: var(--primary); font-weight: 600; } /* Main Slider Container */ .showcase-container { display: grid; grid-template-columns: 1fr 400px; gap: 40px; margin-bottom: 60px; min-height: 700px; } /* Main Slider */ .main-slider { position: relative; border-radius: 25px; overflow: hidden; height: 700px; box-shadow: var(--shadow-xl); perspective: 1000px; } .slider-track { display: flex; height: 100%; transition: transform 0.9s cubic-bezier(0.77, 0, 0.175, 1); transform-style: preserve-3d; } .property-slide { min-width: 100%; height: 100%; position: relative; background-size: cover; background-position: center; transform-style: preserve-3d; } .property-slide::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to bottom, rgba(10, 37, 64, 0.85) 0%, rgba(10, 37, 64, 0.4) 40%, rgba(10, 37, 64, 0.1) 70%, transparent 100%); z-index: 1; } .slide-content { position: relative; z-index: 2; padding: 50px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; transform: translateZ(50px); } .property-badge { display: inline-block; padding: 12px 25px; border-radius: 30px; font-weight: 600; font-size: 0.9rem; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 25px; align-self: flex-start; backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.2); animation: badgePulse 3s infinite; } @keyframes badgePulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.4); } 50% { box-shadow: 0 0 0 10px rgba(46, 204, 113, 0); } } .badge-sale { background: rgba(46, 204, 113, 0.2); color: #2ecc71; } .badge-sold { background: rgba(231, 76, 60, 0.2); color: #e74c3c; } .badge-featured { background: rgba(255, 209, 102, 0.2); color: var(--secondary); } .property-price { font-size: 4rem; font-weight: 800; margin-bottom: 10px; background: linear-gradient(to right, var(--secondary), #fff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; line-height: 1; font-family: 'Cormorant Garamond', serif; } .property-price span { font-size: 2rem; font-weight: 600; } .property-title { font-size: 3.2rem; font-weight: 700; margin-bottom: 20px; line-height: 1.1; font-family: 'Cormorant Garamond', serif; } .property-location { display: flex; align-items: center; font-size: 1.2rem; margin-bottom: 30px; opacity: 0.9; } .property-location i { color: var(--secondary); margin-right: 12px; font-size: 1.4rem; } /* Property Details Panel */ .property-details-panel { background: rgba(255, 255, 255, 0.05); border-radius: 25px; padding: 40px; backdrop-filter: blur(15px); border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: var(--shadow-lg); height: 700px; overflow-y: auto; } .panel-header { margin-bottom: 30px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); padding-bottom: 20px; } .panel-title { font-size: 1.8rem; font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; gap: 15px; } .panel-title i { color: var(--secondary); font-size: 1.5rem; } .property-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 40px; } .stat-item { background: rgba(255, 255, 255, 0.05); border-radius: 15px; padding: 25px; text-align: center; transition: var(--transition); border: 1px solid transparent; } .stat-item:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.2); transform: translateY(-5px); } .stat-value { font-size: 2.2rem; font-weight: 700; color: var(--secondary); margin-bottom: 5px; font-family: 'Cormorant Garamond', serif; } .stat-label { font-size: 0.9rem; color: var(--gray); text-transform: uppercase; letter-spacing: 1px; } .property-description { margin-bottom: 40px; line-height: 1.8; color: rgba(255, 255, 255, 0.8); } .amenities-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; margin-bottom: 40px; } .amenity-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.03); transition: var(--transition); } .amenity-item:hover { background: rgba(255, 255, 255, 0.08); } .amenity-item i { color: var(--secondary); font-size: 1.2rem; width: 30px; } .cta-button { width: 100%; padding: 20px; background: linear-gradient(135deg, var(--secondary), #ffb347); color: var(--primary); border: none; border-radius: 15px; font-size: 1.2rem; font-weight: 700; cursor: pointer; transition: var(--transition); display: flex; justify-content: center; align-items: center; gap: 15px; margin-top: 20px; } .cta-button:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(255, 209, 102, 0.3); } /* Thumbnail Navigation */ .thumbnail-nav { display: flex; justify-content: center; gap: 20px; margin-bottom: 40px; } .thumbnail { width: 120px; height: 80px; border-radius: 12px; overflow: hidden; cursor: pointer; position: relative; transition: var(--transition); border: 2px solid transparent; opacity: 0.7; } .thumbnail:hover { transform: translateY(-5px); opacity: 1; } .thumbnail.active { border-color: var(--secondary); opacity: 1; transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3); } .thumbnail img { width: 100%; height: 100%; object-fit: cover; } .thumbnail-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(10, 37, 64, 0.6); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.9rem; transition: var(--transition); } .thumbnail.active .thumbnail-overlay { background: rgba(10, 37, 64, 0.3); } /* Controls */ .slider-controls { display: flex; justify-content: center; align-items: center; gap: 30px; margin-bottom: 40px; } .nav-btn { width: 70px; height: 70px; border-radius: 50%; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); color: white; font-size: 1.5rem; cursor: pointer; transition: var(--transition); display: flex; align-items: center; justify-content: center; backdrop-filter: blur(10px); } .nav-btn:hover { background: var(--secondary); color: var(--primary); transform: scale(1.1); } .progress-bar { width: 300px; height: 4px; background: rgba(255, 255, 255, 0.1); border-radius: 2px; overflow: hidden; position: relative; } .progress-fill { height: 100%; background: linear-gradient(to right, var(--secondary), var(--accent)); width: 20%; border-radius: 2px; transition: width 0.3s ease; } /* Property Counter */ .property-counter { position: absolute; top: 40px; right: 40px; z-index: 10; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(10px); padding: 15px 25px; border-radius: 30px; font-weight: 600; font-size: 1.1rem; letter-spacing: 2px; border: 1px solid rgba(255, 255, 255, 0.2); } /* Floating Elements */ .floating-tag { position: absolute; top: 40px; left: 40px; z-index: 10; background: rgba(255, 209, 102, 0.9); color: var(--primary); padding: 12px 25px; border-radius: 30px; font-weight: 700; transform: rotate(-5deg); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2); animation: float 6s ease-in-out infinite; } @keyframes float { 0%, 100% { transform: rotate(-5deg) translateY(0); } 50% { transform: rotate(-5deg) translateY(-10px); } } /* Footer */ .footer-info { text-align: center; padding: 30px 0; border-top: 1px solid rgba(255, 255, 255, 0.1); color: var(--gray); font-size: 0.9rem; } /* Parallax Background */ .parallax-bg { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -2; pointer-events: none; } .parallax-item { position: absolute; border-radius: 50%; background: radial-gradient(circle, rgba(255, 209, 102, 0.1) 0%, transparent 70%); } /* Responsive */ @media (max-width: 1400px) { .showcase-container { grid-template-columns: 1fr; } .property-details-panel { height: auto; max-height: 500px; } .main-slider { height: 600px; } } @media (max-width: 992px) { .main-header { flex-direction: column; gap: 25px; text-align: center; } .property-title { font-size: 2.5rem; } .property-price { font-size: 3rem; } .thumbnail-nav { flex-wrap: wrap; } } @media (max-width: 768px) { .container { padding: 20px; } .main-slider { height: 500px; } .slide-content { padding: 30px; } .property-title { font-size: 2rem; } .property-stats { grid-template-columns: 1fr; } .amenities-list { grid-template-columns: 1fr; } .nav-btn { width: 60px; height: 60px; } } @media (max-width: 576px) { .main-slider { height: 400px; } .property-price { font-size: 2.5rem; } .property-title { font-size: 1.8rem; } .floating-tag { top: 20px; left: 20px; padding: 8px 15px; font-size: 0.9rem; } .property-counter { top: 20px; right: 20px; padding: 10px 15px; } }
JavaScript
document.addEventListener('DOMContentLoaded', function() { // DOM Elements const sliderTrack = document.getElementById('sliderTrack'); const propertyCounter = document.getElementById('propertyCounter'); const progressFill = document.getElementById('progressFill'); const prevBtn = document.getElementById('prevBtn'); const nextBtn = document.getElementById('nextBtn'); const thumbnails = document.querySelectorAll('.thumbnail'); const scheduleButton = document.getElementById('scheduleButton'); // Property details elements const propertyLocation = document.getElementById('currentPropertyLocation'); const bedroomCount = document.getElementById('bedroomCount'); const bathroomCount = document.getElementById('bathroomCount'); const squareFootage = document.getElementById('squareFootage'); const yearBuilt = document.getElementById('yearBuilt'); const propertyDescription = document.getElementById('propertyDescription'); // Property data const properties = [ { location: 'Malibu, California', bedrooms: 5, bathrooms: 6, sqft: '4,500', year: 2021, description: 'Stunning contemporary villa featuring panoramic ocean views, infinity pool, and state-of-the-art smart home technology. This property offers the ultimate luxury living experience with premium finishes throughout.', amenities: ['Infinity Pool', 'Outdoor Spa', 'Wine Cellar', 'Home Theater', 'Gymnasium', 'Smart Garage'] }, { location: 'Manhattan, New York', bedrooms: 3, bathrooms: '3.5', sqft: '2,800', year: 2019, description: 'Exclusive penthouse in the heart of the city featuring a private rooftop garden, floor-to-ceiling windows, and premium finishes throughout. Recently sold at a premium price.', amenities: ['Rooftop Garden', 'Smart Home', 'Wine Cooler', 'Jacuzzi', 'Concierge', 'Private Elevator'] }, { location: 'Lake Tahoe, Nevada', bedrooms: 6, bathrooms: 7, sqft: '6,200', year: 2020, description: 'Architectural masterpiece on the lakefront with private beach access, home theater, wine cellar, and custom-designed interiors by a renowned designer.', amenities: ['Private Beach', 'Home Theater', 'Wine Cellar', 'Game Room', 'Boathouse', 'Fire Pit'] }, { location: 'Aspen, Colorado', bedrooms: 4, bathrooms: 5, sqft: '4,100', year: 2018, description: 'Luxury mountain home with breathtaking views, ski-in/ski-out access, indoor pool, and spa. Perfect for year-round enjoyment in a premier location.', amenities: ['Ski Access', 'Indoor Pool', 'Spa', 'Fireplace', 'Sauna', 'Game Room'] }, { location: 'Napa Valley, California', bedrooms: 7, bathrooms: 8, sqft: '8,500', year: 2022, description: 'Magnificent estate on 10 acres with producing vineyard, olive grove, guest house, and infinity pool overlooking the valley. An entertainer\'s dream home.', amenities: ['Vineyard', 'Guest House', 'Infinity Pool', 'Wine Cellar', 'Orchard', 'Entertainment Pavilion'] } ]; let currentIndex = 0; let slideInterval; const totalSlides = thumbnails.length; const slideDuration = 6000; // 6 seconds // Initialize property details updatePropertyDetails(); // Create parallax background createParallaxBackground(); // Function to update slider position function updateSlider() { // Update slider track position sliderTrack.style.transform = `translateX(-${currentIndex * 100}%)`; // Update property counter propertyCounter.textContent = `0${currentIndex + 1}`; // Update progress bar const progress = ((currentIndex + 1) / totalSlides) * 100; progressFill.style.width = `${progress}%`; // Update active thumbnail thumbnails.forEach((thumb, index) => { thumb.classList.toggle('active', index === currentIndex); }); // Update property details updatePropertyDetails(); // Add animation effect to slide const slides = document.querySelectorAll('.property-slide'); slides.forEach((slide, index) => { if (index === currentIndex) { slide.style.opacity = '1'; slide.style.transform = 'scale(1)'; } else { slide.style.opacity = '0.7'; slide.style.transform = 'scale(0.95)'; } }); } // Function to update property details panel function updatePropertyDetails() { const property = properties[currentIndex]; propertyLocation.textContent = property.location; bedroomCount.textContent = property.bedrooms; bathroomCount.textContent = property.bathrooms; squareFootage.textContent = property.sqft; yearBuilt.textContent = property.year; propertyDescription.textContent = property.description; // Update amenities const amenitiesList = document.querySelector('.amenities-list'); amenitiesList.innerHTML = ''; property.amenities.forEach(amenity => { const amenityItem = document.createElement('div'); amenityItem.className = 'amenity-item'; amenityItem.innerHTML = ` <i class="fas fa-check-circle"></i> <span>${amenity}</span> `; amenitiesList.appendChild(amenityItem); }); } // Function to go to next slide function nextSlide() { currentIndex = (currentIndex + 1) % totalSlides; updateSlider(); resetTimer(); } // Function to go to previous slide function prevSlide() { currentIndex = (currentIndex - 1 + totalSlides) % totalSlides; updateSlider(); resetTimer(); } // Function to go to specific slide function goToSlide(index) { currentIndex = index; updateSlider(); resetTimer(); } // Function to start auto slide function startTimer() { clearInterval(slideInterval); slideInterval = setInterval(nextSlide, slideDuration); } // Function to reset timer function resetTimer() { clearInterval(slideInterval); startTimer(); } // Event listeners for buttons prevBtn.addEventListener('click', prevSlide); nextBtn.addEventListener('click', nextSlide); // Event listeners for thumbnails thumbnails.forEach(thumbnail => { thumbnail.addEventListener('click', function() { const slideIndex = parseInt(this.getAttribute('data-index')); goToSlide(slideIndex); }); }); // Schedule button scheduleButton.addEventListener('click', function() { const propertyName = document.querySelector('.property-title').textContent; alert(`Thank you for your interest in "${propertyName}". Our agent will contact you shortly to schedule a private tour.`); this.innerHTML = '<i class="fas fa-check"></i> Tour Requested'; this.style.background = '#2ecc71'; setTimeout(() => { this.innerHTML = '<i class="fas fa-calendar-alt"></i> Schedule Private Tour'; this.style.background = ''; }, 3000); }); // Keyboard navigation document.addEventListener('keydown', (e) => { if (e.key === 'ArrowLeft') prevSlide(); if (e.key === 'ArrowRight') nextSlide(); if (e.key >= '1' && e.key <= '5') goToSlide(parseInt(e.key) - 1); }); // Swipe functionality for touch devices let touchStartX = 0; const sliderContainer = document.querySelector('.main-slider'); sliderContainer.addEventListener('touchstart', (e) => { touchStartX = e.changedTouches[0].screenX; }); sliderContainer.addEventListener('touchend', (e) => { const touchEndX = e.changedTouches[0].screenX; const swipeThreshold = 50; if (touchStartX - touchEndX > swipeThreshold) nextSlide(); if (touchEndX - touchStartX > swipeThreshold) prevSlide(); }); // Create parallax background function createParallaxBackground() { const parallaxBg = document.getElementById('parallaxBg'); for (let i = 0; i < 15; i++) { const item = document.createElement('div'); item.className = 'parallax-item'; // Random size and position const size = Math.random() * 300 + 100; const posX = Math.random() * 100; const posY = Math.random() * 100; item.style.width = `${size}px`; item.style.height = `${size}px`; item.style.left = `${posX}%`; item.style.top = `${posY}%`; item.style.opacity = Math.random() * 0.1 + 0.05; parallaxBg.appendChild(item); } } // Mouse move parallax effect document.addEventListener('mousemove', (e) => { const x = e.clientX / window.innerWidth; const y = e.clientY / window.innerHeight; // Move background elements slightly const items = document.querySelectorAll('.parallax-item'); items.forEach((item, index) => { const speed = 0.5 + (index * 0.05); const moveX = x * speed * 20; const moveY = y * speed * 20; item.style.transform = `translate(${moveX}px, ${moveY}px)`; }); }); // Initialize updateSlider(); startTimer(); // Add initial animation to slides setTimeout(() => { const slides = document.querySelectorAll('.property-slide'); slides.forEach(slide => { slide.style.transition = 'opacity 1s ease, transform 1s ease'; }); }, 100); });
Output Preview
Desktop
Mobile
Fullscreen