Chipan commited on
Commit
d36cfab
·
verified ·
1 Parent(s): 8c11d29

Add 3 files

Browse files
Files changed (3) hide show
  1. README.md +6 -4
  2. index.html +572 -19
  3. prompts.txt +0 -0
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Knowyourmessv1
3
- emoji: 🌖
4
- colorFrom: yellow
5
  colorTo: yellow
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: knowyourmessv1
3
+ emoji: 🐳
4
+ colorFrom: purple
5
  colorTo: yellow
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,572 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>KnowYourMess - Stress Level Indicator</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+ <style>
10
+ @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
11
+
12
+ body {
13
+ font-family: 'Poppins', sans-serif;
14
+ background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
15
+ min-height: 100vh;
16
+ }
17
+
18
+ .gradient-bg {
19
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
20
+ }
21
+
22
+ .stress-meter {
23
+ height: 20px;
24
+ background: linear-gradient(to right,
25
+ #4ade80 0%,
26
+ #4ade80 20%,
27
+ #facc15 20%,
28
+ #facc15 40%,
29
+ #f97316 40%,
30
+ #f97316 60%,
31
+ #ef4444 60%,
32
+ #ef4444 80%,
33
+ #991b1b 80%,
34
+ #991b1b 100%);
35
+ }
36
+
37
+ .pulse {
38
+ animation: pulse 2s infinite;
39
+ }
40
+
41
+ @keyframes pulse {
42
+ 0% {
43
+ transform: scale(0.95);
44
+ box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
45
+ }
46
+ 70% {
47
+ transform: scale(1);
48
+ box-shadow: 0 0 0 10px rgba(74, 222, 128, 0);
49
+ }
50
+ 100% {
51
+ transform: scale(0.95);
52
+ box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
53
+ }
54
+ }
55
+
56
+ .floating {
57
+ animation: floating 3s ease-in-out infinite;
58
+ }
59
+
60
+ @keyframes floating {
61
+ 0% { transform: translateY(0px); }
62
+ 50% { transform: translateY(-15px); }
63
+ 100% { transform: translateY(0px); }
64
+ }
65
+ </style>
66
+ </head>
67
+ <body class="text-gray-800">
68
+ <!-- Navigation -->
69
+ <nav class="gradient-bg text-white shadow-lg">
70
+ <div class="container mx-auto px-6 py-4">
71
+ <div class="flex items-center justify-between">
72
+ <div class="flex items-center space-x-4">
73
+ <i class="fas fa-brain text-2xl"></i>
74
+ <span class="font-semibold text-xl">KnowYourMess</span>
75
+ </div>
76
+ <div class="hidden md:flex items-center space-x-8">
77
+ <a href="#" class="hover:text-gray-200">Home</a>
78
+ <a href="#" class="hover:text-gray-200">About</a>
79
+ <a href="#" class="hover:text-gray-200">Resources</a>
80
+ <a href="#" class="hover:text-gray-200">Contact</a>
81
+ </div>
82
+ <button class="md:hidden focus:outline-none">
83
+ <i class="fas fa-bars text-xl"></i>
84
+ </button>
85
+ </div>
86
+ </div>
87
+ </nav>
88
+
89
+ <!-- Hero Section -->
90
+ <section class="py-16 px-4">
91
+ <div class="container mx-auto flex flex-col md:flex-row items-center">
92
+ <div class="md:w-1/2 mb-10 md:mb-0">
93
+ <h1 class="text-4xl md:text-5xl font-bold mb-6 text-gray-800">Understand Your <span class="text-indigo-600">Stress</span> Levels</h1>
94
+ <p class="text-lg mb-8 text-gray-600">KnowYourMess helps you identify and manage your stress through simple, interactive assessments and personalized recommendations.</p>
95
+ <button onclick="startAssessment()" class="gradient-bg text-white px-8 py-3 rounded-full font-semibold hover:shadow-lg transition duration-300 flex items-center">
96
+ <i class="fas fa-play mr-2"></i> Start Assessment
97
+ </button>
98
+ </div>
99
+ <div class="md:w-1/2 flex justify-center">
100
+ <div class="relative w-64 h-64 md:w-80 md:h-80">
101
+ <div class="absolute inset-0 bg-indigo-100 rounded-full opacity-20 floating"></div>
102
+ <div class="absolute inset-4 bg-indigo-200 rounded-full opacity-30 floating" style="animation-delay: 0.5s;"></div>
103
+ <div class="absolute inset-8 bg-indigo-300 rounded-full opacity-40 floating" style="animation-delay: 1s;"></div>
104
+ <img src="https://cdn-icons-png.flaticon.com/512/4052/4052981.png" alt="Stress illustration" class="relative z-10 w-full h-full object-contain">
105
+ </div>
106
+ </div>
107
+ </div>
108
+ </section>
109
+
110
+ <!-- Assessment Section (Hidden by default) -->
111
+ <section id="assessmentSection" class="hidden py-12 px-4 bg-white rounded-lg shadow-xl mx-4 md:mx-auto max-w-4xl">
112
+ <div class="container mx-auto">
113
+ <h2 class="text-3xl font-bold mb-8 text-center text-gray-800">Stress Level Assessment</h2>
114
+
115
+ <div class="mb-8">
116
+ <div class="flex justify-between mb-2">
117
+ <span class="text-sm font-medium">Your stress level</span>
118
+ <span id="stressValue" class="text-sm font-medium">0%</span>
119
+ </div>
120
+ <div class="stress-meter rounded-full overflow-hidden mb-2">
121
+ <div id="stressIndicator" class="h-full bg-white rounded-full w-0 transition-all duration-500" style="width: 0%;"></div>
122
+ </div>
123
+ <div class="flex justify-between text-xs">
124
+ <span>Low</span>
125
+ <span>Moderate</span>
126
+ <span>High</span>
127
+ <span>Very High</span>
128
+ <span>Critical</span>
129
+ </div>
130
+ </div>
131
+
132
+ <div id="questionContainer" class="space-y-8">
133
+ <!-- Questions will be inserted here by JavaScript -->
134
+ </div>
135
+
136
+ <div class="mt-10 flex justify-center">
137
+ <button id="submitBtn" onclick="calculateStress()" class="gradient-bg text-white px-8 py-3 rounded-full font-semibold hover:shadow-lg transition duration-300 hidden">
138
+ Get Results
139
+ </button>
140
+ </div>
141
+ </div>
142
+ </section>
143
+
144
+ <!-- Results Section (Hidden by default) -->
145
+ <section id="resultsSection" class="hidden py-12 px-4 bg-white rounded-lg shadow-xl mx-4 md:mx-auto max-w-4xl">
146
+ <div class="container mx-auto text-center">
147
+ <h2 class="text-3xl font-bold mb-6 text-gray-800">Your Stress Results</h2>
148
+
149
+ <div class="mb-8">
150
+ <div class="flex justify-between mb-2">
151
+ <span class="text-sm font-medium">Your stress level</span>
152
+ <span id="finalStressValue" class="text-sm font-medium">0%</span>
153
+ </div>
154
+ <div class="stress-meter rounded-full overflow-hidden mb-2">
155
+ <div id="finalStressIndicator" class="h-full bg-white rounded-full transition-all duration-1000" style="width: 0%;"></div>
156
+ </div>
157
+ <div class="flex justify-between text-xs">
158
+ <span>Low</span>
159
+ <span>Moderate</span>
160
+ <span>High</span>
161
+ <span>Very High</span>
162
+ <span>Critical</span>
163
+ </div>
164
+ </div>
165
+
166
+ <div id="stressLevelText" class="text-xl font-semibold mb-6"></div>
167
+
168
+ <div id="recommendations" class="text-left bg-gray-50 p-6 rounded-lg mb-8">
169
+ <!-- Recommendations will be inserted here by JavaScript -->
170
+ </div>
171
+
172
+ <button onclick="resetAssessment()" class="bg-gray-200 text-gray-800 px-8 py-3 rounded-full font-semibold hover:bg-gray-300 transition duration-300">
173
+ <i class="fas fa-redo mr-2"></i> Take Again
174
+ </button>
175
+ </div>
176
+ </section>
177
+
178
+ <!-- Features Section -->
179
+ <section class="py-16 px-4 bg-white">
180
+ <div class="container mx-auto">
181
+ <h2 class="text-3xl font-bold text-center mb-12 text-gray-800">How It Works</h2>
182
+
183
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-8">
184
+ <div class="bg-gray-50 p-6 rounded-xl hover:shadow-md transition duration-300">
185
+ <div class="w-16 h-16 gradient-bg text-white rounded-full flex items-center justify-center mb-4 mx-auto">
186
+ <i class="fas fa-clipboard-list text-2xl"></i>
187
+ </div>
188
+ <h3 class="text-xl font-semibold text-center mb-3">Answer Questions</h3>
189
+ <p class="text-gray-600 text-center">Complete our simple questionnaire about your recent feelings and experiences.</p>
190
+ </div>
191
+
192
+ <div class="bg-gray-50 p-6 rounded-xl hover:shadow-md transition duration-300">
193
+ <div class="w-16 h-16 gradient-bg text-white rounded-full flex items-center justify-center mb-4 mx-auto">
194
+ <i class="fas fa-chart-line text-2xl"></i>
195
+ </div>
196
+ <h3 class="text-xl font-semibold text-center mb-3">Get Analysis</h3>
197
+ <p class="text-gray-600 text-center">Our algorithm calculates your stress level based on your responses.</p>
198
+ </div>
199
+
200
+ <div class="bg-gray-50 p-6 rounded-xl hover:shadow-md transition duration-300">
201
+ <div class="w-16 h-16 gradient-bg text-white rounded-full flex items-center justify-center mb-4 mx-auto">
202
+ <i class="fas fa-heart text-2xl"></i>
203
+ </div>
204
+ <h3 class="text-xl font-semibold text-center mb-3">Receive Tips</h3>
205
+ <p class="text-gray-600 text-center">Get personalized recommendations to help manage and reduce your stress.</p>
206
+ </div>
207
+ </div>
208
+ </div>
209
+ </section>
210
+
211
+ <!-- Testimonials -->
212
+ <section class="py-16 px-4 gradient-bg text-white">
213
+ <div class="container mx-auto">
214
+ <h2 class="text-3xl font-bold text-center mb-12">What People Say</h2>
215
+
216
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-8">
217
+ <div class="bg-white bg-opacity-10 p-6 rounded-xl backdrop-filter backdrop-blur-sm">
218
+ <div class="flex items-center mb-4">
219
+ <div class="w-12 h-12 rounded-full bg-white flex items-center justify-center text-indigo-600 mr-4">
220
+ <i class="fas fa-user text-xl"></i>
221
+ </div>
222
+ <div>
223
+ <h4 class="font-semibold">Sarah J.</h4>
224
+ <div class="flex text-yellow-300">
225
+ <i class="fas fa-star"></i>
226
+ <i class="fas fa-star"></i>
227
+ <i class="fas fa-star"></i>
228
+ <i class="fas fa-star"></i>
229
+ <i class="fas fa-star"></i>
230
+ </div>
231
+ </div>
232
+ </div>
233
+ <p>"This tool helped me realize I was more stressed than I thought. The recommendations were spot on!"</p>
234
+ </div>
235
+
236
+ <div class="bg-white bg-opacity-10 p-6 rounded-xl backdrop-filter backdrop-blur-sm">
237
+ <div class="flex items-center mb-4">
238
+ <div class="w-12 h-12 rounded-full bg-white flex items-center justify-center text-indigo-600 mr-4">
239
+ <i class="fas fa-user text-xl"></i>
240
+ </div>
241
+ <div>
242
+ <h4 class="font-semibold">Michael T.</h4>
243
+ <div class="flex text-yellow-300">
244
+ <i class="fas fa-star"></i>
245
+ <i class="fas fa-star"></i>
246
+ <i class="fas fa-star"></i>
247
+ <i class="fas fa-star"></i>
248
+ <i class="fas fa-star-half-alt"></i>
249
+ </div>
250
+ </div>
251
+ </div>
252
+ <p>"Simple and effective. I use it weekly to check in with myself and adjust my routines accordingly."</p>
253
+ </div>
254
+
255
+ <div class="bg-white bg-opacity-10 p-6 rounded-xl backdrop-filter backdrop-blur-sm">
256
+ <div class="flex items-center mb-4">
257
+ <div class="w-12 h-12 rounded-full bg-white flex items-center justify-center text-indigo-600 mr-4">
258
+ <i class="fas fa-user text-xl"></i>
259
+ </div>
260
+ <div>
261
+ <h4 class="font-semibold">Priya K.</h4>
262
+ <div class="flex text-yellow-300">
263
+ <i class="fas fa-star"></i>
264
+ <i class="fas fa-star"></i>
265
+ <i class="fas fa-star"></i>
266
+ <i class="fas fa-star"></i>
267
+ <i class="fas fa-star"></i>
268
+ </div>
269
+ </div>
270
+ </div>
271
+ <p>"The visualization of my stress level was eye-opening. The coping strategies really helped me during exams."</p>
272
+ </div>
273
+ </div>
274
+ </div>
275
+ </section>
276
+
277
+ <!-- CTA Section -->
278
+ <section class="py-16 px-4 bg-white">
279
+ <div class="container mx-auto text-center">
280
+ <h2 class="text-3xl font-bold mb-6 text-gray-800">Ready to Understand Your Stress?</h2>
281
+ <p class="text-lg mb-8 text-gray-600 max-w-2xl mx-auto">Take control of your mental wellbeing today with our simple, effective stress assessment tool.</p>
282
+ <button onclick="startAssessment()" class="gradient-bg text-white px-8 py-3 rounded-full font-semibold hover:shadow-lg transition duration-300">
283
+ <i class="fas fa-play mr-2"></i> Start Assessment Now
284
+ </button>
285
+ </div>
286
+ </section>
287
+
288
+ <!-- Footer -->
289
+ <footer class="bg-gray-800 text-white py-8 px-4">
290
+ <div class="container mx-auto">
291
+ <div class="flex flex-col md:flex-row justify-between items-center">
292
+ <div class="mb-6 md:mb-0">
293
+ <div class="flex items-center space-x-2">
294
+ <i class="fas fa-brain text-2xl text-indigo-400"></i>
295
+ <span class="font-semibold text-xl">KnowYourMess</span>
296
+ </div>
297
+ <p class="text-gray-400 mt-2">Helping you understand and manage stress since 2023.</p>
298
+ </div>
299
+
300
+ <div class="flex space-x-6">
301
+ <a href="#" class="text-gray-400 hover:text-white transition duration-300">
302
+ <i class="fab fa-facebook-f"></i>
303
+ </a>
304
+ <a href="#" class="text-gray-400 hover:text-white transition duration-300">
305
+ <i class="fab fa-twitter"></i>
306
+ </a>
307
+ <a href="#" class="text-gray-400 hover:text-white transition duration-300">
308
+ <i class="fab fa-instagram"></i>
309
+ </a>
310
+ <a href="#" class="text-gray-400 hover:text-white transition duration-300">
311
+ <i class="fab fa-linkedin-in"></i>
312
+ </a>
313
+ </div>
314
+ </div>
315
+
316
+ <div class="border-t border-gray-700 mt-8 pt-8 flex flex-col md:flex-row justify-between items-center">
317
+ <p class="text-gray-400 text-sm mb-4 md:mb-0">© 2023 KnowYourMess. All rights reserved.</p>
318
+ <div class="flex space-x-6">
319
+ <a href="#" class="text-gray-400 hover:text-white text-sm transition duration-300">Privacy Policy</a>
320
+ <a href="#" class="text-gray-400 hover:text-white text-sm transition duration-300">Terms of Service</a>
321
+ <a href="#" class="text-gray-400 hover:text-white text-sm transition duration-300">Contact Us</a>
322
+ </div>
323
+ </div>
324
+ </div>
325
+ </footer>
326
+
327
+ <script>
328
+ // Questions for the assessment
329
+ const questions = [
330
+ {
331
+ question: "How often have you felt nervous or stressed in the past week?",
332
+ options: [
333
+ { text: "Never", value: 0 },
334
+ { text: "Rarely", value: 1 },
335
+ { text: "Sometimes", value: 2 },
336
+ { text: "Often", value: 3 },
337
+ { text: "Constantly", value: 4 }
338
+ ]
339
+ },
340
+ {
341
+ question: "How would you rate your sleep quality recently?",
342
+ options: [
343
+ { text: "Excellent", value: 0 },
344
+ { text: "Good", value: 1 },
345
+ { text: "Average", value: 2 },
346
+ { text: "Poor", value: 3 },
347
+ { text: "Terrible", value: 4 }
348
+ ]
349
+ },
350
+ {
351
+ question: "How often have you felt overwhelmed by your responsibilities?",
352
+ options: [
353
+ { text: "Never", value: 0 },
354
+ { text: "Rarely", value: 1 },
355
+ { text: "Sometimes", value: 2 },
356
+ { text: "Often", value: 3 },
357
+ { text: "Always", value: 4 }
358
+ ]
359
+ },
360
+ {
361
+ question: "How easily do you get irritated or annoyed these days?",
362
+ options: [
363
+ { text: "Not at all", value: 0 },
364
+ { text: "Slightly", value: 1 },
365
+ { text: "Moderately", value: 2 },
366
+ { text: "Very", value: 3 },
367
+ { text: "Extremely", value: 4 }
368
+ ]
369
+ },
370
+ {
371
+ question: "How often have you experienced physical symptoms of stress (headaches, muscle tension, etc.)?",
372
+ options: [
373
+ { text: "Never", value: 0 },
374
+ { text: "Rarely", value: 1 },
375
+ { text: "Sometimes", value: 2 },
376
+ { text: "Often", value: 3 },
377
+ { text: "Daily", value: 4 }
378
+ ]
379
+ }
380
+ ];
381
+
382
+ let currentQuestion = 0;
383
+ let totalScore = 0;
384
+ const maxPossibleScore = questions.length * 4; // 4 is the highest value per question
385
+
386
+ // Start the assessment
387
+ function startAssessment() {
388
+ document.getElementById('assessmentSection').classList.remove('hidden');
389
+ document.querySelector('html').scrollTo({
390
+ top: document.getElementById('assessmentSection').offsetTop - 20,
391
+ behavior: 'smooth'
392
+ });
393
+ showQuestion();
394
+ }
395
+
396
+ // Show current question
397
+ function showQuestion() {
398
+ const questionContainer = document.getElementById('questionContainer');
399
+ questionContainer.innerHTML = '';
400
+
401
+ const questionDiv = document.createElement('div');
402
+ questionDiv.className = 'bg-gray-50 p-6 rounded-lg';
403
+
404
+ const questionText = document.createElement('h3');
405
+ questionText.className = 'text-xl font-semibold mb-4';
406
+ questionText.textContent = `Question ${currentQuestion + 1}/${questions.length}: ${questions[currentQuestion].question}`;
407
+ questionDiv.appendChild(questionText);
408
+
409
+ const optionsDiv = document.createElement('div');
410
+ optionsDiv.className = 'space-y-3';
411
+
412
+ questions[currentQuestion].options.forEach((option, index) => {
413
+ const optionDiv = document.createElement('div');
414
+ optionDiv.className = 'flex items-center';
415
+
416
+ const input = document.createElement('input');
417
+ input.type = 'radio';
418
+ input.name = 'stressOption';
419
+ input.value = option.value;
420
+ input.id = `option${index}`;
421
+ input.className = 'h-4 w-4 text-indigo-600 focus:ring-indigo-500';
422
+ input.onclick = () => optionSelected(option.value);
423
+
424
+ const label = document.createElement('label');
425
+ label.htmlFor = `option${index}`;
426
+ label.className = 'ml-3 block text-gray-700';
427
+ label.textContent = option.text;
428
+
429
+ optionDiv.appendChild(input);
430
+ optionDiv.appendChild(label);
431
+ optionsDiv.appendChild(optionDiv);
432
+ });
433
+
434
+ questionDiv.appendChild(optionsDiv);
435
+ questionContainer.appendChild(questionDiv);
436
+
437
+ // Show/hide submit button based on whether it's the last question
438
+ if (currentQuestion === questions.length - 1) {
439
+ document.getElementById('submitBtn').classList.remove('hidden');
440
+ } else {
441
+ document.getElementById('submitBtn').classList.add('hidden');
442
+ }
443
+ }
444
+
445
+ // When an option is selected
446
+ function optionSelected(value) {
447
+ totalScore += parseInt(value);
448
+ currentQuestion++;
449
+
450
+ // Update stress meter during assessment
451
+ const currentPercentage = (totalScore / ((currentQuestion) * 4)) * 100;
452
+ document.getElementById('stressIndicator').style.width = `${currentPercentage}%`;
453
+ document.getElementById('stressValue').textContent = `${Math.round(currentPercentage)}%`;
454
+
455
+ if (currentQuestion < questions.length) {
456
+ setTimeout(showQuestion, 500);
457
+ }
458
+ }
459
+
460
+ // Calculate final stress level
461
+ function calculateStress() {
462
+ const stressPercentage = (totalScore / maxPossibleScore) * 100;
463
+
464
+ // Show results section
465
+ document.getElementById('assessmentSection').classList.add('hidden');
466
+ document.getElementById('resultsSection').classList.remove('hidden');
467
+
468
+ // Animate the final stress meter
469
+ setTimeout(() => {
470
+ document.getElementById('finalStressIndicator').style.width = `${stressPercentage}%`;
471
+ document.getElementById('finalStressValue').textContent = `${Math.round(stressPercentage)}%`;
472
+ }, 100);
473
+
474
+ // Set stress level text
475
+ const stressLevelText = document.getElementById('stressLevelText');
476
+ if (stressPercentage < 25) {
477
+ stressLevelText.textContent = "Your stress level is Low";
478
+ stressLevelText.className = "text-xl font-semibold mb-6 text-green-500";
479
+ } else if (stressPercentage < 50) {
480
+ stressLevelText.textContent = "Your stress level is Moderate";
481
+ stressLevelText.className = "text-xl font-semibold mb-6 text-yellow-500";
482
+ } else if (stressPercentage < 75) {
483
+ stressLevelText.textContent = "Your stress level is High";
484
+ stressLevelText.className = "text-xl font-semibold mb-6 text-orange-500";
485
+ } else if (stressPercentage < 90) {
486
+ stressLevelText.textContent = "Your stress level is Very High";
487
+ stressLevelText.className = "text-xl font-semibold mb-6 text-red-500";
488
+ } else {
489
+ stressLevelText.textContent = "Your stress level is Critical";
490
+ stressLevelText.className = "text-xl font-semibold mb-6 text-red-700";
491
+ }
492
+
493
+ // Set recommendations based on stress level
494
+ const recommendations = document.getElementById('recommendations');
495
+ if (stressPercentage < 25) {
496
+ recommendations.innerHTML = `
497
+ <h3 class="text-lg font-semibold mb-3 text-green-600">Recommendations:</h3>
498
+ <ul class="list-disc pl-5 space-y-2">
499
+ <li>Continue your healthy habits that are keeping your stress low</li>
500
+ <li>Practice mindfulness to maintain your current state</li>
501
+ <li>Consider helping others manage their stress</li>
502
+ </ul>
503
+ `;
504
+ } else if (stressPercentage < 50) {
505
+ recommendations.innerHTML = `
506
+ <h3 class="text-lg font-semibold mb-3 text-yellow-600">Recommendations:</h3>
507
+ <ul class="list-disc pl-5 space-y-2">
508
+ <li>Practice deep breathing exercises for 5 minutes daily</li>
509
+ <li>Take regular breaks during work or study sessions</li>
510
+ <li>Engage in physical activity for at least 30 minutes most days</li>
511
+ <li>Consider keeping a gratitude journal</li>
512
+ </ul>
513
+ `;
514
+ } else if (stressPercentage < 75) {
515
+ recommendations.innerHTML = `
516
+ <h3 class="text-lg font-semibold mb-3 text-orange-600">Recommendations:</h3>
517
+ <ul class="list-disc pl-5 space-y-2">
518
+ <li>Prioritize sleep and aim for 7-9 hours per night</li>
519
+ <li>Practice progressive muscle relaxation techniques</li>
520
+ <li>Limit caffeine and alcohol intake</li>
521
+ <li>Schedule "worry time" to contain anxious thoughts</li>
522
+ <li>Consider talking to a friend or professional about your stress</li>
523
+ </ul>
524
+ `;
525
+ } else if (stressPercentage < 90) {
526
+ recommendations.innerHTML = `
527
+ <h3 class="text-lg font-semibold mb-3 text-red-600">Recommendations:</h3>
528
+ <ul class="list-disc pl-5 space-y-2">
529
+ <li>Seek professional help from a therapist or counselor</li>
530
+ <li>Practice daily meditation or mindfulness exercises</li>
531
+ <li>Identify and reduce major stressors in your life where possible</li>
532
+ <li>Establish a consistent sleep routine</li>
533
+ <li>Engage in regular physical activity</li>
534
+ <li>Consider stress management workshops or programs</li>
535
+ </ul>
536
+ `;
537
+ } else {
538
+ recommendations.innerHTML = `
539
+ <h3 class="text-lg font-semibold mb-3 text-red-700">Recommendations:</h3>
540
+ <p class="mb-3">Your stress levels are critically high. It's important to seek professional help immediately.</p>
541
+ <ul class="list-disc pl-5 space-y-2">
542
+ <li>Contact a mental health professional as soon as possible</li>
543
+ <li>Reach out to trusted friends or family members for support</li>
544
+ <li>Consider contacting a crisis hotline if needed</li>
545
+ <li>Remove yourself from highly stressful situations when possible</li>
546
+ <li>Practice emergency stress relief techniques like box breathing</li>
547
+ </ul>
548
+ <p class="mt-4 font-medium">National Crisis Hotline (US): 1-800-273-8255</p>
549
+ `;
550
+ }
551
+
552
+ // Scroll to results
553
+ setTimeout(() => {
554
+ document.querySelector('html').scrollTo({
555
+ top: document.getElementById('resultsSection').offsetTop - 20,
556
+ behavior: 'smooth'
557
+ });
558
+ }, 300);
559
+ }
560
+
561
+ // Reset the assessment
562
+ function resetAssessment() {
563
+ currentQuestion = 0;
564
+ totalScore = 0;
565
+ document.getElementById('resultsSection').classList.add('hidden');
566
+ document.getElementById('stressIndicator').style.width = '0%';
567
+ document.getElementById('stressValue').textContent = '0%';
568
+ startAssessment();
569
+ }
570
+ </script>
571
+ <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Chipan/knowyourmessv1" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
572
+ </html>
prompts.txt ADDED
File without changes