-
Notifications
You must be signed in to change notification settings - Fork 78
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
Alma-Pine #78
base: main
Are you sure you want to change the base?
Alma-Pine #78
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.
Awesome job Alma! The functionality is spot-on and the JS code is clean. I love the way you re-use your functions and write nice, compact anonymous callbacks. This project is definitely green!
<select id="skySelect"> | ||
<option>Sunny</option> | ||
<option>Cloudy</option> | ||
<option>Rainy</option> | ||
<option>Snowy</option> | ||
</select> |
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 use of select
!
const skyOption = document.getElementById("skySelect"); | ||
const getInput = skyOption.options[skyOption.selectedIndex].value; | ||
const skyContainer = document.getElementById("sky"); |
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 use of const
s here! Also good job getting elements by id
.
const resetCity = () => { | ||
const cityContainer = document.getElementById("cityNameInput"); | ||
cityContainer.value = "Seattle 🌧"; | ||
// reflect that reset on the header | ||
updateCity(); | ||
}; |
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.
I love how you re-use the updateCity
function here!
incButton.addEventListener("click", function () { | ||
tempValue += 1; | ||
updateTemp(tempValue); | ||
}); |
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 anonymous callback!
|
||
// registerEventHandlers() | ||
|
||
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.
Good job on remembering to wait for the DOM to be loaded before registering the event handlers.
justify-content: center; | ||
} | ||
|
||
.mainAarea { |
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.
I think a typo here prevents this style from being applied.
.temperatureText { | ||
display:flex; | ||
/* flex-direction: row-reverse; */ | ||
align-items: center; | ||
padding: 0px 10px 5px 10px; | ||
} |
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 use of flex!
No description provided.