-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
193 lines (153 loc) · 5.15 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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<!DOCTYPE html>
<html ng-app="app">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Arduino UI Test</title>
<link rel="stylesheet" type="text/css" href="css/bulma.css">
<script defer src="https://use.fontawesome.com/releases/v5.3.1/js/all.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.7.5/angular.min.js"></script>
<script src="scripts/app.js"></script>
</head>
<body ng-controller="appController">
<section class="section">
<div class="container">
<h1 class="title">
Dataquire v0.01
</h1>
<p class="subtitle" >
Firebase test !
</p>
</div>
</section>
<section>
<div class="box">
<div ng-show="mySensor" id="sensorval" >
<h1 class="title" >Sensor Readings</h1>
<div class="columns is-multiline is-mobile">
<div class="column">
<article class="media">
<div class="media-left">
<figure class="image is-64x64">
<img src="images/like.png" alt="Image">
</figure>
</div>
<div class="media-content">
<div class="content">
<p class="is-size-2">
<strong id="heart_reading">--</strong><small class="is-size-4">bpm</small>
<br>
</p>
</div>
</div>
</article>
</div>
<div class="column">
<article class="media">
<div class="media-left">
<figure class="image is-64x64">
<img src="images/thermometer.png" alt="Image">
</figure>
</div>
<div class="media-content">
<div class="content">
<p class="is-size-2">
<strong id="temp_reading">--</strong><small class="is-size-4">°C</small>
<br>
</p>
</div>
</div>
</article>
</div>
<div class="column">
<article class="media">
<div class="media-left">
<figure class="image is-64x64">
<img src="images/drop.png" alt="Image">
</figure>
</div>
<div class="media-content">
<div class="content">
<p class="is-size-2">
<strong id='hum_reading'>--</strong><small class="is-size-4">%</small>
<br>
</p>
</div>
</div>
</article>
</div>
<div class="column">
<article class="media">
<div class="media-left">
<figure class="image is-64x64">
<img src="images/sunny.png" alt="Image">
</figure>
</div>
<div class="media-content">
<div class="content">
<p class="is-size-2">
<strong id='lux_reading'>--</strong><small class="is-size-4">L</small>
<br>
</p>
</div>
</div>
</article>
</div>
</div>
</div>
<div ng-show="myHome" id="homeval"><h1 class="title">Welcome</h1>
<p>Please select your options on the sidebar to view the specified settings. The sensor values are updated from Firebase.</p>
</div>
</div>
<div class="box2">
<div class="columns is-multiline is-mobile is-gapless">
<div class="column" >
<a ><figure class="image is-64x64">
<img ng-click="home()" src="images/house.png" alt="Image">
</figure></a>
</div>
<div class="column">
<figure class="image is-64x64">
<a><img ng-click="sens()" src="images/temperature.png" alt="Image"></a>
</figure>
</div>
<div class="column">
<figure class="image is-64x64">
<img src="images/bar.png" alt="Image">
</figure>
</div>
<div class="column">
<figure class="image is-64x64">
<img src="images/empty.png" alt="Image">
</figure>
</div>
</div>
</div>
</section>
</body>
<script src="https://www.gstatic.com/firebasejs/5.8.1/firebase.js"></script>
<script>
// Initialize Firebase
var config = {
apiKey: "AIzaSyBFCqmnuT2EkTqDn_Yrnz1b4n45LP1Qwsc",
authDomain: "dataquire-ardutest.firebaseapp.com",
databaseURL: "https://dataquire-ardutest.firebaseio.com",
projectId: "dataquire-ardutest",
storageBucket: "dataquire-ardutest.appspot.com",
messagingSenderId: "914254519739"
};
firebase.initializeApp(config);
var heart_reading = document.getElementById('heart_reading');
var dbRef = firebase.database().ref().child('heart');
dbRef.on('value', snap => heart_reading.innerText =snap.val());
var temp_reading = document.getElementById('temp_reading');
var dbRef2 = firebase.database().ref().child('temprature');
dbRef2.on('value', snap => temp_reading.innerText =snap.val());
var hum_reading = document.getElementById('hum_reading');
var dbRef3 = firebase.database().ref().child('humidity');
dbRef3.on('value', snap => hum_reading.innerText =snap.val());
var lux_reading = document.getElementById('lux_reading');
var dbRef4 = firebase.database().ref().child('Light');
dbRef4.on('value', snap => lux_reading.innerText =snap.val());
</script>
</html>