Jump to content
Search Community

Trouble distributing images responsively on a diagonal in react/nextjs

noahtrotman test
Moderator Tag

Go to solution Solved by noahtrotman,

Recommended Posts

Hi, 

 

I am currently trying to create an infinite diagonal slider in react/nextjs. One of the issues I am having trouble with is distributing the images diagonally for all viewport sizes. Currently there are 4 images in the array that is being mapped to the screen but I'm just trying to have the screen show 3 on the viewport. One in the bottom left, the center and top right with the images being pinned to its center. (for the bottom left and top right, 3/4 of it would be out of the viewport)

 

I have gotten it to work for some viewport sizes but for others that's not the case and it becomes an issue when I start animating with gsap's modifiers as they become offset very quickly.

 

I've simplified my code in a sandbox to show what I have. Any sort of help/direction would be greatly appreciated.

https://codesandbox.io/s/i4tksf?file=/components/Slider.js

 

Thanks

Noah

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...