Jump to content
Search Community

DrawSVG Plugin

Suprabha test
Moderator Tag

Recommended Posts

Recently I joined GSAP club, I am trying to run drawSVG locally, but couldn't able to. I am getting export error. Please find the error attachment below.

 

NOTE: I am using vanilla JS, and trying to add it in script like:

<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.6.1/gsap.min.js"></script>
<script src="./scripts/DrawSVGPlugin.js"></script>
<script>
var shapes = "rect, circle, ellipse, polyline"
var tl = gsap.timeline({ repeat: -1, yoyo: true })
 
tl.fromTo(
shapes,
{ drawSVG: "100%" },
{ duration: 1, drawSVG: "50% 50%", stagger: 0.1 }
).fromTo(
shapes,
{ drawSVG: "0%" },
{ duration: 0.1, drawSVG: "10%", immediateRender: false },
"+=0.1"
)

 

Not sure what I am missing here.

 

Screenshot 2021-05-26 at 9.08.16 PM.png

Link to comment
Share on other sites

What does the error message say? My guess is that you're trying to use the ES Module file but your environment is set up to expect a plain ES5 file, thus it'll choke on the "export". If that's the case, just use the .min.js file from the "minified" folder of your zip download:

 

<script src="./scripts/DrawSVGPlugin.min.js"></script>

 

  • Like 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...