The main: All the animation data and global options are included in SVG code itself via class name and HTML5 data attributes. The script finds all these data in your SVG code (file) and produces animations and applies options.
You can add these data and options by hand writing in a code or, the better way, use the Animation Editor for doing that in a WYSIWYG mode. Look for the Editor in the animator folder.
You can animate the following SVG tags only:
circle
, ellipse
, g
, image
, line
, path
, polygon
, polyline
, rect
, text
and use
.
Using animations on any other tag may cause an unexpected results.
Also please keep in mind that the drawLines effect will not work for image
, text
and use
tags.
Here is an example of SVG code (for "Infinity" icon), which is ready to use with the script:
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100" height="100" viewBox="0 0 100 100" data-global-elvn="enableViewport, enableClick, full, startInvisible, responsive, 0, notLoop, 500">
<circle id="loop-background" class="elvn-layer" data-elvn="expandY, in, 0, 800, bounce" fill="#E74C3C" cx="50" cy="50" r="50"></circle>
<path id="loop-sign" class="elvn-layer" data-elvn="drawLines, 800, 800, #065462, 6, notRandom" fill="none" stroke="#F0C419" stroke-width="8" stroke-linecap="square" stroke-miterlimit="10" d="M12.5,50.5c0,10,7,17,17,17c17,0,26-34,43-34c10,0,18,7,18,17s-8,17-18,17c-17,0-26-34-43-34C19.5,33.5,12.5,40.5,12.5,50.5z"></path>
<path id="loop-shade" class="elvn-layer" data-elvn="fade, in, 1400, 200, linear" opacity="0.15" d="M45.938,50.5l5.046,6.516c0,0-2.141,2.797-3.5,4.25c0,0-3.547-3.609-5.477-5.88C43.316,53.983,45.938,50.5,45.938,50.5z"></path>
</svg>
Important! You must have defined width and height and/or viewBox attributes of the main svg
tag. Also the script works only with the pixel units! You can't use em, %, etc., only px. Think of your SVG illustration like any other image which has its own width and height. If you want to make your SVG responsive, simply define responsive option in the data-global-elvn attribute.
If you have to use em, %, etc. instead of px, you can wrap your Enliven 'Em image with an additional div or span and apply styles with em, %, etc. values to it.