yr-icons

Icon set for weather data provided by Yr.no

Usage no npm install needed!

<script type="module">
  import yrIcons from 'https://cdn.skypack.dev/yr-icons';
</script>

README

Yr-icons

Icon set for weather data provided by Yr.no A fork of Matmonsen/yr-icons. Forked to be able to create a NPM package and add a wind arrow font + css for those.

More information about the different weather symbols

Installation

Install from NPM

npm i yr-icons

Reference the main css file

  <link rel="stylesheet" href="./yr-icons/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="ico yr-wind-beauf-2 yr-wind-from-direction-10"></i>
  <i class="ico yr-wind-beauf-3 yr-wind-from-direction-20"></i>
  <i class="ico yr-wind-beauf-3 yr-wind-from-direction-30"></i>

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

License - Yr weather icons

License - Yr wind beaufort scale icons