Character Showcase Gallery Using HTML And CSS
Hey there, You are most welcome to this article. I hope you will enjoy this article. If you like this article then please share this article with your friends and colleagues. If you have any questions or suggestions regarding this article then please comment down below.
๐Table Of Content
- Project Folder Structure of Character Showcase Gallery
- Character Showcase Gallery HTML CODE
- Character Showcase Gallery CSS CODE
- Live Preview of Character Showcase Gallery
Project Folder Structure:
- Create a file called index.html to serve as the main file.
- Create a file called style.css for the CSS code.
- Create a file called script.js for the JavaScript code.
Character Showcase Gallery HTML CODE
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Character Showcase Gallery By Codewithshobhit</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<div class="box box-1"
style="--img: url(https://is.zobj.net/image-server/v1/images?r=cX7k5Gulg4dit8Vm4tX9t25pk5EL5HuAe7UOLRU7OblvcEnAz-BsuDp-p8_6mDX9MlYq_mDnxu_m5Gm8uyuIHIzJ27fcM7Qt-y8AgdhWzbwfHtYYYIEWQEyMjoVc_ULGCBX1yZLsQ3MGkexvT-O_CKr-R0gVHodaRFq4oVZg4h5Pogh-ku8Q_8Dm0E600lyyMNTxP38RsmLMrvMc4qoyelCXJ1mm_QrJzJoG0uAxohpRAJvWaU6-k1zsGvs);"
data-text="Sukuna"></div>
<div class="box box-2"
style="--img: url(https://4kwallpapers.com/images/wallpapers/satoru-gojo-jujutsu-1125x2436-9292.jpg);"
data-text="Gojo"></div>
<div class="box box-3"
style="--img: url(https://e0.pxfuel.com/wallpapers/35/713/desktop-wallpaper-suguru-geto-jujutsu-kaisen.jpg);"
data-text="Kenjaku"></div>
<div class="box box-4"
style="--img: url(https://w0.peakpx.com/wallpaper/962/404/HD-wallpaper-mahito-anime-jujutsu-kaisen-thumbnail.jpg);"
data-text="Mahito"></div>
<div class="box box-5" style="--img: url(https://i.ytimg.com/vi/jXizUv7cGYs/maxresdefault.jpg);"
data-text="Todo"></div>
</div>
</body>
</html>
Character Showcase Gallery CSS CODE
@import url("https://fonts.googleapis.com/css2?family=Figtree&display=swap");
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Figtree", sans-serif;
}
body {
display: grid;
place-content: center;
min-height: 100vh;
background: #000;
}
.container {
position: relative;
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
gap: 1em;
width: 800px;
height: 500px;
transition: all 400ms;
}
.container:hover .box {
filter: grayscale(100%) opacity(24%);
}
.box {
position: relative;
background: var(--img) center center;
background-size: cover;
transition: all 400ms;
display: flex;
justify-content: center;
align-items: center;
}
.container .box:hover {
filter: grayscale(0%) opacity(100%);
}
.container:has(.box-1:hover) {
grid-template-columns: 3fr 1fr 1fr 1fr 1fr;
}
.container:has(.box-2:hover) {
grid-template-columns: 1fr 3fr 1fr 1fr 1fr;
}
.container:has(.box-3:hover) {
grid-template-columns: 1fr 1fr 3fr 1fr 1fr;
}
.container:has(.box-4:hover) {
grid-template-columns: 1fr 1fr 1fr 3fr 1fr;
}
.container:has(.box-5:hover) {
grid-template-columns: 1fr 1fr 1fr 1fr 3fr;
}
.box:nth-child(odd) {
transform: translateY(-16px);
}
.box:nth-child(even) {
transform: translateY(16px);
}
.box::after {
content: attr(data-text);
position: absolute;
bottom: 20px;
background: #000;
color: #fff;
padding: 10px 10px 10px 14px;
letter-spacing: 4px;
text-transform: uppercase;
transform: translateY(60px);
opacity: 0;
transition: all 400ms;
}
.box:hover::after {
transform: translateY(0);
opacity: 1;
transition-delay: 400ms;
}
Live Preview of Character Showcase Gallery
See the Pen Untitled by Codewithshobhit (@Codewithshobhit) on CodePen.
How to run this Html Css and Js Project in Our Browser?
first, you need a code editor either you can use VS code studio or notepad and then copy the html,css, and javascript code, create separate or different files for coding then combine them, after creating file just click .html file or run from VS Code studio and you can project preview.
Which Code Editor do you use to create those projects?
I am using VS Code Studio.
is this project responsive or not?
Yes! this project is a responsive project.
If you enjoyed reading this post and have found it useful for you, then please give share it with your friends, and follow me to get updates on my upcoming posts. You can connect with me on Instagram
if you have any confusion Comment below or you can contact us by filling out our Contact Us form from the home section. ๐ค๐

No comments:
Post a Comment