Skip to content

Commit

Permalink
feat: deband keybind
Browse files Browse the repository at this point in the history
feat: keybind descriptions
  • Loading branch information
ThaUnknown committed Apr 13, 2024
1 parent 13c4526 commit f54e5cb
Showing 1 changed file with 49 additions and 21 deletions.
70 changes: 49 additions & 21 deletions common/views/Player/Player.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -460,82 +460,105 @@
KeyX: {
fn: () => screenshot(),
id: 'screenshot_monitor',
type: 'icon'
type: 'icon',
desc: 'Save Screenshot to Clipboard'
},
KeyI: {
fn: () => toggleStats(),
id: 'list',
type: 'icon'
type: 'icon',
desc: 'Toggle Stats'
},
Backquote: {
fn: () => (showKeybinds = !showKeybinds),
id: 'help_outline',
type: 'icon'
type: 'icon',
desc: 'Toggle Keybinds'
},
Space: {
fn: () => playPause(),
id: 'play_arrow',
type: 'icon'
type: 'icon',
desc: 'Play/Pause'
},
KeyN: {
fn: () => playNext(),
id: 'skip_next',
type: 'icon'
type: 'icon',
desc: 'Next Episode'
},
KeyB: {
fn: () => playLast(),
id: 'skip_previous',
type: 'icon'
type: 'icon',
desc: 'Previous Episode'
},
KeyA: {
fn: () => {
$settings.playerDeband = !$settings.playerDeband
},
id: 'deblur',
type: 'icon',
desc: 'Toggle Video Debanding'
},
KeyM: {
fn: () => (muted = !muted),
id: 'volume_off',
type: 'icon'
type: 'icon',
desc: 'Toggle Mute'
},
KeyP: {
fn: () => togglePopout(),
id: 'picture_in_picture',
type: 'icon'
type: 'icon',
desc: 'Toggle Picture in Picture'
},
KeyF: {
fn: () => toggleFullscreen(),
id: 'fullscreen',
type: 'icon'
type: 'icon',
desc: 'Toggle Fullscreen'
},
KeyS: {
fn: () => skip(),
id: '+90'
id: '+90',
desc: 'Skip Intro/90s'
},
KeyW: {
fn: () => { fitWidth = !fitWidth },
id: 'fit_width',
type: 'icon'
type: 'icon',
desc: 'Toggle Video Cover'
},
KeyD: {
fn: () => toggleCast(),
id: 'cast',
type: 'icon'
type: 'icon',
desc: 'Toggle Cast [broken]'
},
KeyC: {
fn: () => cycleSubtitles(),
id: 'subtitles',
type: 'icon'
type: 'icon',
desc: 'Cycle Subtitles'
},
ArrowLeft: {
fn: e => {
e.stopImmediatePropagation()
e.preventDefault()
rewind()
},
id: '-2'
id: '-2',
desc: 'Rewind 2s'
},
ArrowRight: {
fn: e => {
e.stopImmediatePropagation()
e.preventDefault()
forward()
},
id: '+2'
id: '+2',
desc: 'Seek 2s'
},
ArrowUp: {
fn: e => {
Expand All @@ -544,7 +567,8 @@
volume = Math.min(1, volume + 0.05)
},
id: 'volume_up',
type: 'icon'
type: 'icon',
desc: 'Volume Up'
},
ArrowDown: {
fn: e => {
Expand All @@ -553,22 +577,26 @@
volume = Math.max(0, volume - 0.05)
},
id: 'volume_down',
type: 'icon'
type: 'icon',
desc: 'Volume Down'
},
BracketLeft: {
fn: () => { playbackRate = video.defaultPlaybackRate -= 0.1 },
id: 'history',
type: 'icon'
type: 'icon',
desc: 'Decrease Playback Rate'
},
BracketRight: {
fn: () => { playbackRate = video.defaultPlaybackRate += 0.1 },
id: 'update',
type: 'icon'
type: 'icon',
desc: 'Increase Playback Rate'
},
Backslash: {
fn: () => { playbackRate = video.defaultPlaybackRate = 1 },
id: 'schedule',
type: 'icon'
type: 'icon',
desc: 'Reset Playback Rate'
}
})
Expand Down Expand Up @@ -974,7 +1002,7 @@
{#if showKeybinds && !miniplayer}
<div class='position-absolute bg-tp w-full h-full z-50 font-size-12 p-20 d-flex align-items-center justify-content-center pointer' on:pointerup|self={() => (showKeybinds = false)} tabindex='-1' role='button'>
<Keybinds let:prop={item} autosave={true} clickable={true}>
<div class:material-symbols-outlined={item?.type} class='bind'>{item?.id || ''}</div>
<div class:material-symbols-outlined={item?.type} class='bind' title={item?.desc} style='pointer-events: all !important;'>{item?.id || ''}</div>
</Keybinds>
</div>
{/if}
Expand Down

0 comments on commit f54e5cb

Please sign in to comment.