Skip to content

DORONIN_DMYTRO-w1-Browser#1

Open
Dmytro-Doronin wants to merge 5 commits intoHackYourAssignment:mainfrom
Dmytro-Doronin:DMYTRO_DORONIN-w1-Browsers
Open

DORONIN_DMYTRO-w1-Browser#1
Dmytro-Doronin wants to merge 5 commits intoHackYourAssignment:mainfrom
Dmytro-Doronin:DMYTRO_DORONIN-w1-Browsers

Conversation

@Dmytro-Doronin
Copy link

No description provided.

@dardecena dardecena self-requested a review September 24, 2025 15:49
Copy link

@dardecena dardecena 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, 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'

Choose a reason for hiding this comment

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

👍
Nice choice of using flex box.

Comment on lines +29 to +33
if (book.alreadyRead) {
li.style.backgroundColor = 'green'
} else {
li.style.backgroundColor = 'red'
}

Choose a reason for hiding this comment

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

👍

Comment on lines +35 to +36
const p = document.createElement('p')
p.textContent = `${book.title} by ${book.author}`

Choose a reason for hiding this comment

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

👍

Comment on lines +38 to +40
const img = document.createElement('img')
img.setAttribute('alt', book.title)
img.setAttribute('src', book.url)

Choose a reason for hiding this comment

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

👍

Comment on lines +42 to +44
li.appendChild(p)
li.appendChild(img)
ul.appendChild(li)

Choose a reason for hiding this comment

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

👍

Comment on lines +19 to +20
position += 10
img.style.left = position + 'px'

Choose a reason for hiding this comment

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

👍

Comment on lines +38 to +42
if (position >= end) {
position = 0
img.style.left = '0px'
dancedThisLap = false
}

Choose a reason for hiding this comment

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

👍

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

Choose a reason for hiding this comment

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

👍

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

Choose a reason for hiding this comment

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

👍

}

// TODO execute `catWalk` when the browser has completed loading the page
window.addEventListener('DOMContentLoaded', catWalk) No newline at end of file

Choose a reason for hiding this comment

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

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants