-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathonboarding.html
More file actions
763 lines (706 loc) · 30.6 KB
/
Copy pathonboarding.html
File metadata and controls
763 lines (706 loc) · 30.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
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SysScale — Get Started</title>
<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=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/tokens.css">
<script>!function(){var t=localStorage.getItem("ss_theme")||"light";document.documentElement.setAttribute("data-theme",t)}();</script>
<link rel="stylesheet" href="css/base.css">
<style>
/* ── Onboarding page ─────────────────────────────── */
body {
min-height: 100vh;
height: auto;
overflow-y: auto;
overflow-x: hidden;
display: block;
background: var(--bg0);
background-image: radial-gradient(circle, rgba(43,160,126,0.07) 1px, transparent 1px);
background-size: 28px 28px;
}
/* Animated gradient orbs */
.orb {
position: fixed;
border-radius: 50%;
filter: blur(80px);
pointer-events: none;
z-index: 0;
}
.orb-1 { width: 500px; height: 500px; top: -120px; right: -100px; background: rgba(43,160,126,0.09); }
.orb-2 { width: 400px; height: 400px; bottom: -100px; left: -80px; background: rgba(31,122,93,0.07); }
.orb-3 { width: 300px; height: 300px; top: 40%; left: 40%; background: rgba(61,194,152,0.05); }
.onb-wrap {
position: relative;
z-index: 1;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
padding: 40px 20px 80px;
}
/* ── Top nav ─────────────────────────────────────── */
.onb-nav {
width: 100%;
max-width: 640px;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 52px;
}
.onb-logo {
display: flex; align-items: center; gap: 9px;
font-family: var(--font-head); font-size: 15px;
font-weight: 700; color: var(--text); text-decoration: none;
}
.onb-logo-mark {
width: 30px; height: 30px; border-radius: 8px;
background: var(--indigo);
display: flex; align-items: center; justify-content: center;
font-size: 10px; font-weight: 800; color: white;
box-shadow: var(--shadow-sm);
}
.onb-skip {
font-size: 12.5px; color: var(--text3); background: none;
border: none; cursor: pointer; padding: 6px 12px;
border-radius: 20px; font-family: var(--font-body);
transition: color var(--dur-fast), background var(--dur-fast);
}
.onb-skip:hover { color: var(--text2); background: var(--bg2); }
/* ── Progress indicator ──────────────────────────── */
.onb-progress {
display: flex; align-items: center; gap: 8px;
margin-bottom: 48px;
}
.onb-step-dot {
width: 32px; height: 4px; border-radius: 2px;
background: var(--bg3);
transition: background var(--dur), width var(--dur);
}
.onb-step-dot.active { background: var(--indigo); width: 48px; }
.onb-step-dot.done { background: var(--teal); }
/* ── Card ────────────────────────────────────────── */
.onb-card {
background: var(--bg1);
border: 1px solid var(--border2);
border-radius: 20px;
padding: 40px 44px;
width: 100%;
max-width: 640px;
box-shadow: var(--shadow-lg);
position: relative;
overflow: hidden;
}
.onb-card::before {
content: '';
position: absolute; top: 0; left: 0; right: 0;
height: 3px;
background: linear-gradient(90deg, #1F7A5D, #2BA07E, #3DC298);
}
.onb-step-label {
font-size: 9px; font-family: var(--font-mono); font-weight: 700;
letter-spacing: .18em; text-transform: uppercase;
color: var(--indigo); margin-bottom: 10px;
}
.onb-card-title {
font-family: var(--font-head); font-size: 26px; font-weight: 700;
color: var(--text); letter-spacing: -0.6px; margin-bottom: 8px;
line-height: 1.2;
}
.onb-card-sub {
font-size: 14px; color: var(--text3); margin-bottom: 32px;
line-height: 1.6;
}
/* Step panels */
.onb-step { display: none; }
.onb-step.visible {
display: block;
animation: fade-up 0.32s var(--ease-out) backwards;
}
@keyframes fade-up {
from { opacity: 0; transform: translateY(12px); }
to { opacity: 1; transform: translateY(0); }
}
/* ── Company grid ────────────────────────────────── */
.company-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 10px;
margin-bottom: 8px;
}
@media (max-width: 480px) { .company-grid { grid-template-columns: repeat(2, 1fr); } }
.company-card {
border: 2px solid var(--border2);
border-radius: var(--r-lg);
padding: 16px 10px;
display: flex; flex-direction: column;
align-items: center; gap: 8px;
cursor: pointer;
background: var(--bg1);
transition: border-color var(--dur), box-shadow var(--dur),
transform var(--dur) var(--ease-out), background var(--dur-fast);
user-select: none;
}
.company-card:hover {
border-color: var(--border3);
transform: translateY(-2px);
box-shadow: var(--shadow);
}
.company-card.selected {
border-color: var(--company-color, var(--indigo));
background: var(--indigo3);
box-shadow: 0 0 0 3px rgba(var(--indigo-rgb), 0.15);
transform: translateY(-2px);
}
.company-logo {
width: 42px; height: 42px; border-radius: 10px;
display: flex; align-items: center; justify-content: center;
font-size: 18px; font-weight: 900; color: white;
font-family: var(--font-head);
box-shadow: 0 3px 10px rgba(0,0,0,0.18);
}
.company-name {
font-size: 11px; font-weight: 700; font-family: var(--font-head);
color: var(--text2); text-align: center;
}
.company-card.selected .company-name { color: var(--text); }
/* ── Level list ──────────────────────────────────── */
.level-list { display: flex; flex-direction: column; gap: 8px; }
.level-option {
border: 2px solid var(--border2); border-radius: var(--r-lg);
padding: 14px 18px; display: flex; align-items: center;
gap: 14px; cursor: pointer; background: var(--bg1);
transition: border-color var(--dur), box-shadow var(--dur),
transform var(--dur) var(--ease-out);
user-select: none;
}
.level-option:hover {
border-color: var(--border3);
transform: translateX(3px);
box-shadow: var(--shadow-sm);
}
.level-option.selected {
border-color: var(--indigo);
background: var(--indigo3);
box-shadow: var(--shadow-violet);
}
.level-icon {
font-size: 20px; width: 42px; height: 42px;
display: flex; align-items: center; justify-content: center;
background: var(--bg2); border-radius: var(--r);
border: 1px solid var(--border); flex-shrink: 0;
}
.level-option.selected .level-icon { background: rgba(43,160,126,0.12); border-color: rgba(43,160,126,0.25); }
.level-info { flex: 1; }
.level-label { font-size: 14px; font-weight: 700; font-family: var(--font-head); color: var(--text); }
.level-sub { font-size: 11.5px; color: var(--text3); margin-top: 1px; }
.level-check {
width: 20px; height: 20px; border-radius: 50%;
border: 2px solid var(--border2);
display: flex; align-items: center; justify-content: center;
font-size: 9px; color: transparent;
transition: all var(--dur) var(--ease-spring);
flex-shrink: 0;
}
.level-option.selected .level-check {
background: var(--indigo); border-color: var(--indigo); color: white;
}
/* ── Timeline buttons ────────────────────────────── */
.timeline-grid {
display: flex; gap: 8px; flex-wrap: wrap;
margin-bottom: 28px;
}
.timeline-btn {
padding: 10px 18px; border-radius: 20px;
border: 2px solid var(--border2); background: var(--bg1);
font-size: 13px; font-weight: 600; font-family: var(--font-head);
color: var(--text2); cursor: pointer;
transition: border-color var(--dur), background var(--dur-fast),
color var(--dur-fast), transform var(--dur) var(--ease-out);
}
.timeline-btn:hover { border-color: var(--border3); transform: translateY(-2px); }
.timeline-btn.selected {
border-color: var(--indigo); background: var(--indigo3); color: var(--indigo);
}
/* Urgency message */
.urgency-msg {
padding: 12px 16px;
border-radius: var(--r);
font-size: 12.5px; line-height: 1.6;
border: 1px solid; margin-bottom: 8px;
}
.urgency-critical { background: rgba(239,68,68,0.05); border-color: rgba(239,68,68,0.20); color: #991B1B; }
.urgency-high { background: rgba(245,158,11,0.05); border-color: rgba(245,158,11,0.20); color: #92400E; }
.urgency-medium { background: var(--indigo3); border-color: rgba(var(--indigo-rgb),0.20); color: var(--indigo2); }
.urgency-low { background: rgba(16,185,129,0.05); border-color: rgba(16,185,129,0.20); color: #065F46; }
.urgency-relaxed { background: rgba(16,185,129,0.05); border-color: rgba(16,185,129,0.20); color: #065F46; }
/* ── Calibration quiz ────────────────────────────── */
.quiz-q { margin-bottom: 28px; }
.quiz-q-text {
font-size: 14px; font-weight: 600; color: var(--text);
margin-bottom: 12px; font-family: var(--font-head);
}
.quiz-options { display: flex; flex-direction: column; gap: 6px; }
.quiz-opt {
display: flex; align-items: center; gap: 12px;
padding: 11px 16px; border-radius: var(--r);
border: 1.5px solid var(--border2); background: var(--bg1);
cursor: pointer; font-size: 13px; color: var(--text2);
transition: border-color var(--dur-fast), background var(--dur-fast), color var(--dur-fast);
user-select: none;
}
.quiz-opt:hover { border-color: var(--border3); background: var(--bg2); }
.quiz-opt.selected {
border-color: var(--indigo); background: var(--indigo3); color: var(--indigo);
font-weight: 600;
}
.quiz-opt-letter {
width: 22px; height: 22px; border-radius: 6px;
background: var(--bg2); border: 1px solid var(--border2);
display: flex; align-items: center; justify-content: center;
font-size: 10px; font-weight: 800; font-family: var(--font-mono);
flex-shrink: 0; color: var(--text3);
transition: background var(--dur-fast), color var(--dur-fast);
}
.quiz-opt.selected .quiz-opt-letter {
background: var(--indigo); border-color: var(--indigo); color: white;
}
/* ── CTA / navigation ────────────────────────────── */
.onb-actions {
display: flex; align-items: center;
justify-content: space-between;
margin-top: 32px; gap: 12px;
}
.onb-back {
padding: 10px 20px; border-radius: var(--r);
border: 1px solid var(--border2); background: var(--bg1);
font-size: 13px; font-weight: 600; font-family: var(--font-head);
color: var(--text2); cursor: pointer;
transition: background var(--dur-fast), border-color var(--dur-fast);
}
.onb-back:hover { background: var(--bg2); border-color: var(--border3); }
.onb-back:disabled { opacity: 0.38; cursor: not-allowed; }
.onb-next {
flex: 1; max-width: 260px;
padding: 12px 28px; border-radius: var(--r);
border: none; background: var(--indigo);
font-size: 14px; font-weight: 700; font-family: var(--font-head);
color: white; cursor: pointer;
box-shadow: var(--shadow-violet);
transition: background var(--dur-fast), transform var(--dur) var(--ease-out),
box-shadow var(--dur), opacity var(--dur-fast);
display: flex; align-items: center; justify-content: center; gap: 8px;
}
.onb-next:hover:not(:disabled) {
background: var(--indigo2);
transform: translateY(-2px);
box-shadow: 0 8px 24px rgba(43,160,126,0.28);
}
.onb-next:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
/* ── Success screen ──────────────────────────────── */
#success-screen {
display: none;
flex-direction: column; align-items: center;
text-align: center;
}
#success-screen.visible { display: flex; animation: fade-up 0.5s var(--ease-out); }
.success-icon {
width: 88px; height: 88px; border-radius: 22px;
background: linear-gradient(135deg, #1F7A5D 0%, #2BA07E 55%, #3DC298 100%);
display: flex; align-items: center; justify-content: center;
font-size: 38px; margin: 0 auto 24px;
box-shadow: 0 12px 40px rgba(43,160,126,0.32);
animation: pop-in 0.6s var(--ease-spring) 0.2s both;
}
@keyframes pop-in {
0% { opacity: 0; transform: scale(0.7); }
65% { transform: scale(1.08); }
100% { opacity: 1; transform: scale(1); }
}
.success-title {
font-family: var(--font-head); font-size: 30px; font-weight: 700;
color: var(--text); letter-spacing: -0.6px; margin-bottom: 12px;
}
.success-sub {
font-size: 15px; color: var(--text3); max-width: 420px;
line-height: 1.7; margin-bottom: 32px;
}
.success-plan {
background: var(--bg1); border: 1px solid var(--border2);
border-radius: var(--r-xl); padding: 24px 28px;
width: 100%; max-width: 480px; margin-bottom: 32px;
box-shadow: var(--shadow); text-align: left;
}
.success-plan-title {
font-size: 10px; font-family: var(--font-mono); font-weight: 700;
text-transform: uppercase; letter-spacing: .16em; color: var(--text4);
margin-bottom: 16px;
}
.success-plan-rows { display: flex; flex-direction: column; gap: 10px; }
.success-plan-row {
display: flex; align-items: center; gap: 12px;
}
.success-plan-icon {
width: 32px; height: 32px; border-radius: var(--r);
background: var(--bg2); border: 1px solid var(--border);
display: flex; align-items: center; justify-content: center;
font-size: 14px; flex-shrink: 0;
}
.success-plan-row-label { font-size: 11.5px; color: var(--text3); }
.success-plan-row-val { font-size: 13px; font-weight: 700; color: var(--text); }
.btn-cta {
display: inline-flex; align-items: center; gap: 10px;
padding: 15px 36px;
background: linear-gradient(135deg, #1F7A5D, #2BA07E);
color: white; font-size: 15px; font-weight: 700;
font-family: var(--font-head); border: none;
border-radius: var(--r-lg); cursor: pointer;
box-shadow: 0 8px 32px rgba(43,160,126,0.32);
text-decoration: none;
transition: transform var(--dur) var(--ease-out), box-shadow var(--dur);
letter-spacing: -0.2px;
}
.btn-cta:hover {
transform: translateY(-3px);
box-shadow: 0 14px 40px rgba(43,160,126,0.38);
}
@media (max-width: 520px) {
.onb-card { padding: 28px 22px; }
.onb-card-title { font-size: 22px; }
}
</style>
<script src="js/utils/theme.js"></script>
</head>
<body>
<div class="orb orb-1"></div>
<div class="orb orb-2"></div>
<div class="orb orb-3"></div>
<div class="onb-wrap">
<!-- Nav -->
<nav class="onb-nav">
<a href="index.html" class="onb-logo">
<div class="onb-logo-mark">SS</div>
SysScale
</a>
<div style="display:flex;align-items:center;gap:10px;">
<button id="theme-btn" onclick="SS.toggleTheme()" title="Dark mode" style="width:30px;height:30px;border-radius:7px;border:1px solid var(--border2);background:none;cursor:pointer;font-size:14px;color:var(--text3);display:inline-flex;align-items:center;justify-content:center;font-family:inherit;">🌙</button>
<button class="onb-skip" onclick="skipOnboarding()">Skip for now →</button>
</div>
</nav>
<!-- Progress dots -->
<div class="onb-progress" id="progress-dots">
<div class="onb-step-dot active" id="dot-1"></div>
<div class="onb-step-dot" id="dot-2"></div>
<div class="onb-step-dot" id="dot-3"></div>
<div class="onb-step-dot" id="dot-4"></div>
</div>
<!-- Card -->
<div class="onb-card" id="onb-card">
<!-- Step 1: Target company -->
<div class="onb-step visible" id="step-1">
<div class="onb-step-label">Step 1 of 4</div>
<h1 class="onb-card-title">Which company is your dream destination?</h1>
<p class="onb-card-sub">We'll tailor your study plan with company-specific question patterns and rubrics.</p>
<div class="company-grid" id="company-grid"></div>
<div class="onb-actions">
<button class="onb-back" disabled>← Back</button>
<button class="onb-next" id="btn-next-1" disabled onclick="goToStep(2)">
Choose Target Level →
</button>
</div>
</div>
<!-- Step 2: Target level -->
<div class="onb-step" id="step-2">
<div class="onb-step-label">Step 2 of 4</div>
<h1 class="onb-card-title">What level are you targeting?</h1>
<p class="onb-card-sub">This determines the depth and complexity of systems we'll focus on.</p>
<div class="level-list" id="level-list"></div>
<div class="onb-actions">
<button class="onb-back" onclick="goToStep(1)">← Back</button>
<button class="onb-next" id="btn-next-2" disabled onclick="goToStep(3)">
Set Your Timeline →
</button>
</div>
</div>
<!-- Step 3: Timeline -->
<div class="onb-step" id="step-3">
<div class="onb-step-label">Step 3 of 4</div>
<h1 class="onb-card-title">When is your interview?</h1>
<p class="onb-card-sub">Be honest — we'll pace your plan to match your runway.</p>
<div class="timeline-grid" id="timeline-grid"></div>
<div id="urgency-msg-wrap"></div>
<div class="onb-actions">
<button class="onb-back" onclick="goToStep(2)">← Back</button>
<button class="onb-next" id="btn-next-3" disabled onclick="goToStep(4)">
Quick Calibration →
</button>
</div>
</div>
<!-- Step 4: Calibration quiz -->
<div class="onb-step" id="step-4">
<div class="onb-step-label">Step 4 of 4</div>
<h1 class="onb-card-title">Quick skill check</h1>
<p class="onb-card-sub">3 questions to find where you shine and where to focus. No judgment.</p>
<div class="quiz-q" id="q1">
<div class="quiz-q-text">How do you handle 10× traffic on your app overnight?</div>
<div class="quiz-options">
<div class="quiz-opt" onclick="selectQuiz('q1', 'a', this)">
<span class="quiz-opt-letter">A</span> Upgrade the server CPU
</div>
<div class="quiz-opt" onclick="selectQuiz('q1', 'b', this)">
<span class="quiz-opt-letter">B</span> Add a load balancer + horizontal scaling
</div>
<div class="quiz-opt" onclick="selectQuiz('q1', 'c', this)">
<span class="quiz-opt-letter">C</span> Enable CDN caching for static assets only
</div>
<div class="quiz-opt" onclick="selectQuiz('q1', 'd', this)">
<span class="quiz-opt-letter">D</span> Not sure — this is new to me
</div>
</div>
</div>
<div class="quiz-q" id="q2">
<div class="quiz-q-text">A read-heavy leaderboard needs millisecond latency for millions of users. Pick your storage?</div>
<div class="quiz-options">
<div class="quiz-opt" onclick="selectQuiz('q2', 'a', this)">
<span class="quiz-opt-letter">A</span> PostgreSQL with an index
</div>
<div class="quiz-opt" onclick="selectQuiz('q2', 'b', this)">
<span class="quiz-opt-letter">B</span> Redis Sorted Sets
</div>
<div class="quiz-opt" onclick="selectQuiz('q2', 'c', this)">
<span class="quiz-opt-letter">C</span> MongoDB with aggregation
</div>
<div class="quiz-opt" onclick="selectQuiz('q2', 'd', this)">
<span class="quiz-opt-letter">D</span> Not sure how caches differ from databases
</div>
</div>
</div>
<div class="quiz-q" id="q3">
<div class="quiz-q-text">Your service returns HTTP 500 errors at peak. First thing you check?</div>
<div class="quiz-options">
<div class="quiz-opt" onclick="selectQuiz('q3', 'a', this)">
<span class="quiz-opt-letter">A</span> Application logs and error traces
</div>
<div class="quiz-opt" onclick="selectQuiz('q3', 'b', this)">
<span class="quiz-opt-letter">B</span> Database connection pool exhaustion
</div>
<div class="quiz-opt" onclick="selectQuiz('q3', 'c', this)">
<span class="quiz-opt-letter">C</span> Restart the server
</div>
<div class="quiz-opt" onclick="selectQuiz('q3', 'd', this)">
<span class="quiz-opt-letter">D</span> Not sure how to start debugging this
</div>
</div>
</div>
<div class="onb-actions">
<button class="onb-back" onclick="goToStep(3)">← Back</button>
<button class="onb-next" id="btn-next-4" disabled onclick="completeOnboarding()">
Build My Plan 🚀
</button>
</div>
</div>
</div><!-- /onb-card -->
<!-- Success screen -->
<div id="success-screen">
<div class="success-icon">🎯</div>
<h1 class="success-title">Your plan is ready!</h1>
<p class="success-sub">We've built a personalised roadmap based on your goals. Time to start your journey.</p>
<div class="success-plan" id="success-plan"></div>
<a href="index.html" class="btn-cta">
Open My Dashboard →
</a>
</div>
</div><!-- /onb-wrap -->
<script src="js/core/onboarding.js"></script>
<script>
const ob = window.SS.onboarding;
/* ── Wizard state ── */
const W = {
targetCompany: null,
targetLevel: null,
timeline: null,
quizAnswers: {},
};
let currentStep = 1;
/* ── Render company grid ── */
const grid = document.getElementById('company-grid');
ob.COMPANIES.forEach(c => {
const card = document.createElement('div');
card.className = 'company-card';
card.style.setProperty('--company-color', c.color);
card.innerHTML = `
<div class="company-logo" style="background:${c.color};">${c.letter}</div>
<div class="company-name">${c.name}</div>
`;
card.onclick = () => {
document.querySelectorAll('.company-card').forEach(el => el.classList.remove('selected'));
card.classList.add('selected');
W.targetCompany = c.id;
document.getElementById('btn-next-1').disabled = false;
};
grid.appendChild(card);
});
/* ── Render level list ── */
const levelList = document.getElementById('level-list');
ob.LEVELS.forEach(l => {
const opt = document.createElement('div');
opt.className = 'level-option';
opt.innerHTML = `
<div class="level-icon">${l.icon}</div>
<div class="level-info">
<div class="level-label">${l.label}</div>
<div class="level-sub">${l.sub}</div>
</div>
<div class="level-check">✓</div>
`;
opt.onclick = () => {
document.querySelectorAll('.level-option').forEach(el => el.classList.remove('selected'));
opt.classList.add('selected');
W.targetLevel = l.id;
document.getElementById('btn-next-2').disabled = false;
};
levelList.appendChild(opt);
});
/* ── Render timeline buttons ── */
const timelineGrid = document.getElementById('timeline-grid');
const URGENCY_MSG = {
critical: { cls: 'urgency-critical', text: '⚡ Crunch mode activated. We\'ll focus on the highest-yield topics only.' },
high: { cls: 'urgency-high', text: '🔥 Tight window. Daily 45-min sessions will cover the essentials.' },
medium: { cls: 'urgency-medium', text: '✅ Good runway. Structured daily practice will get you to interview-ready.' },
low: { cls: 'urgency-low', text: '🌱 Plenty of time. Deep-dive each topic; aim for mastery, not memorization.' },
relaxed: { cls: 'urgency-relaxed', text: '🎯 Long game. Build intuition, not just patterns. Revisit regularly.' },
};
ob.TIMELINES.forEach(t => {
const btn = document.createElement('button');
btn.className = 'timeline-btn';
btn.textContent = t.label;
btn.onclick = () => {
document.querySelectorAll('.timeline-btn').forEach(el => el.classList.remove('selected'));
btn.classList.add('selected');
W.timeline = t.id;
document.getElementById('btn-next-3').disabled = false;
const msg = URGENCY_MSG[t.urgency];
document.getElementById('urgency-msg-wrap').innerHTML =
`<div class="urgency-msg ${msg.cls}">${msg.text}</div>`;
};
timelineGrid.appendChild(btn);
});
/* ── Quiz selection ── */
function selectQuiz(qId, answer, el) {
el.closest('.quiz-options').querySelectorAll('.quiz-opt').forEach(o => o.classList.remove('selected'));
el.classList.add('selected');
W.quizAnswers[qId] = answer;
const allAnswered = ['q1','q2','q3'].every(q => W.quizAnswers[q]);
document.getElementById('btn-next-4').disabled = !allAnswered;
}
/* ── Step navigation ── */
function goToStep(n) {
document.getElementById(`step-${currentStep}`).classList.remove('visible');
currentStep = n;
document.getElementById(`step-${n}`).classList.add('visible');
updateDots();
document.getElementById('onb-card').scrollIntoView({ behavior: 'smooth', block: 'start' });
}
function updateDots() {
for (let i = 1; i <= 4; i++) {
const dot = document.getElementById(`dot-${i}`);
dot.classList.remove('active', 'done');
if (i === currentStep) dot.classList.add('active');
else if (i < currentStep) dot.classList.add('done');
}
}
/* ── Derive weak areas from quiz ── */
function calcWeakAreas() {
const weak = [];
// q1: scaling → foundations weak if 'a' or 'd'
if (W.quizAnswers.q1 === 'a' || W.quizAnswers.q1 === 'd') weak.push('foundations');
// q2: storage → storage weak if 'a' or 'd'
if (W.quizAnswers.q2 === 'a' || W.quizAnswers.q2 === 'd') weak.push('storage');
// q3: debugging / ops → patterns weak if 'c' or 'd'
if (W.quizAnswers.q3 === 'c' || W.quizAnswers.q3 === 'd') weak.push('patterns');
// Determine overall experience
const goodAnswers = [
W.quizAnswers.q1 === 'b',
W.quizAnswers.q2 === 'b',
W.quizAnswers.q3 === 'a',
].filter(Boolean).length;
let experienceLevel;
if (goodAnswers === 3) experienceLevel = 'experienced';
else if (goodAnswers >= 1) experienceLevel = 'some';
else experienceLevel = 'beginner';
return { weak, experienceLevel };
}
/* ── Complete onboarding ── */
function completeOnboarding() {
const { weak, experienceLevel } = calcWeakAreas();
const user = ob.complete({
targetCompany: W.targetCompany,
targetLevel: W.targetLevel,
timeline: W.timeline,
experienceLevel,
weakAreas: weak,
});
// Hide wizard card, show success
document.getElementById('onb-card').style.display = 'none';
document.getElementById('progress-dots').style.display = 'none';
showSuccess(user);
}
function showSuccess(user) {
const screen = document.getElementById('success-screen');
screen.classList.add('visible');
const company = ob.getCompany(user.targetCompany);
const levelObj = ob.LEVELS.find(l => l.id === user.targetLevel) || ob.LEVELS[0];
const tl = ob.TIMELINES.find(t => t.id === user.timeline) || ob.TIMELINES[2];
const firstFocus = user.weakAreas.length
? ({ foundations:'Scalability Fundamentals', storage:'Storage Systems', patterns:'Design Patterns', interview:'Interview Skills', systems:'Real Systems' }[user.weakAreas[0]] || 'Foundations')
: 'Foundations';
document.getElementById('success-plan').innerHTML = `
<div class="success-plan-title">Your personalised plan</div>
<div class="success-plan-rows">
<div class="success-plan-row">
<div class="success-plan-icon">${company.emoji}</div>
<div>
<div class="success-plan-row-label">Target Company</div>
<div class="success-plan-row-val">${company.name} — ${levelObj.label}</div>
</div>
</div>
<div class="success-plan-row">
<div class="success-plan-icon">📅</div>
<div>
<div class="success-plan-row-label">Interview Timeline</div>
<div class="success-plan-row-val">${tl.label} · ${user.daysToInterview} days to go</div>
</div>
</div>
<div class="success-plan-row">
<div class="success-plan-icon">🎯</div>
<div>
<div class="success-plan-row-label">Starting Focus</div>
<div class="success-plan-row-val">${firstFocus}</div>
</div>
</div>
</div>
`;
screen.scrollIntoView({ behavior: 'smooth', block: 'center' });
}
function skipOnboarding() {
// Create minimal user profile and redirect
const user = ob.complete({
targetCompany: 'other',
targetLevel: 'mid',
timeline: '2m',
experienceLevel: 'some',
weakAreas: [],
});
window.location.href = 'index.html';
}
/* Redirect if already onboarded */
if (ob.isComplete()) {
window.location.href = 'index.html';
}
</script>
<script src="js/auth/firebase-init.js"></script>
</body>
</html>