Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Scissors - Christian #63

wants to merge 2 commits into from

Conversation

Crintion
Copy link

No description provided.

Copy link

@beccaelenzil beccaelenzil left a 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>

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";

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)) {

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:

Suggested change
} else if ((value >= 70) && (value <= 79)) {
} else if (value >= 70) {

};
};

const setGroundLandscape = (tag, value) => {

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.

Comment on lines +72 to +73
var downArrow = document.getElementById("down-arrow");
downArrow.addEventListener("click", decreaseTemp, false);

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants