(This page includes affiliate links. If you click and purchase, I receive a small commission at no extra cost from you and that way you can support me. I only recommend tools that I have personally used and loved.)
Get Elementor Pro Today –
1 – Elementor Pro
Don’t want to make from scratch? Get the template instead 🙂
Animated Photo Collage Gallery Reveal based on scroll – Elementor & GSAP code (v1)
- dm-scroll-reveal-image-wrapper is the CSS class of the container that has all the images. Ideally, it should be 100vh height.
- dm-scroll-reveal-image is the CSS class of the images that need to show when scrolling down.
- The images are given position absolute and rotate value. (In this case we do it via Elementor editor, but you can do it via code too)
- In below code, change 1000% in end:’1000% 50%’ to your desired value to change the amount of scroll needed.
- Make markers:true to see it better and then make it false after all changes are done.
- rotate:’50deg’ is used to add rotation to images, you can change this value to your desired angle.
Animated Photo Collage Gallery Reveal based on scroll – Elementor & GSAP code (v2)
- dm-scroll-reveal-image-wrapper is the CSS class of the container that has all the images. Ideally, it should be 100vh height.
- dm-scroll-reveal-image is the CSS class of the images that need to show when scrolling down.
- The images are given position absolute and rotate value. (In this case we do it via Elementor editor, but you can do it via code too)
- In below code, change end value “300%” in end: ‘300% 50%’ to your desired value to increase/decrease amount of scrolling needed.
- After all changes make markers:false to hide the markers on screen.
- We have used array to control each image individually. Example in below code – dmScrollRevealImage[0] is the first image, dmScrollRevealImage[1] is the second image and so on.
- This allows us to use different y value and rotate value for each individual image.
- To add images, simply copy code from line 74 to 79 below and increase the array number (6 in this case) in dmScrollRevealImage[6] ,
- Important: In this code, I have used y:1000, y:1200 and so on, it basically moves the image 1000px below original location. I would recommend using y:’120vh’, y:’130vh’, and so on for better responsiveness. vh is basically viewport height, you can think of it as % in height. Using this makes sure that the images are always starting from outside the screen. If you use px, then in some vertical screens, it will be visible before even scrolling. I have added comments showing where to add vh values, it’s your choice whether to use it or not. You can check above youtube video at 13:45 to understand it better.
Add Smooth Scroll for better effect
The below code is used to add smooth scrolling with lenis js. You can use any other plugin too.