-
Notifications
You must be signed in to change notification settings - Fork 0
/
index001-newDesign.html
183 lines (174 loc) · 6.32 KB
/
index001-newDesign.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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Index Page</title>
<link type="text/css" rel="stylesheet" href="jquery-ui-themes-1.12.1/themes/smoothness/jquery-ui.css"/>
<script language="JavaScript" type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
<script language="JavaScript" type="text/javascript" src="jquery-ui-1.12.1/jquery-ui.js"></script>
<style>
html, body {
height:100%;
}
body {
background-color: transparent;
background-image: url('images/main_bg.png');
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
}
.mainContent { /* this css should center and scale to fit the web page */
background-color: transparent;
border: 1px solid transparent;
position: absolute;
width: 60%;
height: 60%;
left: 13%;
top: 0;
right: 0;
bottom: 0px;
margin: auto;
text-align: center;
}
div.horizontal {
display: flex;
justify-content: center;
}
div.vertical {
padding: 3px;
display: flex;
flex-direction: column;
justify-content: center;
}
.imgSixClass {
bottom:0px;
margin: 0px;
}
</style>
<script>
$(document).ready(function() {
var MAXLiTE1_status = false, MAXLiTE2_status = false, MAXLiTE3_status = false;
var MAXAir_status = false, MAXScene_status = false, MAXBook_status = false;
var arr = ["0A", "0B", "13", "14", "16", "18"];
var dictionary = '[' +
'{"ID":"0A", "SN":"FFFFFFFFFFA1", "bleName":"MAXBook"},' +
'{"ID":"13", "SN":"FFFFFFFFFFA2", "bleName":"MAXAir"},' +
'{"ID":"0B", "SN":"FFFFFFFFFFA2", "bleName":"MAXScene"},' +
'{"ID":"16", "SN":"FFFFFFFFFFC3", "bleName":"MAXLite XL-2"}]';
initBleDeviceJson();
function initBleDeviceJson(){
var obj = JSON.parse(dictionary);
for(var i = 0; i < obj.length; ++i)
{
var bleId = obj[i].ID;
var sn = obj[i].SN;
var bleName = obj[i].bleName;
console.log("bleId = " + bleId);
var st = setupBleDeviceStatus(bleId);
console.log("st =" + st);
}
}
function setupBleDeviceStatus (condition) {
var stuff = {
'0A': function () {
MAXBook_status = true;
$('#MAXBook_img').attr('src','images/WEB-c_device_btn_mb_on-s.png');
$('#MAXBook_img').hover(function() {
$(this).css('cursor','pointer');
});
$("#MAXBook_img").click(function () {
alert('MAXBook_img btn clicked');
});
return true;
},
'0B': function () {
MAXScene_status = true;
$('#MAXScene_img').attr('src','images/WEB-c_device_btn_ms_on-s.png');
$('#MAXScene_img').hover(function() {
$(this).css('cursor','pointer');
});
$("#MAXScene_img").click(function () {
alert('MAXScene_img btn clicked');
});
return true;
},
'13': function () {
MAXAir_status = true;
$('#MAXAir_img').attr('src','images/WEB-c_device_btn_ma_on-s.png');
$('#MAXAir_img').hover(function() {
$(this).css('cursor','pointer');
});
$("#MAXAir_img").click(function () {
alert('MAXAir_img btn clicked');
});
return true;
},
'14': function () {
MAXLiTE1_status = true;
$('#MAXLiTE1_img').attr('src','images/WEB-c_device_btn_ml1_on-s.png');
$('#MAXLiTE1_img').hover(function() {
$(this).css('cursor','pointer');
});
$("#MAXLiTE1_img").click(function () {
alert('MAXLiTE1_img btn clicked');
});
return true;
},
'16': function () {
MAXLiTE2_status = true;
$('#MAXLiTE2_img').attr('src','images/WEB-c_device_btn_ml2_on-s.png');
$('#MAXLiTE2_img').hover(function() {
$(this).css('cursor','pointer');
});
$("#MAXLiTE2_img").click(function () {
alert('MAXLiTE2_img btn clicked');
});
return true;
},
'18': function () {
MAXLiTE3_status = true;
$('#MAXLiTE3_img').attr('src','images/WEB-c_device_btn_ml3_on-s.png');
$('#MAXLiTE3_img').hover(function() {
$(this).css('cursor','pointer');
});
$("#MAXLiTE3_img").click(function () {
alert('MAXLiTE3_img btn clicked');
});
return true;
}
};
if (typeof stuff[condition] !== 'function') {
return 'default';
}
return stuff[condition]();
}
});
</script>
</head>
<body>
<div id="mainContentDiv" class="mainContent">
<div class="horizontal Row1" style="border: 1px solid transparent; width:98%;height:48%; margin: 0 auto;top:5px; position:relative;" >
<div class="vertical" style="border: 1px solid transparent; position:relative;float:left;">
<img class="imgSixClass" id="MAXLiTE1_img" src="images/WEB-c_device_btn_ml1_off-s.png" width="100%" height="100%" style="border: 1px solid transparent; " />
</div>
<div class="vertical" style="border: 1px solid transparent; position:relative;float:left;">
<img class="imgSixClass" id="MAXLiTE2_img" src="images/WEB-c_device_btn_ml2_off-s.png" width="100%" height="100%" style="border: 1px solid transparent; " />
</div>
<div class="vertical" style="border: 1px solid transparent; position:relative;float:left;">
<img class="imgSixClass" id="MAXLiTE3_img" src="images/WEB-c_device_btn_ml3_off-s.png" width="100%" height="100%" style="border: 1px solid transparent; " />
</div>
</div>
<div class="horizontal Row2" style="border: 1px solid transparent; width:98%;height:48%; margin: 0 auto;top:5px; position:relative;" >
<div class="vertical" style="border: 1px solid transparent; position:relative;float:left;">
<img class="imgSixClass" id="MAXAir_img" src="images/WEB-c_device_btn_ma_off-s.png" width="100%" height="100%" style="border: 1px solid transparent; " />
</div>
<div class="vertical" style="border: 1px solid transparent; position:relative;float:left;">
<img class="imgSixClass" id="MAXScene_img" src="images/WEB-c_device_btn_ms_off-s.png" width="100%" height="100%" style="border: 1px solid transparent; " />
</div>
<div class="vertical" style="border: 1px solid transparent; position:relative;float:left;">
<img class="imgSixClass" id="MAXBook_img" src="images/WEB-c_device_btn_mb_off-s.png" width="100%" height="100%" style="border: 1px solid transparent; " />
</div>
</div>
</div>
</body>
</html>