Skip to content

Card art accessibility improvements #114

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 7 commits into
base: main
Choose a base branch
from

Conversation

crookedneighbor
Copy link
Collaborator

@crookedneighbor crookedneighbor commented May 10, 2025

  • adds tests for CardArt.vue component
  • adds written text to error loading overlay to explicitly explain what's happening
  • adds a visually hidden text for pending overlay to tell screenreaders what's happening
Screenshot 2025-05-10 at 10 47 59 AM

@@ -29,7 +29,7 @@ export function makeCard<T extends ScryfallCard>(overrides: Partial<T> = {}): T
scryfall_uri: "<scryfall uri>",
type_line: "<type line>",
set: "<set code>",
image_uris: makeImageUris(),
image_uris: makeImageUris(overrides.name),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is so that the image uri does change for the computed property, so the watch on the imageUri does trigger.

@@ -74,12 +85,14 @@ $default-art-width: 626px;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

both the style changes here are to make the text and x in error overlay be centered.

:src="imageUri"
:onload="onLoad"
:onerror="onError"
data-testid="card-art-preload"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

needed to add a data-testid here to target it in the test to trigger the load and error events.

<div class="shape-x"></div>
<div>
<div class="shape-x"></div>
<p>There was an error loading the card art.</p>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thoughts on the wording here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

this can also occur if we get a server error from the random endpoint, I think.

There was an error loading the next card. You should skip this one.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Screenshot 2025-05-10 at 2 54 13 PM Screenshot 2025-05-10 at 2 53 57 PM Screenshot 2025-05-10 at 2 53 30 PM

</div>
<div v-else-if="showLoadingOverlay" class="overlay loading">
<LoadingPulser class="pulser" />
<p class="vh">Loading next card art...</p>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thoughts on the wording here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Loading next card

(no dots)

@@ -74,12 +85,15 @@ $default-art-width: 626px;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
padding: 1rem;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added some padding here because the class/saga art crops don't give you much space and the text was butting up against the edge.

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