kasperlegarth Posted February 25, 2022 Posted February 25, 2022 Hello, I'm trying to have animate a clip path on a div. The div contains an image or a video. The clip path is in a svg, and i use css to apply the clip path, but the animation is laggy. I have tried to insert an image into to the svg the animations i smooth. When i try to use foreignObject to put the video into the svg. The animations is smooth, but there is somekind border on the foreignObject. Currently im stocked how to proceed, what should i search for, how do i debug? In my codepen the first two examples is clippath on a div with some element inside. The next two is the element inside the svg. See the Pen oNoXyYx by legarth (@legarth) on CodePen.
Trapti Posted February 25, 2022 Posted February 25, 2022 The border issue is browser specific it is not happening in Firefox. And I don't know the fix, google search for it.
OSUblake Posted February 25, 2022 Posted February 25, 2022 foreignObject has always been buggy, and I would not suggest to use it. And the animation isn't laggy, it's just a rounding issue with plugin as it only does 2 decimals places, but your paths are normalized to 1. It needs more precision to be smoother. Please standby.
GreenSock Posted February 25, 2022 Posted February 25, 2022 You can set the precision like this: tl.to(test1, {morphSVG:{shape: "#test1-2", precision: 5}}) See the Pen ZEaMOyY?editors=0010 by GreenSock (@GreenSock) on CodePen. 4
kasperlegarth Posted March 15, 2022 Author Posted March 15, 2022 Hey. Thanks so much. I overlooked that setting in the docs
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now