-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
45 lines (33 loc) · 1.1 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<html>
<head>
<style>
input[type=range][orient=vertical]
{
writing-mode: bt-lr; /* IE */
-webkit-appearance: slider-vertical; /* WebKit */
width: 8px;
height: 175px;
padding: 0 5px;
}
</style>
</head>
<body>
<input type="range" min="0" max="255" orient="vertical" onchange="update()" onmousemove="update()" id="red" />
<input type="range" min="0" max="255" orient="vertical" onchange="update()" onmousemove="update()" id="green" />
<input type="range" min="0" max="255" orient="vertical" onchange="update()" onmousemove="update()" id="blue" />
<input type="range" min="0" max="255" orient="vertical" onchange="update()" onmousemove="update()" id="brightness" />
<script>
var x = new XMLHttpRequest();
var R, G, B = 0;
var BRIGHTNESS = 128;
function update() {
R = parseInt(document.getElementById("red").value);
G = parseInt(document.getElementById("blue").value);
B = parseInt(document.getElementById("green").value);
BRIGHTNESS = parseInt(document.getElementById("brightness").value);
x.open('GET', '/color?r='+R+'&g='+G+'&b='+B+'&brightness='+BRIGHTNESS);
x.send();
}
</script>
</body>
</html>