-
Notifications
You must be signed in to change notification settings - Fork 6
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
Player accessibility #37
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,13 +25,14 @@ | |
<script src="player.js"></script> | ||
</head> | ||
<body ng-cloak> | ||
<div id="ariaLive" aria-live="polite" aria-atomic="true"></div> | ||
<div class="browserwarning">We recommend you upgrade your browser for a better experience</div> | ||
<div id="browserfailure"> | ||
<p>We're sorry</p> | ||
<p>But this widget requires features that your browser does not support.</p> | ||
<p>Please upgrade to a newer version to play Guess the Phrase.</p> | ||
</div> | ||
<div ng-hide="inGame" hammer-tap="toggleGame()" class="overlay"> | ||
<div ng-hide="inGame" ng-click="toggleGame()" class="overlay"> | ||
<div class="portal"> | ||
<h1>Guess the Phrase</h1> | ||
<p ng-show="!gameDone">Press or type letters to guess words and phrases.</p> | ||
|
@@ -42,8 +43,8 @@ <h1>Guess the Phrase</h1> | |
<div>Loading...</div> | ||
</center> | ||
</div> | ||
<div id="start" ng-show="!loading && !gameDone" class="start">Start</div> | ||
<div ng-show="!loading && gameDone" class="finished"><span>FINISH</span></div> | ||
<div id="start" ng-show="!loading && !gameDone" class="start" tabindex="0">Start</div> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this is a div, it's not immediately clear to the user that they are indeed focusing a button and need to interact with it to continue. Aside from changing the actual HTML element from |
||
<div ng-show="!loading && gameDone" class="finished" tabindex="0"><span>FINISH</span></div> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as the above. This should be given a button role to indicate its purpose as a focusable input. |
||
</div> | ||
</div> | ||
<div class="game"> | ||
|
@@ -52,10 +53,10 @@ <h1>Guess the Phrase</h1> | |
<img src="assets/img/anvil.png" aria-hidden="true" class="anvil"> | ||
</div> | ||
<div aria-hidden="true" class="podium"></div> | ||
<div class="title"></div> | ||
<div class="title" tabindex="0" aria-label="{{focusTitleMessage}}"></div> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Generally, anything in the tab sequence should have a clear indication of its purpose, and why it's focusable (as tab stops are normally tied to inputs). It might help to have a |
||
<div class="question-num">{{ curItem+1 }}</div> | ||
<div class="total-questions"></div> | ||
<div ng-class="{transition: inQues}" class="answer"> | ||
<div ng-class="{transition: inQues}" class="answer" tabindex="0" aria-label="{{focusAnswerMessage}}"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A thought: the |
||
<div ng-repeat="word in answer.string" class="row"> | ||
<span ng-repeat="letter in word" ng-class="{quirks: cssQuirks}" class="box"> | ||
<span class="letter" | ||
|
@@ -72,7 +73,9 @@ <h1>Guess the Phrase</h1> | |
</div> | ||
<div ng-class="{transition: inQues}" | ||
ng-show="inGame" | ||
class="question"> | ||
class="question" | ||
tabindex="0" | ||
aria-label="{{focusQuestionMessage}}"> | ||
{{ ques }} | ||
<div class="tail"></div> | ||
</div> | ||
|
@@ -82,7 +85,7 @@ <h1>Guess the Phrase</h1> | |
class="icon-close"> | ||
</span> | ||
</div> | ||
<div aria-hidden="true" class="keyboard-bg"></div> | ||
<div aria-hidden="true" class="keyboard-bg" tabindex="0" aria-label="{{focusKeyboardMessage}}"></div> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Be careful here, because your |
||
<div aria-hidden="true" | ||
ng-show="inQues" | ||
ng-init="keys=[ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -540,3 +540,9 @@ div.browserwarning { | |
padding: 20px; | ||
display: none; | ||
} | ||
|
||
#ariaLive { | ||
width: 1px; | ||
height: 1px; | ||
overflow: hidden; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two things:
assertive
property, and having these updates (correct or incorrect) report to that assertive live region instead. Those will interrupt whatever is currently being said, and also won't repeat the way polite ones do (which is a known bug).