Weather project - Solhee Jin, Renata Murzina#7
Weather project - Solhee Jin, Renata Murzina#7RenaSpb wants to merge 32 commits intoAda-C23:mainfrom
Conversation
…e unit as displayed temp
There was a problem hiding this comment.
I believe that we aren't supposed to have the package-lock.json and package.json files, but they got added at some point while we were applying EsLint/Prettier -- please let us know if you need them to be deleted for grading purposes or such!
mikellewade
left a comment
There was a problem hiding this comment.
Renata and Solhee, great work on your Weather Report project!
| </section> | ||
| </div> | ||
|
|
||
| <script src="https://unpkg.com/axios/dist/axios.min.js"></script> |
| @@ -1,15 +1,87 @@ | |||
| <!DOCTYPE html> | |||
| <!doctype html> | |||
There was a problem hiding this comment.
Is there a reason this got changed to lowercase, or was it a side effect of something else?
| <!doctype html> | |
| <!DOCTYPE html> |
| <meta charset="UTF-8" /> | ||
| <meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
There was a problem hiding this comment.
You are good here, but just a warning about trailing / in HTML:
| <title>Weather Report</title> | ||
| <link rel="preconnect" href="https://fonts.gstatic.com"> | ||
| <link href="https://fonts.googleapis.com/css2?family=Rubik&display=swap" rel="stylesheet"> | ||
| <link rel="icon" type="image/png" href="https://www.principalrelocation.com/wp-content/uploads/2018/06/cloud.png`" /> |
There was a problem hiding this comment.
Seems like your tab icon wasn't loading because of a (`) being left in the href.
| <link rel="icon" type="image/png" href="https://www.principalrelocation.com/wp-content/uploads/2018/06/cloud.png`" /> | |
| <link rel="icon" type="image/png" href="https://www.principalrelocation.com/wp-content/uploads/2018/06/cloud.png" /> |
| <h1>Weather Report</h1> | ||
| <h2> | ||
| For the lovely city of | ||
| <span id="headerCityName" class="header__city-name"></span> |
There was a problem hiding this comment.
@RenaSpb and @ellenjin, I'm commenting here but it could be applied to your class naming in general. Your naming conventions for them are, in some cases, inconsistent (city-name__section vs city-input-wrapper) and a bit redundant (header__header). You'll want to make sure that you being consistent and meaningful when naming classes. This isn't blocking, just a suggestion to improve long-term maintainability and consistency.
There was a problem hiding this comment.
Actually, you can disregard this! I see that it is from the template! LOL
| }) | ||
| .catch((error) => { | ||
| console.log('Error:', error); | ||
| alert('Enter right city name!'); |
There was a problem hiding this comment.
Being that this could go wrong for a number of reasons, I 'd probably not state in the alert to enter a correct city name. That would misleading in cases where it isn't user error.
|
|
||
| const getRealWeather = (lat, lon) => { | ||
| axios | ||
| .get('http://localhost:5000/weather', { |
There was a problem hiding this comment.
You could use a constant variable, say BASE_URL, that way you won't have to change the url in multiple places come deployment.
| }); | ||
| }; | ||
|
|
||
| updateTempEmoji(); |
There was a problem hiding this comment.
This could also be moved inside of the DOMContentLoaded event. But despite that, it feels a bit misplaced, this function being called in the middle of function defintions. Maybe we could move it to the top or bottom?
| switch (selected) { | ||
| case 'Sunny': | ||
| skyDisplay.textContent = '☀️'; | ||
| document.body.classList.add('sunny-bg'); | ||
| break; | ||
| case 'Cloudy': | ||
| skyDisplay.textContent = '☁️'; | ||
| document.body.classList.add('cloudy-bg'); | ||
| break; | ||
| case 'Rainy': | ||
| skyDisplay.textContent = '🌧️'; | ||
| document.body.classList.add('rainy-bg'); | ||
| break; | ||
| case 'Snowy': | ||
| skyDisplay.textContent = '❄️'; | ||
| document.body.classList.add('snowy-bg'); | ||
| break; | ||
| default: | ||
| skyDisplay.textContent = ''; | ||
| } |
| let isFahrenheit = true; | ||
| let currentTemp = 50; | ||
|
|
||
| function updateCityName() { |
There was a problem hiding this comment.
No description provided.