Compare commits
No commits in common. "e01e46ef3ba4508bddce4b04e7268a3c250f7d9d" and "a2f70bf5ec120ea9aad4aae981ac60e59bde48b8" have entirely different histories.
e01e46ef3b
...
a2f70bf5ec
11 changed files with 62 additions and 53 deletions
Binary file not shown.
Before Width: | Height: | Size: 2 MiB After Width: | Height: | Size: 2 MiB |
|
@ -427,6 +427,10 @@ container.innerHTML = "";
|
||||||
container.classList.add("pure-form");
|
container.classList.add("pure-form");
|
||||||
container.appendChild(table);
|
container.appendChild(table);
|
||||||
}
|
}
|
||||||
|
function rgb2Hex(r, g, b) {
|
||||||
|
var hex = "#" + ((1 << 24) | (r << 16) | (g << 8) | b).toString(16).slice(1);
|
||||||
|
return hex;
|
||||||
|
}
|
||||||
function createSlider(id, max, value, step) {
|
function createSlider(id, max, value, step) {
|
||||||
var input = document.createElement("input");
|
var input = document.createElement("input");
|
||||||
input.type = "range";
|
input.type = "range";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<!-- middle -->
|
<!-- middle -->
|
||||||
</td>
|
</td>
|
||||||
<td class="top-align">
|
<td>
|
||||||
<div id="plot_chart" class="top-align"></div>
|
<div id="plot_chart" class="top-align"></div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -25,21 +25,5 @@ output{{LIGHT_NUMBER_DEC}}.innerHTML = (Math.round((slider{{LIGHT_NUMBER_DEC}}.v
|
||||||
slider{{LIGHT_NUMBER_DEC}}.oninput = function() {
|
slider{{LIGHT_NUMBER_DEC}}.oninput = function() {
|
||||||
output{{LIGHT_NUMBER_DEC}}.innerHTML = (Math.round((this.value * 100.0 / 255.0) * 100) / 100).toFixed(2);
|
output{{LIGHT_NUMBER_DEC}}.innerHTML = (Math.round((this.value * 100.0 / 255.0) * 100) / 100).toFixed(2);
|
||||||
}
|
}
|
||||||
var lightNumber = {{LIGHT_NUMBER}};
|
|
||||||
var slider = document.getElementById("bri{{LIGHT_NUMBER_DEC}}");
|
|
||||||
var pwm = document.getElementById("light{{LIGHT_NUMBER_DEC}}_pwm");
|
|
||||||
if (lightNumber === 1) {
|
|
||||||
slider.style.background = "linear-gradient(to bottom, " + rgb2Hex(31, 119, 180) + ", white)";
|
|
||||||
pwm.style.background = "linear-gradient(to right, white, " + rgb2Hex(31, 119, 180) + ")";
|
|
||||||
} else if (lightNumber === 2) {
|
|
||||||
slider.style.background = "linear-gradient(to bottom, " + rgb2Hex(255, 127, 14) + ", white)";
|
|
||||||
pwm.style.background = "linear-gradient(to right, white, " + rgb2Hex(255, 127, 14) + ")";
|
|
||||||
} else if (lightNumber === 3) {
|
|
||||||
slider.style.background = "linear-gradient(to bottom, " + rgb2Hex(44, 160, 44) + ", white)";
|
|
||||||
pwm.style.background = "linear-gradient(to right, white, " + rgb2Hex(44, 160, 44) + ")";
|
|
||||||
} else if (lightNumber === 4) {
|
|
||||||
slider.style.background = "linear-gradient(to bottom, " + rgb2Hex(214, 39, 40) + ", white)";
|
|
||||||
pwm.style.background = "linear-gradient(to right, white, " + rgb2Hex(214, 39, 40) + ")";
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -74,6 +74,27 @@ background-color: #ddd;
|
||||||
input[type=range]:focus {
|
input[type=range]:focus {
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
[id^="bri"] {
|
/*
|
||||||
width: 50%;
|
input[type=range]::-webkit-slider-thumb {
|
||||||
}
|
-webkit-appearance: none;
|
||||||
|
appearance: none;
|
||||||
|
width: 15px;
|
||||||
|
height: 15px;
|
||||||
|
border-radius: 10%;
|
||||||
|
background-color: #a1a1a1;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
input[type=range]::-moz-range-thumb {
|
||||||
|
width: 15px;
|
||||||
|
height: 15px;
|
||||||
|
border-radius: 10%;
|
||||||
|
background-color: #a1a1a1;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
input[type=range]::-ms-thumb {
|
||||||
|
width: 15px;
|
||||||
|
height: 15px;
|
||||||
|
border-radius: 10%;
|
||||||
|
background-color: #a1a1a1;
|
||||||
|
cursor: pointer;
|
||||||
|
}*/
|
|
@ -96,8 +96,4 @@ showToast(`Error sending slider value to ${url}: ${error}`, 'error');
|
||||||
console.error(`Error sending slider value to ${url}: ${error}`);
|
console.error(`Error sending slider value to ${url}: ${error}`);
|
||||||
});
|
});
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
function rgb2Hex(r, g, b) {
|
|
||||||
var hex = "#" + ((1 << 24) | (r << 16) | (g << 8) | b).toString(16).slice(1);
|
|
||||||
return hex;
|
|
||||||
}
|
|
|
@ -509,6 +509,12 @@ function createTable() {
|
||||||
container.appendChild(table);
|
container.appendChild(table);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function rgb2Hex(r, g, b) {
|
||||||
|
// RGB-Werte in hexadezimale Werte umwandeln
|
||||||
|
var hex = "#" + ((1 << 24) | (r << 16) | (g << 8) | b).toString(16).slice(1);
|
||||||
|
return hex;
|
||||||
|
}
|
||||||
|
|
||||||
function createSlider(id, max, value, step) {
|
function createSlider(id, max, value, step) {
|
||||||
// Create a new input element of type range
|
// Create a new input element of type range
|
||||||
var input = document.createElement("input");
|
var input = document.createElement("input");
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<!-- middle -->
|
<!-- middle -->
|
||||||
</td>
|
</td>
|
||||||
<td class="top-align">
|
<td>
|
||||||
<div id="plot_chart" class="top-align"></div>
|
<div id="plot_chart" class="top-align"></div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -25,22 +25,5 @@
|
||||||
slider{{LIGHT_NUMBER_DEC}}.oninput = function() {
|
slider{{LIGHT_NUMBER_DEC}}.oninput = function() {
|
||||||
output{{LIGHT_NUMBER_DEC}}.innerHTML = (Math.round((this.value * 100.0 / 255.0) * 100) / 100).toFixed(2);
|
output{{LIGHT_NUMBER_DEC}}.innerHTML = (Math.round((this.value * 100.0 / 255.0) * 100) / 100).toFixed(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
var lightNumber = {{LIGHT_NUMBER}};
|
|
||||||
var slider = document.getElementById("bri{{LIGHT_NUMBER_DEC}}");
|
|
||||||
var pwm = document.getElementById("light{{LIGHT_NUMBER_DEC}}_pwm");
|
|
||||||
if (lightNumber === 1) {
|
|
||||||
slider.style.background = "linear-gradient(to bottom, " + rgb2Hex(31, 119, 180) + ", white)";
|
|
||||||
pwm.style.background = "linear-gradient(to right, white, " + rgb2Hex(31, 119, 180) + ")";
|
|
||||||
} else if (lightNumber === 2) {
|
|
||||||
slider.style.background = "linear-gradient(to bottom, " + rgb2Hex(255, 127, 14) + ", white)";
|
|
||||||
pwm.style.background = "linear-gradient(to right, white, " + rgb2Hex(255, 127, 14) + ")";
|
|
||||||
} else if (lightNumber === 3) {
|
|
||||||
slider.style.background = "linear-gradient(to bottom, " + rgb2Hex(44, 160, 44) + ", white)";
|
|
||||||
pwm.style.background = "linear-gradient(to right, white, " + rgb2Hex(44, 160, 44) + ")";
|
|
||||||
} else if (lightNumber === 4) {
|
|
||||||
slider.style.background = "linear-gradient(to bottom, " + rgb2Hex(214, 39, 40) + ", white)";
|
|
||||||
pwm.style.background = "linear-gradient(to right, white, " + rgb2Hex(214, 39, 40) + ")";
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -74,6 +74,27 @@ background-color: #ddd;
|
||||||
input[type=range]:focus {
|
input[type=range]:focus {
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
[id^="bri"] {
|
/*
|
||||||
width: 50%;
|
input[type=range]::-webkit-slider-thumb {
|
||||||
}
|
-webkit-appearance: none;
|
||||||
|
appearance: none;
|
||||||
|
width: 15px;
|
||||||
|
height: 15px;
|
||||||
|
border-radius: 10%;
|
||||||
|
background-color: #a1a1a1;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
input[type=range]::-moz-range-thumb {
|
||||||
|
width: 15px;
|
||||||
|
height: 15px;
|
||||||
|
border-radius: 10%;
|
||||||
|
background-color: #a1a1a1;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
input[type=range]::-ms-thumb {
|
||||||
|
width: 15px;
|
||||||
|
height: 15px;
|
||||||
|
border-radius: 10%;
|
||||||
|
background-color: #a1a1a1;
|
||||||
|
cursor: pointer;
|
||||||
|
}*/
|
|
@ -105,10 +105,4 @@ function sendSliderValue(x) {
|
||||||
console.error(`Error sending slider value to ${url}: ${error}`);
|
console.error(`Error sending slider value to ${url}: ${error}`);
|
||||||
});
|
});
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
function rgb2Hex(r, g, b) {
|
|
||||||
// RGB-Werte in hexadezimale Werte umwandeln
|
|
||||||
var hex = "#" + ((1 << 24) | (r << 16) | (g << 8) | b).toString(16).slice(1);
|
|
||||||
return hex;
|
|
||||||
}
|
|
Loading…
Reference in a new issue