How to create an infinity scroll? (Stack pages vertically)

I am using the “Stack all pages vertically” option and I would like it to seamlessly go back to the first page once it reaches the last page, creating an infinite scroll effect. I tried applying some JS code to achieve this, but it didn’t work. Does anyone have a code for this or any workaround to achieve this effect?

Thanks

this might be pretty hard to implement.

With custom code you could set up a observer if an element is in view. so that if this element, for example the footer is in view jump to the beggining of the page. But it might be a bit confusing and wouldn´t be the infinite scroll behaviour you might want to achieve…