diff options
author | Humberto Alfonso Díaz <humberto.alfonso@asvito.es> | 2019-07-05 11:15:05 +0200 |
---|---|---|
committer | Lorenzo Tilve <ltilve@igalia.com> | 2020-02-04 09:42:15 +0100 |
commit | c614436d29a11ddbb1218485a05da7dde0e57038 (patch) | |
tree | d109f6f139868a7239ca16ac0eae331fe71f3539 /src/js/buttons.js | |
parent | 5ef2a232c9f8701531419f6d8ac8ebcfc4d21fc6 (diff) |
FUNCT Add buttons, fan speed and chair functionality
Diffstat (limited to 'src/js/buttons.js')
-rw-r--r-- | src/js/buttons.js | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/js/buttons.js b/src/js/buttons.js new file mode 100644 index 0000000..3730d9f --- /dev/null +++ b/src/js/buttons.js @@ -0,0 +1,50 @@ +var buttons = { + ac: false, + auto: false, + circulation: false, + down: false, + up: false, + right: false, + rear: false, + front: false +}; + +module.exports = { + update: function() { + for( var button in buttons ) { + document.getElementById(button+'button').setAttribute('value', buttons[button]); + } + }, + ac: function() { + buttons.ac = !buttons.ac; + this.update(); + }, + auto: function() { + buttons.auto = !buttons.auto; + this.update(); + }, + circulation: function() { + buttons.circulation = !buttons.circulation; + this.update(); + }, + down: function() { + buttons.down = !buttons.down; + this.update(); + }, + up: function() { + buttons.up = !buttons.up; + this.update(); + }, + right: function() { + buttons.right = !buttons.right; + this.update(); + }, + rear: function() { + buttons.rear = !buttons.rear; + this.update(); + }, + front: function() { + buttons.front = !buttons.front; + this.update(); + } +}
\ No newline at end of file |