I'm a newbie to gsap - also rather weak at javascript.
I'm working on a new site with a section that horizontal scrolls - that is working however scroll snap does not align sections with the edge of the viewport as expected.
In the above codepen - I've also got a modal (powered by AlpineJs) that slides in from the left, but because the scroll snap isn't aligning with the edge of the browser it looks wrong. is it possible to have this align to the left edge of the browser
No worries. Just take it one small bit at a time.
What is it you're not understanding? How snap values work or how to adjust the array?
--- Let's look at how to adjust the array. Task - add a 0 to the beginning of the array
Currently we have an empty array, we're then looping through the array of widths, doing a little math and adding the those calculated numbers into the snapValues array.
let snapValues = [];
let prev = 0;
snapValues = widths.map(