UNPKG

svg-filter-animation

Version:

Plays given SVG-filter animations.

28 lines (23 loc) 780 B
# svg-filter-animation #### Plays given SVG-filter animations created with SVG-Pro See https://github.com/JJ995/svg-pro ## Installation Install package to your project: ```` npm install svg-filter-animation ```` Include package: ```` import SVGFilterAnimation from 'svg-filter-animation'; ```` Paste your generated filter code on your site and link the filter to an element via CSS. e.g.: ``style="filter: url(#svgFilter)"`` Make sure you have set an unique ID for the filter! Place the downloaded keyframes .json-file somewhere accessible on your server. Trigger the animation whenever you want by calling: ``` SVGFilterAnimation.SVGFilterAnimation([PATH_TO_KEYFRAMES]); ``` e.g.: ``` SVGFilterAnimation.SVGFilterAnimation('/keyframes.json'); ```