Skip to content

Improved Skycons by Darksky with typings for TypeScript.

License

Notifications You must be signed in to change notification settings

kygoh/skycons-ts

 
 

Repository files navigation

CircleCI Maintainability

Skycons for TypeScript

This project is a fork of Skycons by DarkSky. Besides providing type definitions, it has more readable source code and is easier to use within a TypeScript application.

All images and animations are unchanged and were designed by DarkSky.

Install

npm install skycons-ts --save

Usage

<canvas id="icon1" width="128" height="128"></canvas>
<canvas id="icon2" width="128" height="128"></canvas>
import { Skycons } from 'skycons-ts';

const skycons = new Skycons({'color': 'blue'});
// on Android, a nasty hack is needed: {'resizeClear': true}

// you can add a canvas by it's ID...
skycons.add('icon1', 'rain');

// ...or by the canvas DOM element itself.
skycons.add(document.getElementById('icon2'), 'rain');

// start animation!
skycons.play();

// you can also halt animation with skycons.pause()

// want to change the icon? no problem:
skycons.set('icon1', 'partly-cloudy-night');

// remove icon
skycons.remove('icon2');

About

Improved Skycons by Darksky with typings for TypeScript.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 100.0%