How to write a function that would work like this: when the screen width was reduced, the slides would gradually slide under each other and at the same time the scrolling ar