-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.html
296 lines (270 loc) · 14.8 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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--Meta tags SEO-->
<meta name="description" content="Covid-19 Api Website with face Recognigation and Health Meter">
<meta name="keywards" content="covid,covid-19,coronavirus,face recognigation, health meter,mask detection">
<meta name="author" content="Aman Singh">
<!--Font Awesome Icon link-->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
<!-- Bootstrap CSS link-->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous">
<link rel="stylesheet" href="style.css">
<link rel="icon" href="https://cdn3.iconfinder.com/data/icons/medical-isometric-1/1024/ic_covid.png">
<title>Covid-19</title>
</head>
<body>
<!--=====================================
Nav Bar Start Here
======================================== -->
<nav class="navbar navbar-dark bg-indigo sticky-top">
<div class="container-fluid ">
<a class="navbar-brand" href="#">
<img src="https://cdn3.iconfinder.com/data/icons/medical-isometric-1/1024/ic_covid.png" alt="" width="40" height="40" class="d-inline-block align-text-top align-items-center" id="logo_img">
COVID-19
</a>
<ul class="nav nav-pills">
<li class="nav-item">
<a class="nav-link" aria-current="page" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#aboutcovid">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#symptoms">Symptoms</a>
</li>
<div class="btn-group m-0 p-0">
<a type="button" class="btn dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
More
</a>
<ul class="dropdown-menu dropdown-menu-end">
<li><a class="dropdown-item" href="#info">Info</a></li>
<li><a class="dropdown-item" data-bs-toggle="modal" data-bs-target="#exampleModal" >Health Meter</a></li>
<li><a class="dropdown-item" data-bs-toggle="modal" data-bs-target="#staticBackdrop">Mask Detection</a></li>
</ul>
</div>
</ul>
</div>
</nav>
<!--==================================================
Header Section Start here
======================================================== -->
<div class="row align-items-center my-3 mx-4 header">
<div class="col-sm-6 mx-auto">
<img src="https://cdn3.iconfinder.com/data/icons/medical-isometric-1/1024/ic_covid.png" id="main-img">
</div>
<div class="col-sm-6 my-5">
<h1 id="main-heading">Let's Stay Safe & Fight Together</h1>
<h5><i>Against Corona Virus</i></h5>
</div>
</div>
<!--===============================================
Covid-19 Updated Data Start Here
================================================== -->
<div class="container">
<h4 class="text-center my-4">Covid-19 Update</h4>
<div class="row row-cols-3">
<div class="col text-center" id="totalCase">0</div>
<div class="col text-center" id="totalDeath">0</div>
<div class="col text-center" id="totalRecovered">0</div>
</div>
<div class="row row-cols-3">
<div class="col text-center"><b>Total Case</b></div>
<div class="col text-center"><b>Death</b></div>
<div class="col text-center"><b>Recovered</b></div>
</div>
</div>
<!--===============================================
About Covid-19 Section Start Here
=================================================== -->
<div class="container">
<h1 class="text-center my-5 heading" id="aboutcovid">About Covid-19</h1>
<div class="row align-items-center px-4">
<div class="col">
<h5>What is Corona Virus <i class="fas fa-volume-up m-3 opacity" onclick="speak('para_1','sp1')" id="sp1" style="color:rgb(153, 153, 153)"></i></h5>
<p id="para_1">Corona viruses are a type of virus. There are many different kinds, and some cause disease. A coronavirus identified in 2019, SARS-CoV-2, has caused a pandemic of respiratory illness, called COVID-19.
</p>
<h5>How does the coronavirus spread? <i class="fas fa-volume-up m-3 opacity" onclick="speak('para_2','sp2')" id="sp2" style="color:rgb(153, 153, 153)"></i></h5>
<p id="para_2">As of now, researchers know that the coronavirus is spread through droplets and virus particles released into the air when an infected person breathes, talks, laughs, sings, coughs or sneezes. Larger droplets may fall to the ground in a few seconds, but tiny infectious particles can linger in the air and accumulate in indoor places, especially where many people are gathered and there is poor ventilation. This is why mask-wearing, hand hygiene and physical distancing are essential to preventing COVID-19.</p>
</div>
</div>
</div>
<!--===============================================
Covid-19 Symptoms Section Start Here
=================================================== -->
<div class="container">
<h1 class="text-center my-5 heading" id="symptoms">Covid-19 Symptoms</h1>
<div class="row row-cols-3">
<div class="col text-center"><img src="https://cdn1.iconfinder.com/data/icons/coronavirus-information/128/__cough_tissue_close_mouth-512.png" width="100px"></div>
<div class="col text-center"><img src="https://cdn4.iconfinder.com/data/icons/coronavirus-color/64/nose-snot-cold-flu-sick-fever-512.png" width="100px"></div>
<div class="col text-center"><img src="https://cdn2.iconfinder.com/data/icons/covid-19-2/64/07-Fever-512.png" width="100px"></div>
</div>
<div class="row row-cols-3">
<div class="col text-center">cough</div>
<div class="col text-center">runny noise</div>
<div class="col text-center">fever</div>
</div><br><br>
<div class="row row-cols-3">
<div class="col text-center"><img src="https://cdn3.iconfinder.com/data/icons/virus-transmission-flat/48/Fever-512.png" width="100px"></div>
<div class="col text-center"><img src="https://cdn2.iconfinder.com/data/icons/virus-15/512/tired_illness_healthcare_sickness_fatigue_tiredness-512.png" width="100px"></div>
<div class="col text-center"><img src="https://cdn1.iconfinder.com/data/icons/coronavirus-information/128/__shortness_breathe_problem-512.png" width="100px"></div>
</div>
<div class="row row-cols-3">
<div class="col text-center">cold</div>
<div class="col text-center">tiredness</div>
<div class="col text-center">difficulty breathing</div>
</div>
</div>
<!--===============================================
Covid-19 Info Section Start Here
=================================================== -->
<div class="container">
<h1 class="text-center my-5 heading" id="info">Covid-19 Info</h1>
<div id="message">
</div>
<div class="d-flex my-2 align-items-center">
<input class="form-control me-2" type="search" placeholder="Enter Country name.." aria-label="Search" id="countrySearch">
<button class="btn bg-indigo" type="submit" onclick="main()" id="submitbtn">Search</button>
<!-- Button trigger modal -->
<button type="button" class="btn bg-indigo mx-2" data-bs-toggle="modal" data-bs-target="#exampleModal" id="health-meter">
<i class="fa fa-user-md" aria-hidden="true"></i>
</button>
</div>
<table class="table table-striped table-hover">
<thead class="bg-indigo">
<tr>
<th scope="col">Country</th>
<th scope="col">Confirmed</th>
<th scope="col">Death</th>
<th scope="col">Recovered</th>
<th scope="col">beds</th>
</tr>
</thead>
<tbody id="data-fetch">
</tbody>
</table>
</div>
<!--===============================================
Modal for Mr Doctor
=================================================== -->
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title heading" id="exampleModalLabel">Mr. Doctor <i class="fa fa-stethoscope" aria-hidden="true"></i></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="meter">
<div class="meter-body">
<div class="needle" id="needle">
</div>
</div>
</div>
<div class="form">
<div class="element-form"><br><p id="Safety">100% Safe</p>
<h3 class="heading text-center">Choose your problem</h3>
<input class="form-check-input mx-3" type="checkbox" value="" id="flexCheckChecked1" onclick="health_meter()">Fever <br>
<input class="form-check-input mx-3" type="checkbox" value="" id="flexCheckChecked2" onclick="health_meter()">Runny noise <br>
<input class="form-check-input mx-3" type="checkbox" value="" id="flexCheckChecked3" onclick="health_meter()">Cough <br>
<input class="form-check-input mx-3" type="checkbox" value="" id="flexCheckChecked4" onclick="health_meter()">Cold <br>
<input class="form-check-input mx-3" type="checkbox" value="" id="flexCheckChecked5" onclick="health_meter()">Tiredness <br>
<input class="form-check-input mx-3" type="checkbox" value="" id="flexCheckChecked6" onclick="health_meter()">Difficulty Breathing <br>
<!-- <button class="btn bg-indigo my-2 text-center" type="submit" onclick="health_meter()" id="submitbtn"><i class="fa fa-calculator" aria-hidden="true"></i> Submit</button> -->
</div>
</div>
</div>
</div>
</div>
</div>
<!--===============================================
Modal for Face Recognigation
=================================================== -->
<div class="modal fade" id="staticBackdrop" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title heading" id="staticBackdropLabel">Mask Detection <i class="fa fa-mask" aria-hidden="true"></i></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="m-2">Detect Your Mask</div>
<button type="button" onclick="init()" class="btn bg-indigo" id="face-btn">Start</button>
<div id="warning-mask" class="m-3">Warning</div>
<div id="webcam-container">
</div>
<div id="label-container"></div>
</div>
</div>
</div>
</div>
<!--===============================================
Footer Section Start Here
=================================================== -->
<footer class="bg-indigo mb-0" >
<p class="mb-0 text-center py-2">
<i>~Aman Singh</i><br>
<a href="https://www.instagram.com/immortal_freak45/" class="bg-indigo"><i class="fab fa-instagram"></i></a>
<a href="https://twitter.com/AmanSin32612202?s=09" class="bg-indigo"><i class="fab fa-twitter mx-3"></i></a>
<a href="https://www.linkedin.com/in/aman-singh-5382351b2" class="bg-indigo"><i class="fab fa-linkedin-in"></i></a>
<a href="https://github.com/TharkiCoder" class="bg-indigo"><i class="fab fa-github mx-3"></i></a>
<br><i>© 2021 copyright all right reserved</i>
</p>
</footer>
<!--Script for voice Recognigation Api-->
<script src="https://code.responsivevoice.org/responsivevoice.js?key=DdcmGh1F"></script>
<!--Script Bootstrap-->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-gtEjrD/SeCtmISkJkNUaaKMoLD0//ElJ19smozuHV6z3Iehds+3Ulb9Bn9Plx0x4" crossorigin="anonymous"></script>
<!--Main script-->
<script src="script.js"></script>
<!--Face Recognigation Script -->
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]/dist/tf.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@teachablemachine/[email protected]/dist/teachablemachine-image.min.js"></script>
<script type="text/javascript">
const URL = "https://teachablemachine.withgoogle.com/models/d35bytzvz/";
let model, webcam, labelContainer, maxPredictions;
async function init() {
const modelURL = URL + "model.json";
const metadataURL = URL + "metadata.json";
model = await tmImage.load(modelURL, metadataURL);
maxPredictions = model.getTotalClasses();
const flip = true; // whether to flip the webcam
webcam = new tmImage.Webcam(200, 200, flip); // width, height, flip
await webcam.setup(); // request access to the webcam
await webcam.play();
window.requestAnimationFrame(loop);
// append elements to the DOM
document.getElementById("webcam-container").appendChild(webcam.canvas);
labelContainer = document.getElementById("label-container");
for (let i = 0; i < maxPredictions; i++) { // and class labels
labelContainer.appendChild(document.createElement("div"));
}
}
async function loop() {
webcam.update(); // update the webcam frame
await predict();
window.requestAnimationFrame(loop);
}
async function predict() {
const prediction = await model.predict(webcam.canvas);
for (let i = 0; i < maxPredictions; i++) {
const classPrediction =
prediction[i].className + ": " + prediction[i].probability.toFixed(2)*100;
labelContainer.childNodes[i].innerHTML = classPrediction;
if(prediction[0].probability.toFixed(2)*100>=80 && prediction[0].probability.toFixed(2)*100<=100){
document.getElementById("warning-mask").innerHTML="<p style=\"text-align:center;background-color:#0f0;\">YOU HAVE WEAR THE MASK<p>";
}
else if(prediction[0].probability.toFixed(2)*100>=40 && prediction[0].probability.toFixed(2)*100<80){
document.getElementById("warning-mask").innerHTML="<p style=\"text-align:center;background-color:#f55516;\">WEAR MASK PROPERLY<p>";
}
else{
document.getElementById("warning-mask").innerHTML="<p style=\"text-align:center;background-color:#f00;\">PLEASE WEAR MASK<p>";
}
}
}
</script>
</body>
</html>