1.0.4 • Published 6 years ago

stencil-skycons v1.0.4

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

Built With Stencil

st-skycons

st-skycons is a web component built with Stencil that allows you to use the Skycons weather icons.

Demo

Getting Started

To try this component:

git clone git@github.com:andregoncalves/stencil-skycons.git skycons
cd skycons
git remote rm origin

and run:

npm install
npm start

Using this component

Script tag

  • Put <script src='https://unpkg.com/stencil-skycons@latest/dist/skycons.js'></script> in the head of your index.html
  • Then you can use the component

Node Modules

  • Run npm install stencil-skycons --save
  • Put a script tag similar to this <script src='node_modules/stencil-skycons/dist/skycons.js></script> in the head of your index.html
  • Then you can use the element <st-skycons> anywhere in your template, JSX, html etc

In a stencil-starter app

  • Run npm install stencil-skycons --save
  • Add { name: 'stencil-skycons' } to your collections
  • Then you can use the element <st-skycons> anywhere in your template, JSX, html etc

Parameters

AttributeDefaultDescription
width64Canvas width
height64Canvas height
icon''The icon, see available icons below
colorblackThe icon color
autoplaytrueThe animation auto starts

Methods

You can change the icon, play and pause the animation:

element = document.querySelector('st-skycons');
element.setAttribute('icon', 'RAIN');
element.pause();
element.play();

Available Icons

'CLEAR_DAY'
'CLEAR_NIGHT'
'PARTLY_CLOUDY_DAY'
'PARTLY_CLOUDY_NIGHT'
'CLOUDY'
'RAIN'
'SLEET'
'SNOW'
'WIND'
'FOG'
1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago