forked from HanSolo/SteelSeries-Canvas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demoLightBulb.html
56 lines (50 loc) · 1.43 KB
/
demoLightBulb.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
46
47
48
49
50
51
52
53
54
55
56
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='utf-8' />
<title>LightBulb</title>
<script src='steelseries-min.js'></script>
<script>
var lightBulb;
function init()
{
// Initialzing
lightBulb = new steelseries.LightBulb('canvas', {
width: 200,
height: 200
});
}
function setLight() {
lightBulb.setOn(document.getElementById('light').checked);
}
function setAlpha(value) {
lightBulb.setAlpha(value / 100);
}
function setColor(color) {
lightBulb.setGlowColor(color);
}
</script>
</head>
<body onload='init()' BGCOLOR="333333" TEXT="cccccc">
<table>
<tr><td>
<canvas id='canvas' width='400' height='400'>
No canvas in your browser...sorry...
</canvas>
</td>
<td>
<input id="light" type="checkbox" onClick="setLight()"/>Light on</br>
<input id="red" type="radio" name="color" onclick="setColor('rgb(204, 51, 0)');"/>red<br/>
<input id="green" type="radio" name="color" onclick="setColor('rgb(0, 255, 0)');"/>green<br/>
<input id="blue" type="radio" name="color" onclick="setColor('rgb(0, 0, 255)');"/>blue<br/>
<input id="yellow" type="radio" name="color" checked onclick="setColor('rgb(255, 255, 0)');"/>yellow<br/>
</td>
</tr>
<tr>
<td>
<input type="range" min="0" max="100" value="100" step="1" onchange="setAlpha(this.value)"/>
</td>
</tr>
</table>
</body>
</html>