Skip to content

Cedar: Khandice Schuhmann#64

Open
khandices wants to merge 24 commits intoAda-C16:mainfrom
khandices:main
Open

Cedar: Khandice Schuhmann#64
khandices wants to merge 24 commits intoAda-C16:mainfrom
khandices:main

Conversation

@khandices
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@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!

Comment thread index.html
</head>
<body>

<header id="city_name_header">
Copy link
Copy Markdown

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

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

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.

Comment thread src/index.js Outdated

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

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.

Comment thread src/index.js Outdated
Comment on lines +47 to +48
city_name_header;
change_widgets;
Copy link
Copy Markdown

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