Rain Machine Demo v0.0.1

Usage: Import the library and include the following line in your javascript
new RainMachine(query, options)
query: querySelector text like ".rain-container" options: options object, all properties are optional
precipitation 'rain' | 'snow' | 'hail'
wind 0 | 1 | 2
numClouds #clouds to show
now current time
lightData: {sunrise, sunset} sunrise and sunset are both date objects
To make a request to the API, simply use the url "https://rainmachinejs.herokuapp.com/weather/{City Name}"
What you will get in return is a valid options object for the library.

Precipitation:

Wind:

Clouds:

Time:




Source Code:

From Buttons const rm = new RainMachine('.rain-container', {options})
Live Query
fetch(`https://rainmachinejs.herokuapp.com/weather/Winnipeg`)
  .then(res => res.json())
  .then(() => {
    const rm = new RainMachine('.rain-container', json)
  })
  .catch(console.error)