From 783be0ef4f7302ca722ab3224f2c9a98e355b8da Mon Sep 17 00:00:00 2001 From: Humberto Alfonso Díaz Date: Mon, 23 Sep 2019 11:32:30 +0200 Subject: FUNCT Add support to modify sliders --- package.json | 4 ++- src/index.html | 93 ++++++++++----------------------------------------- src/index.js | 7 ++++ src/js/app.js | 29 ++++++++++++++++ src/js/buttons.js | 38 --------------------- src/js/chair.js | 33 ------------------ src/js/fan_speed.js | 29 ---------------- src/js/sliders.js | 56 +++++++++++++++++++++++++++++++ src/js/temperature.js | 89 ------------------------------------------------ src/styles/main.scss | 3 +- webpack.config.js | 3 +- 11 files changed, 117 insertions(+), 267 deletions(-) create mode 100644 src/js/app.js delete mode 100644 src/js/buttons.js delete mode 100644 src/js/chair.js delete mode 100644 src/js/fan_speed.js create mode 100644 src/js/sliders.js delete mode 100644 src/js/temperature.js diff --git a/package.json b/package.json index fabae34..d75f535 100644 --- a/package.json +++ b/package.json @@ -35,5 +35,7 @@ "webpack-dev-server": "^3.7.2", "zip-webpack-plugin": "^3.0.0" }, - "dependencies": {} + "dependencies": { + "mustache": "^3.1.0" + } } diff --git a/src/index.html b/src/index.html index 9c1ac9b..6b2ed01 100644 --- a/src/index.html +++ b/src/index.html @@ -25,81 +25,24 @@

Mixer

-
-
- Volume 1: 50% -
- - - -
- - -
- - - -
-
-
- Volume 1: 50% -
- - - -
- - -
- - - -
-
-
- Volume 1: 50% -
- - - -
- - -
- - - -
-
-
- Volume 1: 50% -
- - - -
- - -
- - - -
-
-
- Volume 1: 50% -
- - - -
- - -
- - - -
+
+
diff --git a/src/index.js b/src/index.js index 142b8d1..fa62684 100644 --- a/src/index.js +++ b/src/index.js @@ -16,6 +16,13 @@ /* JS */ import './js/AFB.js'; +import { init } from './js/app'; +import { increase, decrease, change } from './js/sliders'; /* CSS */ import './styles/app.scss'; + +window.increase = increase; +window.decrease = decrease; +window.change = change; +init(); \ No newline at end of file diff --git a/src/js/app.js b/src/js/app.js new file mode 100644 index 0000000..773e5b0 --- /dev/null +++ b/src/js/app.js @@ -0,0 +1,29 @@ +import Mustache from 'mustache'; +import { init as init_sliders } from './sliders'; + +var template; + +function render_sliders(sliders) { + var sliderContainer = document.getElementById('SliderContainer'); + for( var i=0; i