You've created an extra file offset.js to calculate the offset from an element with translation, why didn't you use simply getBoundingClientRect(). It has perfect support and also includes the translation. (You could save several lines of code)
If I'm not wrong, getBoundingClientRect() gives the position and dimension of the elements by automatically taking into account, the transformations applied via css. The offset.js file here calculates the coordinates without considering any translations, which is what might be needed in this context. Please correct me if I'm wrong about this.
Yeah, but the description of the method say [...] including these with translation. So I guess, he actually want to include the transition offset. I'm confused.
Yup. That's correct. Maybe a change in the description reflecting the correct purpose of the offset function would do because currently it gives the position of the elements without taking any translations into account (unless of course I'm missing something).
Yes, that would be nice, maybe @michalsnik could change this so it won't confuse others :)
Hey, good point. Maybe this comment isn't too descriptive. What I'm calculating there is offset without any translations. Initially I tried to use getBoundingClientReact, but it take translations into consideration and in result, when element before animation has been transformed vertically down 200px, it's trigger point for animation would've been also shifted by 200px than the desired one (after animation), so I had to calculate what would've been the final position of the element and set trigger points based on it :)
I updated it on next branch and will release together with other changes.
Most helpful comment
I updated it on
nextbranch and will release together with other changes.