I am currently working on a unique single-page website and I have been experimenting with creating dynamic background animations that change as the user scrolls. Imagine my website is divided into four different sections, each with its own distinct background.
By using jQuery, I have managed to determine the percentage of the scroll being used. As an example, let's assume each section corresponds to 25% intervals (although this may not be entirely accurate). So, from 0-25% we have backgroundA, from 25-50% we have backgroundB, from 50-75% we have backgroundC, and finally from 75-100%, we have backgroundD.
The backgrounds are similar but transition seamlessly from one to another like a ping-pong ball bouncing back and forth across the website. The icons also change accordingly; for instance, a house image might appear on the left in the first background while a magnifying glass image might be displayed on the right in the second background, both sized at 100px by 100px.
What I aim to achieve now is to create a smooth transition or "fluidity" between these backgrounds so it appears as if backgroundA gradually morphs into backgroundB.
I have come across websites showcasing this kind of behavior before, so I believe it can be done. However, I could use some guidance on how to implement it myself.
If you require any further clarification, please feel free to reach out.
Thank you! :)