-
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
Paper - Kate Malakhova #59
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.
Nice work Kate, you hit all the learning goals here. I made a couple of minor suggestions, but otherwise this is great work. The site looks very well done. I like the use of CSS Grid!
<p><button id="increase-temp">⬆</button></p> | ||
<p><button id="decrease-temp">⬇</button></p> | ||
</div> | ||
<p> </p><span id="currentTemp">65</span> |
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 would start off the span here with the default class value for 65 degrees.
</header> | ||
<body> | ||
<section class="temperature-section"> | ||
<h2>Temperature (F)</h2> |
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.
Fahrenheit? Sigh, no one here uses rational measurements. (not serious)
@@ -0,0 +1,103 @@ | |||
let currentTemp = 65; | |||
|
|||
const updateTempColor = currentTemp => { |
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 helper function
const increaseTemp = () => { | ||
currentTemp += 1; | ||
updateTemp(currentTemp); | ||
}; | ||
|
||
const decreaseTemp = () => { | ||
currentTemp -= 1; | ||
updateTemp(currentTemp); | ||
}; |
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 a note that you can combine these functions with:
const increaseTemp = () => { | |
currentTemp += 1; | |
updateTemp(currentTemp); | |
}; | |
const decreaseTemp = () => { | |
currentTemp -= 1; | |
updateTemp(currentTemp); | |
}; | |
const changeTemp = (increment) => { | |
currentTemp += increment; | |
updateTemp(currentTemp); | |
}; |
Then we can register the event handler with an anonymous function like this:
increaseTempButton.addEventListener("click", () => updateTemp( +1 ) );
No description provided.