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 #1</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="wrapper">
<div class="carousel">
<div class="carousel-item">
<div class="carousel-item-head">😀</div>
<div class="carousel-item-body">
<p class="title">Grinning Face</p>
<p>Description 1</p>
</div>
</div>
<div class="carousel-item">
<div class="carousel-item-head">😂</div>
<div class="carousel-item-body">
<p class="title">Face With Tears of Joy</p>
<p>Description 2</p>
</div>
</div>
<div class="carousel-item">
<div class="carousel-item-head">😉</div>
<div class="carousel-item-body">
<p class="title">Winking Face</p>
<p>Description 3</p>
</div>
</div>
<div class="carousel-item">
<div class="carousel-item-head">😋</div>
<div class="carousel-item-body">
<p class="title">Face Savouring Delicious Food</p>
<p>Description 4</p>
</div>
</div>
<div class="carousel-item">
<div class="carousel-item-head">😴</div>
<div class="carousel-item-body">
<p class="title">Sleeping Face</p>
<p>Description 5</p>
</div>
</div>
</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%;
font-family: serif;
}
.wrapper {
display: flex;
height: 100%;
width: 100%;
background-color: #1e9afe;
background-image: linear-gradient(45deg, #1e9afe, #60dfcd);
justify-content: center;
}
.carousel {
position: relative;
width: 100%;
max-width: 500px;
display: flex;
flex-direction: column;
justify-content: center;
}
.carousel-item {
position: absolute;
width: 100%;
display: flex;
align-items: center;
padding: 0 12px;
opacity: 0;
filter: drop-shadow(0 2px 2px #777777);
will-change: transform, opacity;
animation: carouselAnim 5s linear infinite;
}
.carousel-item:nth-child(1) {
animation-delay: calc(1s * -1);
}
.carousel-item:nth-child(2) {
animation-delay: calc(1s * 0);
}
.carousel-item:nth-child(3) {
animation-delay: calc(1s * 1);
}
.carousel-item:nth-child(4) {
animation-delay: calc(1s * 2);
}
.carousel-item:last-child {
animation-delay: calc(-1s * 2);
}
.carousel-item-head {
position: relative;
height: 90px;
width: 90px;
display: flex;
background-color: #dadada;
align-items: center;
justify-content: center;
font-size: 64px;
border-radius: 50%;
padding: 14px;
margin-right: -45px;
flex-shrink: 0;
}
.carousel-item-body {
width: 100%;
background-color: #ffffff;
border-radius: 8px;
padding: 16px 20px 16px 70px;
}
.title {
font-size: 16px;
margin-top: 10px;
text-transform: uppercase;
}
@keyframes carouselAnim {
0% {
transform: translateY(100%) scale(0.5);
opacity: 0;
visibility: hidden;
}
3%, 20% {
transform: translateY(100%) scale(0.75);
opacity: 0.33;
visibility: visible;
}
23%, 40% {
transform: translateY(0) scale(1);
opacity: 1;
visibility: visible;
}
43%, 60% {
transform: translateY(-100%) scale(0.75);
opacity: 0.33;
visibility: visible;
}
63% {
transform: translateY(-100%) scale(0.5);
opacity: 0;
visibility: visible;
}
100% {
transform: translateY(-100%) scale(0.5);
opacity: 0;
visibility: hidden;
}
}
Thanks for visiting