Skip to main content

Neon light effect in JavaScript using Aninejs | Animejs SVG animation

Animation can be very time consuming if we use vanilla JavaScript and CSS. But there are a lot of JavaScript libraries which can help us in animation. Today I will be using Animejs for animation. Today I will be animating a SVG and give it a neon light effect.

Now let's see the final output first.


You can get this code from GitHub from  here.

Live demo.  

Now let's just jump into the code . I will start with HTML.

So far we have  added a wrapper div which is wrapping the neon div. Div with class neon is the div which will have the SVG code. We have also linked the html with the css file .

Now before adding the SVG, let's give the basic styles to our page.

Now after adding the basic styling we will add the SVG file code.



You guys can have the same SVG file from the GitHub repository. Now let's add styling to the SVG file classes.


Now we will link the Animejs library using the CDN.


Since we have Animejs linked now we can work on the JavaScript part.



And it's done. With the help of Animejs animation of SVG files is so easy. 

That's it for this post, see you guys soon in the next post let me know if find any issues in this tutorials. 

Comments