Spaces:
Running
Running
Ron Au
commited on
Commit
•
8db1028
1
Parent(s):
0bae5c5
fix(a11y): Hide hidden actions bar from a11y tree
Browse files- static/index.html +4 -5
- static/js/index.js +5 -2
static/index.html
CHANGED
@@ -42,12 +42,11 @@
|
|
42 |
</p>
|
43 |
</section>
|
44 |
<section class="output" data-mode="booster" data-state="ready">
|
45 |
-
<div class="actions">
|
46 |
-
<!-- <button class="share">Share</button> -->
|
47 |
<div class="buttons">
|
48 |
-
<button class="save">Save</button>
|
49 |
-
<button class="toggle-name" data-include>Trainer Name</button>
|
50 |
-
<button class="generate-new">New Pokémon</button>
|
51 |
</div>
|
52 |
<div class="duration"><span class="elapsed">0.0</span>s (ETA: <span class="eta">40</span>s)</div>
|
53 |
</div>
|
|
|
42 |
</p>
|
43 |
</section>
|
44 |
<section class="output" data-mode="booster" data-state="ready">
|
45 |
+
<div class="actions" aria-hidden="true">
|
|
|
46 |
<div class="buttons">
|
47 |
+
<button class="save" tabindex="-1">Save</button>
|
48 |
+
<button class="toggle-name" data-include tabindex="-1">Trainer Name</button>
|
49 |
+
<button class="generate-new" tabindex="-1">New Pokémon</button>
|
50 |
</div>
|
51 |
<div class="duration"><span class="elapsed">0.0</span>s (ETA: <span class="eta">40</span>s)</div>
|
52 |
</div>
|
static/js/index.js
CHANGED
@@ -25,7 +25,8 @@ const generate = async () => {
|
|
25 |
try {
|
26 |
const scene = document.querySelector('.scene');
|
27 |
const cardSlot = scene.querySelector('.card-slot');
|
28 |
-
const
|
|
|
29 |
|
30 |
scene.removeEventListener('mousemove', mousemoveHandlerForPreviousCard, true);
|
31 |
cardSlot.innerHTML = '';
|
@@ -36,7 +37,9 @@ const generate = async () => {
|
|
36 |
pokeName = details.name;
|
37 |
const task = await createTask(details.energy_type);
|
38 |
|
39 |
-
|
|
|
|
|
40 |
durationDisplay.classList.add('displayed');
|
41 |
const timer = durationTimer(durationDisplay);
|
42 |
const timerCleanup = timer().cleanup;
|
|
|
25 |
try {
|
26 |
const scene = document.querySelector('.scene');
|
27 |
const cardSlot = scene.querySelector('.card-slot');
|
28 |
+
const actions = document.querySelector('.actions');
|
29 |
+
const durationDisplay = actions.querySelector('.duration');
|
30 |
|
31 |
scene.removeEventListener('mousemove', mousemoveHandlerForPreviousCard, true);
|
32 |
cardSlot.innerHTML = '';
|
|
|
37 |
pokeName = details.name;
|
38 |
const task = await createTask(details.energy_type);
|
39 |
|
40 |
+
actions.style.opacity = '1';
|
41 |
+
actions.setAttribute('aria-hidden', 'false');
|
42 |
+
actions.querySelectorAll('button').forEach((button) => button.setAttribute('tabindex', '0'));
|
43 |
durationDisplay.classList.add('displayed');
|
44 |
const timer = durationTimer(durationDisplay);
|
45 |
const timerCleanup = timer().cleanup;
|