Skip to content
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

[Work In Progress] Image Gallery Component #234

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

Conversation

psastha-patel
Copy link

No description provided.

Copy link
Collaborator

@zoltan-dulac zoltan-dulac left a comment

Choose a reason for hiding this comment

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

In general, this is great work. I especially appreciate how you were able to do all the code walkthrough work without any assistance (it is not exactly the easiest library to work with).

Please expose this as an NPM Module (this will require us to ensure the library is in index.js).

slide.setAttribute('aria-hidden', i !== index);
if(i === index) {
const msg = slide.getAttribute('alt');
slideAlert.innerHTML = `<p>Now showing image with ${msg} </p>`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's remove the <p> tags here. It may interfere with the screen reader alerts in some browsers.

<img src="images/image-gallery/02-laser-disc.jpg" alt="A CD with colorful reflections on its surface, resting on a black case." class="slide">
<img src="images/image-gallery/03-laser-disc.jpg" alt="A large disc with rainbow reflections on its surface, placed on a cluttered table." class="slide">
<img src="images/image-gallery/04-laser-disc.jpg" alt="A person holding a large disc with rainbow reflections on its surface." class="slide">
<img src="images/image-gallery/05-laser-disc.jpg" alt="Two discs with rainbow reflections, one large and one small, on a white background." class="slide">
Copy link
Collaborator

@zoltan-dulac zoltan-dulac Dec 3, 2024

Choose a reason for hiding this comment

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

In general, this is a good demo. I want to make two variations of this component on the page:

  1. A gallery without visible captions under the photos (basically this demo ... but I want to use different images. I would like to add product shots of the Space Invaders miniature arcade game. The pictures are in this gallery, alt text and captions are in the description for each image.
  2. A gallery with visible captions under the photos (this one will use these images). I would like you to use the images in this gallery (alt text and captions are in the description for each image).

<img src="images/next.svg" alt="Display Next Image"/>
</button>
</div>
<div class="gallery-alert sr-only" role="status" aria-live="polite">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's change the aria-live to "assertive".

<?php includeStats(["isNPM" => true]); ?>

<div id="example1" class="enable-example">
<div class="gallery">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's add role="group" and aria-label="Photo Gallery". If we do that, screen reader users will hear that they are inside a photo gallery when they tab into this component.

{
"label": "Add aria-hidden to slide image",
"highlight": "%FILE% ./js/modules/image-gallery.js ~ aria-hidden",
"notes": "Ensure only one active thumbnail display on slide other gets hide and add aira-hidden"
Copy link
Collaborator

Choose a reason for hiding this comment

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

mispelled aria-hidden :-)

{
"label": "Create JavaScript that ensure active image get update when any changes occurs",
"highlight": "%FILE% ./js/modules/image-gallery.js ~ this.showSlide",
"notes": "This function add shows active image in gallery and updates gallery alert message."
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please also highlight the update to the aria-live region in this step.

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