-
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
Pine - Diana #68
base: main
Are you sure you want to change the base?
Pine - Diana #68
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.
Nice work Diana, you hit the learning goals here. Well done. I like the styling, very solid submission.
Other than my comments the only suggestion for improvement I have is to consider adjusting the layout to fit mobile devices. (not important, just a note for later).
const resetButton = document.getElementById('reset'); | ||
resetButton.addEventListener('click', resetCity) | ||
}; | ||
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.
👍
const upTemperature = () => { | ||
const tempUp = document.getElementById('base-temp'); | ||
//Makes temp count go up | ||
state.temperature += 1; | ||
//Making the text content o tempUp = the current temperature | ||
tempUp.textContent = `${state.temperature}`; | ||
//querySelector: Returns the first element | ||
const tempUptemp = document.querySelector('#temperature') | ||
const clothes = document.getElementById('clothes') | ||
temperature() | ||
}; | ||
const downTemperature = () => { | ||
const tempDown = document.getElementById('base-temp'); | ||
state.temperature -= 1; | ||
//Returns every element in the Node | ||
tempDown.textContent = `${state.temperature}`; | ||
//This line is selecting the temperature id | ||
temperature() | ||
}; |
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.
Just note that these two functions could be combined into one that takes a parameter.
Then the event handler could look like.
TemperatureHot.addEventListener('click', () => upTemperature(+1))
and
TemperatureHot.addEventListener('click', () => upTemperature(-1))
You would just need to modify the function to use the parameter instead of a hardcoded state.temperature += 1
or state.temperature -= 1
No description provided.