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

Add prefers reduced motion sample #7

Merged
merged 3 commits into from
Mar 11, 2025

Conversation

kellyhutchins
Copy link
Collaborator

No description provided.

Add prefers reduced motion and make minor updates to the aria live demo
Copy link
Owner

@geospatialem geospatialem left a comment

Choose a reason for hiding this comment

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

Awesome!! ✨

Some nitpicks for consideration, but LGTM!! 🏆

@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
<title>2025 Esri Developer & Technology Summit - Reduced Motion</title>
<title>Reduced motion</title>
Copy link
Owner

Choose a reason for hiding this comment

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

nitpick:

Since the switch toggle pertains to animation and not the light/dark modes, should line 14 be omitted?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removing

@@ -1,6 +1,72 @@
// DOM Elements
const mapEl = document.querySelector("arcgis-map");
Copy link
Owner

Choose a reason for hiding this comment

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

Unrelated to the code, but can the basemap be changed to a dark-grey or less prominent basemap? It seems like the data gets a bit washed out in the sample with the high contrast basemap.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done in the Map Viewer

toggleModeEl.addEventListener("click", handleModeChange);

Copy link
Owner

Choose a reason for hiding this comment

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

nitpick for line 29, do you think it would be useful to change the basemap when toggling between light/dark modes?

document.body.className = isDarkMode ? "calcite-mode-dark" : "";
mapEl.basemap = isDarkMode ? "dark-gray" : "gray";

Copy link
Owner

Choose a reason for hiding this comment

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

Related nitpick:

What if the toggle switch also provided an aria-live region indicating the light/dark mode has been toggled?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@geospatialem let me look at the aria-live update for light/dark mode. I "think" that since the user clicks the button that tells them they are toggling the light/dark that aria-live might be overkill? But I can add it and see if it feels too chatty
Updating the code to flip the basemap

@kellyhutchins kellyhutchins merged commit 9dfb1d2 into main Mar 11, 2025
@geospatialem geospatialem deleted the add-prefers-reduced-motion-sample branch March 15, 2025 21:49
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