Display slideshow with navigation
by davidxmartins
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Slideshow - Full Width Bottom Aligned</title>
<style>
.slideshow-container {
position: relative;
width: 100%;
height: 100vh;
overflow: hidden;
display: flex;
align-items: flex-end;
}
.slide {
position: absolute;
width: 100%;
height: 100%;
opacity: 0;
transition: opacity 0.5s ease-in-out;
display: flex;
align-items: flex-end;
}
.slide.active {
opacity: 1;
}
.slide img {
width: 100%; /* Full width */
height: auto; /* Maintain aspect ratio for height */
object-fit: cover; /* Changed back to cover */
object-position: bottom; /* Align to bottom */
max-height: 100%; /* Prevent exceeding container */
}
.arrow {
position: absolute;
top: 50%;
transform: translateY(-50%);
font-size: 2rem;
color: white;
background: rgba(0, 0, 0, 0.5);
padding: 10px;
cursor: pointer;
user-select: none;
z-index: 10;
}
.prev {
left: 10px;
}
.next {
right: 10px;
}
.nav-buttons {
position: absolute;
bottom: 20px;
left: 50%;
transform: translateX(-50%);
display: flex;
gap: 5px;
z-index: 10;
}
.nav-button {
width: 30px;
height: 30px;
background: rgba(0, 0, 0, 0.5);
color: white;
border: none;
border-radius: 50%;
cursor: pointer;
...