The content on this website, including videos and code examples, is for educational purposes only. All demonstrations and designs are fictional and created to illustrate coding techniques. Any resemblance to existing websites or brands is purely coincidental.
The creators and administrators of this website do not claim ownership or affiliation with any existing websites or companies. Users are encouraged to use the information responsibly for learning purposes. Liability for any misuse of the content provided is not accepted.
Below is the html code for this video.
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vertical Image Carousel #2</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="carousel">
<div class="carousel-thumbnails">
<ul class="thumbnails">
<li>
<input type="radio" name="cs-input" id="img1" checked>
<label for="img1" class="label-slide1"></label>
<div class="content content-slide1">
<span class="img"></span>
<h3>Title 1</h3>
<p>Description 1</p>
</div>
</li>
<li>
<input type="radio" name="cs-input" id="img2">
<label for="img2" class="label-slide2"></label>
<div class="content content-slide2">
<span class="img"></span>
<h3>Title 2</h3>
<p>Description 2</p>
</div>
</li>
<li>
<input type="radio" name="cs-input" id="img3">
<label for="img3" class="label-slide3"></label>
<div class="content content-slide3">
<span class="img"></span>
<h3>Title 3</h3>
<p>Description 3</p>
</div>
</li>
</ul>
</div>
<div class="middle-border"></div>
<div class="content-container"></div>
</div>
</body>
</html>
Below is the css code for this video.
style.css
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
height: 100vh;
width: 100%;
background-color: #fce043;
background-image: radial-gradient(#fce043, #ffff00, #fb7b82, #ff0000);
font-family: serif;
user-select: none;
}
.carousel {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
display: flex;
height: 75%;
width: 60%;
background-color: rgba(255, 255, 255, 0.5);
align-items: center;
justify-content: left;
margin: auto;
border: 1px solid rgba(255, 255, 255, 0.25);
border-radius: 16px;
overflow: hidden;
backdrop-filter: blur(16px) saturate(180%);
}
.carousel-thumbnails {
display: flex;
flex-grow: 0;
height: 100%;
width: 20%;
align-items: center;
justify-content: left;
}
.thumbnails {
display: flex;
flex-direction: column;
flex-grow: 1;
align-content: stretch;
list-style: none;
}
input[type=radio] {
display: none;
}
label {
display: block;
height: 75px;
margin: 15% auto;
line-height: 75px;
text-align: center;
opacity: 0.5;
}
label:hover {
opacity: 0.75;
cursor: pointer;
}
.label-slide1::before, .label-slide2::before, .label-slide3::before {
content: "";
position: absolute;
display: block;
height: 75px;
width: 75px;
margin-left: 5%;
background-position: center;
background-size: 75% 75%;
background-repeat: no-repeat;
}
.label-slide1::before {
background-image: url("https://images.unsplash.com/photo-1617259111814-31755625b3f1?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=80");
}
.label-slide2::before {
background-image: url("https://images.unsplash.com/photo-1496303546775-e565e0b4c88a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1473&q=80");
}
.label-slide3::before {
background-image: url("https://images.unsplash.com/photo-1587405254461-abd1d1c7440e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=80");
}
.content {
position: absolute;
top: -100%;
left: 20%;
display: flex;
flex-direction: column;
height: 100%;
width: 80%;
align-items: center;
justify-content: center;
animation: slideOutAnim 0.75s ease-out;
}
.content-slide1 .img, .content-slide2 .img, .content-slide3 .img {
height: 75%;
width: 90%;
background-position: center;
background-size: cover;
background-repeat: no-repeat;
}
.content-slide1 .img {
background-image: url("https://images.unsplash.com/photo-1617259111814-31755625b3f1?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=80");
}
.content-slide2 .img {
background-image: url("https://images.unsplash.com/photo-1496303546775-e565e0b4c88a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1473&q=80");
}
.content-slide3 .img {
background-image: url("https://images.unsplash.com/photo-1587405254461-abd1d1c7440e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=80");
}
h3 {
color: #fc575e;
font-size: 24px;
margin: 1% auto;
}
p {
max-width: 85%;
color: #fb8085;
font-size: 16px;
text-align: center;
margin: 0 auto;
}
input[type=radio]:checked~label {
opacity: 1;
animation: all 1s cubic-bezier(0.5, 0.05, 0.5, 1);
}
input[type=radio]:checked~.label-slide1, input[type=radio]:checked~.label-slide2, input[type=radio]:checked~.label-slide3 {
border-right: 4px solid #f53844;
}
input[type=radio]:checked~.content {
animation: slideInAnim 0.75s cubic-bezier(0.5, 0.05, 0.5, 1) forwards;
}
.middle-border {
height: 90%;
max-width: 0.5%;
background-color: #ffffff;
flex-grow: 1;
z-index: 0;
}
.content-container {
height: 100%;
flex-grow: 3;
}
@keyframes slideOutAnim {
from {
top: 0;
opacity: 1;
}
to {
top: -100%;
opacity: 0;
}
}
@keyframes slideInAnim {
from {
top: -100%;
opacity: 0;
}
to {
top: 0;
opacity: 1;
}
}
Thanks for visiting