Let me create something visually striking and modern, not a generic template. I'll:
A cinematic, editorial-style gallery slider with smooth transitions, Ken Burns effect, and elegant controls.
html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lumière Gallery</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@300;400;600&family=DM+Sans:wght@400;500&display=swap" rel="stylesheet">
<style>
:root {
--bg: #0a0a0b;
--fg: #f5f5f3;
--muted: #6b6b6b;
--accent: #c9a87c;
--card: #151517;
--border: #2a2a2d;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'DM Sans', sans-serif;
background: var(--bg);
color: var(--fg);
min-height: 100vh;
overflow-x: hidden;
}
.font-display {
font-family: 'Cormorant Garamond', serif;
}
/* Background texture */
.noise-overlay {
position: fixed;
inset: 0;
pointer-events: none;
opacity: 0.03;
background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
z-index: 1000;
}
/* Slider container */
.slider-container {
position: relative;
width: 100%;
height: 100vh;
overflow: hidden;
}
/* Slides */
.slide {
position: absolute;
inset: 0;
opacity: 0;
visibility: hidden;
transition: opacity 0.8s ease, visibility 0.8s ease;
}
.slide.active {
opacity: 1;
visibility: visible;
}
.slide-image {
position: absolute;
inset: 0;
background-size: cover;
background-position: center;
transform: scale(1);
transition: transform 8s ease-out;
}
.slide.active .slide-image {
transform: scale(1.08);
}
@media (prefers-reduced-motion: reduce) {
.slide-image {
transition: none;
transform: scale(1) !important;
}
.slide {
transition: opacity 0.3s ease;
}
}
.slide-overlay {
position: absolute;
inset: 0;
background: linear-gradient(
to bottom,
rgba(10, 10, 11, 0.3) 0%,
rgba(10, 10, 11, 0.1) 40%,
rgba(10, 10, 11, 0.6) 100%
);
}
/* Content */
.slide-content {
position: absolute;
bottom: 0;
left: 0;
right: 0;
padding: 3rem;
transform: translateY(20px);
opacity: 0;
transition: transform 0.6s ease 0.3s, opacity 0.6s ease 0.3s;
}
.slide.active .slide-content {
transform: translateY(0);
opacity: 1;
}
.slide-number {
font-size: 0.75rem;
letter-spacing: 0.2em;
color: var(--accent);
margin-bottom: 0.5rem;
text-transform: uppercase;
}
.slide-title {
font-size: clamp(2rem, 6vw, 4.5rem);
font-weight: 300;
line-height: 1.1;
margin-bottom: 1rem;
letter-spacing: -0.02em;
}
.slide-description {
max-width: 500px;
color: var(--muted);
font-size: 0.95rem;
line-height: 1.6;
}
/* Navigation arrows */
.nav-arrow {
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 60px;
height: 60px;
border: 1px solid var(--border);
background: rgba(21, 21, 23, 0.6);
backdrop-filter: blur(10px);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.3s ease;
z-index: 10;
}
.nav-arrow:hover {
background: var(--accent);
border-color: var(--accent);
}
.nav-arrow:hover svg {
stroke: var(--bg);
}
.nav-arrow:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 3px;
}
.nav-arrow svg {
width: 24px;
height: 24px;
stroke: var(--fg);
stroke-width: 1.5;
fill: none;
transition: stroke 0.3s ease;
}
.nav-prev {
left: 2rem;
}
.nav-next {
right: 2rem;
}
/* Progress indicator */
.progress-container {
position: absolute;
bottom: 3rem;
right: 3rem;
display: flex;
align-items: center;
gap: 1rem;
z-index: 10;
}
.progress-bar {
width: 120px;
height: 2px;
background: var(--border);
position: relative;
overflow: hidden;
}
.progress-fill {
position: absolute;
left: 0;
top: 0;
height: 100%;
background: var(--accent);
width: 0%;
transition: width 0.1s linear;
}
.progress-bar.paused .progress-fill {
animation-play-state: paused;
}
.slide-counter {
font-size: 0.85rem;
color: var(--muted);
font-variant-numeric: tabular-nums;
}
.slide-counter .current {
color: var(--fg);
font-size: 1.1rem;
}
/* Dot indicators */
.dots-container {
position: absolute;
bottom: 3rem;
left: 50%;
transform: translateX(-50%);
display: flex;
gap: 0.75rem;
z-index: 10;
}
.dot {
width: 8px;
height: 8px;
border: 1px solid var(--muted);
background: transparent;
cursor: pointer;
transition: all 0.3s ease;
padding: 0;
}
.dot:hover {
border-color: var(--fg);
}
.dot.active {
background: var(--accent);
border-color: var(--accent);
transform: scale(1.3);
}
.dot:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 3px;
}
/* Play/Pause button */
.play-pause {
position: absolute;
top: 3rem;
right: 3rem;
width: 48px;
height: 48px;
border: 1px solid var(--border);
background: rgba(21, 21, 23, 0.6);
backdrop-filter: blur(10px);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.3s ease;
z-index: 10;
}
.play-pause:hover {
border-color: var(--accent);
}
.play-pause:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 3px;
}
.play-pause svg {
width: 18px;
height: 18px;
fill: var(--fg);
}
/* Header */
.header {
position: absolute;
top: 3rem;
left: 3rem;
z-index: 10;
}
.logo {
font-size: 1.5rem;
font-weight: 300;
letter-spacing: 0.15em;
text-transform: uppercase;
}
.logo span {
color: var(--accent);
}
/* Thumbnail strip */
.thumbnail-strip {
position: absolute;
right: 3rem;
top: 50%;
transform: translateY(-50%);
display: flex;
flex-direction: column;
gap: 0.5rem;
z-index: 10;
}
.thumbnail {
width: 60px;
height: 40px;
background-size: cover;
background-position: center;
border: 2px solid transparent;
cursor: pointer;
opacity: 0.5;
transition: all 0.3s ease;
}
.thumbnail:hover {
opacity: 0.8;
}
.thumbnail.active {
border-color: var(--accent);
opacity: 1;
}
.thumbnail:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 3px;
}
/* Responsive */
@media (max-width: 768px) {
.nav-arrow {
width: 48px;
height: 48px;
}
.nav-prev {
left: 1rem;
}
.nav-next {
right: 1rem;
}
.slide-content {
padding: 1.5rem;
padding-bottom: 8rem;
}
.header {
top: 1.5rem;
left: 1.5rem;
}
.play-pause {
top: 1.5rem;
right: 1.5rem;
width: 40px;
height: 40px;
}
.progress-container {
bottom: 2rem;
right: 1.5rem;
}
.dots-container {
bottom: 2rem;
}
.thumbnail-strip {
display: none;
}
.progress-bar {
width: 80px;
}
}
/* Entrance animation */
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(30px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.animate-entrance {
animation: fadeInUp 0.8s ease forwards;
}
.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
</style>
</head>
<body>
<div class="noise-overlay"></div>
<div class="slider-container" role="region" aria-label="Photo gallery">
<!-- Header -->
<header class="header animate-entrance">
<div class="logo font-display">Lum<span>iè</span>re</div>
</header>
<!-- Play/Pause -->
<button class="play-pause animate-entrance delay-1" aria-label="Pause slideshow" id="playPause">
<svg class="pause-icon" viewBox="0 0 24 24">
<rect x="6" y="4" width="4" height="16"/>
<rect x="14" y="4" width="4" height="16"/>
</svg>
<svg class="play-icon" viewBox="0 0 24 24" style="display: none;">
<polygon points="5,3 19,12 5,21"/>
</svg>
</button>
<!-- Slides -->
<div class="slides-wrapper" id="slidesWrapper"></div>
<!-- Navigation -->
<button class="nav-arrow nav-prev animate-entrance delay-2" aria-label="Previous slide" id="prevBtn">
<svg viewBox="0 0 24 24">
<polyline points="15,18 9,12 15,6"/>
</svg>
</button>
<button class="nav-arrow nav-next animate-entrance delay-2" aria-label="Next slide" id="nextBtn">
<svg viewBox="0 0 24 24">
<polyline points="9,18 15,12 9,6"/>
</svg>
</button>
<!-- Dots -->
<div class="dots-container animate-entrance delay-2" id="dotsContainer" role="tablist" aria-label="Slide navigation"></div>
<!-- Progress -->
<div class="progress-container animate-entrance delay-2">
<div class="slide-counter">
<span class="current" id="currentSlide">01</span>
<span>/</span>
<span id="totalSlides">05</span>
</div>
<div class="progress-bar" id="progressBar">
<div class="progress-fill" id="progressFill"></div>
</div>
</div>
<!-- Thumbnails -->
<div class="thumbnail-strip" id="thumbnailStrip"></div>
</div>
<script>
// Slide data
const slides = [
{
id: 1,
image: 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=1920&q=80',
title: 'Alpine Serenity',
description: 'Misty mountain peaks emerge through the morning clouds, a testament to nature\'s grandeur.',
location: 'Swiss Alps'
},
{
id: 2,
image: 'https://images.unsplash.com/photo-1470071459604-3b5ec3a7fe05?w=1920&q=80',
title: 'Verdant Valley',
description: 'Rolling hills draped in morning mist, where silence speaks louder than words.',
location: 'Tuscany, Italy'
},
{
id: 3,
image: 'https://images.unsplash.com/photo-1505142468610-359e7d316be0?w=1920&q=80',
title: 'Desert Solitude',
description: 'Golden dunes stretch endlessly under the burning sun, sculpted by timeless winds.',
location: 'Sahara Desert'
},
{
id: 4,
image: 'https://images.unsplash.com/photo-1518173946687-a4c036bc3c95?w=1920&q=80',
title: 'Frozen Horizon',
description: 'Where ice meets sky in an endless dance of blue and white.',
location: 'Iceland'
},
{
id: 5,
image: 'https://images.unsplash.com/photo-1475924156734-496f6cac6ec1?w=1920&q=80',
title: 'Coastal Dreams',
description: 'The eternal rhythm of waves against ancient cliffs, a melody written in stone.',
location: 'Big Sur, California'
}
];
// DOM Elements
const slidesWrapper = document.getElementById('slidesWrapper');
const dotsContainer = document.getElementById('dotsContainer');
const thumbnailStrip = document.getElementById('thumbnailStrip');
const progressFill = document.getElementById('progressFill');
const progressBar = document.getElementById('progressBar');
const currentSlideEl = document.getElementById('currentSlide');
const totalSlidesEl = document.getElementById('totalSlides');
const playPauseBtn = document.getElementById('playPause');
const prevBtn = document.getElementById('prevBtn');
const nextBtn = document.getElementById('nextBtn');
// State
let currentIndex = 0;
let isPlaying = true;
let autoSlideInterval = null;
let progressInterval = null;
let progress = 0;
const SLIDE_DURATION = 6000;
// Initialize
function init() {
totalSlidesEl.textContent = String(slides.length).padStart(2, '0');
renderSlides();
renderDots();
renderThumbnails();
startAutoSlide();
setupEventListeners();
}
function renderSlides() {
slidesWrapper.innerHTML = slides.map((slide, index) => `
<div class="slide ${index === 0 ? 'active' : ''}" data-index="${index}" role="tabpanel" aria-hidden="${index !== 0}">
<div class="slide-image" style="background-image: url('${slide.image}')"></div>
<div class="slide-overlay"></div>
<div class="slide-content">
<div class="slide-number">${String(index + 1).padStart(2, '0')} — ${slide.location}</div>
<h2 class="slide-title font-display">${slide.title}</h2>
<p class="slide-description">${slide.description}</p>
</div>
</div>
`).join('');
}
function renderDots() {
dotsContainer.innerHTML = slides.map((_, index) => `
<button
class="dot ${index === 0 ? 'active' : ''}"
data-index="${index}"
role="tab"
aria-selected="${index === 0}"
aria-label="Go to slide ${index + 1}"
></button>
`).join('');
}
function renderThumbnails() {
thumbnailStrip.innerHTML = slides.map((slide, index) => `
<button
class="thumbnail ${index === 0 ? 'active' : ''}"
data-index="${index}"
style="background-image: url('${slide.image}')"
aria-label="Go to slide ${index + 1}"
></button>
`).join('');
}
function goToSlide(index) {
const slideElements = slidesWrapper.querySelectorAll('.slide');
const dots = dotsContainer.querySelectorAll('.dot');
const thumbnails = thumbnailStrip.querySelectorAll('.thumbnail');
// Remove active class from current
slideElements[currentIndex].classList.remove('active');
slideElements[currentIndex].setAttribute('aria-hidden', 'true');
dots[currentIndex].classList.remove('active');
dots[currentIndex].setAttribute('aria-selected', 'false');
thumbnails[currentIndex].classList.remove('active');
// Update index
currentIndex = index;
if (currentIndex >= slides.length) currentIndex = 0;
if (currentIndex < 0) currentIndex = slides.length - 1;
// Add active class to new
slideElements[currentIndex].classList.add('active');
slideElements[currentIndex].setAttribute('aria-hidden', 'false');
dots[currentIndex].classList.add('active');
dots[currentIndex].setAttribute('aria-selected', 'true');
thumbnails[currentIndex].classList.add('active');
// Update counter
currentSlideEl.textContent = String(currentIndex + 1).padStart(2, '0');
// Reset progress
resetProgress();
}
function nextSlide() {
goToSlide(currentIndex + 1);
}
function prevSlide() {
goToSlide(currentIndex - 1);
}
function startAutoSlide() {
if (!isPlaying) return;
resetProgress();
progressInterval = setInterval(() => {
if (!isPlaying) return;
progress += 100 / (SLIDE_DURATION / 50);
progressFill.style.width = `${Math.min(progress, 100)}%`;
if (progress >= 100) {
nextSlide();
}
}, 50);
}
function resetProgress() {
progress = 0;
progressFill.style.width = '0%';
}
function togglePlayPause() {
isPlaying = !isPlaying;
const pauseIcon = playPauseBtn.querySelector('.pause-icon');
const playIcon = playPauseBtn.querySelector('.play-icon');
if (isPlaying) {
pauseIcon.style.display = 'block';
playIcon.style.display = 'none';
playPauseBtn.setAttribute('aria-label', 'Pause slideshow');
progressBar.classList.remove('paused');
startAutoSlide();
} else {
pauseIcon.style.display = 'none';
playIcon.style.display = 'block';
playPauseBtn.setAttribute('aria-label', 'Play slideshow');
progressBar.classList.add('paused');
}
}
function setupEventListeners() {
prevBtn.addEventListener('click', () => {
prevSlide();
if (isPlaying) startAutoSlide();
});
nextBtn.addEventListener('click', () => {
nextSlide();
if (isPlaying) startAutoSlide();
});
playPauseBtn.addEventListener('click', togglePlayPause);
dotsContainer.addEventListener('click', (e) => {
if (e.target.classList.contains('dot')) {
goToSlide(parseInt(e.target.dataset.index));
if (isPlaying) startAutoSlide();
}
});
thumbnailStrip.addEventListener('click', (e) => {
if (e.target.classList.contains('thumbnail')) {
goToSlide(parseInt(e.target.dataset.index));
if (isPlaying) startAutoSlide();
}
});
// Keyboard navigation
document.addEventListener('keydown', (e) => {
if (e.key === 'ArrowLeft') {
prevSlide();
if (isPlaying) startAutoSlide();
} else if (e.key === 'ArrowRight') {
nextSlide();
if (isPlaying) startAutoSlide();
} else if (e.key === ' ') {
e.preventDefault();
togglePlayPause();
}
});
// Pause on hover
const sliderContainer = document.querySelector('.slider-container');
sliderContainer.addEventListener('mouseenter', () => {
if (isPlaying) {
progressBar.classList.add('paused');
}
});
sliderContainer.addEventListener('mouseleave', () => {
if (isPlaying) {
progressBar.classList.remove('paused');
}
});
// Touch support
let touchStartX = 0;
let touchEndX = 0;
sliderContainer.addEventListener('touchstart', (e) => {
touchStartX = e.changedTouches[0].screenX;
}, { passive: true });
sliderContainer.addEventListener('touchend', (e) => {
touchEndX = e.changedTouches[0].screenX;
handleSwipe();
}, { passive: true });
function handleSwipe() {
const swipeThreshold = 50;
const diff = touchStartX - touchEndX;
if (Math.abs(diff) > swipeThreshold) {
if (diff > 0) {
nextSlide();
} else {
prevSlide();
}
if (isPlaying) startAutoSlide();
}
}
}
// Check for reduced motion preference
const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)');
if (prefersReducedMotion.matches) {
// Disable auto-sliding for users who prefer reduced motion
isPlaying = false;
document.querySelector('.pause-icon').style.display = 'none';
document.querySelector('.play-icon').style.display = 'block';
}
// Start
init();
</script>
</body>
</html>