WLED/wled00/data/index.htm

206 wiersze
5.2 KiB
HTML
Czysty Zwykły widok Historia

2016-09-11 21:07:18 +00:00
<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>WLED 0.3pd</title>
2016-09-11 21:07:18 +00:00
<script>
strA = "";
strR = "";
strG = "";
strB = "";
function Startup()
{
setInterval('GetArduinoIO()', 5000);
GetArduinoIO();
2016-09-11 21:07:18 +00:00
}
function GetArduinoIO()
2016-09-11 21:07:18 +00:00
{
nocache = "&nocache=" + Math.random() * 1000000;
2016-09-11 21:07:18 +00:00
var request = new XMLHttpRequest();
request.onreadystatechange = function()
{
if (this.readyState == 4) {
if (this.status == 200) {
if (this.responseXML != null) {
document.Ctrl_form.SA.value = this.responseXML.getElementsByTagName('act')[0].childNodes[0].nodeValue;
document.Ctrl_form.SR.value = this.responseXML.getElementsByTagName('cl')[0].childNodes[0].nodeValue;
document.Ctrl_form.SG.value = this.responseXML.getElementsByTagName('cl')[1].childNodes[0].nodeValue;
document.Ctrl_form.SB.value = this.responseXML.getElementsByTagName('cl')[2].childNodes[0].nodeValue;
UpdateVals();
}
}
}
}
// send HTTP request
request.open("GET", "ajax_in/" + strA + strR + strG + strB + nocache, true);
2016-09-11 21:07:18 +00:00
request.send(null);
strA = "";
strR = "";
strG = "";
strB = "";
2016-09-11 21:07:18 +00:00
}
function GetCheck()
{
strA = "&A=" + Ctrl_form.SA.value;
strR = "&R=" + Ctrl_form.SR.value;
strG = "&G=" + Ctrl_form.SG.value;
strB = "&B=" + Ctrl_form.SB.value;
2016-09-11 21:07:18 +00:00
UpdateVals();
GetArduinoIO();
2016-09-11 21:07:18 +00:00
}
function rgb2hex(red, green, blue) {
var rgb = blue | (green << 8) | (red << 16);
return '#' + (0x1000000 + rgb).toString(16).slice(1)
}
function lingrad(red, green, blue) {
return "linear-gradient(white, " + rgb2hex(red, green, blue) + ")";
}
function UpdateVals()
{
document.body.style.background = lingrad(Ctrl_form.SR.value, Ctrl_form.SG.value, Ctrl_form.SB.value);
}
function OpenSettings()
{
window.open("/settings","_self");
}
2016-10-30 19:04:39 +00:00
function ToggleNightMode()
{
}
2016-09-11 21:07:18 +00:00
</script>
<style>
.ctrl_box {
border: 0.3ch solid grey;
margin: auto;
width: 80vw;
background-color: #B9B9B9;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.sliders {
width: 100%;
height: 12vh;
2016-09-11 21:07:18 +00:00
}
.sliderA {
margin-left: auto;
margin-right: auto;
width: 77vw;
background: linear-gradient(to right, black, yellow);
}
.sliderR {
margin-left: auto;
margin-right: auto;
width: 77vw;
background: linear-gradient(to right, black, red);
}
.sliderG {
margin-left: auto;
margin-right: auto;
width: 77vw;
background: linear-gradient(to right, black, green);
}
.sliderB {
margin-left: auto;
margin-right: auto;
width: 77vw;
background: linear-gradient(to right, black, blue);
}
body {
text-align: right;
background: linear-gradient(white, black);
height: 100%;
margin: 0;
background-repeat: no-repeat;
background-attachment: fixed;
}
html {
height: 100%;
}
.tool_box {
}
2016-10-30 19:04:39 +00:00
input[type=image] {
width: 10vmin;
height: 10vmin;
2016-09-11 21:07:18 +00:00
margin-top: 4px;
margin-right: 4px;
}
input[type=range] {
-webkit-appearance: none;
width: 100%;
margin: -4px 0;
}
input[type=range]:focus {
outline: none;
}
input[type=range]::-webkit-slider-runnable-track {
width: 100%;
height: 12vh;
2016-09-11 21:07:18 +00:00
cursor: pointer;
background: #DDDDDD;
}
input[type=range]::-webkit-slider-thumb {
height: 10vh;
width: 10vh;
2016-09-11 21:07:18 +00:00
background: #ffffff;
cursor: pointer;
-webkit-appearance: none;
margin-top: 1vh;
2016-09-11 21:07:18 +00:00
}
input[type=range]::-moz-range-track {
width: 100%;
height: 12vh;
2016-09-11 21:07:18 +00:00
cursor: pointer;
background: #DDDDDD;
}
input[type=range]::-moz-range-thumb {
height: 10vh;
width: 10vh;
2016-09-11 21:07:18 +00:00
background: #ffffff;
cursor: pointer;
margin-top: 1vh;
2016-09-11 21:07:18 +00:00
}
input[type=range]::-ms-track {
width: 100%;
height: 12vh;
2016-09-11 21:07:18 +00:00
cursor: pointer;
background: transparent;
border-color: transparent;
color: transparent;
}
input[type=range]::-ms-fill-lower {
background: #DDDDDD;
}
input[type=range]::-ms-fill-upper {
background: #DDDDDD;
}
input[type=range]::-ms-thumb {
width: 10vh;
2016-09-11 21:07:18 +00:00
background: #ffffff;
cursor: pointer;
height: 10vh;
2016-09-11 21:07:18 +00:00
}
</style>
<style id="holderjs-style" type="text/css"></style></head>
<body onload="Startup()" class=" __plain_text_READY__">
<div id="tbB" class="tool_box">
<input type="image" class="settingsbutton" src="/button.png" onclick="OpenSettings()"id="tool">
<!--<input type="image" class="nightbutton" src="/moon.png" onclick="ToggleNightMode()"id="night">-->
2016-09-11 21:07:18 +00:00
</div>
<div id="cdB" class="ctrl_box">
<form id="form_c" name="Ctrl_form">
<br>
<div id="slA" class="sliderA">
<input type="range" class="sliders" name="SA" value="0" min="0" max="255" step="1" onchange="GetCheck()"> </div> <br>
<div id="slR" class="sliderR">
<input type="range" class="sliders" name="SR" value="0" min="0" max="255" step="1" onchange="GetCheck()"> </div> <br>
<div id="slR" class="sliderG">
<input type="range" class="sliders" name="SG" value="0" min="0" max="255" step="1" onchange="GetCheck()"> </div> <br>
<div id="slR" class="sliderB">
<input type="range" class="sliders" name="SB" value="0" min="0" max="255" step="1" onchange="GetCheck()"> </div> <br>
</form>
2016-09-11 21:07:18 +00:00
</div>
</div></body></html>