Hi again! We subscribed to Shockingly Green, got the plugins, I got them integrated into Nuxt fine, but there is just one anomaly with the animation that is driving me nuts. The LHS circle is visible when the logo is first displayed on the page; you can see the full circle quadrant. Then when the LHS animation with DrawSVG starts, that initial circle shrinks to about half its initial radius, while the circle animation that I actually want to see starts and ends properly. And yet there's only one circle element in the SVG!! I verified this in Chrome devtools. I attached a screenshot with the LHS animation tweened to "drawSVG: "87% 100%"" instead of "drawSVG: "100% 100%"". I can't do a codepen cos it uses DrawSVG, but here's my SVG markup:
<svg id="logo" xmlns="http://www.w3.org/2000/svg" width="420.7448" height="241.5" viewBox="0 0 420.7448 241.5">
<circle id="logo-animatable-lhs" r="112" cx="0" cy="240" stroke="#231f20" stroke-width="224" fill="none"/>
<polygon id="logo-animatable-rhs1" points="420.74503 240.66667 419.91173 240.66667 419.91173 241.5 420.74503 241.5 420.74503 240.66667" fill="#231f20"/>
<polygon id="logo-animatable-rhs2" style="visibility:hidden" points="420.74511 158.8462 333.62138 158.8462 333.62138 241.5 420.74511 241.5 420.74511 158.8462" fill="#231f20"/>
<polygon id="logo-animatable-rhs3" style="visibility:hidden" points="420.745 0 211.428 134.095 288.529 241.5 420.745 241.5 420.745 0" fill="#231f20"/>
</svg>
and here's my code:
gsap.registerPlugin(MorphSVGPlugin, DrawSVGPlugin);
[ "#logo-animatable-rhs1", "logo-animatable-rhs2", "logo-animatable-#rhs3" ].forEach((id) => {
MorphSVGPlugin.convertToPath(id);
});
let totalDur = 6;
let lhsProp = 0.85;
let lhsDur = lhsProp * totalDur;
let rhsDur = totalDur;
let tlLeft = gsap.timeline({ defaults: { duration: 0.01 }});
let tlLeft2 = gsap.timeline({ defaults: { duration: lhsDur }});
let tlRight = gsap.timeline({ defaults: { duration: rhsDur/2 }});
tlLeft.to("#logo-animatable-lhs", { opacity: 1 });
tlLeft2.fromTo("#logo-animatable-lhs", { drawSVG: "100% 100%"}, { drawSVG: "87% 100%" });
tlRight
.to("#logo-animatable-rhs1", { morphSVG: { shape: "#logo-animatable-rhs2" }, ease: "none" })
.to("#logo-animatable-rhs1", { morphSVG: { shape: "#logo-animatable-rhs3" }})
;
Any help GREATLY APPRECIATED!
cheers
PS for some reason my screenshot file upload fails (only 90kb)....hmmm....maybe you can reproduce with my svg and code anyway???