Modern Aesthetic Salon Slider
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>Modern Aesthetic Salon Slider</title> <!-- Google Fonts: Cormorant Garamond for elegant chic headings, Jost for clean minimal text --> <link href="https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Jost:wght@300;400;500&display=swap" rel="stylesheet"> </head> <body> <div class="salon-slider"> <div class="slider-track" id="sliderTrack"> <!-- Slide 1: Skincare / Facial --> <div class="slide active"> <div class="slide-inner"> <div class="slide-content"> <span class="service-tag">Signature Skincare</span> <h2 class="title">Radiant <i>Glow</i> Facial</h2> <p class="description">Revitalize your skin with our bespoke hydrating treatments. Experience a luminous, healthy complexion crafted perfectly for your skin type.</p> <a href="#" class="btn">Book Session</a> </div> <div class="slide-image-wrapper"> <img src="https://images.unsplash.com/photo-1616394584738-fc6e612e71b9?q=80&w=1000&auto=format&fit=crop" alt="Facial Treatment" class="slide-img"> </div> </div> </div> <!-- Slide 2: Hair Styling --> <div class="slide"> <div class="slide-inner"> <div class="slide-content"> <span class="service-tag">Hair Artistry</span> <h2 class="title">Bespoke <i>Styling</i></h2> <p class="description">From effortless waves to precision cuts, our master stylists create modern looks that complement your natural beauty and lifestyle.</p> <a href="#" class="btn">View Lookbook</a> </div> <div class="slide-image-wrapper"> <img src="https://images.unsplash.com/photo-1595476108010-b4d1f10d5e43?q=80&w=1000&auto=format&fit=crop" alt="Hair Styling" class="slide-img"> </div> </div> </div> <!-- Slide 3: Makeup / Glam --> <div class="slide"> <div class="slide-inner"> <div class="slide-content"> <span class="service-tag">Soft Glam Makeup</span> <h2 class="title">Flawless <i>Beauty</i></h2> <p class="description">Elevate your everyday look or prepare for a special event with our professional makeup services. Subtle, elegant, and entirely you.</p> <a href="#" class="btn">Reserve Artist</a> </div> <div class="slide-image-wrapper"> <img src="https://images.unsplash.com/photo-1512496015851-a1dc8a477de0?q=80&w=1000&auto=format&fit=crop" alt="Makeup Service" class="slide-img"> </div> </div> </div> </div> <!-- Navigation Controls --> <div class="controls"> <button class="nav-btn" id="prevBtn" aria-label="Previous"> <svg viewBox="0 0 24 24"><path d="M15 19l-7-7 7-7" stroke-linecap="round" stroke-linejoin="round"/></svg> </button> <button class="nav-btn" id="nextBtn" aria-label="Next"> <svg viewBox="0 0 24 24"><path d="M9 5l7 7-7 7" stroke-linecap="round" stroke-linejoin="round"/></svg> </button> </div> </div> </body> </html>
CSS
* { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: 'Jost', sans-serif; background-color: #F9F8F6; /* Soft warm alabaster/beige */ color: #2A2A2A; /* Soft charcoal black */ overflow-x: hidden; } /* Slider Wrapper */ .salon-slider { position: relative; width: 100vw; height: 100vh; min-height: 600px; overflow: hidden; display: flex; align-items: center; } /* Horizontal Moving Track */ .slider-track { display: flex; height: 100%; width: max-content; /* Ultra-smooth horizontal sliding easing */ transition: transform 1.2s cubic-bezier(0.77, 0, 0.175, 1); } /* Individual Slide Layout */ .slide { width: 100vw; height: 100%; display: flex; align-items: center; justify-content: center; padding: 0 5%; } /* Inner Container for max-width and split layout */ .slide-inner { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 1200px; gap: 50px; } /* Left Side: Content */ .slide-content { flex: 1; max-width: 500px; } /* Instagram Aesthetic Tag */ .service-tag { display: inline-block; font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: 2px; color: #A68A7B; /* Muted mocha/blush */ margin-bottom: 20px; position: relative; padding-bottom: 5px; } .service-tag::after { content: ''; position: absolute; bottom: 0; left: 0; width: 30px; height: 1px; background-color: #A68A7B; } /* Chic Headline */ .title { font-family: 'Cormorant Garamond', serif; font-size: 4.5rem; font-weight: 500; line-height: 1.1; margin-bottom: 20px; color: #1A1A1A; } .title i { font-style: italic; font-weight: 400; color: #7A6558; /* Slightly lighter accent */ } /* Clean Description */ .description { font-size: 1.1rem; font-weight: 300; line-height: 1.6; color: #555; margin-bottom: 35px; } /* Modern Subtle CTA */ .btn { display: inline-flex; align-items: center; justify-content: center; padding: 15px 35px; background-color: #2A2A2A; color: #fff; text-decoration: none; font-size: 14px; font-weight: 400; letter-spacing: 1px; text-transform: uppercase; border-radius: 4px; /* Minimal rounding */ transition: all 0.3s ease; } .btn:hover { background-color: #A68A7B; transform: translateY(-3px); /* Subtle lift */ box-shadow: 0 10px 20px rgba(166, 138, 123, 0.2); } /* Right Side: Image */ .slide-image-wrapper { flex: 1; height: 70vh; position: relative; overflow: hidden; border-radius: 20px; /* Modern soft corners */ box-shadow: 0 20px 40px rgba(0,0,0,0.06); } .slide-img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.15); /* Start slightly zoomed */ transition: transform 1.5s cubic-bezier(0.25, 1, 0.5, 1); } /* Text & Image Animation Logic (Triggered on Active Slide) */ .service-tag, .title, .description, .btn { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease, transform 0.6s ease; } /* Sequenced Delays when slide is active */ .slide.active .service-tag { opacity: 1; transform: translateY(0); transition-delay: 0.6s; } .slide.active .title { opacity: 1; transform: translateY(0); transition-delay: 0.8s; } .slide.active .description { opacity: 1; transform: translateY(0); transition-delay: 1.0s; } .slide.active .btn { opacity: 1; transform: translateY(0); transition-delay: 1.2s; } /* Settle image nicely */ .slide.active .slide-img { transform: scale(1); } /* Minimal Navigation */ .controls { position: absolute; bottom: 40px; left: 5%; display: flex; gap: 15px; z-index: 10; } .nav-btn { width: 45px; height: 45px; border-radius: 50%; background: #fff; border: 1px solid #E5E0D8; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.3s ease; color: #2A2A2A; box-shadow: 0 4px 10px rgba(0,0,0,0.03); } .nav-btn:hover { background: #2A2A2A; border-color: #2A2A2A; color: #fff; } .nav-btn svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.5; fill: none; } /* Responsive Design */ @media (max-width: 992px) { .slide-inner { flex-direction: column-reverse; justify-content: center; gap: 30px; text-align: center; } .slide-content { max-width: 100%; padding-top: 20px; } .service-tag::after { left: 50%; transform: translateX(-50%); } .slide-image-wrapper { width: 100%; height: 45vh; } .title { font-size: 3.5rem; } .controls { left: 50%; transform: translateX(-50%); bottom: 20px; } } @media (max-width: 600px) { .title { font-size: 2.8rem; } .description { font-size: 1rem; margin-bottom: 25px; } .slide-image-wrapper { height: 40vh; border-radius: 12px; } }
JavaScript
document.addEventListener('DOMContentLoaded', () => { const track = document.getElementById('sliderTrack'); const slides = document.querySelectorAll('.slide'); const prevBtn = document.getElementById('prevBtn'); const nextBtn = document.getElementById('nextBtn'); let currentIndex = 0; const totalSlides = slides.length; function updateSlider() { // 1. Move the Horizontal Track track.style.transform = `translateX(-${currentIndex * 100}vw)`; // 2. Handle Text & Image Animation Logic slides.forEach((slide, index) => { if(index === currentIndex) { // Small delay to let the sliding finish before text pops up setTimeout(() => { slide.classList.add('active'); }, 200); } else { slide.classList.remove('active'); } }); } nextBtn.addEventListener('click', () => { currentIndex = (currentIndex + 1) % totalSlides; updateSlider(); }); prevBtn.addEventListener('click', () => { currentIndex = (currentIndex - 1 + totalSlides) % totalSlides; updateSlider(); }); // Optional: Auto-play setup /* setInterval(() => { nextBtn.click(); }, 6000); */ });
Output Preview
Desktop
Mobile
Fullscreen