-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdepressques.html
201 lines (155 loc) · 5.45 KB
/
depressques.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
<!DOCTYPE html>
<html>
<head>
<title>Mind Mate</title>
<link rel="stylesheet" type="text/css" href="uv.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inria+Sans:wght@400;700&display=swap" rel="stylesheet">
<script>
let dep=[
"How often have you been bothered by feeling down, depressed, irritable, or hopeless over the last two weeks?",
"Feeling down, depressed, or hopeless",
"Trouble falling or staying asleep, or sleeping too much?",
"Feeling tired or having little energy?",
"Poor appetite or overeating?",
"Feeling bad about yourself - or that you are a failure or have let yourself or your family down?",
"Moving or speaking so slowly that other people could have noticed?",
"Thoughts that you would be better off dead, or of hurting yourself in some way?",
"Trouble concentrating on things, such as reading the newspaper or watching television?"
];
let c = 0;
let score =0;
function sendData(score) {
localStorage.setItem("inputScore", score);
}
function changePage(id1, id2, id3,id4){
if(id4=='op1'){
score = score +0.1;
}
else if(id4=='op2'){
score = score +1.5;
}
else if(id4=='op3'){
score = score +2;
}
else if(id4=='op4'){
score = score +4;
}
if(c==8){
sendData(score);
window.location.replace("depresult.html");
}
else{
c++;
document.getElementById(id1).innerHTML = dep[c];
document.getElementById(id2).innerHTML = c+1;
let tempwidth = c*(11.11);
let final = tempwidth + "%";
document.getElementById(id3).style.width = final;
}
}
function goBack(id1, id2, id3)
{
if(c == 0)
{
window.location.replace("index.html");
}
else
{
c--;
document.getElementById(id1).innerHTML = dep[c];
document.getElementById(id2).innerHTML = c+1;
let tempwidth = c*(11.11);
let final = tempwidth + "%";
document.getElementById(id3).style.width = final;
}
}
</script>
</head>
<body>
<div id="mySidebar" class="sidebar">
<a href="javascript:void(0)" class="closebtn" onclick="closeNav()">×</a>
<a href="about.html">About Us</a>
<a href="#">FAQs</a>
<a href="https://www.nimh.nih.gov/health/topics/suicide-prevention">Help Line</a>
<a href="contact.html">Contact Us</a>
</div>
<div class="header">
<div class="navbar" onclick="openNav()">
<a href="#" class="nav">
<div class="one"></div>
<div class="two"></div>
<div class="three"></div>
</a>
</div>
<div class="main-container">
<a href="index.html" class="main">MindMate</a>
</div>
</div>
<hr>
<script>
function openNav() {
document.getElementById("mySidebar").style.width = "250px";
document.getElementById("navbar").style.marginRight = "250px";
}
function closeNav() {
document.getElementById("mySidebar").style.width = "0";
document.getElementById("navbar").style.marginRight= "0";
}
</script>
<div class="test-name">
<p class="test-style">
Depression Test
</p>
</div>
<div class="circle-container">
<div class="circle">
<span class="number" id="numb">
1
</span>
</div>
</div>
<div class="progress-bar">
<div class="back-arrow">
<button class="back-arrow-style" onclick="goBack('ques','numb','progbar')">
</button>
</div>
<div class="progress-container">
<div class="progress style" id="progbar">
</div>
</div>
<div class="progress-container-align">
</div>
</div>
<div class="question">
<div class="question-wrap">
<p class="question-style" id="ques">
How often have you been bothered by feeling down, depressed, irritable, or hopeless over the last two weeks?
</p>
</div>
</div>
<div class="options-container">
<div class="option" id = "op1">
<button class="option-style" onclick="changePage('ques','numb','progbar','op1')">
Not At All
</button>
</div>
<div class="option" id = "op2">
<button class="option-style" onclick="changePage('ques','numb','progbar','op2')">
Sometimes
</button>
</div>
<div class="option" id = "op3">
<button class="option-style" onclick="changePage('ques','numb','progbar','op3')">
Often
</button>
</div>
<div class="option" id = "op4">
<button class="option-style" onclick="changePage('ques','numb','progbar','op4')">
Always
</button>
</div>
</div>
</body>
</html>