diff options
author | metamuffin <metamuffin@disroot.org> | 2024-04-17 11:58:03 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-04-17 11:58:03 +0200 |
commit | 54d2f832c95b2f8a935715e73aba9661573ebeb5 (patch) | |
tree | e744cccf7e0ee91dbae8b5534bda299ff7720380 /web/script/player | |
parent | 0f17a9c4f38ffa7295bd7c596fc37ffdf28c48af (diff) | |
download | jellything-54d2f832c95b2f8a935715e73aba9661573ebeb5.tar jellything-54d2f832c95b2f8a935715e73aba9661573ebeb5.tar.bz2 jellything-54d2f832c95b2f8a935715e73aba9661573ebeb5.tar.zst |
jsp: scatter some aria labels
Diffstat (limited to 'web/script/player')
-rw-r--r-- | web/script/player/mod.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/web/script/player/mod.ts b/web/script/player/mod.ts index 2defa6e..f290db4 100644 --- a/web/script/player/mod.ts +++ b/web/script/player/mod.ts @@ -91,6 +91,7 @@ function initialize_player(el: HTMLElement, node_id: string) { const enabled = active.length > 0 return e("button", MEDIA_KIND_ICONS[kind][+enabled], { class: "icon", + aria_label: `configure ${kind}`, onclick: () => { if (enabled) { for (const t of active) { @@ -141,7 +142,7 @@ function initialize_player(el: HTMLElement, node_id: string) { // TODO show loading indicator } return e("li", { class: active ? ["active"] : [] }, - e("button", { class: "jsp-track-state", onclick }, active ? "-" : "+"), " ", + e("button", { class: ["jsp-track-state", "icon"], onclick }, active ? "remove" : "add"), " ", e("span", { class: "jsp-track-name" }, `"${track.name}"`), " ", e("span", { class: "jsp-track-lang" }, `(${track.language})`) ) @@ -154,7 +155,7 @@ function initialize_player(el: HTMLElement, node_id: string) { } const settings_popup = () => { - const button = e("button", "settings", { class: "icon" }) + const button = e("button", "settings", { class: "icon", aria_label: "settings" }) new Popup(button, popups, () => e("div", { class: "jsp-settings-popup" }, e("h2", "Settings"), playersync_controls(sync_state, player), @@ -169,7 +170,7 @@ function initialize_player(el: HTMLElement, node_id: string) { const controls = e("div", { class: "jsp-controls" }, player.playing.map(playing => - e("button", { class: "icon" }, playing ? "pause" : "play_arrow", { onclick: toggle_playing }) + e("button", { class: "icon", aria_label: "toggle pause/play" }, playing ? "pause" : "play_arrow", { onclick: toggle_playing }) ), e("p", { class: "jsp-status" }, player.position.map(v => e("span", show.duration(v))), e("br"), @@ -208,7 +209,7 @@ function initialize_player(el: HTMLElement, node_id: string) { track_select("subtitles") ), settings_popup(), - e("button", "fullscreen", { class: "icon", onclick: toggle_fullscreen }) + e("button", "fullscreen", { class: "icon", onclick: toggle_fullscreen, aria_label: "fullscreen" }) ) player.position.onchangeinit(p => pri_current.style.width = pri_map(p)) |