generated from ManonLef/webpack-eslint-prettier
-
Notifications
You must be signed in to change notification settings - Fork 0
/
notes
97 lines (80 loc) · 4.74 KB
/
notes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Weather APP notes
## Project Requirements
- [x] toggle Fahrenheit or Celsius
- [x] change the look of the page bases on the data
- [x] use Promises or Async/Await in the code
- [x] add a form that lets users input their location
## 2023-05-22 I
- I set up my repo using [the template I created a few weeks aga](https://github.com/ManonLef/webpack-eslint-prettier)
- I will postpone the style loader until a bit later to not bloat the setup immediately and see how it works.
- added the build command to package.json. Might consider adding this to the template so you can use the `npm run build` command:
```
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack"
},
```
- can do the same as above for `watch` with adding `"watch": "webpack --watch"`
## 2023-05-22 II
- I set up some basic functions to get the location based data for the current weather but now I need to start planning to:
- decide which data I'm actually going to display to store inside an object
- plan out modules and I think this will be similar to the to-do list (MVC) where model will deal with the API, view with UI and controller with user clicks and such
## 2023-05-22 III Planning ideas
- Main Elements (checked available in API):
- Location data
- Location name
- Country
- Current Weather
- Current Condition (check different ones on their site)
- This is where I'll base the background on. Probably with a switch/case.
- Conditions available: [found here](https://www.weatherapi.com/docs/weather_conditions.json) from [the docs](https://www.weatherapi.com/docs/#weather-icons)
- Temperature
- Wind direction
- Wind strength
- possible air quality
- Forecast
- Forecast for today (is available in current weather call as well)
- decide on amount of days (if possible to get >3 since I came across a discord post this was limited for the free API plan)
-
- Location input
- Temperature Unit toggle
## 2023-05-23
- Started with populating the object for current weather.
- Have to look up if there's a way to concatenate the temperature unit to extract API data. I might just be overlooking something obvious currently since it's evening and my day was full.
- I added a function to display days of the week for the forecast. Came across some mentions of it not being very scalable in case of many conversions (memory leaks). I could add something like date-fns, but since I'm limiting my forecast to the coming week probable, I will leave this as is.
## 2023-05-24
- smooth sailing so far
- added a basic form to enter location, weather outputs to the console nicely
- added a temperature toggle to toggle between F and C temp units
- both form and "toggle" (which is still a checkbox) are very basic still but they work
## 2023-05-25
- Added enough data for now and imported the basic icons from WeatherAPI itself. I don't feel spending much time on linking all the weather conditions to a custom background adds anything to my learning so these icons will suffice for now
- Spent a while troubleshooting why every single forecast was seven days of sun. I only rendered the forecast during loading but not after entering a new location (facepalm)
- I considered adding a function to start the website with a search result for user location. This didn't work well since even my own browser has location services off by system settings. It turned out the API has an ip option that does seem to work nicely.
## 2023-05-26
- added some styling
- decided to move on from this project for the objective is complete
- In the future I'd like to learn a bit more about error handling options, I only added the basics for now
## 2023-05-28
- had some time to clean up the code, noticed an error I'd want to catch with the temperature not toggling after location unfound
### Notes:
- the condition features icons
## Inspiration (things I thought of building or doing while working on this project)
- Future App idea; create a METAR/TAF weather project for aviation
## To-do's
- [x] 2023-05-22 look into free API options available for forecast
- [x] 2023-05-22 pseudocode/plan
- [x] 2023-05-22 store all the info I actually want to use in one object
- [x] 2023-05-22 at the end of project please make sure to credit WeatherAPI.com [instructions](https://www.weatherapi.com/docs/#credit)
- [x] 2023-05-23 consider extracting temp function as helper
- [x] 2023-05-24 add error handling
- [x] location unknown
- [x] 2023-05-28 fix toggle bug on location error
## Future Additions
- [ ] Hourly forecast for today
- [ ] My own illustrated backgrounds to change the mood depending on weather
- [ ] My own icons
- [ ] SuperMaybe: Add an Aviation Toggle to display TAFs and METARs
- [ ] More specific error handling
## Test with:
- location error: input `av`