Skip to content

ITP London_Jan 2025| Samunta Sunuwar | Module Data Groups | Sprint 3| Slideshow #515

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

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

Conversation

Samunta
Copy link

@Samunta Samunta commented Apr 22, 2025

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with COHORT_NAME | FIRST_NAME LAST_NAME | REPO_NAME | WEEK
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

@Samunta Samunta added the Needs Review Participant to add when requesting review label Apr 22, 2025
@Samunta Samunta linked an issue Apr 22, 2025 that may be closed by this pull request
5 tasks
@illicitonion illicitonion added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Participant to add when requesting review labels Apr 30, 2025
Copy link
Member

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

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

This is looking really good - a few small things to think about, but everything is looking well done.

<button type="button" id="backward-btn">Backwards</button>
<button id="stop">Stop</button>
<button type="button" id="forward-btn">Forward</button>
<button type="button" id="auto-backward">Auto Backward</button>
Copy link
Member

Choose a reason for hiding this comment

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

I found it a little surprising that "Auto Backwards" is in the "Forwards" direction end of the buttons, and "Auto Forwards" was in the "Backwards" direction end of the buttons. Is there a reason you ordered them like this? Would it perhaps be more clear if you swapped them?

Comment on lines +36 to +50
function startAutoForward() {
stopSlideshow();
slideshowInterval = setInterval(goForward, 2000);
autoForwardBtn.disabled = true;
autoBackwardBtn.disabled = true;
}

// Auto Backward logic
function startAutoBackward() {
stopSlideshow();
slideshowInterval = setInterval(goBackward, 2000);
autoForwardBtn.disabled = true;
autoBackwardBtn.disabled = true;
}
Copy link
Member

Choose a reason for hiding this comment

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

These two functions seem to mostly do the same thing.

Imagine if we decided we also wanted to disable the "Forward" and "Backward" buttons when in auto mode, and only allow the "Stop" button to be pressed. We would need to make the same change to both of these functions. Maybe we wouldn't remember this, and would only change one, and have a bug.

Can you think of a way to avoid this, so that we re-use this code across both functions, rather than having two copies of it?

let currentIndex = 0;
const carouselImg = document.getElementById("carousel-img");
Copy link
Member

Choose a reason for hiding this comment

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

In general your naming in this PR is really good. The variables are really clear what they are and what they're for, the functions have really clear names - I can tell what they do from just their names, etc. Good job!

@illicitonion illicitonion added Reviewed Volunteer to add when completing a review and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reviewed Volunteer to add when completing a review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TECH ED] Build slideshow app
2 participants