Skip to content

Commit

Permalink
keyboard navigable tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
bbrk24 committed Mar 24, 2024
1 parent 7ea4fc7 commit f4a2daf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
5 changes: 4 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,9 @@
<option value="yes">Only</option>
<option value="no">Ignored</option>
</select>
<span class="info"
<span
tabindex="0"
class="info"
title="Some bikes shift their center of gravity inwards while drifting, making them handle very differently. Select &quot;Only&quot; to only see these bikes, or &quot;Ignored&quot; to omit these bikes."
></span>
<br />
Expand Down Expand Up @@ -485,6 +487,7 @@
</tbody>
</table>
<div id="rivals">Rivals<sup
tabindex="0"
class="info"
title="When playing as P1 in a Grand Prix, these characters are guaranteed to be COM characters and should be better than other COMs, unless they are chosen by other players. Not all characters have rivals."
></sup>:&nbsp;</div>
Expand Down
13 changes: 9 additions & 4 deletions src/index.civet
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,12 @@ form.addEventListener
{ +passive }

document.querySelectorAll<HTMLElement> '.info'
.forEach .addEventListener
'click'
-> alert @title
{ +passive }
.forEach (el) =>
el.addEventListener
'click'
-> alert @title
{ +passive }
el.addEventListener
'keypress'
(e) -> if e.key is 'Enter' or e.key is ' ' then alert @title
{ +passive }

0 comments on commit f4a2daf

Please sign in to comment.