Hello developers, today in this blog, you'll learn to create a Parallax Image Gallery using HTML, CSS & JavaScript.
The Image Gallery is the place, where the collection of images gets stored. Those stored images can be viewed whenever we want to see them. The parallax is a computer graphics technique used to create a faux-3D effect. The parallax effect is a difference in the apparent position of an object when viewed along two different lines of sight.
In this blog(Parallax Image Gallery), there is an image at the center of the webpage with its title at the right bottom of the image. You can see more images by scrolling horizontally by using the scroll button at the bottom of the webpage. You can add as many images as you need. This is mainly made by using Javascript.
The source code of this Parallax Image Gallery is given below, if you want the source code of this program, you can copy it. You can use this Parallax Image Gallery on your project and take it to the subsequent level.
Parallax Image Gallery [Source Code]
To make this website, you would like to make three files: an HTML file, a CSS file & a JavaScript file. First, create an HTML file with the name of index.html and remember, you have to create a file with a .html extension.
@import url('https://fonts.googleapis.com/css2?family=Neonderthaw&family=Roboto+Slab:wght@100&display=swap');
* {
box-sizing: border-box;
border-radius: 5px;
}
body {
background: #eee;
}
main {
min-height: 100vh;
display: grid;
grid-template-columns: 100vw 100vw 100vw;
width: 300vw;
justify-content: center;
align-items: center;
}
figure {
max-width: 45vw;
margin: 0 auto;
background: rgba(255,255,255,0.8);
padding: 2em;
border: 1px solid #ddd;
box-shadow: 0 0 2em -0.5em #aaa;
position: relative;
}
figure img {
max-width: 100%;
max-height: 70vh;
}
figure figcaption {
font-family: "Playfair Display";
font-weight: 900;
font-size: 3em;
font-style: italic;
text-align: right;
text-shadow: 0 0 1em #555;
text-shadow: 0 0 0.5em white;
position: absolute;
right: 10px;
bottom: -2rem;
}
.helper {
position: absolute;
top: 0;
left: 0;
margin: 1rem;
text-align: center;
font-family: 'Nunito Sans';
opacity: .45;
font-size: 1.2em;
transition: opacity, .15s;
}
.helper:hover {
opacity: 1;
}
.credit a {
text-decoration: none;
color: #000;
font-weight: 800;
}
.credit {
text-align: center;
font-family: Verdana,Geneva,Tahoma,sans-serif;
}
var rellax = new Rellax('.rellax',{horizontal: true, vertical: false, speed: 1.5});
Thank you for reading our blog. If you face any problem creating this Parallax Image Gallery using HTML, CSS & JavaScript, then contact us or comment us. We'll try to provide a solution to your problem as soon as possible.
Post a Comment
Thank you
Learning robo team