-
Notifications
You must be signed in to change notification settings - Fork 4
DARYNA_TKACHENKO-w1-browsers #3
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
base: main
Are you sure you want to change the base?
DARYNA_TKACHENKO-w1-browsers #3
Conversation
acadavid
left a comment
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.
@dashaaaa21 Great job! Almost there. Some minor adjustments to make.
| -----------------------------------------------------------------------------*/ | ||
| //cspell: enable | ||
|
|
||
| function createBookList(books) { |
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 job here!
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.
Tkank you!
| const currentTime = hours + ':' + minutes + ':' + seconds; | ||
| const timeElement = document.getElementById('time'); | ||
| if (timeElement) { | ||
| timeElement.textContent = currentTime; |
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.
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.
Thank you very much, I have already changed this assignment
| -----------------------------------------------------------------------------*/ | ||
| function catWalk() { | ||
| // TODO complete this function | ||
| const img = document.querySelector('img'); |
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.
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.
Thank you very much, I have already changed this assignment
acadavid
left a comment
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.
Looks good! I left a final suggestion for you to simplify the code and get rid of an unnecessary method. Would you mind changing that? But I'll approve your homework already 👍
| if (img.complete && img.naturalWidth > 0) { | ||
| timer = setInterval(step, 50); | ||
| } else { | ||
| img.addEventListener('load', () => { |
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 see that you're using load here, but you already have window.addEventListener('DOMContentLoaded', catWalk);. DOMContentLoaded awaits for the DOM elements (p, spans, etc) to be loaded, but not for the rest of the elements to be loaded like images. load does wait for them as I see you're trying to do here, also by checkingimg.complete.
Can you simplify the code to avoid the startWhenReady() method? You can modify the eventListener for catWalk :)
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.
Thank you very much, I’ve already changed exercise 5


No description provided.