Hello masters of animations
Try to adaptive this demo to my own slider but i can't find the right formula to recalculate slides position and trigger active slide when slide touch the right border of div.slider. Slides count can be from 2 to n+.
This is the best thing I came up with. You can change in html slides number and see wrong work of this code
https://codepen.io/1simonianartur1/pen/WNJgdmL
start: () =>
"top top-=" +
(slide.offsetLeft - window.innerWidth / slide_arr.length) *
(max_width / (max_width - window.innerWidth)),
end: () =>
"+=" +
(slide.offsetWidth + gsap.getProperty(slide, "marginRight")) *
(max_width / (max_width - window.innerWidth)),