I am currently looking for hours on help how all these modern web apps are built. They seem to have overflow hidden and still animate elements on scroll in all directions.
Example pages I liked and use it: http://www.contiducco.it/chi-siamo & https://theshift.tokyo/
I tried to build something like this using:
componentDidMount() {
var scrollDepth = 0;
$(window).bind("mousewheel DOMMouseScroll", function(event) {
if (
event.originalEvent.wheelDelta < 0 ||
event.originalEvent.detail > 0
) {
var onScrollDown = setTimeout(function() {
scrollDepth = scrollDepth + 1;
this.onScrollDown;
}, 10);
} else {
var onScrollUp = setTimeout(function() {
scrollDepth = scrollDepth - 1;
this.onScrollUp;
console.log(scrollDepth);
}, 10);
}
});
But I guess calculating scrollDepth multiple times per second is pretty bad for the framerates.
Is there a library or simpler/ more efficient way to be able to move elements by scrolling without having the scrollbar?
Thank you for your help