Beverly Tang
Content Type
Profiles
Forums
Store
Blog
Product
Showcase
FAQ
Downloads
Posts posted by Beverly Tang
-
-
I'm trying to make a background morph into an svg shape by starting with a rect and converting that to a path with MorphSVGPlugin.convertToPath('rect'). However, I'm initially setting the rect size based on the page size (to look like a background color).
How would I make this responsive to page resize? After the rect is converted to a path, I tried creating a new rect but morphSVG doesn't work with the newly replaced path.Is there a way to make this work? (this is a scrolling animation)
Update: When I repeat the timeline action after the resize, it'll sort of work but the morphing is not smooth.
See the Pen zYPNpxe by sublimina (@sublimina) on CodePen
How to update path size after MorphSVG is already initiated
in GSAP
Posted
@elegantseagulls Yes, the height would need to change too. I actually didn't know viewBox was responsive so thank you for that tip!
@GreenSock Thank you for this solution! It is exactly what I was trying to do.