-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
170 lines (166 loc) · 7.62 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
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
<!doctype html>
<html lang="zh-TW">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>PM2.5 空氣偵測顯示器</title>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/animate.css@3.5.2/animate.min.css">
<link rel="stylesheet" href="css/app.css">
</head>
<body>
<div id="app">
<transition>
<div class="page main" v-if="currentPage === 'main'">
<div
class="container-fluid"
v-bind:style="{ backgroundColor: getBackgroundColorByValue(currentValue), height: '100%' }"
>
<div class="row">
<div class="col-xs-12 col-md-8 col-md-offset-2">
<img src="img/logo.png" class="logo">
<img src="img/set.png" class="img-btn setting" v-on:click="switchPage('setting')">
<div class="pm25-information">
<h1 class="pm25-title">PM2.5 濃度</h1>
<h1 class="pm25-value">
{{ translateValue(currentValue) }}<small v-if="translateValue(currentValue) !== '--'">μg/m<sup>3</sup></small>
</h1>
<br>
<div class="pm25-description">{{ getDescriptionByValue(currentValue) }}</div>
</div>
</div>
</div>
</div>
</div>
</transition>
<transition>
<div
class="page setting"
style="background-color: #ffffff; overflow: scroll;"
v-if="currentPage === 'setting'"
>
<div class="container-fluid setting">
<div class="row">
<div class="col-xs-12 col-md-8 col-md-offset-2">
<img src="img/back.png" class="img-btn back" v-on:click="switchPage('main')">
</div>
<div class="setting-section col-xs-12 col-md-8 col-md-offset-2">
<h3>細懸浮微粒傳感器</h3>
<p>接收腳位 (TXD):14</p>
<h4>Webduino Smart 開發板 ID</h4>
<input type="text" v-model="deviceId" autofocus>
<div v-if="boardHistory.length > 1">
<button
v-for="board in boardHistory"
v-on:click="quickSetting(board)"
class="btn btn-grey board-history"
:key="board"
>
{{ board }}
</button>
</div>
<button class="btn btn-grey btn-block" v-on:click="createBoard">{{ buttonStatus[currentStatus] }}</button>
</div>
<div class="setting-section col-xs-12 col-md-8 col-md-offset-2">
<h3>細懸浮微粒指標對照表</h3>
<p style="margin-bottom: 0;">PM2.5 濃度及活動建議</p>
<div class="row level-table">
<div class="col-xs-12 level-content">
<div class="col-xs-4 level-value">
<div v-bind:style="{ backgroundColor: backgroundColorTable[1] }">0~11
<sub class="hidden-xs">μg/m<sup>3</sup></sub>
</div>
<div v-bind:style="{ backgroundColor: backgroundColorTable[2] }">12~23
<sub class="hidden-xs">μg/m<sup>3</sup></sub>
</div>
<div v-bind:style="{ backgroundColor: backgroundColorTable[3] }">24~35
<sub class="hidden-xs">μg/m<sup>3</sup></sub>
</div>
</div>
<div class="col-xs-8 level-description">
<div>
<ul>
<li>空氣品質:良好</li>
<li>一般民眾:正常戶外活動</li>
<li>敏感族群:正常戶外活動</li>
</ul>
</div>
</div>
</div>
<div class="col-xs-12 level-content">
<div class="col-xs-4 level-value">
<div v-bind:style="{ backgroundColor: backgroundColorTable[4] }">36~41
<sub class="hidden-xs">μg/m<sup>3</sup></sub>
</div>
<div v-bind:style="{ backgroundColor: backgroundColorTable[5] }">42~47
<sub class="hidden-xs">μg/m<sup>3</sup></sub>
</div>
<div v-bind:style="{ backgroundColor: backgroundColorTable[6] }">48~53
<sub class="hidden-xs">μg/m<sup>3</sup></sub>
</div>
</div>
<div class="col-xs-8 level-description">
<div>
<ul>
<li>空氣品質:尚可</li>
<li>一般民眾:正常戶外活動</li>
<li>敏感族群:減少體力消耗及戶外活動</li>
</ul>
</div>
</div>
</div>
<div class="col-xs-12 level-content">
<div class="col-xs-4 level-value">
<div v-bind:style="{ backgroundColor: backgroundColorTable[7] }">54~58
<sub class="hidden-xs">μg/m<sup>3</sup></sub>
</div>
<div v-bind:style="{ backgroundColor: backgroundColorTable[8] }">59~64
<sub class="hidden-xs">μg/m<sup>3</sup></sub>
</div>
<div v-bind:style="{ backgroundColor: backgroundColorTable[9] }">65~70
<sub class="hidden-xs">μg/m<sup>3</sup></sub>
</div>
</div>
<div class="col-xs-8 level-description">
<div>
<ul>
<li>空氣品質:不健康</li>
<li>一般民眾:減少戶外活動</li>
<li>敏感族群:減少體力消耗,特別是戶外活動</li>
<li>氣喘族群:需增加使用吸入劑頻率</li>
</ul>
</div>
</div>
</div>
<div class="col-xs-12 level-content">
<div class="col-xs-4 level-value">
<div v-bind:style="{ backgroundColor: backgroundColorTable[10] }">71
<sub class="hidden-xs">μg/m<sup>3</sup></sub> 以上
</div>
</div>
<div class="col-xs-8 level-description">
<div>
<ul>
<li>空氣品質:危害</li>
<li>一般民眾:減少體力消耗,特別是戶外活動</li>
<li>敏感族群:避免體力消耗及戶外活動</li>
<li>氣喘族群:需增加使用吸入劑頻率</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</transition>
</div>
<script src="//cdn.jsdelivr.net/npm/vue@2.5.16/dist/vue.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="//webduino.io/components/webduino-js/dist/webduino-all.min.js"></script>
<script src="//blockly.webduino.io/webduino-blockly.js"></script>
<script src="js/g3.js"></script>
<script src="js/app.js"></script>
</body>
</html>