1.0.0 • Published 1 year ago

weather-conditions-icons v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Weather Conditions Icons ☁️

The Weather Conditions Icons npm package is a comprehensive collection of weather icons designed to enhance the visual representation of different weather conditions. This package simplifies the integration of weather icons into your web applications, providing a wide range of symbols that accurately depict various weather phenomena.

Instillations

npm install weather-conditions-icons

Usage

HTML or JavaScript projects.

With the Weather Conditions Icons package, you can easily integrate weather icons into your HTML or JavaScript projects. Here's a basic example using core JavaScript: const weatherIcons = require('weather-conditions-icons');

// Test for getting the default icon
const defaultIcon = weatherIcons.getDefaultIcon();
console.log('Default Icon:', defaultIcon);

// Get the default icon
const defaultIcon = weatherIcons.getDefaultIcon();
console.log('Default Icon:', defaultIcon);

// Get an icon by name
const iconByName = weatherIcons.getIconByName('set-1', 'Thunderstorm with light rain');
console.log('Icon by Name:', iconByName);

// Get an icon by command
const iconByCommand = weatherIcons.getIconByCommand('set-2', 'thunderstorm_with_light_rain');
console.log('Icon by Command:', iconByCommand);

In React

import React from 'react';
import weatherIcons from 'weather-conditions-icons';

const WeatherComponent = ({ condition }) => {
    // Get the default icon
    const defaultIcon = weatherIcons.getDefaultIcon();

    // Get an icon by name
    const iconByName = weatherIcons.getIconByName('set-1', 'Thunderstorm with light rain');

    // Get an icon by command
    const iconByCommand = weatherIcons.getIconByCommand('set-2', 'thunderstorm_with_light_rain');

    return (
        <div>
            <img src={defaultIcon} alt="Default Icon" />
            <img src={iconByName} alt="Icon One" />
            <img src={iconByCommand} alt="Icon Three" />
        </div>
    );
};

export default WeatherComponent;

In Vue

<template>
<div>
    <!-- Get the default icon -->
    <img :src="weatherIcons.getDefaultIcon()" alt="Default Icon" />

    <!-- Get an icon by name -->
    <img :src="weatherIcons.getIconByName('set-2', 'Thunderstorm with light rain')" alt="Icon One" />

    <!-- Get an icon by command -->
    <img :src="weatherIcons.getIconByCommand('set-1', 'thunderstorm_with_light_rain')" alt="Icon Three" />
</div>
</template>

<script>
import weatherIcons from 'weather-conditions-icons';

    export default {
        data() {
            return {
                weatherIcons,
            };
        },
    };
</script>

In Angular

// app.component.ts
import { Component } from '@angular/core';
import weatherIcons from 'your-package-name';

@Component({
selector: 'app-root',
template: `
    <div>
    <!-- Get the default icon -->
    <img [src]="weatherIcons.getDefaultIcon()" alt="Default Icon" />

    <!-- Get an icon by name -->
    <img [src]="weatherIcons.getIconByName('set-1', 'Thunderstorm with light rain')" alt="Icon One" />

    <!-- Get an icon by command -->
    <img [src]="weatherIcons.getIconByCommand('set-2', 'thunderstorm_with_light_rain')" alt="Icon Three" />
    </div>
`,
})
export class AppComponent {
    weatherIcons = weatherIcons;
}

Icons 😊

1. Thunderstorm

1. thunderstorm with light rain
2. thunderstorm with rain
3. thunderstorm with heavy rain
4. light thunderstorm
5. thunderstorm
6. heavy thunderstorm
7. ragged thunderstorm
8. thunderstorm with light drizzle
9. thunderstorm with drizzle
10. thunderstorm with heavy drizzle

SET-1 (Thunderstorm).


SnoNameCommandIcon
1Thunderstorm with light rainthunderstorm_with_light_rain
2Thunderstorm with rainthunderstorm_with_rain
3Thunderstorm with heavy rainthunderstorm_with_heavy_rain
4Light thunderstormlight_thunderstorm
5Thunderstormthunderstorm
6Heavy thunderstormheavy_thunderstorm
7Ragged thunderstormragged_thunderstorm
8Thunderstorm with light drizzlethunderstorm_with_light_drizzle
9Thunderstorm with drizzlethunderstorm_with_drizzle
10Thunderstorm with heavy drizzlethunderstorm_with_heavy_drizzle

2. Drizzle

1. light intensity drizzle
2. drizzle
3. heavy intensity drizzle
4. light intensity drizzle rain
5. drizzle rain
6. heavy intensity drizzle rain
7. shower rain and drizzle
8. heavy shower rain and drizzle
9. shower drizzle

SET-1 (Drizzle).


SnoNameCommandIcon
1Light intensity drizzlelight_intensity_drizzle
2Drizzledrizzle
3Heavy intensity drizzleheavy_intensity_drizzle
4Light intensity drizzle rainlight_intensity_drizzle_rain
5Drizzle raindrizzle_rain
6Heavy intensity drizzle rainheavy_intensity_drizzle_rain
7Shower rain and drizzleshower_rain_and_drizzle
8Heavy shower rain and drizzleheavy_shower_rain_and_drizzle
9Shower drizzleshower_drizzle

3. Rain

1. light rain
2. moderate rain
3. heavy intensity rain
4. very heavy rain
5. extreme rain
6. freezing rain
7. light intensity shower rain
8. shower rain
9. heavy intensity shower rain
10. ragged shower rain

SET-1 (Rain).


SnoNameCommandIcon
1Light rainlight_rain
2Moderate rainmoderate_rain
3Heavy intensity rainheavy_intensity_rain
4Very heavy rainvery_heavy_rain
5Extreme rainextreme_rain
6Freezing rainfreezing_rain
7Light intensity shower rainlight_intensity_shower_rain
8Shower rainshower_rain
9Heavy intensity shower rainheavy_intensity_shower_rain
10Ragged shower rainragged_shower_rain

4. Snow

1. light snow
2. snow
3. heavy snow
4. sleet
5. light shower sleet
6. shower sleet
7. light rain and snow
8. rain and snow
9. light shower snow
10. shower snow
11. heavy shower snow

SET-1 (Snow).


SnoNameCommandIcon
1Light snowlight_snow
2Snowsnow
3Heavy snowheavy_snow
4Sleetsleet
5Light shower sleetlight_shower_sleet
6Shower sleetshower_sleet
7Light rain and snowlight_rain_and_snow
8Rain and snowrain_and_snow
9Light shower snowlight_shower_snow
10Shower snowshower_snow
11Heavy shower snowheavy_shower_snow

5. Atmosphere

1. mist
2. smoke
3. haze
4. sand_dust whirls
5. fog
6. sand
7. dust
8. volcanic ash
9. squalls
10. tornado

SET-1 (Atmosphere).


SnoNameCommandIcon
1Mistmist
2Smokesmoke
3Hazehaze
4Sand/dust whirlssand_dust_whirls
5Fogfog
6Sandsand
7Dustdust
8Volcanic ashvolcanic_ash
9Squallssqualls
10Tornadotornado

6. Clear

1. clear sky

SET-1 (Clear).


SnoNameCommandIcon
1Clear skyclear_sky

7. Clouds

1. few clouds: 11-25%
2. scattered clouds: 25-50%
3. broken clouds: 51-84%
4. overcast clouds: 85-100%

SET-1 (Clouds).


SnoNameCommandIcon
1Few clouds: 11-25%few_clouds
2Scattered clouds: 25-50%scattered_clouds
3Broken clouds: 51-84%broken_clouds
4Overcast clouds: 85-100%overcast_clouds
1.0.0

1 year ago