Add additional accessibility improvements (quick wins)
This commit adds more accessibility enhancements that improve usability for screen reader and keyboard users with minimal code changes. Changes: - Add aria-labels to all icon-only buttons * Show/hide video and chat toggle buttons * Video controls (play, volume, pip, fullscreen, stop) * Chat submit button (send message) * All buttons converted from spans/divs to proper button elements - Add aria-label to volume slider * Screen readers can now identify the volume control - Increase error message timeout from 4s to 8s * Gives screen reader users more time to read error messages * Messages still dismissible with close button - Add semantic HTML landmarks * Changed main div to <main> element * Changed settings sidebar div to <aside> with aria-label * Added role="region" and aria-label to chat area * Left sidebar already uses <nav> element - Fix typo and improve close button * Fixed id from "clodeside" to "closeside" * Converted close button from anchor to button element * Added aria-label "Close settings" These changes improve navigation for screen reader users through proper landmarks and ensure all interactive elements are properly labeled.
This commit is contained in:
+29
-27
@@ -16,7 +16,7 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="main" class="app">
|
||||
<main id="main" class="app">
|
||||
<div class="row full-height">
|
||||
<nav id="left-sidebar">
|
||||
<div class="users-header">
|
||||
@@ -68,7 +68,7 @@
|
||||
</header>
|
||||
<div class="row full-width" id="mainrow">
|
||||
<div class="coln-left" id="left">
|
||||
<div id="chat">
|
||||
<div id="chat" role="region" aria-label="Chat">
|
||||
<div id="chatbox">
|
||||
<button class="close-chat" id="close-chat" aria-label="Hide chat">
|
||||
<span class="close-icon"></span>
|
||||
@@ -78,7 +78,7 @@
|
||||
<div class="reply">
|
||||
<form id="inputform">
|
||||
<textarea id="input" class="form-reply"></textarea>
|
||||
<input id="inputbutton" type="submit" value="➤" class="btn btn-default"/>
|
||||
<input id="inputbutton" type="submit" value="➤" class="btn btn-default" aria-label="Send message"/>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -86,15 +86,15 @@
|
||||
</div>
|
||||
<div id="resizer"></div>
|
||||
<div class="coln-right" id="right">
|
||||
<span class="show-video blink invisible" id="show-video">
|
||||
<button class="show-video blink invisible" id="show-video" aria-label="Show video">
|
||||
<i class="fas fa-exchange-alt" aria-hidden="true"></i>
|
||||
</span>
|
||||
<div class="chat-btn show-chat invisible" id="show-chat">
|
||||
<i class="far fa-comment-alt icon-chat" title="Show chat"></i>
|
||||
</div>
|
||||
<div class="chat-btn collapse-video invisible" id="collapse-video">
|
||||
<i class="far fa-comment-alt icon-chat" title="Hide video and show chat"></i>
|
||||
</div>
|
||||
</button>
|
||||
<button class="chat-btn show-chat invisible" id="show-chat" aria-label="Show chat">
|
||||
<i class="far fa-comment-alt icon-chat" aria-hidden="true"></i>
|
||||
</button>
|
||||
<button class="chat-btn collapse-video invisible" id="collapse-video" aria-label="Hide video and show chat">
|
||||
<i class="far fa-comment-alt icon-chat" aria-hidden="true"></i>
|
||||
</button>
|
||||
<div class="video-container invisible" id="video-container">
|
||||
<div id="expand-video" class="expand-video">
|
||||
<div id="peers"></div>
|
||||
@@ -143,12 +143,12 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<div id="sidebarnav" class="sidenav">
|
||||
<aside id="sidebarnav" class="sidenav" aria-label="Settings">
|
||||
<div class="sidenav-header">
|
||||
<h2>Settings</h2>
|
||||
<a class="closebtn" id="clodeside"><i class="fas fa-times" aria-hidden="true"></i></a>
|
||||
<button class="closebtn" id="closeside" aria-label="Close settings"><i class="fas fa-times" aria-hidden="true"></i></button>
|
||||
</div>
|
||||
<div class="sidenav-content" id="optionsdiv">
|
||||
<div id="profile" class="profile invisible">
|
||||
@@ -256,34 +256,36 @@
|
||||
</form>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<div id="videocontrols-template" class="invisible">
|
||||
<div class="video-controls vc-overlay">
|
||||
<div class="controls-button controls-left">
|
||||
<span class="video-play" title="Play video">
|
||||
<i class="fas fa-play"></i>
|
||||
</span>
|
||||
<span class="volume" title="Volume">
|
||||
<i class="fas fa-volume-up volume-mute" aria-hidden="true"></i>
|
||||
<input class="volume-slider" type="range" max="100" value="100" min="0" step="5" >
|
||||
<button class="video-play" aria-label="Play video">
|
||||
<i class="fas fa-play" aria-hidden="true"></i>
|
||||
</button>
|
||||
<span class="volume">
|
||||
<button class="volume-mute" aria-label="Mute volume">
|
||||
<i class="fas fa-volume-up" aria-hidden="true"></i>
|
||||
</button>
|
||||
<input class="volume-slider" type="range" max="100" value="100" min="0" step="5" aria-label="Volume">
|
||||
</span>
|
||||
</div>
|
||||
<div class="controls-button controls-right">
|
||||
<span class="pip" title="Picture In Picture">
|
||||
<button class="pip" aria-label="Picture in picture">
|
||||
<i class="far fa-clone" aria-hidden="true"></i>
|
||||
</span>
|
||||
<span class="fullscreen" title="Fullscreen">
|
||||
</button>
|
||||
<button class="fullscreen" aria-label="Fullscreen">
|
||||
<i class="fas fa-expand" aria-hidden="true"></i>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="topvideocontrols-template" class="invisible">
|
||||
<div class="top-video-controls">
|
||||
<div class="controls-button controls-right">
|
||||
<span class="close-icon video-stop" title="Stop video">
|
||||
</span>
|
||||
<button class="close-icon video-stop" aria-label="Stop video">
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+2
-2
@@ -4344,7 +4344,7 @@ function displayError(message, level) {
|
||||
/** @ts-ignore */
|
||||
Toastify({
|
||||
text: message,
|
||||
duration: 4000,
|
||||
duration: 8000, // Increased from 4000 for screen reader users
|
||||
close: true,
|
||||
position: position,
|
||||
gravity: gravity,
|
||||
@@ -4417,7 +4417,7 @@ document.getElementById('openside').onclick = function(e) {
|
||||
};
|
||||
|
||||
|
||||
document.getElementById('clodeside').onclick = function(e) {
|
||||
document.getElementById('closeside').onclick = function(e) {
|
||||
e.preventDefault();
|
||||
closeNav();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user