__smm_static_temp_content__

Getting Started

Install

npm i follow-path

Import

import FollowPath from 'follow-path';

Or include the built file directly:

<script src="node_modules/follow-path/dist/index.js"></script>

Minimal setup

<svg height="700" width="1000">
  <polyline points="0,350 200,100 400,400 600,50 1000,350"
            style="fill:transparent;stroke:black;stroke-width:5px" />
</svg>
<div class="element"></div>
const fp = new FollowPath({
  element: document.querySelector('.element'),
  duration: 3000,
  path: document.querySelector('polyline'),
  iterations: 2
});

fp.animate();