Skip to content

Commit 3f031db

Browse files
Update ITL_AI-Inclusive-Design-Sprints_Start.html
1 parent 64ed551 commit 3f031db

1 file changed

Lines changed: 24 additions & 21 deletions

File tree

ITL_AI-Inclusive-Design-Sprints_Start.html

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,26 @@
1313
.copy-btn {margin-bottom: 0.3rem; padding: 0.3rem 0.7rem; font-size: 0.7rem; cursor: pointer;}
1414
</style>
1515
<script>
16-
document.querySelectorAll('.copy-btn').forEach(function(button) {
17-
button.addEventListener('click', function() {
18-
// Find the next sibling <pre> and its <code> child
19-
const pre = button.nextElementSibling;
20-
if (pre && pre.tagName.toLowerCase() === 'pre') {
21-
const code = pre.querySelector('code');
22-
if (code) {
23-
navigator.clipboard.writeText(code.innerText).then(function() {
24-
button.textContent = 'Copied!';
25-
setTimeout(() => button.textContent = 'Copy', 1500);
26-
}, function() {
27-
button.textContent = 'Error';
28-
});
16+
// Attach copy functionality to each button
17+
document.querySelectorAll(".copy-btn").forEach((button) => {
18+
button.addEventListener("click", () => {
19+
// Find the <pre class="cdblk"> immediately after this button
20+
const pre = button.nextElementSibling;
21+
if (pre && pre.classList.contains("cdblk")) {
22+
const codeEl = pre.querySelector("code");
23+
if (codeEl) {
24+
const text = codeEl.innerText.trim();
25+
navigator.clipboard.writeText(text).then(() => {
26+
// Optional feedback
27+
button.textContent = "Copied!";
28+
setTimeout(() => (button.textContent = "Copy"), 1500);
29+
}).catch(err => {
30+
console.error("Failed to copy: ", err);
31+
});
32+
}
2933
}
30-
}
34+
});
3135
});
32-
});
3336
</script>
3437
</head>
3538
<body>
@@ -58,8 +61,8 @@
5861
<article aria-labelledby="art1Title">
5962
<h2 id="art1Title">Websites</h2>
6063
<p class="intro">TBD</p>
61-
<button class="copy-btn" aria-label="Copy code">Copy Prompt</button>
62-
<pre><code>
64+
<button class="copy-btn">Copy Prompt</button>
65+
<pre class="cdblk"><code>
6366
I am a web designer applying Microsoft Inclusive Design methods, specifically the principle of "recognize exclusion", to identify potential barriers in a website I'm designing.
6467

6568
**Goal:** Generate a list of at least 24 potential exclusions that users with disabilities or assistive technology mismatches might encounter when interacting with my website.
@@ -90,8 +93,8 @@ <h2 id="art1Title">Websites</h2>
9093
<article aria-labelledby="art2Title">
9194
<h2 id="art2Title">Apps</h2>
9295
<p class="intro">tbd</p>
93-
<button class="copy-btn" aria-label="Copy code">Copy Prompt</button>
94-
<pre><code>
96+
<button class="copy-btn">Copy Prompt</button>
97+
<pre class="cdblk"><code>
9598
I am an app designer applying Microsoft Inclusive Design methods, specifically the principle of "recognize exclusion", to identify potential barriers in a mobile app I'm designing.
9699

97100
**Goal:** Generate a list of at least 24 potential exclusions that users with disabilities or assistive technology mismatches might encounter when interacting with my mobile app.
@@ -122,8 +125,8 @@ <h2 id="art2Title">Apps</h2>
122125
<article aria-labelledby="art3Title">
123126
<h2 id="art3Title">Game</h2>
124127
<p class="intro">TBD</p>
125-
<button class="copy-btn" aria-label="Copy code">Copy Prompt</button>
126-
<pre><code>
128+
<button class="copy-btn">Copy Prompt</button>
129+
<pre class="cdblk"><code>
127130
I am a game designer applying Microsoft Inclusive Design methods, specifically the principle of "recognize exclusion", to identify potential barriers in a game I'm designing.
128131

129132
**Goal:** Generate a list of at least 24 potential exclusions that users with disabilities or assistive technology mismatches might encounter when interacting with my game.

0 commit comments

Comments
 (0)