For days and days I have been trying to recreate the smooth scrolling of this page :
and without success. I see this kind of effect everywhere on awwwards but I have never found the right solution.
It's the best track I have right now, but I don't think it's the right one ...
I would like something that is triggered during the : " wheel ".
<script>
const body = document.body,
scrollWrap = document.getElementsByClassName("smooth-scroll-wrapper")[0],
height = scrollWrap.getBoundingClientRect().height - 1,
speed = 0.04;
let offset = 0;
body.style.height = Math.floor(height) + "px";
function smoothScroll() {
offset += (window.pageYOffset - offset) * speed;
let scroll = `translate3d(0px, ${offset * -1}px, 0)`;
scrollWrap.style.transform = scroll;
callScroll = requestAnimationFrame(smoothScroll);
}
smoothScroll();
</script>