Skip to content

Commit 0882fb8

Browse files
committed
initial commit
1 parent 0e9c1fc commit 0882fb8

File tree

3 files changed

+91
-0
lines changed

3 files changed

+91
-0
lines changed

demos/high-contrast/app.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
const toggleModeEl = document.getElementById("toggle-mode");
2+
const mapEl = document.querySelector("arcgis-map");
3+
const darkModeCss = document.getElementById("jsapi-mode-dark");
4+
const lightModeCss = document.getElementById("jsapi-mode-light");
5+
const liveRegion = document.getElementById("liveRegion");
6+
const searchEl = document.getElementById("search-el");
7+
const expandEl = document.getElementById("expand-el");
8+
9+
let mode = "light";
10+
11+
toggleModeEl.addEventListener("click", handleModeChange);
12+
13+
14+
function handleModeChange() {
15+
mode = mode === "dark" ? "light" : "dark";
16+
const isDarkMode = mode === "dark";
17+
darkModeCss.disabled = !isDarkMode;
18+
lightModeCss.disabled = isDarkMode;
19+
toggleModeEl.icon = isDarkMode ? "moon" : "brightness";
20+
document.body.className = isDarkMode ? "calcite-mode-dark" : "";
21+
mapEl.basemap = isDarkMode ? "dark-grey" : "grey";
22+
23+
document.querySelectorAll(`.calcite-mode-${isDarkMode ? "light" : "dark"}`).forEach(node =>
24+
node.classList.replace(`calcite-mode-${isDarkMode ? "light" : "dark"}`, `calcite-mode-${mode}`)
25+
);
26+
}

demos/high-contrast/index.html

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<html lang="en">
2+
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" />
6+
<title>2025 Esri Developer & Technology Summit - High contrast</title>
7+
8+
<!-- Calcite imports -->
9+
<script type="module" src="https://js.arcgis.com/calcite-components/3.0.3/calcite.esm.js"></script>
10+
11+
12+
<!-- ArcGIS Maps SDK for JavaScript imports -->
13+
<script src="https://js.arcgis.com/4.32/"></script>
14+
<link id="jsapi-mode-light" rel="stylesheet" href="https://js.arcgis.com/4.32/esri/themes/light/main.css" />
15+
<link disabled id="jsapi-mode-dark" rel="stylesheet" href="https://js.arcgis.com/4.32/esri/themes/dark/main.css" />
16+
<script type="module" src="https://js.arcgis.com/map-components/4.32/arcgis-map-components.esm.js"></script>
17+
18+
<!-- Demo imports -->
19+
<script src="./app.js" defer></script>
20+
<link rel="stylesheet" href="./style.css" />
21+
</head>
22+
23+
<body>
24+
<calcite-shell content-behind>
25+
<calcite-navigation slot="header" id="nav">
26+
<calcite-navigation-logo href="#" icon="accessibility" alt="Application logo" slot="logo"
27+
heading="High contrast"
28+
description="Esri Developer & Technology Summit 2025"></calcite-navigation-logo>
29+
<calcite-action-pad layout="horizontal" expand-disabled slot="content-end">
30+
<calcite-action id="toggle-mode" text="Toggle mode" icon="brightness"></calcite-action>
31+
</calcite-action-pad>
32+
33+
<calcite-tooltip placement="bottom" reference-element="toggle-mode" slot="content-end">Toggle
34+
mode</calcite-tooltip>
35+
</calcite-navigation>
36+
<arcgis-map item-id="05e015c5f0314db9a487a9b46cb37eca"></arcgis-map>
37+
</calcite-shell>
38+
39+
</body>
40+
41+
</html>

demos/high-contrast/style.css

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/* Esri Developer & Technology Summit Demo Template */
2+
/* Demo template theming example */
3+
4+
body calcite-navigation-logo{
5+
--calcite-color-text-2:#737373;
6+
}
7+
body.calcite-mode-dark calcite-navigation-logo{
8+
--calcite-icon-color:#8FD0FF;
9+
--calcite-color-text-2:#C7C7C7;
10+
}
11+
12+
13+
html,
14+
body,
15+
arcgis-map {
16+
padding: 0;
17+
margin: 0;
18+
height: 100%;
19+
width: 100%;
20+
}
21+
22+
calcite-shell-panel[slot="panel-start"] calcite-panel {
23+
border-top: 0;
24+
}

0 commit comments

Comments
 (0)