eklem / yr-icons

Weather symbols from Yr.no's weather forecast api. Delivered as monochrome Web font.
MIT License
1 stars 0 forks source link

Yr-icons

Icon set for weather data provided by Yr.no. Developed for monochrome e-paper/e-ink screens in mind. Heavily inspired by Matmonsen/yr-icons. Used to be a fork.

More information about the different weather symbols and wind arrows. Warning icons may be developed later. Create an issue if there is something additional you need.

Installation

Install from NPM

npm i yr-icons

Reference the main css file

  <link rel="stylesheet" href="https://github.com/eklem/yr-icons/blob/trunk/yr-icons/style.css">

CDN

  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/yr-icons@1.1.0/style.css">

Usage

Yr's location forecast outputs weather summaries like clearsky_day or lightssnowshowersandthunder_day. The weather icons have matching CSS class references for easy integration. HTML example:

  <i class="yr-icon-clearsky_day"></i>
  <i class="yr-icon-lightssnowshowersandthunder_day"></i>
  <i class="yr-icon-fog"></i>

The wind arrows follows the Beaufort scale, which needs a translation from meters/second that the same Yr API outputs. The good part is that wind direction is easily translated from Yr's API. The only thing you need to do is to round the number to the closest integer.

  <i class="yr-wind-beauf-2 yr-wind-from-direction-10"></i>
  <i class="yr-wind-beauf-3 yr-wind-from-direction-20"></i>
  <i class="yr-wind-beauf-3 yr-wind-from-direction-30"></i>

Icons

Icons overview

HTML example for all weather and wind icons and css classes.

License