summaryrefslogtreecommitdiffstats
path: root/src/js/chair.js
diff options
context:
space:
mode:
authorHumberto Alfonso Díaz <humberto.alfonso@asvito.es>2019-07-05 11:15:05 +0200
committerHumberto Alfonso Díaz <humberto.alfonso@asvito.es>2019-07-05 11:15:05 +0200
commite7ed285298166bf0589f6a6d8e88000c60d5681b (patch)
treed109f6f139868a7239ca16ac0eae331fe71f3539 /src/js/chair.js
parent238bcb88ac7bd7e6083fdd8dd6227163a37ece70 (diff)
FUNCT Add buttons, fan speed and chair functionality
Diffstat (limited to 'src/js/chair.js')
-rw-r--r--src/js/chair.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/js/chair.js b/src/js/chair.js
new file mode 100644
index 0000000..ceed88c
--- /dev/null
+++ b/src/js/chair.js
@@ -0,0 +1,19 @@
+var left = 0;
+var right = 0;
+
+module.exports = {
+ update_left: function() {
+ document.getElementById('LeftChair').setAttribute('value', left);
+ },
+ left: function() {
+ left = (left + 1) % 3;
+ this.update_left();
+ },
+ update_right: function() {
+ document.getElementById('RightChair').setAttribute('value', right);
+ },
+ right: function() {
+ right = (right + 1) % 3;
+ this.update_right();
+ },
+} \ No newline at end of file