0.1.0 • Published 8 years ago

weather-type-icons v0.1.0

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

weather-type-icons

A javascript library to convert weather-types to SVG icons.

Example

Code

import WeatherType from 'weather-type';
import {draw}      from 'weather-type-icons';

const weatherOption = WeatherType.fromString('storm');
weatherOption.map(weatherType => draw(weatherType, '#body');
  

Output

Storm icon

Further example outputs can be found here.

Install

npm install weather-type-icons --save

Usage

draw(weatherType: WeatherType, selector: string)

Appends an SVG element to an element in the HTML document mathcing the provided CSS selector. The SVG is a pictorial representation of the WeatherType.

Exposed classes

The generated SVG has default fill colours set for each component. However, these can be overridden by adding CSS 'fill' rules to the following CSS selectors:

SelectorDefault fillComponent description
.cloudAny cloud
.cloud.lightlightgreyLight clouds
.cloud.heavygreyHeavy clouds
.raindropdodgerblueRaindrops
.hailwhiteHail stones
.snowflakewhiteSnowflakes
.lightninggoldLightning bolt
.sungoldSun
.icon-textgreyText for Mist & Fog

License

MIT