Skip to content

Weather project - Solhee Jin, Renata Murzina#7

Open
RenaSpb wants to merge 32 commits intoAda-C23:mainfrom
ellenjin:main
Open

Weather project - Solhee Jin, Renata Murzina#7
RenaSpb wants to merge 32 commits intoAda-C23:mainfrom
ellenjin:main

Conversation

@RenaSpb
Copy link

@RenaSpb RenaSpb commented Jun 5, 2025

No description provided.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

Copy link

@mikellewade mikellewade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renata and Solhee, great work on your Weather Report project!

</section>
</div>

<script src="https://unpkg.com/axios/dist/axios.min.js"></script>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⭐️

@@ -1,15 +1,87 @@
<!DOCTYPE html>
<!doctype html>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason this got changed to lowercase, or was it a side effect of something else?

Suggested change
<!doctype html>
<!DOCTYPE html>

Comment on lines +4 to +6
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<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`" />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like your tab icon wasn't loading because of a (`) being left in the href.

Suggested change
<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>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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', {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Comment on lines +123 to +142
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 = '';
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

let isFahrenheit = true;
let currentTemp = 50;

function updateCityName() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In some places you use the function keyword to declare functions and others you use const fnName = ().... You should make sure that you are being consistent in their uses for maintainability and predicatabliity (based on declare them one could have hoisting and the other won't). @ellenjin @RenaSpb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants