|
1 | 1 | # Open API App |
2 | 2 |
|
3 | | -[Open Meteo](https://open-meteo.com) |
4 | | -[Open Meteo Geocoding]("https://open-meteo.com/en/docs/geocoding-api) |
| 3 | +**_Data provided by Open-Meteo:_** |
| 4 | + |
| 5 | +- [Open Meteo](https://open-meteo.com) |
| 6 | +- [Open Meteo Geocoding](https://open-meteo.com/en/docs/geocoding-api) |
| 7 | + |
| 8 | +## Live site |
| 9 | + |
| 10 | +- Click on the link to the upper right of this page to access the live link (pending......) |
5 | 11 |
|
6 | 12 | ## Overview |
7 | 13 |
|
8 | | -- A simple weather app that uses Open Meteo APIs to show real-time weather data based on the user's city input |
9 | | -- The app displays a weather code illustration, temperature, and the city and country names |
| 14 | +- A simple weather app that uses Open Meteo APIs to show real-time weather data for the US based on the user's zip code input |
| 15 | +- The app displays current temperature, city, state and an illustration based on the called api's weather code |
| 16 | +- The user can then click on a second icon that will reveal the apparent temperature, wind speed, wind direction and UV index for the selected zip code |
| 17 | + |
| 18 | +<p> |
| 19 | + <img src="images/default-screenshot.png" alt="weather app default display" height="50%"> |
| 20 | + <img src="images/example-screenshot.png" alt="weather app example display (New York zip code 10001)" height="50%"> |
| 21 | +</p> |
10 | 22 |
|
11 | 23 | ## How It Works |
12 | 24 |
|
13 | | -The user enters the name of a city, and the app displays: |
| 25 | +The user enters a zip code, clicks on the temperature icon and the app displays: |
14 | 26 |
|
15 | | -- A weather code illustration |
16 | 27 | - The current temperature |
17 | | -- The city and country names |
| 28 | +- The city and state names |
| 29 | +- An illustration I have designed that reflects the weather code |
| 30 | + |
| 31 | +The user can then select the "angles-down" icon in order to display additional weather conditions: |
| 32 | + |
| 33 | +- Apparent temperature |
| 34 | +- Wind speed |
| 35 | +- Wind direction |
| 36 | +- UV index |
18 | 37 |
|
19 | 38 | ## Key Features |
20 | 39 |
|
21 | | -- Fetches live weather data using two Open Meteo APIs |
22 | | -- Displays weather condition (via an illustration), temperature and location |
| 40 | +- Fetches live weather data using two Open Meteo APIs from user's zip code input |
| 41 | +- Displays various weather conditions |
23 | 42 | - Pulling API data with async/await JavaScript promises as well as helper functions |
24 | 43 |
|
25 | | -## Still in Progress |
| 44 | +## App Checklist Examples |
| 45 | + |
| 46 | +### API Requirement |
| 47 | + |
| 48 | +- Added two search buttons |
| 49 | + |
| 50 | +### HTML |
| 51 | + |
| 52 | +- Added copyright in footer |
| 53 | +- Reconsidered Google Fonts (Kept Unica and changed Roboto to Lexend) |
| 54 | +- Created a favicon |
| 55 | + |
| 56 | +### CSS |
| 57 | + |
| 58 | +- Stored CSS and JS files in folders |
| 59 | +- Decided that layout should be in a column on all sizes |
| 60 | +- Centered the placeholder in the zip code input field |
| 61 | +- Showing a default sun illustration when the app loads |
| 62 | +- Added media queries for larger displays |
| 63 | +- Added colors as variables in :root |
| 64 | + |
| 65 | +### JS |
| 66 | + |
| 67 | +- Used global variables for access in helper functions |
| 68 | +- Corrected the image paths after placing script.js in a js folder |
| 69 | +- Added "Just a sec..." for temp if it takes too long to load |
| 70 | +- Added night images (to replace two images of suns if local time is night) based on isDay variable |
| 71 | +- Decided which weather details to add from the second api async function call |
| 72 | +- Converted celsius into fahrenheit (in more information api call) |
| 73 | +- Used wind range based on Beaufort wind scale |
| 74 | +- Clear user input when and placeholder when user enters a new search based on zip code |
| 75 | + |
| 76 | +### Error message handling |
| 77 | + |
| 78 | +- Checked for valid 5 number zip code |
| 79 | +- Display an error message if no zip code is entered or if the input is invalid |
| 80 | + |
| 81 | +## Future considerations |
| 82 | + |
| 83 | +- Had issues with linear-gradient background color. Will possibly add that at a later date and overcome CSS issues (height, overlap of text, etc.) |
| 84 | +- Example of linear-gradient code: |
| 85 | + |
| 86 | +```css |
| 87 | +linear-gradient(145deg, #fff085, #feba17) |
| 88 | +``` |
26 | 89 |
|
27 | | -- Complete function that displays illustration based on city's weather code |
28 | | -- Show a default sun illustration when the app loads |
29 | | -- Display an error message if no city is entered or if the input is invalid |
30 | | -- Clear the input field after displaying the city data |
| 90 | +- Optimize padding and margins even more |
| 91 | +- When clicking outside of zip code field - be able to clear too? |
0 commit comments