Skip to content

Commit

Permalink
fix: aesthetics
Browse files Browse the repository at this point in the history
  • Loading branch information
flotwig committed Aug 14, 2020
1 parent dba936e commit ff132ff
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
12 changes: 10 additions & 2 deletions frontend/src/controls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,16 @@ export function startControls() {

;['Power', 'WakeUp', 'Sleep'].map(code => {
const el = document.querySelector(`button#${code.toLowerCase()}`)
el.addEventListener('mousedown', () => document.dispatchEvent(new KeyboardEvent('keydown', { code })))
el.addEventListener('mouseup', () => document.dispatchEvent(new KeyboardEvent('keyup', { code })))

el.addEventListener('mousedown', () => {
log.info(`Pressing ${code} button...`)
document.dispatchEvent(new KeyboardEvent('keydown', { code }))
})

el.addEventListener('mouseup', () => {
log.info(`${code} button released.`)
document.dispatchEvent(new KeyboardEvent('keyup', { code }))
})
})
})
}
Expand Down
1 change: 1 addition & 0 deletions frontend/src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ body {
overflow-x: hidden;

li {
font-size: .9em;
padding: 2px 8px;
width: 100%;
list-style-type: none;
Expand Down

0 comments on commit ff132ff

Please sign in to comment.