-
Notifications
You must be signed in to change notification settings - Fork 76
/
demoLcdSections.html
152 lines (144 loc) · 5.88 KB
/
demoLcdSections.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<!DOCTYPE html>
<html manifest="demo.manifest"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title>Canvas Steel</title>
</head>
<body onload="init()" style="background-color:#84a5ed">
<table>
<tbody><tr>
<td width="100%">
<select id="comboLcdColor" onchange="setLcdColor(this)">
<option selected="selected" value="">LCD color</option>
<option value="BEIGE">Beige</option>
<option value="BLUE">Blue</option>
<option value="ORANGE">Orange</option>
<option value="RED">Red</option>
<option value="YELLOW">Yellow</option>
<option value="WHITE">White</option>
<option value="GRAY">Gray</option>
<option value="BLACK">Black</option>
<option value="GREEN">Green</option>
<option value="BLUE2">Blue2</option>
<option value="BLUE_BLACK">BlueBlack</option>
<option value="BLUE_DARKBLUE">BlueDarkBlue</option>
<option value="BLUE_GRAY">BlueGray</option>
<option value="STANDARD">Standard</option>
<option value="STANDARD_GREEN">StandardGreen</option>
<option value="BLUE_BLUE">BlueBlue</option>
<option value="RED_DARKRED">RedDarkRed</option>
<option value="DARKBLUE">DarkBlue</option>
<option value="LILA">Lila</option>
<option value="BLACKRED">BlackRed</option>
<option value="DARKGREEN">DarkGreen</option>
<option value="AMBER">Amber</option>
<option value="LIGHTBLUE">LightBlue</option>
<option value="SECTIONS">Sections</option>
</select>
</td>
</tr>
<tr>
<td width="100%">
<canvas id="canvasSingle1" width="120" height="50"></canvas>
</td>
</tr>
</tbody></table>
<script>
var scroll = false;
var single1;
function init() {
// Initialzing gauge
var sections = [steelseries.Section(0, 70, 'rgba(255, 0, 0, 1.0)'),
steelseries.Section(70, 95, 'rgba(255, 255, 0, 1.0)'),
steelseries.Section(95, 100, 'rgba(0, 255, 0, 1.0)') ];
single1 = new steelseries.DisplaySingle('canvasSingle1', {
width: 120,
height: 50,
section: sections
});
single1.setLcdColor(steelseries.LcdColor.SECTIONS);
// Start the random update
setInterval(function(){ setRandomValue(single1, 100); }, 1500);
}
function setRandomValue(gauge, range) {
gauge.setValue(Math.random() * range);
}
function setLcdColor(sel) {
switch(sel.options[sel.selectedIndex].value) {
case "BEIGE":
single1.setLcdColor(steelseries.LcdColor.BEIGE);
break;
case "BLUE":
single1.setLcdColor(steelseries.LcdColor.BLUE);
break;
case "ORANGE":
single1.setLcdColor(steelseries.LcdColor.ORANGE);
break;
case "RED":
single1.setLcdColor(steelseries.LcdColor.RED);
break;
case "YELLOW":
single1.setLcdColor(steelseries.LcdColor.YELLOW);
break;
case "WHITE":
single1.setLcdColor(steelseries.LcdColor.WHITE);
break;
case "GRAY":
single1.setLcdColor(steelseries.LcdColor.GRAY);
break;
case "BLACK":
single1.setLcdColor(steelseries.LcdColor.BLACK);
break;
case "GREEN":
single1.setLcdColor(steelseries.LcdColor.GREEN);
break;
case "BLUE2":
single1.setLcdColor(steelseries.LcdColor.BLUE2);
break;
case "BLUE_BLACK":
single1.setLcdColor(steelseries.LcdColor.BLUE_BLACK);
break;
case "BLUE_DARKBLUE":
single1.setLcdColor(steelseries.LcdColor.BLUE_DARKBLUE);
break;
case "BLUE_GRAY":
single1.setLcdColor(steelseries.LcdColor.BLUE_GRAY);
break;
case "STANDARD":
single1.setLcdColor(steelseries.LcdColor.STANDARD);
break;
case "STANDARD_GREEN":
single1.setLcdColor(steelseries.LcdColor.STANDARD_GREEN);
break;
case "BLUE_BLUE":
single1.setLcdColor(steelseries.LcdColor.BLUE_BLUE);
break;
case "RED_DARKRED":
single1.setLcdColor(steelseries.LcdColor.RED_DARKRED);
break;
case "DARKBLUE":
single1.setLcdColor(steelseries.LcdColor.DARKBLUE);
break;
case "LILA":
single1.setLcdColor(steelseries.LcdColor.LILA);
break;
case "BLACKRED":
single1.setLcdColor(steelseries.LcdColor.BLACKRED);
break;
case "DARKGREEN":
single1.setLcdColor(steelseries.LcdColor.DARKGREEN);
break;
case "AMBER":
single1.setLcdColor(steelseries.LcdColor.AMBER);
break;
case "LIGHTBLUE":
single1.setLcdColor(steelseries.LcdColor.LIGHTBLUE);
break;
case "SECTIONS":
single1.setLcdColor(steelseries.LcdColor.SECTIONS);
break;
}
}
</script>
<script src="steelseries-min.js"></script>
</body></html>