1.0.8 • Published 3 years ago

@deadlyjack/trails v1.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

TRAILS.js

Create trails like effect for text and svg image using JavaScript canvas.

Usage

How to import?

import Trails from 'trails';

How to use it for text

const $canvas = document.getElementById('canvas');
(async ()=>{
  const trails = await Trails.fromText(
    'foxdebug',
    './Lobster/Lobster-Regular.ttf',
    $canvas
  );
  animation();
})();

window.addEventListener('resize', trails.resize);

function animation() {
  trails.update();
  requestAnimationFrame(animation);
}

Docs

Methods

fromText: Use this method to render text on canvas

fromSVG: Use this method to render svg file on canvas

1.0.8

3 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago