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

Cedar: Khandice Schuhmann #64

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

Cedar: Khandice Schuhmann #64

wants to merge 24 commits into from

Conversation

khandices
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 your first javascript on the web project! You've met the learning goals around dynamically applying styles and event handling. I've left a few in-line comments on small ways you may consider refactoring. Nice work!

</head>
<body>

<header id="city_name_header">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work writing semantic html

src/index.js Outdated
change_widgets;
const createGroundListener = () => {
document.getElementById('temp_display').addEventListener('DOMSubtreeModified', function () {
if (document.getElementById('temp_display').innerHTML <= 44) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work dynamically implementing these styles. It looks great!

Notice that there is quite a bit of repeated code here. Here are a couple ways you might consider refactoring. 1) Rather than applying the style directly to the element, you could assign a class to each element here, and then use that class to apply to styles. Assign each element that you are dynamically styling to a constant, and then you can use that constant to either directly change the style or assign a class name.

src/index.js Outdated

const createResetListener = () => {
const resetButton = document.getElementById('reset');
resetButton.addEventListener('click', function(){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the callback functions in each of the addEventListener functions, consider encapsulating that functionality in a named function rather than an anonymous function to enhance readability.

src/index.js Outdated
Comment on lines 47 to 48
city_name_header;
change_widgets;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like these lines can be removed

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