Add Settings panel with a button to change themes
Only 2 themes besides the default are implemented for now. More to come!
This commit is contained in:
parent
08ca381a9f
commit
729c71fac0
6 changed files with 74 additions and 8 deletions
22
sources/scripts/settings.js
Normal file
22
sources/scripts/settings.js
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
'use strict'
|
||||
|
||||
function Settings () {
|
||||
this.element = null
|
||||
this.theme_button = null
|
||||
|
||||
this.install = function () {
|
||||
this.element = document.createElement('div')
|
||||
this.element.setAttribute('class', 'settings')
|
||||
|
||||
this.theme_button = document.createElement('select')
|
||||
this.theme_button.setAttribute('class', 'theme button')
|
||||
this.theme_button.innerHTML = '<option value=\"theme\">Theme (default)</option>'
|
||||
this.theme_button.innerHTML += '<option value=\"gameboy\">Game Boy</option>'
|
||||
this.theme_button.innerHTML += '<option value=\"nightowl\">Night Owl</option>'
|
||||
this.theme_button.addEventListener('mousedown', () => { donsol.player.change_theme(this.theme_button.value) })
|
||||
|
||||
this.element.appendChild(this.theme_button)
|
||||
|
||||
return this.element
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue