Hi.
I'm animating a div container clip-path using gsap. The idea here is to turn the container from a rectangle shape into a pill shape.
This is how I'm doing it inside a timeline:
const videoPinTl = $gsap.timeline({
scrollTrigger: {
trigger: '.video-wrapper-pin',
start: `center center`,
end: "+=1000",
pin: true,
scrub: true,
}
})
.fromTo('.video',
{
clipPath: 'inset(0% 0% round 50px)',
}, {
duration: 1,
clipPath: `inset(46% 34% round 140px)`,
})
Code above works fine in all browsers except Safari in which the shape radius bugs out while scrolling. I think the reason for this is because of the decimal values when animating from 50px to 140px. If I inspect the devtools and do a "manual" animation from 50px to 140px (without decimals) it doesn't bug.
Is there a way to make it so that the clipPath border-radius does not use decimal values while animating?
Thanks.