DORONIN_DMYTRO-w1-Browser#1
Open
Dmytro-Doronin wants to merge 5 commits intoHackYourAssignment:mainfrom
Open
Conversation
dardecena
approved these changes
Sep 24, 2025
dardecena
left a comment
There was a problem hiding this comment.
Great work, especially the catWalk exercise. The code is clean and easy to follow. A job well done.
Comment on lines
+21
to
+24
| const ul = document.createElement('ul') | ||
| ul.style.listStyle = 'none' | ||
| ul.style.display = 'flex' | ||
| ul.style.gap = '10px' |
Comment on lines
+29
to
+33
| if (book.alreadyRead) { | ||
| li.style.backgroundColor = 'green' | ||
| } else { | ||
| li.style.backgroundColor = 'red' | ||
| } |
Comment on lines
+35
to
+36
| const p = document.createElement('p') | ||
| p.textContent = `${book.title} by ${book.author}` |
Comment on lines
+38
to
+40
| const img = document.createElement('img') | ||
| img.setAttribute('alt', book.title) | ||
| img.setAttribute('src', book.url) |
Comment on lines
+42
to
+44
| li.appendChild(p) | ||
| li.appendChild(img) | ||
| ul.appendChild(li) |
Comment on lines
+19
to
+20
| position += 10 | ||
| img.style.left = position + 'px' |
Comment on lines
+38
to
+42
| if (position >= end) { | ||
| position = 0 | ||
| img.style.left = '0px' | ||
| dancedThisLap = false | ||
| } |
Comment on lines
+25
to
+36
| if (!dancedThisLap && position >= middle) { | ||
| isDancing = true | ||
| dancedThisLap = true | ||
| clearInterval(timer) | ||
| img.src = DANCE | ||
|
|
||
| setTimeout(() => { | ||
| img.src = WALK | ||
| isDancing = false | ||
| timer = setInterval(step, 50) | ||
| }, 5000) | ||
| } |
Comment on lines
+45
to
+53
| function startWhenReady() { | ||
| if (img.complete && img.naturalWidth > 0) { | ||
| timer = setInterval(step, 50) | ||
| } else { | ||
| img.addEventListener('load', () => { | ||
| timer = setInterval(step, 50) | ||
| }, { once: true }) | ||
| } | ||
| } |
| } | ||
|
|
||
| // TODO execute `catWalk` when the browser has completed loading the page | ||
| window.addEventListener('DOMContentLoaded', catWalk) No newline at end of file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.