-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Amethyst Abby Goodman & Winslow Edwards #67
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, Abby + Winslow! 🥳
Thank you for your patience as we catch up on grading. Nice work! The HTML is structured well and the JS is clear and well-factored. This project is a Green. 🟢
Keep it up!
state = { | ||
temp: 50, | ||
city: "Atlanta", | ||
latitude: 0, | ||
longitude: 0 | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job setting up state!
.then((response) => { | ||
let tempK = response.data.main.temp | ||
state.temp = Math.round(((tempK-273.15)*1.8) + 32) | ||
console.log(response.data.main.temp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remember to remove debugging log statements
colorChanging(); | ||
changeGround(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Smart approach!
state.latitude = response.data[0].lat; | ||
state.longitude = response.data[0].lon; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏾
const changeGround = function () { | ||
if (state.temp <= 39) { | ||
document.querySelector("#currentTemp") | ||
const tempGroundContainer = document.querySelector("#groundChange") | ||
tempGroundContainer.textContent = `❄️🌲❄️☃️❄️🏂❄️🌲❄️` | ||
} | ||
|
||
else if (state.temp >= 40 && state.temp <= 59) { | ||
document.querySelector("#currentTemp") | ||
const tempGroundContainer = document.querySelector("#groundChange") | ||
tempGroundContainer.textContent = `🌬️ 🍂 🦃 🌾 🍂 🌰 🐿️ 🌾 🍂` | ||
} | ||
|
||
else if (state.temp >= 60 && state.temp <= 69){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great function naming, this looks really clean 💯 Your conditonal comprehension is very strong
} | ||
} | ||
|
||
const colorChanging = function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥳
} | ||
|
||
const incrementTemp = function() { | ||
state.temp +=1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer state.temp += 1
here for reada😄bility
}; | ||
|
||
const decrementTemp = function() { | ||
state.temp -=1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer state.temp -= 1
here for readability
const getRealTimeTemp = function (){ | ||
findLatitudeAndLongitude(); | ||
colorChanging(); | ||
changeGround(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice way to reuse these functions!
colorChanging(); | ||
} | ||
|
||
const newSKySelect = function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer newSkySelect
here
// colorChangeEffect.addEventListener("click", colorChangeEffect) | ||
}; | ||
|
||
document.addEventListener("DOMContentLoaded", registerEventHandlers); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥳🎉
No description provided.