-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
115 lines (112 loc) · 3.07 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
<!DOCTYPE html>
<html lang="en">
<head>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<meta charset="UTF-8">
<title>Covid-19 Test</title>
<style>
div {
border-radius: 5px;
background-color: #f2f2f2;
padding: 20px;
height: 100%;
}
footer {
position: fixed;
bottom: 0;
left: 0;
height: 40px;
width: 100%;
}
</style>
</head>
<body>
<div style="text-align:center;">
<h4>Covid-19 Test</h4>
</br>
<span id="log"></span><br>
<span id="display"></span><br>
<footer style="text-align: right;">
<h6>© Salman Dabbakuti </h6>
</footer>
</div>
<script>
function log(message) {
$('#log').append($('<p>').addClass('dark-red').text(message));
$('#log').scrollTop($('#log').prop('scrollHeight'));
}
function result(message) {
$('#display').append($('<p>').addClass('dark-red').text(message));
$('#display').scrollTop($('#log').prop('scrollHeight'));
}
let name = prompt("Please Enter Your Name..")
var age = Number(prompt("Your Age.."))
let fever = Number(prompt("Do you have fever symptoms? (0= no, 1= yes):"))
let cough = Number(prompt("Do you have cough symptoms? (0= no, 1= yes):"))
let sob = Number(prompt("Do you have Shortness of Breath symptoms? (0= no, 1= yes):"))
let sore = Number(prompt("Do you have Sore throat or runny nose symptoms? (0= no, 1= yes):"))
let vomit = Number(prompt("Do you have vomitting symptoms? (0= no, 1= yes):"))
let ill = Number(prompt("Do you have Diabetes, kidney, or heart diseases? (0= no, 1= yes):"))
let epi = Number(prompt("Have you been in epidemic region, or in contact with person from that region in last 14 days? (0= no, 1= yes):"))
let risk = fever*2 + cough*2 + sob*2 + sore + vomit + ill
log(`Name: ${name}`)
log(`Age: ${age}`)
if(fever==1){
log(`Fever: Yes`)
}if(fever==0){
log(`Fever: No`)
}
if(cough==1){
log(`Cough: Yes`)
}if(cough==0){
log(`Cough: No`)
}
if(sob==1){
log(`Breathe Shortness: Yes`)
}if(sob==0){
log(`Breathe Shortness: No`)
}
if(sore==1){
log(`Sore Throat or Runny Nose: Yes`)
}if(sore==0){
log(`Sore Throat or Runny Nose: No`)
}
if(vomit==1){
log(`Vomittings: Yes`)
}if(vomit==0){
log(`Vomittings: No`)
}
if(ill==1){
log(`Other Illness: Yes`)
}if(ill==0){
log(`Other Illness: No`)
}
if(epi==1){
log(`Lived in Epidemic Region: Yes`)
}if(epi==0){
log(`Lived in Epidemic Region: No`)
}
log(`RiskFactor: ${risk}`)
if (epi ==0){
if (risk > 4){
result("You don't have high risk of COVID-19, it's probably flu")
}else{
if (age<41){var rate = "0.2";}
if (age>42&&age<51){var rate = "0.4";}
if (age>52&&age<61){var rate = '1.3';}
if (age>62&&age<71){var rate = "3.6";}
if (age>72&&age<81){var rate = '8.0';}
if (82<age){var rate = '14.8';}
result(`You don't have a risk of COVID 19 infection.
"According to your age, if you have infected, the fatality rate is: ${rate}%`)
}
}
if (epi ==1){
if (risk > 4){ result('You have risk of infection, you should wear surgical mask and be isolated until make the test')
}else{
result("You don't have COVID 19 sign, but may you have risk because of epidemic region")
}
}
</script>
</body>
</html>