@warnick/forecast-js
Advanced tools
Comparing version 2.3.1 to 2.3.3
{ | ||
"name": "@warnick/forecast-js", | ||
"version": "2.3.1", | ||
"version": "2.3.3", | ||
"description": "Weather data using vue.js", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/ajwarnick/forecast-js", |
196
readme.md
@@ -7,8 +7,6 @@ # ![forecast.js logo](https://raw.githubusercontent.com/ajwarnick/forecast-js/master/logo/logo.png) | ||
## Description | ||
## Description | ||
Using Vue for data binding this app provides both current data, forecast predictions, and weather map for a ZIP code in the United States. The data is obtained from the [National Weather Service (NWS)](https://www.weather.gov) which is supported through federal taxes dollars. This library is markup agnostic and simply provides an object you can inject into your design. | ||
Using Vue for data binding this app provides both current data, forecast predictions, and weather map for a ZIP code in the United States. The data is obtained from the [National Weather Service (NWS)](https://www.weather.gov) which is supported through federal taxes dollars. This library is markup agnostic and simply provides an object you can inject into your design. | ||
## Usage | ||
@@ -26,4 +24,2 @@ | ||
#### Using UNPKG | ||
@@ -34,18 +30,30 @@ | ||
```html | ||
<script src="https://unpkg.com/@warnick/forecast-js/dist/js/forecast.min.js" defer></script> | ||
<link rel="stylesheet" href="https://unpkg.com/@warnick/forecast-js/dist/css/forecast.css"> | ||
<script | ||
src="https://unpkg.com/@warnick/forecast-js/dist/js/forecast.min.js" | ||
defer | ||
></script> | ||
<link | ||
rel="stylesheet" | ||
href="https://unpkg.com/@warnick/forecast-js/dist/css/forecast.css" | ||
/> | ||
``` | ||
### Prerequisite | ||
### Prerequisite | ||
Before you begin there are a few things you need. | ||
##### First (Load JS) | ||
##### First (Load JS) | ||
Import the library into the head of your `index.html` file. | ||
Import the library into the head of your `index.html` file. | ||
```html | ||
<script src="https://unpkg.com/@warnick/forecast-js/dist/js/forecast.min.js" defer></script> | ||
<link rel="stylesheet" href="https://unpkg.com/@warnick/forecast-js/dist/css/forecast.css"> | ||
<link rel="stylesheet" href="/style.css"> | ||
<script | ||
src="https://unpkg.com/@warnick/forecast-js/dist/js/forecast.min.js" | ||
defer | ||
></script> | ||
<link | ||
rel="stylesheet" | ||
href="https://unpkg.com/@warnick/forecast-js/dist/css/forecast.css" | ||
/> | ||
<link rel="stylesheet" href="/style.css" /> | ||
``` | ||
@@ -59,18 +67,21 @@ | ||
<body> | ||
<div class="results" id="app"> | ||
</div> | ||
<div class="results" id="app" data-default-zip="90210"></div> | ||
</body> | ||
``` | ||
Additionally, you can set the default zip here with the data attribute 'data-default-zip'. | ||
##### Third (ZIP Code) | ||
To trigger the fetching of data you will need to use the input for ZIP code. | ||
To trigger the fetching of data you will need to use the input for ZIP code. | ||
```html | ||
<input placeholder="Enter Your ZIP Code" v-on:input="zip_trigger" name="name" id="zip" /> | ||
<input | ||
placeholder="Enter Your ZIP Code" | ||
v-on:input="zip_trigger" | ||
name="name" | ||
id="zip" | ||
/> | ||
``` | ||
### Weather Object | ||
@@ -80,32 +91,24 @@ | ||
There are six main categories of information: location, time, alerts, current, hourly, and forecast. Within each of these there are a myriad of pieces of data you can implement into your application. | ||
There are six main categories of information: location, time, alerts, current, hourly, and forecast. Within each of these there are a myriad of pieces of data you can implement into your application. | ||
#### Location | ||
This is based on the Zip Code entered in the input or retrieved from a browser cookie. This object contains: | ||
This is based on the Zip Code entered in the input or retrieved from a browser cookie. This object contains: | ||
#### Icons | ||
| Icon | Code | Description | | ||
| ------------------------------------------------------------ | ------------ | ---------------------------- | | ||
| ![clear sky icon](https://raw.githubusercontent.com/ajwarnick/ART300_weather_base/master/img/01d.png) | skc | Clear Sky | | ||
| ![few clouds icon](https://raw.githubusercontent.com/ajwarnick/ART300_weather_base/master/img/02d.png) | few | Few Clouds | | ||
| Icon | Code | Description | | ||
| ------------------------------------------------------------------------------------------------------------ | ------------ | ---------------------------- | | ||
| ![clear sky icon](https://raw.githubusercontent.com/ajwarnick/ART300_weather_base/master/img/01d.png) | skc | Clear Sky | | ||
| ![few clouds icon](https://raw.githubusercontent.com/ajwarnick/ART300_weather_base/master/img/02d.png) | few | Few Clouds | | ||
| ![scattered clouds icon](https://raw.githubusercontent.com/ajwarnick/ART300_weather_base/master/img/03d.png) | sct | Scattered Clouds | | ||
| ![broken clouds icon](https://raw.githubusercontent.com/ajwarnick/ART300_weather_base/master/img/04d.png) | bkn | Broken Clouds | | ||
| ![shower rain icon](https://raw.githubusercontent.com/ajwarnick/ART300_weather_base/master/img/09d.png) | rain_showers | Rain Showers | | ||
| ![rain icon](https://raw.githubusercontent.com/ajwarnick/ART300_weather_base/master/img/10d.png) | rain | Rain | | ||
| ![thunderstorm icon](https://raw.githubusercontent.com/ajwarnick/ART300_weather_base/master/img/11d.png) | tsra | Thunderstorm | | ||
| ![snow icon](https://raw.githubusercontent.com/ajwarnick/ART300_weather_base/master/img/13d.png) | snow | Snow | | ||
| ![mist icon](https://raw.githubusercontent.com/ajwarnick/ART300_weather_base/master/img/50d.png) | fog | Fog, Haze, <br />Smoke, Dust | | ||
| ![broken clouds icon](https://raw.githubusercontent.com/ajwarnick/ART300_weather_base/master/img/04d.png) | bkn | Broken Clouds | | ||
| ![shower rain icon](https://raw.githubusercontent.com/ajwarnick/ART300_weather_base/master/img/09d.png) | rain_showers | Rain Showers | | ||
| ![rain icon](https://raw.githubusercontent.com/ajwarnick/ART300_weather_base/master/img/10d.png) | rain | Rain | | ||
| ![thunderstorm icon](https://raw.githubusercontent.com/ajwarnick/ART300_weather_base/master/img/11d.png) | tsra | Thunderstorm | | ||
| ![snow icon](https://raw.githubusercontent.com/ajwarnick/ART300_weather_base/master/img/13d.png) | snow | Snow | | ||
| ![mist icon](https://raw.githubusercontent.com/ajwarnick/ART300_weather_base/master/img/50d.png) | fog | Fog, Haze, <br />Smoke, Dust | | ||
##### Complex Icons | ||
###### Clear Sky / Sunny | ||
@@ -119,4 +122,2 @@ | ||
###### Clouds | ||
@@ -143,4 +144,2 @@ | ||
###### Thunderstorm | ||
@@ -157,4 +156,2 @@ | ||
###### Snow | ||
@@ -175,4 +172,2 @@ | ||
###### Fog/Haze/Smoke | ||
@@ -187,6 +182,4 @@ | ||
### Exemples | ||
### Exemples | ||
###### [Full exmaple](https://codesandbox.io/s/forecast-js-example-v201-in96t) | ||
@@ -204,2 +197,8 @@ | ||
#### [2.3.3] - 2021-10-06 | ||
##### Fixed | ||
Mixed Content Fetch in Hourly and Forecast | ||
#### [2.3.1] - 2021-09-28 | ||
@@ -211,7 +210,6 @@ | ||
##### Added | ||
##### Fixed | ||
Issue with ZIP codes starting with 0 | ||
Issue with ZIP codes starting with 0 | ||
#### [2.3.0] - 2021-09-15 | ||
@@ -227,35 +225,34 @@ | ||
<body> | ||
<div class="results" id="app" data-default-zip="90210"> | ||
</div> | ||
<div class="results" id="app" data-default-zip="90210"></div> | ||
</body> | ||
``` | ||
Added Air Quality object under Current. | ||
Added Air Quality object under Current. | ||
```json | ||
{ | ||
"name":"PM2.5", | ||
"aqi":50, | ||
"range":1, | ||
"discription":"Good", | ||
"details":[ | ||
{ | ||
"name":"PM2.5", | ||
"aqi":50, | ||
"range":1, | ||
"discription":"Good" | ||
}, | ||
{ | ||
"name":"O3", | ||
"aqi":35, | ||
"range":1, | ||
"discription":"Good" | ||
} | ||
] | ||
"name": "PM2.5", | ||
"aqi": 50, | ||
"range": 1, | ||
"discription": "Good", | ||
"details": [ | ||
{ | ||
"name": "PM2.5", | ||
"aqi": 50, | ||
"range": 1, | ||
"discription": "Good" | ||
}, | ||
{ | ||
"name": "O3", | ||
"aqi": 35, | ||
"range": 1, | ||
"discription": "Good" | ||
} | ||
] | ||
} | ||
``` | ||
##### Removed | ||
removed the city variable replaced with location.city | ||
removed the city variable replaced with location.city | ||
@@ -266,5 +263,5 @@ #### [2.2.0] - 2021-09-12 | ||
Moon has changed from .moon to be an object .moon.class is slug (i.e. "waxing-crescent-moon") and .moon.name is human readable (i.e. "Waxing Crescent Moon") this breaks past uses of moon | ||
Moon has changed from .moon to be an object .moon.class is slug (i.e. "waxing-crescent-moon") and .moon.name is human readable (i.e. "Waxing Crescent Moon") this breaks past uses of moon | ||
##### Updated | ||
##### Updated | ||
@@ -274,3 +271,3 @@ Update js-cookie to 3.0.1 | ||
Update rollup-plugin-terser to 7.0.2 | ||
Update vue to 2.6.14 | ||
Update vue to 2.6.14 | ||
Update sunrise-sunset-js to 2.2.1 | ||
@@ -284,6 +281,5 @@ | ||
#### [2.1.0] - 2021-03-31 | ||
##### Updated | ||
##### Updated | ||
@@ -297,3 +293,3 @@ Fetch for zip api now used {mode:'cors'} | ||
weather.current.uv - UV index from the EPA's Envirofacts Data Service API | ||
weather.current.air_quality - Air quality information from EPA's airnow.gov | ||
weather.current.air_quality - Air quality information from EPA's airnow.gov | ||
@@ -306,8 +302,8 @@ #### [2.0.0] - 2020-09-19 | ||
##### Removed | ||
##### Removed | ||
[OpenWeatherMap](https://openweathermap.org/api) and [Weatherbit](https://www.weatherbit.io/api) data | ||
[OpenWeatherMap](https://openweathermap.org/api) and [Weatherbit](https://www.weatherbit.io/api) data | ||
Removed map and moved it to version 3 | ||
##### Depricated | ||
##### Depricated | ||
@@ -322,3 +318,3 @@ current.uv [Hopefully will return in v3] | ||
forecast[i].snow | ||
forecast[i].pres | ||
forecast[i].pres | ||
@@ -329,3 +325,3 @@ #### [1.6.0] - 2020-03-18 | ||
Time is now localized to the time at the zip code | ||
Time is now localized to the time at the zip code | ||
@@ -340,5 +336,4 @@ #### [1.5.0] - 2020-03-18 | ||
Fixed Mixed content (http/https) | ||
Fixed Mixed content (http/https) | ||
#### [1.4.0] - 2020-03-15 | ||
@@ -354,6 +349,4 @@ | ||
Expired dependancies | ||
Expired dependancies | ||
## TODO | ||
@@ -364,3 +357,3 @@ | ||
- ~~have students set default Zip Code and fill it to their id~~ | ||
- ~~get more info from NOA~~ | ||
- ~~get more info from NOA~~ | ||
- Solution for matching multiple icons | ||
@@ -370,12 +363,11 @@ - ~~Add https://www.airnow.gov/?city=Manhattan&state=KS&country=USA~~ | ||
#### v3 | ||
#### v3 | ||
- Add other types of search | ||
- Add map back in | ||
- get mothods written by students and add those dynamically to the vue methods | ||
- Add other types of search | ||
- Add map back in | ||
- get mothods written by students and add those dynamically to the vue methods | ||
- Set User-Agent: (myweatherapp.com, contact@myweatherapp.com) | ||
## Contributors | ||
## Contributors | ||
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. | ||
@@ -385,6 +377,4 @@ | ||
## License | ||
This project is licensed under the MIT License |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
2681712
89532
356