Beware that the value is calculated when the code is evaluated. So if you set a Timeline at page load, then resize your window, and finnaly play the Timeline, you may have incorrect values.
Btw, tried this too, but it's still evaluated when the Timeline is set, not when the actual animation is triggered:
transform in vh units
in GSAP
Posted
you can also create a small function to get viewport units like this (ES6):
Then use it like this:
Beware that the value is calculated when the code is evaluated. So if you set a Timeline at page load, then resize your window, and finnaly play the Timeline, you may have incorrect values.
Btw, tried this too, but it's still evaluated when the Timeline is set, not when the actual animation is triggered:
If someone knows how to handle this... My guess is that it's not possible for performance reasons.