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 name="viewport" content="width=device-width, initial-scale=1.0">
<title>Divine Goddesses Gallery</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container inactive">
<div class="container-inner">
<div class="gallery-image">
<div class="overflow">
<div class="inner">
<div class="background"></div>
<div class="content">
<div class="title">Maa Shailputri</div>
<div class="close-button"></div>
</div>
</div>
</div>
<div class="index">
<div class="index-back">1</div>
<div class="index-front">
<div class="index-overlay" data-index="1">1</div>
</div>
</div>
</div>
<div class="gallery-image">
<div class="overflow">
<div class="inner">
<div class="background"></div>
<div class="content">
<div class="title">Maa Brahmacharini</div>
<div class="close-button"></div>
</div>
</div>
</div>
<div class="index">
<div class="index-back">2</div>
<div class="index-front">
<div class="index-overlay" data-index="2">2</div>
</div>
</div>
</div>
<div class="gallery-image">
<div class="overflow">
<div class="inner">
<div class="background"></div>
<div class="content">
<div class="title">Maa Chandraghanta</div>
<div class="close-button"></div>
</div>
</div>
</div>
<div class="index">
<div class="index-back">3</div>
<div class="index-front">
<div class="index-overlay" data-index="3">3</div>
</div>
</div>
</div>
<div class="gallery-image">
<div class="overflow">
<div class="inner">
<div class="background"></div>
<div class="content">
<div class="title">Maa Kushmanda</div>
<div class="close-button"></div>
</div>
</div>
</div>
<div class="index">
<div class="index-back">4</div>
<div class="index-front">
<div class="index-overlay" data-index="4">4</div>
</div>
</div>
</div>
<div class="gallery-image">
<div class="overflow">
<div class="inner">
<div class="background"></div>
<div class="content">
<div class="title">Skandamata</div>
<div class="close-button"></div>
</div>
</div>
</div>
<div class="index">
<div class="index-back">5</div>
<div class="index-front">
<div class="index-overlay" data-index="5">5</div>
</div>
</div>
</div>
<div class="gallery-image">
<div class="overflow">
<div class="inner">
<div class="background"></div>
<div class="content">
<div class="title">Maa Katyayani</div>
<div class="close-button"></div>
</div>
</div>
</div>
<div class="index">
<div class="index-back">6</div>
<div class="index-front">
<div class="index-overlay" data-index="6">6</div>
</div>
</div>
</div>
<div class="gallery-image">
<div class="overflow">
<div class="inner">
<div class="background"></div>
<div class="content">
<div class="title">Maa Kaalratri</div>
<div class="close-button"></div>
</div>
</div>
</div>
<div class="index">
<div class="index-back">7</div>
<div class="index-front">
<div class="index-overlay" data-index="7">7</div>
</div>
</div>
</div>
<div class="gallery-image">
<div class="overflow">
<div class="inner">
<div class="background"></div>
<div class="content">
<div class="title">Maa Mahagauri</div>
<div class="close-button"></div>
</div>
</div>
</div>
<div class="index">
<div class="index-back">8</div>
<div class="index-front">
<div class="index-overlay" data-index="8">8</div>
</div>
</div>
</div>
<div class="gallery-image">
<div class="overflow">
<div class="inner">
<div class="background"></div>
<div class="content">
<div class="title">Maa Siddhidatri</div>
<div class="close-button"></div>
</div>
</div>
</div>
<div class="index">
<div class="index-back">9</div>
<div class="index-front">
<div class="index-overlay" data-index="9">9</div>
</div>
</div>
</div>
</div>
</div>
<script src="index.js"></script>
</body>
</html>
Below is the css code for this video.
style.css
*, *::after, *::before {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
height: 100vh;
width: 100%;
background: linear-gradient(to right, black, orange, white, red, #4169e1, yellow, green, grey, purple, #17684f, black);
font-family: Arial, Helvetica, sans-serif;
}
.container {
position: relative;
height: 100vh;
padding: 80px 70px;
overflow: hidden;
}
.container-inner {
position: relative;
height: 100%;
}
.container-inner:hover .background::after {
opacity: 1;
}
.gallery-image {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 10.615%;
background: radial-gradient(circle, grey, black);
transition: transform 0.5s 0.75s, width 0.75s, opacity 0.5s 0.75s, z-index 0s 0.25s;
will-change: transform, width, opacity;
}
.gallery-image:not(.gallery-active) {
cursor: pointer;
}
.overflow, .inner {
position: relative;
height: 100%;
overflow: hidden;
}
.inner {
transition: transform 1s;
}
.container.inactive .inner {
transform: translate3d(0, 100%, 0);
}
.background {
position: relative;
height: 100%;
width: calc(100vw - 140px);
transition: transform 0.5s 0.75s;
will-change: transform;
}
.background::before {
content: "";
position: absolute;
top: -5%;
left: 0;
height: 110%;
width: 100%;
background-size: cover;
background-position: center;
transform: translate3d(0, 0, 0) scale(1);
transition: transform 1s;
}
.container.inactive .background::before {
transform: translate3d(0, -100%, 0) scale(1.2);
}
.gallery-image.gallery-active .background::before {
transition: transform 0.75s;
}
.background::after {
content: "";
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
background: #00000080;
z-index: 1;
opacity: 0;
transition: opacity 0.5s;
}
.container.gallery-image-active .background::after {
opacity: 1 !important;
transition: opacity 0.5s 1.5s;
}
.content {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
padding: 30px;
z-index: -1;
opacity: 0;
pointer-events: none;
transition: all 0.1s;
}
.gallery-image.gallery-active .content {
z-index: 2;
opacity: 1;
pointer-events: auto;
transition: all 0.5s 1.5s;
}
.title {
font-size: 3vw;
color: #ffffff;
text-transform: uppercase;
}
.close-button {
position: absolute;
top: 10px;
right: 10px;
height: 60px;
width: 60px;
z-index: -1;
opacity: 0;
pointer-events: none;
transition: all 0s 1.5s;
cursor: pointer;
}
.gallery-image.gallery-active .close-button {
z-index: 5;
opacity: 1;
pointer-events: auto;
transition: all 0s 1.5s;
}
.close-button::after, .close-button::before {
content: "";
position: absolute;
top: 50%;
left: 0;
height: 8px;
width: 100%;
background: #ffffff;
margin-top: -4px;
opacity: 0;
transition: opacity 0s;
}
.gallery-image.gallery-active .close-button::before, .gallery-image.gallery-active .close-button::after {
opacity: 1;
}
.close-button::before {
transform: rotate(45deg) translateX(100%);
}
.gallery-image.gallery-active .close-button::before {
transform: rotate(45deg) translateX(0);
transition: all 0.25s 1.5s cubic-bezier(0.725, 0.09, 0.325, 1.55);
}
.close-button::after {
transform: rotate(-45deg) translateX(100%);
}
.gallery-image.gallery-active .close-button::after {
transform: rotate(-45deg) translateX(0%);
transition: all 0.25s 1.5s cubic-bezier(0.725, 0.09, 0.325, 1.55);
}
.index {
position: absolute;
left: 0;
bottom: -80px;
height: 100%;
width: 100%;
min-height: 250px;
text-align: center;
font-size: 15vw;
line-height: 0.85;
font-weight: bold;
transform: translate3d(0, 1vw, 0);
overflow: hidden;
transition: transform 0.5s, opacity 0.25s 1.5s;
}
.gallery-image:hover .index, .gallery-image:hover .index-overlay, .gallery-image:hover .index-overlay::before {
transform: translate3d(0, 0, 0);
}
.container.gallery-image-active .index {
opacity: 0;
transition: transform 0.5s, opacity 0.25s;
}
.index-back, .index-front {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
}
.index-back {
color: grey;
opacity: 0;
transition: opacity 0.25s 0.25s;
}
.gallery-image:hover .index-back {
opacity: 1;
transition: opacity 0.25s;
}
.index-overlay {
position: relative;
color: transparent;
transform: translate3d(0, 100%, 0);
transition: transform 0.5s 0.1s;
overflow: hidden;
}
.index-overlay::before {
content: attr(data-index);
position: absolute;
left: 0;
bottom: 0;
height: 100%;
width: 100%;
color: #ffffff;
transform: translate3d(0, -100%, 0);
transition: transform 0.5s 0.1s;
}
.gallery-image:nth-child(1) {
transform: translate3d(0, 0, 0);
transform-origin: 50% 50%;
}
.container.gallery-image-active .gallery-image:nth-child(1):not(.gallery-active) {
transform: scale(0.5) translate3d(0, 0, 0);
opacity: 0;
transition: transform 1s, opacity 1s;
}
.gallery-image:nth-child(1) .inner {
transition-delay: 0s;
}
.gallery-image:nth-child(1) .background {
transform: translate3d(0, 0, 0);
}
.gallery-image:nth-child(1) .background::before {
background-image: url(https://static.toiimg.com/imagenext/toiblogs/photo/blogs/wp-content/uploads/2016/10/Shailaputri_Sanghasri_2010_Arnab_Dutta.jpg);
transition-delay: 0s;
}
.gallery-image:nth-child(2) {
transform: translate3d(105.20833%, 0, 0);
transform-origin: 155.20833% 50%;
}
.container.gallery-image-active .gallery-image:nth-child(2):not(.gallery-active) {
transform: scale(0.5) translate3d(105.20833%, 0, 0);
opacity: 0;
transition: transform 1s, opacity 1s;
}
.gallery-image:nth-child(2) .inner {
transition-delay: 0.1s;
}
.gallery-image:nth-child(2) .background {
transform: translate3d(-10.2%, 0, 0);
}
.gallery-image:nth-child(2) .background::before {
background-image: url(https://akm-img-a-in.tosshub.com/indiatoday/images/story/202209/pjimage-13-1648920108_0_x.jpeg?VersionId=M3jFVW747lwSYSxmtSdQ1HzX78UFWE4x);
transition-delay: 0.1s;
}
.gallery-image:nth-child(3) {
transform: translate3d(210.4166%, 0, 0);
transform-origin: 260.4166% 50%;
}
.container.gallery-image-active .gallery-image:nth-child(3):not(.gallery-active) {
transform: scale(0.5) translate3d(210.4166%, 0, 0);
opacity: 0;
transition: transform 1s, opacity 1s;
}
.gallery-image:nth-child(3) .inner {
transition-delay: 0.2s;
}
.gallery-image:nth-child(3) .background {
transform: translate3d(-20.4%, 0, 0);
}
.gallery-image:nth-child(3) .background::before {
background-image: url(https://upload.wikimedia.org/wikipedia/commons/4/4f/Chandraghanta_Sanghasri_2010_Arnab_Dutta.JPG);
transition-delay: 0.2s;
}
.gallery-image:nth-child(4) {
transform: translate3d(315.625%, 0, 0);
transform-origin: 365.625% 50%;
}
.container.gallery-image-active .gallery-image:nth-child(4):not(.gallery-active) {
transform: scale(0.5) translate3d(315.625%, 0, 0);
opacity: 0;
transition: transform 1s, opacity 1s;
}
.gallery-image:nth-child(4) .inner {
transition-delay: 0.3s;
}
.gallery-image:nth-child(4) .background {
transform: translate3d(-30.6%, 0, 0);
}
.gallery-image:nth-child(4) .background::before {
background-image: url(https://upload.wikimedia.org/wikipedia/commons/thumb/1/13/Kushmanda_Sanghasri_2010_Arnab_Dutta.JPG/1024px-Kushmanda_Sanghasri_2010_Arnab_Dutta.JPG);
transition-delay: 0.3s;
}
.gallery-image:nth-child(5) {
transform: translate3d(420.833%, 0, 0);
transform-origin: 470.833% 50%;
}
.container.gallery-image-active .gallery-image:nth-child(5):not(.gallery-active) {
transform: scale(0.5) translate3d(420.833%, 0, 0);
opacity: 0;
transition: transform 1s, opacity 1s;
}
.gallery-image:nth-child(5) .inner {
transition-delay: 0.4s;
}
.gallery-image:nth-child(5) .background {
transform: translate3d(-40.8%, 0, 0);
}
.gallery-image:nth-child(5) .background::before {
background-image: url(https://upload.wikimedia.org/wikipedia/commons/thumb/b/b2/Skandamata_Sanghasri_2010_Arnab_Dutta.JPG/1024px-Skandamata_Sanghasri_2010_Arnab_Dutta.JPG);
transition-delay: 0.4s;
}
.gallery-image:nth-child(6) {
transform: translate3d(526.04165%, 0, 0);
transform-origin: 576.04165% 50%;
}
.container.gallery-image-active .gallery-image:nth-child(6):not(.gallery-active) {
transform: scale(0.5) translate3d(526.04165%, 0, 0);
opacity: 0;
transition: transform 1s, opacity 1s;
}
.gallery-image:nth-child(6) .inner {
transition-delay: 0.5s;
}
.gallery-image:nth-child(6) .background {
transform: translate3d(-51%, 0, 0);
}
.gallery-image:nth-child(6) .background::before {
background-image: url(https://upload.wikimedia.org/wikipedia/commons/thumb/b/b1/Katyayani_Sanghasri_2010_Arnab_Dutta.JPG/1024px-Katyayani_Sanghasri_2010_Arnab_Dutta.JPG);
transition-delay: 0.5s;
}
.gallery-image:nth-child(7) {
transform: translate3d(631.25%, 0, 0);
transform-origin: 681.25% 50%;
}
.container.gallery-image-active .gallery-image:nth-child(7):not(.gallery-active) {
transform: scale(0.5) translate3d(631.25%, 0, 0);
opacity: 0;
transition: transform 1s, opacity 1s;
}
.gallery-image:nth-child(7) .inner {
transition-delay: 0.6s;
}
.gallery-image:nth-child(7) .background {
transform: translate3d(-61.2%, 0, 0);
}
.gallery-image:nth-child(7) .background::before {
background-image: url(https://upload.wikimedia.org/wikipedia/commons/thumb/e/ea/Kalratri_Sanghasri_2010_Arnab_Dutta.JPG/1024px-Kalratri_Sanghasri_2010_Arnab_Dutta.JPG);
transition-delay: 0.6s;
}
.gallery-image:nth-child(8) {
transform: translate3d(736.45831%, 0, 0);
transform-origin: 786.45831% 50%;
}
.container.gallery-image-active .gallery-image:nth-child(8):not(.gallery-active) {
transform: scale(0.5) translate3d(736.45831%, 0, 0);
opacity: 0;
transition: transform 1s, opacity 1s;
}
.gallery-image:nth-child(8) .inner {
transition-delay: 0.7s;
}
.gallery-image:nth-child(8) .background {
transform: translate3d(-71.4%, 0, 0);
}
.gallery-image:nth-child(8) .background::before {
background-image: url(https://upload.wikimedia.org/wikipedia/commons/thumb/f/ff/Mahagauri_Sanghasri_2010_Arnab_Dutta.JPG/1024px-Mahagauri_Sanghasri_2010_Arnab_Dutta.JPG);
transition-delay: 0.7s;
}
.gallery-image:nth-child(9) {
transform: translate3d(841.67%, 0, 0);
transform-origin: 891.67% 50%;
}
.container.gallery-image-active .gallery-image:nth-child(9):not(.gallery-active) {
transform: scale(0.5) translate3d(841.67%, 0, 0);
opacity: 0;
transition: transform 1s, opacity 1s;
}
.gallery-image:nth-child(9) .inner {
transition-delay: 0.8s;
}
.gallery-image:nth-child(9) .background {
transform: translate3d(-81.6%, 0, 0);
}
.gallery-image:nth-child(9) .background::before {
background-image: url(https://upload.wikimedia.org/wikipedia/commons/thumb/a/a2/Siddhidatri_Sanghasri_2010_Arnab_Dutta.JPG/1024px-Siddhidatri_Sanghasri_2010_Arnab_Dutta.JPG);
transition-delay: 0.8s;
}
.gallery-image:hover .background::after {
opacity: 0;
}
.gallery-image.gallery-active {
width: 100%;
z-index: 1;
transform: translate3d(0, 0, 0);
transition: transform 0.75s, width 0.75s 0.75s, z-index 0s;
}
.gallery-image.gallery-active .background {
transform: translate3d(0, 0, 0);
transition: transform 0.5s, background 0.5s;
}
.gallery-image.gallery-active .background::before {
background-position: center;
background-size: contain;
background-repeat: no-repeat;
transform: scale(1);
transition-delay: 0.5s;
}
.gallery-image.gallery-active .background::after {
background: transparent;
}
Below is the javascript code for this video.
index.js
var container = document.querySelector(".container"), galleryImages = Array.from(document.querySelectorAll(".gallery-image")),
closeButtons = Array.from(document.querySelectorAll(".close-button"));
setTimeout(function () { container.classList.remove("inactive") }, 200);
galleryImages.forEach(galleryImage => galleryImage.addEventListener("click", function () {
if (this.classList.contains("gallery-active")) { return; }
container.classList.add("gallery-image-active");
this.classList.add("gallery-active");
}));
closeButtons.forEach(closeButton => closeButton.addEventListener("click", function (event) {
event.stopPropagation();
container.classList.remove("gallery-image-active");
document.querySelector(".gallery-image.gallery-active").classList.remove("gallery-active");
}));
Thanks for visiting