I am trying to create a smooth scrolling horizontal slider animation inspired by the one here https://weltio.com/
As visible in weltio, as you scroll you get a sticky smooth slider of images and content inside.
My page is filled with content and what I would like to achieve is that once that section is scrolled to, I want the div to occupy the screen and as you scroll down it changes the content.
-------------------------------------------------------------------------------
I have been looking for videos and examples for so long and I can't seem to achieve that desired, smooth sticky animated design I am looking for because I can't seem to find any similar examples I can use online.
This is the last solution I came to but it still does not look smooth as the user can sense the scroll on the page where as I want it to be sticky in place and give that same smooth effect demonstrated in weltio.
.contain {
position: relative;
width: 100%;
height: 100vh;
overflow: auto;
scroll-behaviour: smooth;
scroll-snap-type: y mandatory;
}
.sec {
position: relative;
width: 100%;
height: 100vh;
display: flex;
justify-content: center;
align-items: centre;
background: #f00;
scroll-snap-align: center;
background-attachment: fixed;
background-size: cover;
background-position: center;
background-blend-mode: multiply;
}
h3 {
color: #ffffff;
font-size: 10vw;
text-align: center;
margin: 0 50px;
}
.sec:nth-child(1) {
background: #f00 url(./big-bgr.png);
}
.sec:nth-child(2) {
background: #0f0 url(./big-bgr.png);
}
.sec:nth-child(3) {
background: #ff0 url(./big-bgr.png);
}
.sec:nth-child(4) {
background: #f436ee url(./big-bgr.png);
}
.sec:nth-child(5) {
background: #00f url(./big-bgr.png);
}
.content {
position: absolute;
top: 0;
width: 100%;
text-align: center;
}
.content h2 {
position: relative;
display: flex;
justify-content: center;
}
.content h2 span {
position: sticky;
top: 0;
line-height: 100vh;
height: 100vh;
color: #ffffff;
font-size: 14vw;
margin-top: calc(100vh * var(--i));
}
<div class="banner">
<div class="contain">
<div class="sec">
<h3>Scroll Down</h3>
</div>
<div class="sec"></div>
<div class="sec"></div>
<div class="sec"></div>
<div class="sec"></div>
<div class="content">
<h2>
<span style="--i:1;">T</span>
<span style="--i:2;">E</span>
<span style="--i:3;">S</span>
<span style="--i:4;">T</span>
</h2>
</div>
</div>
</div>