Skip to content

Commit

Permalink
accessibility
Browse files Browse the repository at this point in the history
  • Loading branch information
ThinLiquid committed May 13, 2024
1 parent aa51f15 commit e49a38a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,34 +58,44 @@ class Metadata {
this.icons = new HTML('div').classOn('icons')

this.playPause = new HTML('button')
.attr({ title: 'Play' })
.classOn('material-symbols-sharp')
.classOn('filled')
.text('play_arrow')

this.prevTrack = new HTML('button')
.attr({ title: 'Previous' })
.classOn('material-symbols-sharp')
.classOn('filled')
.text('skip_previous')

this.nextTrack = new HTML('button')
.attr({ title: 'Next' })
.classOn('material-symbols-sharp')
.classOn('filled')
.text('skip_next')

this.like = new HTML('button').classOn('material-symbols-sharp').text('add')
this.like = new HTML('button')
.attr({ title: 'Like' })
.classOn('material-symbols-sharp')
.text('add')

this.options = new HTML('div').classOn('options')
this.menu = new HTML('button')
.attr({ title: 'Menu' })
.classOn('material-symbols-sharp')
.text('playlist_play')
.text('menu')
this.queuebtn = new HTML('button')
.attr({ title: 'Queue' })
.classOn('material-symbols-sharp')
.text('queue_music')

this.volume = new HTML('div')
.attr({ title: 'Volume' })
.id('range-slider')

this.crt = new HTML('button')
.attr({ title: 'CRT Mode' })
.classOn('material-symbols-sharp')
.text('blur_on')

Expand Down Expand Up @@ -172,14 +182,17 @@ class Metadata {
// Register the events for the buttons
this.player.audio.addEventListener('play', () => {
this.playPause.text('pause')
.attr({ title: 'Pause' })
})

this.player.audio.addEventListener('pause', () => {
this.playPause.text('play_arrow')
.attr({ title: 'Play' })
})

this.player.audio.addEventListener('ended', () => {
this.playPause.text('play_arrow')
.attr({ title: 'Play' })
})

// Update the progress bar
Expand Down
7 changes: 7 additions & 0 deletions src/searchpal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ class SearchPalette {
const icons = new HTML('div').classOn('icons')

const add = new HTML('button')
.attr({ title: 'Add to queue' })
.classOn('material-symbols-sharp')
.text('playlist_add')
.appendTo(icons)
Expand All @@ -173,6 +174,7 @@ class SearchPalette {
})

const open = new HTML('button')
.attr({ title: 'Open in Spotify' })
.classOn('material-symbols-sharp')
.text('open_in_new')
.appendTo(icons)
Expand Down Expand Up @@ -216,6 +218,7 @@ class SearchPalette {
const icons = new HTML('div').classOn('icons')

const add = new HTML('button')
.attr({ title: 'Add to queue' })
.classOn('material-symbols-sharp')
.text('playlist_add')
.appendTo(icons)
Expand All @@ -227,6 +230,7 @@ class SearchPalette {
})

const open = new HTML('button')
.attr({ title: 'Open in Spotify' })
.classOn('material-symbols-sharp')
.text('open_in_new')
.appendTo(icons)
Expand Down Expand Up @@ -277,6 +281,7 @@ class SearchPalette {
const icons = new HTML('div').classOn('icons')

const addNext = new HTML('button')
.attr({ title: 'Add to queue next' })
.classOn('material-symbols-sharp')
.text('playlist_play')
.appendTo(icons)
Expand All @@ -288,6 +293,7 @@ class SearchPalette {
})

const add = new HTML('button')
.attr({ title: 'Add to queue' })
.classOn('material-symbols-sharp')
.text('playlist_add')
.appendTo(icons)
Expand All @@ -299,6 +305,7 @@ class SearchPalette {
})

const open = new HTML('button')
.attr({ title: 'Open in Spotify' })
.classOn('material-symbols-sharp')
.text('open_in_new')
.appendTo(icons)
Expand Down

0 comments on commit e49a38a

Please sign in to comment.