-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstructions.html
More file actions
654 lines (577 loc) · 24.6 KB
/
instructions.html
File metadata and controls
654 lines (577 loc) · 24.6 KB
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
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover"/>
<title>Assessment Instructions | Parkinsense</title>
<style>
:root {
--safe-top: env(safe-area-inset-top, 0px);
--safe-right: env(safe-area-inset-right, 0px);
--safe-bottom: env(safe-area-inset-bottom, 0px);
--safe-left: env(safe-area-inset-left, 0px);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
background-color: #ffffff;
background-image:
linear-gradient(rgba(0, 0, 0, 0.08) 1px, transparent 1px),
linear-gradient(90deg, rgba(0, 0, 0, 0.08) 1px, transparent 1px);
background-size: 50px 50px;
color: #1a1a1a;
line-height: 1.6;
height: auto;
overflow: auto;
position: relative;
}
body::before {
content: '';
position: fixed; inset: 0;
background: radial-gradient(circle at center, rgba(255, 255, 255, 1) 20%, rgba(255, 255, 255, 0.7) 50%, rgba(255, 255, 255, 0) 80%);
pointer-events: none; z-index: 1;
}
.grid-light { position: fixed; width: 8px; height: 8px; background: radial-gradient(circle, #888 0%, rgba(136,136,136,.6) 50%, transparent 70%); border-radius: 50%; pointer-events: none; z-index: 1; opacity: .6; }
.grid-light-1{ top:10%; left:-10px; animation: moveRightHorizontal 16s linear infinite, greenGlow 3.4s ease-in-out infinite;}
.grid-light-2{ top:90%; left:-10px; animation: moveRightHorizontal 13s linear infinite, greenGlow 2.9s ease-in-out infinite; animation-delay:2.5s,.7s;}
.grid-light-3{ top:-10px; left:20%; animation: moveDownVertical 14s linear infinite, greenGlow 3.1s ease-in-out infinite; animation-delay:1.2s,1.8s;}
.grid-light-4{ bottom:-10px; left:80%; animation: moveUpVertical 11s linear infinite, greenGlow 2.7s ease-in-out infinite; animation-delay:3.5s,.3s;}
.grid-light-5{ top:50%; right:-10px; animation: moveLeftHorizontal 15s linear infinite, greenGlow 3.3s ease-in-out infinite; animation-delay:4s,1.5s;}
@keyframes moveRightHorizontal{0%{left:-10px;}100%{left:calc(100% + 10px);}}
@keyframes moveLeftHorizontal{0%{right:-10px;}100%{right:calc(100% + 10px);}}
@keyframes moveDownVertical{0%{top:-10px;}100%{top:calc(100% + 10px);}}
@keyframes moveUpVertical{0%{bottom:-10px;}100%{bottom:calc(100% + 10px);}}
@keyframes greenGlow{
0%,70%,100%{background:radial-gradient(circle,#888 0%,rgba(136,136,136,.6) 50%,transparent 70%);box-shadow:0 0 0 rgba(34,197,94,0);opacity:.6;transform:scale(1);}
15%,55%{background:radial-gradient(circle,#22c55e 0%,rgba(34,197,94,.8) 50%,rgba(34,197,94,.2) 70%);box-shadow:0 0 15px rgba(34,197,94,.8),0 0 30px rgba(34,197,94,.4);opacity:1;transform:scale(1.3);}
}
.container {
max-width: 1200px;
min-height: 100dvh; /* fills the viewport but never squashes content */
align-content: start; /* prevents weird distribution on tall screens */
margin: 0 auto;
position: relative;
z-index: 2;
display: grid;
grid-template-rows: auto 1fr auto;
gap: 0.75rem; /* single, consistent gap */
}
.header {
text-align: center;
background: rgba(255,255,255,.95);
border-radius: 15px;
padding: 0.25rem;
box-shadow: 0 8px 32px rgba(0,0,0,.12), 0 2px 16px rgba(0,0,0,.08), inset 0 1px 0 rgba(255,255,255,.3);
border: 1px solid rgba(255,255,255,.2);
backdrop-filter: blur(20px);
position: relative; overflow: hidden;
}
.header::before{
content:'';position:absolute;top:0;left:-100%;width:100%;height:100%;
background:linear-gradient(90deg,transparent,rgba(255,255,255,.1),transparent);
animation: headerShimmer 8s ease-in-out infinite;
}
@keyframes headerShimmer{0%,90%,100%{left:-100%;}45%{left:100%;}}
.subtitle{font-size:1.4rem;color:#4a4a4a;margin-top:.1rem;font-weight:400;}
h1{font-size:clamp(1.6rem, 4vw, 2.4rem);font-weight:600;color:#1a1a1a;letter-spacing:-.02em;}
.tabs{display:none;}
.tab{flex:1;padding:.75rem 1rem;background:transparent;border:none;border-radius:10px;cursor:pointer;font-size:1rem;font-weight:500;color:#6b7280;transition:.2s;font-family:inherit;}
.tab.active{background:white;color:#1a1a1a;box-shadow:0 2px 8px rgba(0,0,0,.1);}
.main-content{
background: rgba(255,255,255,.95);
border-radius: 15px;
padding: .5rem;
box-shadow: 0 12px 40px rgba(0,0,0,.15), 0 4px 20px rgba(0,0,0,.1), inset 0 1px 0 rgba(255,255,255,.2);
border: 1px solid rgba(255,255,255,.15);
backdrop-filter: blur(20px);
overflow: hidden;
display: flex; flex-direction: column;
position: relative;
gap: 0.75rem; /* ✅ add this line directly after position: relative */
}
.main-content::after{
content:'';position:absolute;top:0;left:0;right:0;height:1px;
background:linear-gradient(90deg,transparent,rgba(34,197,94,.3),transparent);
animation: topGlow 6s ease-in-out infinite;
}
@keyframes topGlow{0%,70%,100%{opacity:0;}35%{opacity:1;}}
.tab-content{display:none;flex-direction:column;height:100%;}
.tab-content.active{display:flex;}
.video-section{display:flex;flex-direction:column;height:100%;gap:.5rem;}
.progress-container{flex-shrink:0;}
.progress-bar{width:100%;height:6px;background:#e5e7eb;border-radius:3px;overflow:hidden;margin-bottom:.25rem;}
.progress-fill{height:100%;background:linear-gradient(90deg,#22c55e 0%,#16a34a 100%);width:0%;transition:width .3s;border-radius:3px;}
.progress-text{text-align:center;font-size:.8rem;color:#6b7280;font-weight:500;}
.video-container{
position: relative;
width: 100%;
overflow: hidden;
border-radius: 10px;
box-shadow: 0 8px 30px rgba(0,0,0,.2), 0 4px 15px rgba(0,0,0,.1), 0 0 0 1px rgba(255,255,255,.1);
border: 1px solid rgba(0,0,0,.1);
flex-shrink: 0;
aspect-ratio: 16 / 9; /* keep a true 16:9 */
max-height: min(70vh, 720px); /* don’t grow too tall */
}
.video-container::before{
content:'';position:absolute;inset:-2px;
background:linear-gradient(135deg,rgba(34,197,94,.3),rgba(16,163,74,.3));
border-radius:12px;z-index:-1;opacity:0;animation: videoPulse 10s ease-in-out infinite;
}
@keyframes videoPulse{0%,85%,100%{opacity:0;}42.5%{opacity:1;}}
.video-container #player{position:absolute;inset:0;width:100%;height:100%;border:none;border-radius:10px;}
.video-description{display:none;}
.steps-content{flex:1;display:flex;align-items:center;justify-content:center;padding:1rem 0;}
.steps{list-style:none;counter-reset:step-counter;position:relative;max-width:100%;width:100%;}
.steps::before{
content:'';position:absolute;left:50%;top:1.4rem;height:calc(100% - 2.8rem);width:4px;
background:linear-gradient(180deg,#22c55e 0%,#16a34a 100%);z-index:0;transform:translateX(-50%);border-radius:2px;overflow:hidden;
}
.steps::after{
content:'';position:absolute;left:50%;top:1.4rem;width:16px;height:16px;
background:radial-gradient(circle,rgba(134,239,172,.9) 0%,rgba(34,197,94,.6) 30%,rgba(34,197,94,.2) 60%,transparent 100%);
z-index:.5;transform:translateX(-50%);border-radius:50%;animation:circularGlowDown 4s ease-in-out infinite;
box-shadow:0 0 12px rgba(34,197,94,.7),0 0 20px rgba(34,197,94,.4);
}
@keyframes circularGlowDown{
0%{opacity:0;top:1.4rem;}10%{opacity:1;}90%{opacity:1;}100%{opacity:0;top:calc(100% - 1.4rem);}
}
.step{
counter-increment: step-counter;
display:flex;align-items:flex-start;margin-bottom:1.5rem;padding:1.2rem;
background:linear-gradient(135deg,#f9fafb 0%,#f3f4f6 100%);
border-radius:12px;border-left:4px solid #22c55e;position:relative;
box-shadow:0 4px 16px rgba(0,0,0,.08),0 2px 8px rgba(0,0,0,.04),inset 0 1px 0 rgba(255,255,255,.5);
z-index:1;transition:all .3s ease;
}
.step:hover{transform:translateY(-2px);box-shadow:0 8px 25px rgba(0,0,0,.12),0 4px 12px rgba(0,0,0,.08),inset 0 1px 0 rgba(255,255,255,.5),0 0 0 1px rgba(34,197,94,.1);}
.step:last-child{margin-bottom:0;}
.step::before{
content:counter(step-counter);
background:linear-gradient(135deg,#22c55e 0%,#16a34a 100%);
color:#fff;width:2.8rem;height:2.8rem;border-radius:50%;
display:flex;align-items:center;justify-content:center;font-weight:bold;font-size:1.1rem;margin-right:1.5rem;flex-shrink:0;
position:relative;z-index:2;box-shadow:0 4px 12px rgba(34,197,94,.4),0 2px 6px rgba(34,197,94,.2),inset 0 1px 0 rgba(255,255,255,.2);
transition:all .3s ease;
}
.step:hover::before{transform:scale(1.05);box-shadow:0 6px 20px rgba(34,197,94,.5),0 3px 10px rgba(34,197,94,.3),inset 0 1px 0 rgba(255,255,255,.3);}
.step-content{font-size:1.3rem;line-height:1.8;}
.highlight{background:linear-gradient(120deg,#a7f3d0 0%,#6ee7b7 100%);padding:.15em .3em;border-radius:3px;font-weight:600;color:#065f46;}
.button-area{
text-align: center;
padding: 0.75rem 0 1rem; /* small top, a touch more bottom so it never hugs the edge */
}
.continue-button{
background:linear-gradient(135deg,#22c55e 0%,#16a34a 100%);
color:#fff;border:none;padding:.9rem 2.8rem;font-size:1.9rem;font-weight:600;border-radius:3rem;cursor:pointer;transition:.3s;font-family:inherit;
text-decoration:none;display:inline-block;box-shadow:0 8px 25px rgba(34,197,94,.4),0 4px 12px rgba(34,197,94,.2),inset 0 1px 0 rgba(255,255,255,.2);
position:relative;overflow:hidden;
}
.continue-button::before{
content:'';position:absolute;top:0;left:-100%;width:100%;height:100%;background:linear-gradient(90deg,transparent,rgba(255,255,255,.2),transparent);transition:left .6s ease;
}
.continue-button:hover::before{left:100%;}
.continue-button:hover{transform:translateY(-4px) scale(1.02);box-shadow:0 12px 35px rgba(34,197,94,.5),0 6px 20px rgba(34,197,94,.3),inset 0 1px 0 rgba(255,255,255,.3),0 0 0 1px rgba(34,197,94,.2);}
.continue-button:active{transform:translateY(-2px) scale(1.01);}
/* ===== MOBILE (no scroll to button) ===== */
/* ===== MOBILE (refined, polished) ===== */
@media (max-width: 768px) {
:root {
--space-xs: 0.5rem;
--space-sm: 0.75rem;
--space-md: 1rem;
--card-radius: 12px;
--shadow-soft: 0 4px 12px rgba(0,0,0,.08);
--shadow-medium: 0 8px 16px rgba(0,0,0,.12);
}
html, body {
height: 100dvh;
overflow: hidden;
padding: 0;
background-size: 30px 30px;
}
/* Page grid fits exactly in the viewport */
.container {
height: 100dvh;
grid-template-rows: auto 1fr auto; /* header / content / button */
gap: var(--space-sm);
padding:
calc(var(--space-sm) + env(safe-area-inset-top))
calc(var(--space-sm) + env(safe-area-inset-right))
calc(var(--space-sm) + env(safe-area-inset-bottom))
calc(var(--space-sm) + env(safe-area-inset-left));
}
/* Header — compact and balanced */
.header {
padding: var(--space-sm);
border-radius: var(--card-radius);
box-shadow: var(--shadow-soft);
}
h1 {
/* scales smoothly from small phones up to big ones */
font-size: clamp(1.1rem, 4.6vw, 1.5rem);
line-height: 1.15;
margin-bottom: 0.25rem;
letter-spacing: -0.01em;
font-weight: 600; /* a touch bolder for legibility */
}
.subtitle {
font-size: clamp(0.8rem, 3.6vw, 0.95rem);
line-height: 1.3;
color: #6b7280;
margin-top: 0;
font-weight: 450;
}
/* Main card uses all remaining height without inner overflow */
.main-content {
padding: var(--space-sm);
border-radius: var(--card-radius);
box-shadow: var(--shadow-soft);
min-height: 0;
overflow: hidden;
}
/* Video section uses a clean 16:9 box with a height cap */
.video-section {
gap: var(--space-sm);
flex: 1 1 auto;
min-height: 0;
}
.progress-container { order: -1; flex-shrink: 0; }
.progress-text { font-size: 0.82rem; margin-bottom: 0.35rem; }
.progress-bar { height: 5px; margin-bottom: 0.5rem; }
.video-container {
/* Remove padding-bottom trick; use true aspect-ratio */
padding-bottom: 0;
height: auto;
aspect-ratio: 16 / 9; /* ✅ prevents “smooshing” */
max-height: 38dvh; /* won’t crowd the button */
border-radius: 10px;
flex: 0 0 auto;
box-shadow: var(--shadow-medium);
}
.video-container #player {
position: absolute; inset: 0; width: 100%; height: 100%;
}
/* Steps pane can scroll internally if needed, page itself will not scroll */
/* WITH: */
.steps-content {
align-items: flex-start;
justify-content: flex-start;
padding: var(--space-xs) 0;
flex: 1; /* Let it use available space */
}
.steps { width: 100%; padding: 0; }
.steps::before { left: 1.1rem; width: 2px; top: 1rem; height: calc(100% - 2rem); }
.steps::after { left: 1.1rem; width: 8px; height: 8px; top: 1rem; }
.step {
padding: 0.75rem 0.75rem 0.75rem 2.5rem;
margin-bottom: 0.75rem;
border-radius: 10px;
box-shadow: var(--shadow-soft);
}
.step::before {
width: 1.9rem; height: 1.9rem; font-size: 0.85rem;
left: 0.2rem; top: 0.75rem; margin-right: 0;
}
.step-content {
font-size: clamp(0.9rem, 3.6vw, 1rem);
line-height: 1.45;
}
/* Bottom button always visible; translucent top edge for depth */
.button-area {
position: fixed; left: 0; right: 0; bottom: 0;
padding:
var(--space-sm)
calc(var(--space-sm) + env(safe-area-inset-right))
calc(var(--space-sm) + env(safe-area-inset-bottom))
calc(var(--space-sm) + env(safe-area-inset-left));
background: linear-gradient(to top, rgba(255,255,255,0.98), rgba(255,255,255,0.7), transparent);
z-index: 5;
}
.continue-button {
width: 100%;
padding: 0.9rem 1.25rem;
font-size: clamp(0.95rem, 3.8vw, 1.05rem);
border-radius: 12px;
box-shadow: 0 6px 16px rgba(34,197,94,.42);
}
.continue-button:hover { transform: none; box-shadow: 0 6px 16px rgba(34,197,94,.55); }
/* Tone down decoration on small screens */
.grid-light { width: 5px; height: 5px; opacity: 0.45; }
}
/* === FINAL MOBILE OVERRIDES (high specificity, last in file) === */
html.is-mobile, html.is-mobile body {
height: 100dvh !important;
overflow: hidden !important;
padding: 0 !important;
-webkit-text-size-adjust: 100%;
}
html.is-mobile .container {
height: 100dvh !important;
display: grid !important;
grid-template-rows: auto 1fr auto !important; /* header / content / button */
gap: 0.75rem !important;
padding:
calc(0.75rem + env(safe-area-inset-top))
calc(0.75rem + env(safe-area-inset-right))
calc(0.75rem + env(safe-area-inset-bottom))
calc(0.75rem + env(safe-area-inset-left)) !important;
}
/* Header */
html.is-mobile .header {
padding: 0.9rem !important;
border-radius: 12px !important;
box-shadow: 0 4px 12px rgba(0,0,0,.08) !important;
}
html.is-mobile h1 {
font-size: clamp(1.2rem, 5.2vw, 1.6rem) !important;
line-height: 1.15 !important;
margin: 0 0 .25rem 0 !important;
letter-spacing: -0.01em !important;
font-weight: 600 !important;
}
html.is-mobile .subtitle {
font-size: clamp(.9rem, 3.7vw, 1rem) !important;
line-height: 1.3 !important;
color: #6b7280 !important;
margin: 0 !important;
font-weight: 450 !important;
}
/* Main card */
html.is-mobile .main-content {
padding: 0.75rem !important;
border-radius: 12px !important;
min-height: 0 !important;
overflow: hidden !important;
box-shadow: 0 4px 12px rgba(0,0,0,.08) !important;
}
/* Progress */
html.is-mobile .progress-text {
font-size: .9rem !important;
margin-bottom: .35rem !important;
}
html.is-mobile .progress-bar {
height: 5px !important;
margin-bottom: .5rem !important;
}
/* Video: true 16:9, never squished */
html.is-mobile .video-container {
height: auto !important;
padding-bottom: 0 !important; /* kill desktop padding hack */
aspect-ratio: 16 / 9 !important;
max-height: 36dvh !important;
border-radius: 10px !important;
flex: 0 0 auto !important;
box-shadow: 0 8px 16px rgba(0,0,0,.12) !important;
overflow: hidden !important;
position: relative !important;
}
html.is-mobile .video-container #player {
position: absolute !important;
inset: 0 !important;
width: 100% !important;
height: 100% !important;
border: 0 !important;
}
html.is-mobile .steps-content {
align-items: flex-start !important;
justify-content: flex-start !important;
padding: .5rem 0 !important;
flex: 1 !important; /* Let it use available space naturally */
}
html.is-mobile .step {
padding: .6rem .6rem .6rem 2.2rem !important; /* More compact padding */
margin-bottom: .6rem !important; /* Less space between steps */
border-radius: 10px !important;
box-shadow: 0 4px 12px rgba(0,0,0,.08) !important;
}
html.is-mobile .step::before {
width: 1.7rem !important;
height: 1.7rem !important;
font-size: .8rem !important;
left: .15rem !important;
top: .6rem !important;
margin-right: 0 !important;
transform: translateX(-10px) !important;
}
/* ADD these new rules - they adjust the vertical connecting line and glow dot for mobile */
html.is-mobile .steps::before {
left: 1rem !important;
width: 2px !important;
top: .8rem !important;
height: calc(100% - 1.6rem) !important;
}
html.is-mobile .steps::after {
left: 1rem !important;
width: 8px !important;
height: 8px !important;
top: .8rem !important;
}
html.is-mobile .step-content {
font-size: clamp(.95rem, 3.8vw, 1.05rem) !important;
line-height: 1.45 !important;
}
/* CTA fixed & always visible */
html.is-mobile .button-area {
position: fixed !important;
left: 0 !important; right: 0 !important; bottom: 0 !important;
padding:
.75rem
calc(.75rem + env(safe-area-inset-right))
calc(.75rem + env(safe-area-inset-bottom))
calc(.75rem + env(safe-area-inset-left)) !important;
background: linear-gradient(to top, rgba(255,255,255,.98), rgba(255,255,255,.7), transparent) !important;
z-index: 5 !important;
}
html.is-mobile .continue-button {
width: 100% !important;
padding: .95rem 1.25rem !important;
font-size: clamp(1rem, 4vw, 1.1rem) !important;
border-radius: 12px !important;
box-shadow: 0 6px 16px rgba(34,197,94,.42) !important;
}
/* Reserve space for CTA so content never hides behind it */
/* Softer decoration on mobile */
html.is-mobile .grid-light { width: 5px !important; height: 5px !important; opacity: .45 !important; }
</style>
<script>
function setMobileClass() {
const isMobile = window.matchMedia('(max-width: 768px)').matches;
document.documentElement.classList.toggle('is-mobile', isMobile);
}
setMobileClass();
window.addEventListener('resize', setMobileClass);
</script>
</head>
<body>
<!-- Animated grid lights -->
<div class="grid-light grid-light-1"></div>
<div class="grid-light grid-light-2"></div>
<div class="grid-light grid-light-3"></div>
<div class="grid-light grid-light-4"></div>
<div class="grid-light grid-light-5"></div>
<div class="container">
<div class="header">
<h1>Please watch this video before continuing.</h1>
</div>
<div class="main-content">
<!-- Video Tab -->
<div id="video" class="tab-content active">
<div class="video-section">
<div class="video-container">
<div id="player"></div>
</div>
</div>
</div>
<!-- Steps Tab -->
<div id="steps" class="tab-content">
<div class="steps-content">
<ol class="steps">
<li class="step">
<div class="step-content">
Position yourself comfortably with <span class="highlight">good lighting</span>. Ensure your palm is facing the camera and clearly visible in the camera view.
</div>
</li>
<li class="step">
<div class="step-content">
You will complete <span class="highlight">6 trials total</span> - each hand will be tested 3 times. Follow the on-screen prompts for which hand to use.
</div>
</li>
<li class="step">
<div class="step-content">
When each trial begins, tap your <span class="highlight">thumb and index finger</span> together as quickly and accurately as possible for <span class="highlight">10 seconds</span>.
</div>
</li>
<li class="step">
<div class="step-content">
Start with your fingers <span class="highlight">wide open</span>, then make clear, deliberate tapping movements. Keep your finger opening wide and consistent throughout each trial.
</div>
</li>
<li class="step">
<div class="step-content">
Follow the visual guides on screen to position your hand correctly. The system will provide real-time feedback during the assessment.
</div>
</li>
</ol>
</div>
</div>
</div>
<div class="button-area">
<button class="continue-button" id="mainButton" onclick="showStepsTab()">
Continue
</button>
</div>
</div>
<!-- YouTube API Script -->
<!-- YouTube API Script -->
<script src="https://www.youtube.com/iframe_api" onerror="loadFallbackVideo()"></script>
<script>
let player;
let apiLoaded = false;
function loadFallbackVideo() {
console.warn('YouTube API failed to load, using iframe fallback');
const playerDiv = document.getElementById('player');
playerDiv.innerHTML = '<iframe width="100%" height="100%" src="https://www.youtube.com/embed/BfJgb57agbk?playsinline=1&rel=0&modestbranding=1" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen style="border-radius: 10px;"></iframe>';
}
function showStepsTab() {
document.querySelector('.header').style.display = 'none';
document.querySelector('.container').style.gridTemplateRows = '1fr auto';
switchTab('steps');
}
function switchTab(tabName) {
document.querySelectorAll('.tab-content').forEach(c => c.classList.remove('active'));
document.getElementById(tabName).classList.add('active');
const button = document.getElementById('mainButton');
if (tabName === 'video') {
button.innerHTML = 'Continue';
button.onclick = showStepsTab;
} else {
button.innerHTML = '<a href="experiment.html" style="color: inherit; text-decoration: none;">Start Assessment</a>';
button.onclick = null;
}
}
function onYouTubeIframeAPIReady() {
apiLoaded = true;
if (player && player.destroy) player.destroy();
setTimeout(() => {
try {
player = new YT.Player('player', {
height: '100%',
width: '100%',
videoId: 'BfJgb57agbk',
playerVars: { 'playsinline': 1, 'rel': 0, 'modestbranding': 1 },
events: { 'onReady': onPlayerReady, 'onStateChange': onPlayerStateChange }
});
} catch(e) {
console.error('YouTube player initialization failed:', e);
loadFallbackVideo();
}
}, 100);
}
function onPlayerReady(_) {
console.log('YouTube player ready');
}
function onPlayerStateChange(_) {}
// Wait for API to load, with timeout fallback
window.addEventListener('load', function() {
setTimeout(() => {
if (typeof YT === 'undefined' || !YT.Player) {
console.warn('YouTube API not loaded after timeout');
loadFallbackVideo();
} else if (!apiLoaded) {
onYouTubeIframeAPIReady();
}
}, 3000);
});
document.addEventListener('visibilitychange', function() {
if (!document.hidden && player && player.getPlayerState) {
setTimeout(() => {
if (player.getPlayerState() === -1 || player.getPlayerState() === 5) {
if (typeof YT !== 'undefined') onYouTubeIframeAPIReady();
}
}, 500);
}
});
</script>
</body>
</html>