Skip to content

Commit

Permalink
♿ Fix linter problems linked with A11y
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianpb committed Jan 21, 2024
1 parent c5dbe1e commit 6657295
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 24 deletions.
7 changes: 4 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ module.exports = {
node: true
},
extends: [
'eslint:recommended'
//'eslint:recommended'
'plugin:svelte/recommended'
],
plugins: [
'svelte3'
'svelte'
],
ignorePatterns: [
'__sapper__/',
Expand All @@ -23,7 +24,7 @@ module.exports = {
overrides: [
{
files: ['**/*.svelte'],
processor: 'svelte3/svelte3'
processor: 'svelte/svelte'
}
],
rules: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/AddToPlaylist.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="modal" class:is-active={showAddToPlaylistModal} >
<div class="modal-background" on:click={() => showAddToPlaylistModal = !showAddToPlaylistModal}></div>
<div class="modal-background" on:click={() => showAddToPlaylistModal = !showAddToPlaylistModal} on:keypress={() => showAddToPlaylistModal = !showAddToPlaylistModal}></div>
<div class="modal-card">
<header class="modal-card-head">
<p class="modal-card-title">Add to playlist</p>
Expand Down
2 changes: 1 addition & 1 deletion src/components/CreatePlaylist.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="modal" class:is-active={showCreatePlaylistModal} >
<div class="modal-background" on:click={() => showCreatePlaylistModal = !showCreatePlaylistModal}></div>
<div class="modal-background" on:click={() => showCreatePlaylistModal = !showCreatePlaylistModal} on:keypress={() => showCreatePlaylistModal = !showCreatePlaylistModal}></div>
<div class="modal-card">
<header class="modal-card-head">
<p class="modal-card-title">Create playlist</p>
Expand Down
2 changes: 1 addition & 1 deletion src/components/DeletePlaylist.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="modal" class:is-active={deletePlaylistConfirmation} >
<div class="modal-background" on:click={() => deletePlaylistConfirmation = !deletePlaylistConfirmation}></div>
<div class="modal-background" on:click={() => deletePlaylistConfirmation = !deletePlaylistConfirmation} on:keypress={() => deletePlaylistConfirmation = !deletePlaylistConfirmation}></div>
<div class="modal-card">
<div class="modal-card-body has-text-centered">
<p class="title">
Expand Down
2 changes: 1 addition & 1 deletion src/components/EditClients.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="modal" class:is-active={$snapClientsEditVisibility} >
<div class="modal-background" on:click={() => $snapClientsEditVisibility = !$snapClientsEditVisibility}></div>
<div class="modal-background" on:click={() => $snapClientsEditVisibility = !$snapClientsEditVisibility} on:keypress={() => $snapClientsEditVisibility = !$snapClientsEditVisibility}></div>
<div class="modal-card">
<header class="modal-card-head">
<p class="modal-card-title">Edit Snapcast Clients</p>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Nav.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
}
</style>

<nav class="navbar" role="navigation" aria-label="main navigation">
<nav class="navbar" aria-label="main navigation">
<div class="navbar-brand">
<a
class="navbar-item"
Expand Down
4 changes: 2 additions & 2 deletions src/components/NavBottom.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<nav class="navbar is-fixed-bottom " role="navigation" aria-label="main navigation">
<nav class="navbar is-fixed-bottom " aria-label="main navigation">
<div class="navbar-brand">
<a
href="{null}"
Expand Down Expand Up @@ -70,7 +70,7 @@
{client.name ? client.name : client.host}
</span>
<div class="columns is-mobile">
<div class="column is-narrow" on:click={() => muteClient(client.id, client.muted)}>
<div class="column is-narrow" on:click={() => muteClient(client.id, client.muted)} on:keypress={() => muteClient(client.id, client.muted)}>
<a class="navbar-item small-separation" href="{null}">
{#if client.muted}
<FontAwesomeIcon icon={faVolumeMute} class="icon"/>
Expand Down
2 changes: 1 addition & 1 deletion src/components/SnapClients.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</div>
</div>
{#if client.connected}
<div class="column is-narrow" on:click={muteClient(client.id, client.muted)}>
<div class="column is-narrow" on:click={muteClient(client.id, client.muted)} on:keypress={muteClient(client.id, client.muted)}>
<a class="navbar-item" href="{null}">
{#if client.muted}
<FontAwesomeIcon icon={faVolumeMute} class="icon"/>
Expand Down
2 changes: 1 addition & 1 deletion src/components/SnapGroups.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
on:input={() => editClientName(group.clients[i].id, group.clients[i].name)}
placeholder="Client name">
</div>
<div class="column is-narrow" on:click="{deleteClient(client.id)}">
<div class="column is-narrow" on:click="{deleteClient(client.id)}" on:keypress="{deleteClient(client.id)}">
<button class="button">
<FontAwesomeIcon icon={faTrash} class="icon"/>
</button>
Expand Down
6 changes: 3 additions & 3 deletions src/routes/browse.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
{#if results.some(checkOverallDropdownNeeded)}
<div class="column is-narrow">
<div class="dropdown is-right" class:is-active={showOptions} >
<div class="dropdown-trigger" on:click={() => showOptions = !showOptions}>
<div class="dropdown-trigger" on:click={() => showOptions = !showOptions} on:keypress={() => showOptions = !showOptions}>
{#if showOptions}
<a href="{null}" class="button">
<FontAwesomeIcon icon={faAngleUp} class="icon" aria-haspopup="true" aria-controls="dropdown-menu"/>
Expand Down Expand Up @@ -84,11 +84,11 @@
{#each results as result, idx}
<a href={null} class="list-item" >
<div class="columns is-mobile">
<div class="column" on:click={() => promise = browserUri(result, idx, 'avance')}>
<div class="column" on:click={() => promise = browserUri(result, idx, 'avance')} on:keypress={() => promise = browserUri(result, idx, 'avance')}>
{result.name}
</div>
{#if checkItemDropdownNeeded(result)}
<div class="column is-narrow" on:click={() => handleDropdownActivation(idx)}>
<div class="column is-narrow" on:click={() => handleDropdownActivation(idx)} on:keypress={() => handleDropdownActivation(idx)}>
{#if options == idx}
<FontAwesomeIcon icon={faAngleUp} class="icon" aria-haspopup="true" aria-controls="dropdown-menu"/>
{:else}
Expand Down
4 changes: 2 additions & 2 deletions src/routes/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@
class:is-active={hovering === index}
>
<div class="columns is-mobile">
<div class="column" on:click={handleDropdownActivation(tlTrack.tlid)}>
<div class="column" on:click={handleDropdownActivation(tlTrack.tlid)} on:keypress={handleDropdownActivation(tlTrack.tlid)}>
{tlTrack.track.name}
{#if index === $currentTrack.index}
&nbsp;<FontAwesomeIcon icon={faCog} spin={$currentState == 'playing' ? true : false} class="icon is-small"/>
{/if}
</div>
<div class="column is-narrow">
<div class="dropdown is-right is-up" class:is-active={dropdownActivate == tlTrack.tlid} >
<div class="dropdown-trigger" on:click={handleDropdownActivation(tlTrack.tlid)}>
<div class="dropdown-trigger" on:click={handleDropdownActivation(tlTrack.tlid)} on:keypress={handleDropdownActivation(tlTrack.tlid)}>
{#if dropdownActivate == tlTrack.tlid}
<FontAwesomeIcon icon={faAngleUp} class="icon" aria-haspopup="true" aria-controls="dropdown-menu"/>
{:else}
Expand Down
6 changes: 3 additions & 3 deletions src/routes/playlists/[slug].svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</div>
<div class="column">
<div class="dropdown is-right" class:is-active={showOptions} >
<div class="dropdown-trigger" on:click={() => showOptions = !showOptions}>
<div class="dropdown-trigger" on:click={() => showOptions = !showOptions} on:keypress={() => showOptions = !showOptions}>
{#if showOptions}
<a href="{null}" class="button">
<FontAwesomeIcon icon={faAngleUp} class="icon" aria-haspopup="true" aria-controls="dropdown-menu"/>
Expand Down Expand Up @@ -97,12 +97,12 @@
animate:flip
>
<div class="columns is-mobile">
<div class="column" on:click={handleDropdownActivation(index)}>
<div class="column" on:click={handleDropdownActivation(index)} on:keypress={handleDropdownActivation(index)}>
{track.name}
</div>
<div class="column is-narrow">
<div class="dropdown is-right is-up" class:is-active={dropdownActivate == index} >
<div class="dropdown-trigger" on:click={handleDropdownActivation(index)}>
<div class="dropdown-trigger" on:click={handleDropdownActivation(index)} on:keypress={handleDropdownActivation(index)}>
{#if dropdownActivate == index}
<FontAwesomeIcon icon={faAngleUp} class="icon" aria-haspopup="true" aria-controls="dropdown-menu"/>
{:else}
Expand Down
2 changes: 1 addition & 1 deletion src/routes/playlists/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</div>
<div class="column is-narrow">
<div class="dropdown is-right is-up" class:is-active={options == i} >
<div class="dropdown-trigger" on:click={() => handleDropdownActivation(i)}>
<div class="dropdown-trigger" on:click={() => handleDropdownActivation(i)} on:keypress={() => handleDropdownActivation(i)}>
{#if options == i}
<FontAwesomeIcon icon={faAngleUp} class="icon" aria-haspopup="true" aria-controls="dropdown-menu"/>
{:else}
Expand Down
6 changes: 3 additions & 3 deletions src/routes/search.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
{:then}
<div class="tags">
{#each uris as uri}
<span class="tag" class:is-primary="{selectedUris[uri]}" on:click="{() => selectedUris[uri] = !selectedUris[uri]}">
<span class="tag" class:is-primary="{selectedUris[uri]}" on:click="{() => selectedUris[uri] = !selectedUris[uri]}" on:keypress="{() => selectedUris[uri] = !selectedUris[uri]}">
{#if uri in uriIcons}
<FontAwesomeIcon icon={uriIcons[uri]} class="icon is-small"/> &nbsp; {uri}
{:else}
Expand All @@ -45,7 +45,7 @@
{#if resultTracks.length > 0}
<div class="column is-narrow">
<div class="dropdown is-right" class:is-active={showOptions}>
<div class="dropdown-trigger" on:click={() => showOptions = !showOptions}>
<div class="dropdown-trigger" on:click={() => showOptions = !showOptions} on:keypress={() => showOptions = !showOptions}>
{#if showOptions}
<a href="{null}" class="button">
<FontAwesomeIcon icon={faAngleUp} class="icon" aria-haspopup="true" aria-controls="dropdown-menu"/>
Expand Down Expand Up @@ -99,7 +99,7 @@
on:dragenter={() => hovering = idx}
class:is-active={hovering === idx}
>
<div class="columns is-mobile" on:click={handleDropdownActivation(idx)}>
<div class="columns is-mobile" on:click={handleDropdownActivation(idx)} on:keypress={handleDropdownActivation(idx)}>
<div class="column">
{#if track.artists}
{track.artists.map(x => x.name).join(', ')} - {track.name}
Expand Down

0 comments on commit 6657295

Please sign in to comment.