-
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
Scissors - Christian #63
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 on this project putting together javascript, html, and css to create a dynamic website! Your code is clear and readable. Please let me know if you have any questions about the inline comments.
@@ -0,0 +1,88 @@ | |||
<!DOCTYPE html> |
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, clear, semantic HTML. Nice work!
@@ -0,0 +1,74 @@ | |||
const setIndicatorColor = (tag, value) => { | |||
if (value >= 80) { | |||
tag.style.color = "red"; |
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.
Consider refactoring to assign a className, and then put the styles in the css
file. For example:
#index.js
tag.className = “red”;
#styles.css
.red {
color: red;
}
const setGroundLandscape = (tag, value) => { | ||
if (value >= 80) { | ||
tag.textContent = "🌵__🐍_🦂_🌵🌵__🐍_🏜_🦂"; | ||
} else if ((value >= 70) && (value <= 79)) { |
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.
Minor note: the && is not necessary for this conditional test, we could just have:
} else if ((value >= 70) && (value <= 79)) { | |
} else if (value >= 70) { |
}; | ||
}; | ||
|
||
const setGroundLandscape = (tag, value) => { |
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.
Notice that setGroundLandscape
and setIndicatorColor
have a lot of the same code. Consider how you might write a single function that achieves both pieces of functionality.
var downArrow = document.getElementById("down-arrow"); | ||
downArrow.addEventListener("click", decreaseTemp, false); |
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.
Consider moving all the Event Listener logic into a function called registerEventHandlers
and add this code document.addEventListener("DOMContentLoaded", registerEventHandlers);
to increase readability and changeability.
No description provided.