Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
856 lines (817 loc) · 32.5 KB
/
Copy pathindex.html
File metadata and controls
856 lines (817 loc) · 32.5 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
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
<!doctype html>
<html lang="fa" dir="rtl">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>دورهٔ رایگان مهندسی داده و هوش مصنوعی</title>
<meta
name="description"
content="دورهٔ رایگان و آنلاین مهندسی داده و هوش مصنوعی. فرم را پر کنید تا در تلگرام با شما در تماس باشیم."
/>
<meta name="theme-color" content="#f7f3ed" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Vazirmatn:wght@400;500;600;700&display=swap"
/>
<style>
/* ---------------------------------------------------------------------
Editorial cream + ink + one warm signal-orange accent. Light default,
dark via prefers-color-scheme.
--------------------------------------------------------------------- */
:root {
color-scheme: light;
--bg: #f7f3ed;
--bg-elevated: #faf6f0;
--bg-soft: #efe8dd;
--bg-inset: #e8ddd0;
--fg: #1a1715;
--fg-muted: #5c544c;
--fg-subtle: #8b8278;
--rule: #d8cfc3;
--rule-strong: #b8aea3;
--accent: #cc5500;
--accent-soft: #fcd9bd;
--accent-ink: #7a3500;
--selection: #ffd9b3;
--sink: #15803d;
--font-sans: "Vazirmatn", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
--font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
margin: 0;
min-height: 100dvh;
background: var(--bg);
color: var(--fg);
font-family: var(--font-sans);
line-height: 1.5;
background-image: repeating-linear-gradient(
135deg,
transparent 0 7px,
color-mix(in srgb, var(--fg) 1.6%, transparent) 7px 8px
);
}
::selection { background: var(--selection); color: var(--fg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
#stream-bg {
position: fixed;
inset: 0;
z-index: -1;
width: 100%;
height: 100%;
pointer-events: none;
}
.wrap { max-width: 62rem; margin: 0 auto; padding: 0 1.5rem; }
/* Terminal-log eyebrow */
.log-line {
display: inline-flex;
flex-wrap: wrap;
align-items: center;
gap: 0.625rem;
font-family: var(--font-mono);
font-size: 0.75rem;
color: var(--fg-muted);
}
.log-line .stage { color: var(--accent); font-weight: 600; letter-spacing: 0.04em; }
.log-line .prompt { color: var(--fg-subtle); }
.log-line .cmd { color: var(--fg); font-weight: 500; }
/* Live pulse dot */
.dot-pulse {
position: relative;
display: inline-block;
width: 0.5rem;
height: 0.5rem;
border-radius: 50%;
background: var(--accent);
}
.dot-pulse::after {
content: "";
position: absolute;
inset: -3px;
border-radius: 50%;
background: var(--accent);
opacity: 0.35;
animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
0% { transform: scale(0.6); opacity: 0.45; }
100% { transform: scale(2.4); opacity: 0; }
}
/* Cornered-frame panel */
.frame {
position: relative;
background: var(--bg-elevated);
border: 1px solid var(--rule);
padding: 1.5rem;
}
.frame::before,
.frame::after {
content: "";
position: absolute;
width: 10px;
height: 10px;
border-color: var(--accent);
border-style: solid;
border-width: 0;
}
.frame::before { top: -1px; left: -1px; border-top-width: 1.5px; border-left-width: 1.5px; }
.frame::after { bottom: -1px; right: -1px; border-bottom-width: 1.5px; border-right-width: 1.5px; }
/* Hero */
.hero { padding: 5rem 0 3.5rem; }
.status {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 0.5rem 1.25rem;
margin-bottom: 2.5rem;
font-size: 0.9rem;
color: var(--fg-subtle);
}
.status .live { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--fg-muted); }
.status b { color: var(--fg); font-weight: 500; }
.eyebrow {
font-size: 0.75rem;
letter-spacing: 0.08em;
color: var(--fg-subtle);
margin: 0 0 1rem;
}
h1 {
margin: 0;
max-width: 20ch;
font-size: clamp(2.5rem, 7vw, 4.5rem);
font-weight: 700;
line-height: 1.15;
letter-spacing: -0.01em;
}
h1 .accent { color: var(--accent); }
.lead {
margin: 1.5rem 0 0;
max-width: 52ch;
font-size: clamp(1.05rem, 2.5vw, 1.2rem);
color: var(--fg-muted);
line-height: 1.9;
}
.lead b { color: var(--fg); font-weight: 600; }
/* Enroll section */
.enroll { padding: 0 0 6rem; }
.enroll-head {
display: flex;
align-items: center;
gap: 1rem;
margin-bottom: 1.25rem;
}
.enroll-head .cap { font-size: 0.75rem; color: var(--fg-subtle); }
.enroll .frame { max-width: 40rem; }
/* Participants & mentors */
.soon { padding: 0 0 6rem; }
.roster {
display: flex;
flex-direction: column;
gap: 2.5rem;
max-width: 40rem;
}
.soon h2 {
margin: 0 0 1rem;
font-size: clamp(1.35rem, 3.5vw, 1.75rem);
font-weight: 700;
}
.people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.person {
display: flex;
align-items: center;
justify-content: flex-start;
gap: 0.9rem;
padding: 0.9rem 1.15rem;
background: var(--bg-elevated);
border: 1px solid var(--rule);
border-radius: 4px;
}
.person .p-id { flex: 1; }
.roster-note {
margin: 0 0 1.5rem;
font-size: 0.9rem;
color: var(--fg-muted);
}
.roster-note code {
font-family: var(--font-mono);
font-size: 0.82em;
color: var(--accent-ink);
background: var(--accent-soft);
padding: 0.05rem 0.35rem;
border-radius: 3px;
}
.people-loading { list-style: none; color: var(--fg-subtle); font-size: 0.9rem; }
.inline-link { color: var(--accent-ink); text-underline-offset: 3px; }
.inline-link:hover { color: var(--accent); }
.site-foot {
padding: 2rem 0 3rem;
border-top: 1px solid var(--rule);
}
.site-foot a {
display: inline-flex;
align-items: center;
gap: 0.5rem;
font-family: var(--font-mono);
font-size: 0.8rem;
color: var(--fg-subtle);
text-decoration: none;
transition: color 0.15s ease;
}
.site-foot a:hover { color: var(--accent); }
.p-id { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.avatar {
flex: none;
width: 2.4rem;
height: 2.4rem;
border-radius: 50%;
overflow: hidden;
display: inline-flex;
align-items: center;
justify-content: center;
background: var(--bg-soft);
border: 1px solid var(--rule);
color: var(--fg-muted);
font-family: var(--font-mono);
font-size: 0.8rem;
font-weight: 600;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-name { font-weight: 600; }
.soon h2 .h2-note { font-size: 0.8rem; font-weight: 400; color: var(--fg-subtle); }
.p-link {
flex: none;
display: inline-flex;
align-items: center;
justify-content: center;
color: var(--accent-ink);
background: var(--accent-soft);
border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
border-radius: 4px;
padding: 0.4rem;
line-height: 0;
text-decoration: none;
transition: background 0.15s ease;
}
.p-link:hover { background: color-mix(in srgb, var(--accent) 22%, var(--accent-soft)); }
.p-link svg { display: block; }
.p-cv { font: inherit; cursor: pointer; }
.p-actions { flex: none; display: flex; align-items: center; gap: 0.5rem; }
/* Résumé modal */
.modal {
position: fixed;
inset: 0;
z-index: 100;
display: flex;
align-items: center;
justify-content: center;
padding: 1.25rem;
}
/* The `.modal` display:flex above outranks the UA [hidden] rule, so the
hidden state must be reasserted here or the modal never hides. */
.modal[hidden] { display: none; }
.modal-backdrop {
position: absolute;
inset: 0;
background: color-mix(in srgb, #000 55%, transparent);
}
.modal-card {
position: relative;
z-index: 1;
width: 100%;
max-width: 34rem;
max-height: 85vh;
overflow-y: auto;
background: var(--bg-elevated);
border: 1px solid var(--rule);
border-radius: 6px;
padding: 1.75rem;
box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.4);
}
.modal-close {
position: absolute;
top: 0.75rem;
left: 0.75rem;
width: 2rem;
height: 2rem;
display: inline-flex;
align-items: center;
justify-content: center;
background: var(--bg-soft);
border: 1px solid var(--rule);
border-radius: 4px;
color: var(--fg-muted);
cursor: pointer;
font-size: 0.85rem;
}
.modal-close:hover { color: var(--accent); border-color: var(--accent); }
.modal-card h3 { margin: 0 0 0.5rem; font-size: 1.4rem; padding-inline-end: 2.5rem; }
.modal-section { margin-top: 1.5rem; }
.modal-section h4 { margin: 0 0 0.6rem; font-size: 0.95rem; color: var(--accent-ink); }
.modal-section ul {
margin: 0;
padding-inline-start: 1.15rem;
display: flex;
flex-direction: column;
gap: 0.4rem;
color: var(--fg-muted);
font-size: 0.92rem;
line-height: 1.7;
}
.soon-box {
display: flex;
align-items: center;
justify-content: center;
gap: 0.6rem;
padding: 2.5rem 1.5rem;
color: var(--fg-muted);
font-size: 1.05rem;
}
.field {
display: flex;
flex-direction: column;
gap: 0.4rem;
margin: 0 0 1.25rem;
border: 0;
padding: 0;
}
.field label,
.field legend { font-size: 0.9rem; font-weight: 500; color: var(--fg); }
.req { color: var(--accent); }
.opt-tag { color: var(--fg-subtle); font-weight: 400; font-size: 0.8rem; }
#enroll-form input[type="text"],
#enroll-form input[type="tel"] {
width: 100%;
padding: 0.7rem 0.85rem;
font: inherit;
color: var(--fg);
background: var(--bg);
border: 1px solid var(--rule-strong);
border-radius: 4px;
transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
#enroll-form input[type="text"]:focus,
#enroll-form input[type="tel"]:focus {
outline: none;
border-color: var(--accent);
box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.opts { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.opt {
display: inline-flex;
align-items: center;
gap: 0.45rem;
padding: 0.5rem 0.85rem;
font-size: 0.9rem;
color: var(--fg-muted);
background: var(--bg-soft);
border: 1px solid var(--rule);
border-radius: 4px;
cursor: pointer;
}
.opt:has(input:checked) {
color: var(--accent-ink);
background: var(--accent-soft);
border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.opt input { accent-color: var(--accent); width: 1rem; height: 1rem; }
.other-text { flex: 1 1 12rem; min-width: 10rem; }
.other-text:disabled { opacity: 0.45; cursor: not-allowed; }
.actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.75rem; }
#f-submit {
font: inherit;
font-weight: 600;
color: #fff;
background: var(--accent);
border: 1px solid var(--accent);
border-radius: 4px;
padding: 0.7rem 1.6rem;
cursor: pointer;
transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
#f-submit:hover:not(:disabled) {
transform: translateY(-2px);
box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 40%, transparent);
}
#f-submit:disabled { opacity: 0.6; cursor: default; }
.msg { font-size: 0.95rem; margin: 1rem 0 0; }
.msg.ok { color: var(--sink); font-weight: 500; }
.msg.err { color: #c0392b; }
@media (prefers-reduced-motion: reduce) {
.dot-pulse::after { animation: none; }
html { scroll-behavior: auto; }
}
</style>
</head>
<body>
<canvas id="stream-bg" aria-hidden="true"></canvas>
<main class="wrap">
<section class="hero">
<div class="status">
<span class="live"><span class="dot-pulse" aria-hidden="true"></span> ثبتنام باز است</span>
<span><b>رایگان</b></span>
<span>آنلاین</span>
<span>مهلت ثبتنام تا <b>۳ مهر ۱۴۰۵</b></span>
</div>
<p class="eyebrow">دورهٔ رایگان مهندسی داده و هوش مصنوعی</p>
<h1>مهندسی داده و مهندسی هوش مصنوعی، <span class="accent">رایگان</span>.</h1>
<p class="lead">
این دوره رایگانه و قراره به صورت آنلاین برگزار شه. برای اینکه اطلاعاتی
راجعبه شما داشته باشیم، لطفا فرم زیر رو پر کنید تا باهاتون تو
<b>تلگرام</b> در تماس باشیم.
</p>
</section>
<section class="enroll">
<div class="enroll-head">
<span class="log-line" dir="ltr">
<span class="stage">[ENROLL]</span>
<span class="prompt">$</span>
<span class="cmd">./enroll --write google-form</span>
</span>
<span class="cap">مهلت ثبتنام تا ۳ مهر ۱۴۰۵ · ظرفیت محدود</span>
</div>
<div class="frame">
<form id="enroll-form" novalidate>
<div class="field">
<label for="f-name">نام و نامخانوادگی <span class="req">*</span></label>
<input id="f-name" type="text" required autocomplete="name" />
</div>
<div class="field">
<label for="f-phone">شماره تماس <span class="req">*</span></label>
<input id="f-phone" type="tel" inputmode="tel" required autocomplete="tel" dir="ltr" />
</div>
<div class="field">
<label for="f-telegram">آیدی تلگرام <span class="req">*</span></label>
<input id="f-telegram" type="text" required placeholder="@username" dir="ltr" />
</div>
<fieldset class="field">
<legend>وضعیت کار / تحصیل <span class="req">*</span></legend>
<div class="opts">
<label class="opt"><input type="checkbox" name="status" value="دانشجو" /><span>دانشجو</span></label>
<label class="opt"><input type="checkbox" name="status" value="کارمند" /><span>کارمند</span></label>
<label class="opt"><input type="checkbox" name="status" value="کار و تحصیل همزمان" /><span>کار و تحصیل همزمان</span></label>
<label class="opt"><input type="checkbox" name="status" value="__other__" id="f-status-other" /><span>غیره</span></label>
<input id="f-status-other-text" type="text" class="other-text" placeholder="توضیح دهید…" disabled />
</div>
</fieldset>
<div class="field">
<label for="f-goal">هدف از شرکت در دوره <span class="opt-tag">(اختیاری، در حد یک خط)</span></label>
<input id="f-goal" type="text" />
</div>
<div class="actions">
<button type="submit" id="f-submit">ثبتنام</button>
</div>
</form>
<!-- Outside the form so it stays visible after the form is hidden -->
<p id="f-msg" class="msg" role="status" aria-live="polite" hidden></p>
</div>
</section>
<section class="soon">
<div class="enroll-head">
<span class="log-line" dir="ltr">
<span class="stage">[TEAM]</span>
<span class="prompt">$</span>
<span class="cmd">./roster --list</span>
</span>
</div>
<p class="roster-note">
میخوای اسمت اینجا باشه؟ کافیه یک ورودی به
<code dir="ltr">data/people.json</code> اضافه کنی و یک
<a
class="inline-link"
href="https://github.com/mostafaghadimi/data-course"
target="_blank"
rel="noopener"
dir="ltr"
>Pull Request</a> بزنی.
</p>
<div class="roster">
<div class="roster-col">
<h2>منتورها <span class="h2-note">(در حال تکمیل)</span></h2>
<ul class="people" id="mentors"><li class="people-loading">در حال بارگذاری…</li></ul>
</div>
<div class="roster-col">
<h2>شرکتکنندهها</h2>
<ul class="people" id="participants"><li class="people-loading">در حال بارگذاری…</li></ul>
</div>
</div>
</section>
<footer class="site-foot">
<a
href="https://github.com/mostafaghadimi/data-course"
target="_blank"
rel="noopener"
dir="ltr"
>
<svg viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true">
<path d="M12 .5A11.5 11.5 0 0 0 .5 12a11.5 11.5 0 0 0 7.86 10.92c.58.1.79-.25.79-.56v-2c-3.2.7-3.88-1.37-3.88-1.37-.53-1.34-1.3-1.7-1.3-1.7-1.05-.72.08-.71.08-.71 1.17.08 1.78 1.2 1.78 1.2 1.04 1.78 2.73 1.27 3.4.97.1-.75.4-1.27.73-1.56-2.55-.29-5.24-1.28-5.24-5.7 0-1.26.45-2.29 1.2-3.1-.13-.29-.52-1.46.11-3.05 0 0 .97-.31 3.18 1.18a11 11 0 0 1 5.8 0c2.2-1.5 3.17-1.18 3.17-1.18.63 1.59.24 2.76.12 3.05.74.81 1.19 1.84 1.19 3.1 0 4.43-2.69 5.4-5.25 5.69.41.36.78 1.05.78 2.12v3.14c0 .31.21.67.8.56A11.5 11.5 0 0 0 23.5 12 11.5 11.5 0 0 0 12 .5z"/>
</svg>
github.com/mostafaghadimi/data-course
</a>
</footer>
</main>
<div id="cv-modal" class="modal" dir="rtl" hidden>
<div class="modal-backdrop" data-close></div>
<div class="modal-card" role="dialog" aria-modal="true" aria-labelledby="cv-name">
<button type="button" class="modal-close" data-close aria-label="بستن">✕</button>
<h3 id="cv-name"></h3>
<div class="modal-section" id="cv-edu-wrap">
<h4>سوابق تحصیلی</h4>
<ul id="cv-edu"></ul>
</div>
<div class="modal-section" id="cv-exp-wrap">
<h4>سوابق کاری</h4>
<ul id="cv-exp"></ul>
</div>
</div>
</div>
<script>
// Native enrollment form → posts straight to the Google Form response
// endpoint (no iframe). Field IDs were read from the live form; if you
// edit the form's questions in Google, update these to match.
(function () {
var FORM_ACTION =
"https://docs.google.com/forms/d/e/1FAIpQLSebdPq51OF-6Jw9yp2wgp_v1jgHBxOv-mcJHW-J4f-tCT1BEQ/formResponse";
var ENTRY = {
name: "entry.1428347690",
phone: "entry.131263601",
status: "entry.1278425926",
telegram: "entry.682448012",
goal: "entry.1101898098",
};
var form = document.getElementById("enroll-form");
if (!form) return;
var msg = document.getElementById("f-msg");
var btn = document.getElementById("f-submit");
var otherBox = document.getElementById("f-status-other");
var otherText = document.getElementById("f-status-other-text");
var $ = function (id) { return document.getElementById(id); };
otherBox.addEventListener("change", function () {
otherText.disabled = !otherBox.checked;
if (otherBox.checked) otherText.focus();
});
// Pure: map collected values → the querystring Google's endpoint expects.
function buildBody(v) {
var p = new URLSearchParams();
p.append(ENTRY.name, v.name);
p.append(ENTRY.phone, v.phone);
p.append(ENTRY.telegram, v.telegram);
if (v.goal) p.append(ENTRY.goal, v.goal);
for (var i = 0; i < v.status.length; i++) p.append(ENTRY.status, v.status[i]);
if (v.otherText) {
p.append(ENTRY.status, "__other_option__");
p.append(ENTRY.status + ".other_option_response", v.otherText);
}
return p.toString();
}
function collect() {
var checked = Array.prototype.slice.call(
form.querySelectorAll('input[name="status"]:checked')
);
var status = checked.map(function (c) { return c.value; })
.filter(function (x) { return x !== "__other__"; });
return {
name: $("f-name").value.trim(),
phone: $("f-phone").value.trim(),
telegram: $("f-telegram").value.trim(),
goal: $("f-goal").value.trim(),
status: status,
otherText: otherBox.checked ? otherText.value.trim() : "",
};
}
function show(text, ok) {
msg.hidden = false;
msg.textContent = text;
msg.classList.toggle("ok", !!ok);
msg.classList.toggle("err", !ok);
}
form.addEventListener("submit", async function (e) {
e.preventDefault();
var v = collect();
if (!v.name || !v.phone || !v.telegram) {
show("لطفاً نام، شماره تماس و آیدی تلگرام را کامل کنید.", false);
return;
}
if (v.status.length === 0 && !v.otherText) {
show("لطفاً وضعیت کار/تحصیل را انتخاب کنید.", false);
return;
}
btn.disabled = true;
var prev = btn.textContent;
btn.textContent = "در حال ارسال…";
try {
// no-cors: Google returns an opaque response but records the entry.
await fetch(FORM_ACTION, {
method: "POST",
mode: "no-cors",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: buildBody(v),
});
form.hidden = true;
show("ثبتنام شما انجام شد ✓ بهزودی در تلگرام با شما در تماس خواهیم بود.", true);
} catch (_) {
btn.disabled = false;
btn.textContent = prev;
show("ارسال ناموفق بود. اتصال اینترنت را بررسی کنید و دوباره تلاش کنید.", false);
}
});
// Tiny self-check for the body builder — visit ?selftest to run it.
if (location.search.indexOf("selftest") !== -1) {
var b = buildBody({ name: "a", phone: "1", telegram: "@t", goal: "", status: ["دانشجو"], otherText: "x" });
var esc = ENTRY.status.replace(/\./g, "\\.");
console.assert(b.indexOf(ENTRY.name + "=a") !== -1, "name missing");
console.assert((b.match(new RegExp(esc + "=", "g")) || []).length === 2, "status+other should send two values");
console.assert(b.indexOf(".other_option_response=x") !== -1, "other text missing");
console.assert(b.indexOf(ENTRY.goal + "=") === -1, "empty goal should be omitted");
console.log("selftest ok");
}
})();
// Mentors & participants are rendered from data/people.json so anyone
// can add themselves with a one-line Pull Request — no HTML needed.
(function () {
var COMING = "بهزودی";
function initials(name) {
return (name || "?").trim().split(/\s+/).slice(0, 2)
.map(function (w) { return w.charAt(0); }).join("");
}
function avatar(p) {
var el = document.createElement("span");
el.className = "avatar";
if (p.avatar) {
var img = document.createElement("img");
img.src = p.avatar;
img.alt = p.name || "";
img.loading = "lazy";
img.onerror = function () { img.remove(); el.textContent = initials(p.name); };
el.appendChild(img);
} else {
el.textContent = initials(p.name);
}
return el;
}
function card(p) {
var li = document.createElement("li");
li.className = "person";
var id = document.createElement("span");
id.className = "p-id";
id.appendChild(avatar(p));
var name = document.createElement("span");
name.className = "p-name";
name.textContent = p.name || "";
id.appendChild(name);
li.appendChild(id);
var actions = document.createElement("span");
actions.className = "p-actions";
if (p.linkedin) {
var a = document.createElement("a");
a.className = "p-link";
a.href = p.linkedin;
a.target = "_blank";
a.rel = "noopener";
a.setAttribute("aria-label", "LinkedIn");
a.title = "LinkedIn";
a.innerHTML =
'<svg viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true">' +
'<path d="M20.45 20.45h-3.56v-5.57c0-1.33-.03-3.04-1.85-3.04-1.86 0-2.14 1.45-2.14 2.94v5.67H9.35V9h3.42v1.56h.05c.48-.9 1.64-1.85 3.37-1.85 3.6 0 4.27 2.37 4.27 5.46v6.28zM5.34 7.43a2.06 2.06 0 1 1 0-4.13 2.06 2.06 0 0 1 0 4.13zM7.12 20.45H3.56V9h3.56v11.45zM22.22 0H1.77C.79 0 0 .77 0 1.72v20.56C0 23.23.79 24 1.77 24h20.45c.98 0 1.78-.77 1.78-1.72V1.72C24 .77 23.2 0 22.22 0z"/>' +
"</svg>";
actions.appendChild(a);
}
var hasCv = (p.education && p.education.length) || (p.experience && p.experience.length);
if (hasCv) {
var cv = document.createElement("button");
cv.type = "button";
cv.className = "p-link p-cv";
cv.setAttribute("aria-label", "سوابق");
cv.title = "سوابق تحصیلی و کاری";
cv.innerHTML =
'<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">' +
'<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><path d="M14 2v6h6"/><path d="M8 13h8M8 17h6"/>' +
"</svg>";
cv.addEventListener("click", function () { openCv(p); });
actions.appendChild(cv);
}
if (actions.childNodes.length) li.appendChild(actions);
return li;
}
function fill(el, list) {
if (!el) return;
el.innerHTML = "";
if (!list || !list.length) {
var box = document.createElement("li");
box.className = "frame soon-box";
var dot = document.createElement("span");
dot.className = "dot-pulse";
var t = document.createElement("span");
t.textContent = COMING;
box.appendChild(dot);
box.appendChild(t);
el.appendChild(box);
return;
}
list.forEach(function (p) { el.appendChild(card(p)); });
}
// Résumé modal — education + work history, opened from a person card.
var modal = document.getElementById("cv-modal");
function fillCv(ul, wrap, items) {
ul.innerHTML = "";
if (!items || !items.length) { wrap.hidden = true; return; }
wrap.hidden = false;
items.forEach(function (t) {
var li = document.createElement("li");
li.textContent = t;
ul.appendChild(li);
});
}
function openCv(p) {
document.getElementById("cv-name").textContent = p.name || "";
fillCv(document.getElementById("cv-edu"), document.getElementById("cv-edu-wrap"), p.education);
fillCv(document.getElementById("cv-exp"), document.getElementById("cv-exp-wrap"), p.experience);
modal.hidden = false;
document.body.style.overflow = "hidden";
}
function closeCv() {
modal.hidden = true;
document.body.style.overflow = "";
}
if (modal) {
modal.addEventListener("click", function (e) {
if (e.target.hasAttribute("data-close")) closeCv();
});
document.addEventListener("keydown", function (e) {
if (e.key === "Escape" && !modal.hidden) closeCv();
});
}
fetch("data/people.json", { cache: "no-cache" })
.then(function (r) { return r.json(); })
.then(function (d) {
fill(document.getElementById("mentors"), d.mentors);
fill(document.getElementById("participants"), d.participants);
})
.catch(function () {
fill(document.getElementById("mentors"), []);
fill(document.getElementById("participants"), []);
});
})();
// Ambient event-stream background: slow drifting dots. ~0 CPU, respects
// prefers-reduced-motion, re-reads the accent so dark mode swaps for free.
(function () {
var canvas = document.getElementById("stream-bg");
if (!canvas) return;
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
var ctx = canvas.getContext("2d", { alpha: true });
if (!ctx) return;
var width = 0, height = 0, dpr = 1, raf = 0;
var particles = [];
function resize() {
dpr = Math.min(window.devicePixelRatio || 1, 1.5);
width = window.innerWidth;
height = window.innerHeight;
canvas.width = Math.floor(width * dpr);
canvas.height = Math.floor(height * dpr);
ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
}
function seed() {
var count = Math.max(40, Math.min(110, Math.floor((width * height) / 22000)));
particles.length = 0;
for (var i = 0; i < count; i++) {
particles.push({
x: Math.random() * width,
y: Math.random() * height,
v: 0.1 + Math.random() * 0.35,
r: 0.6 + Math.random() * 1.6,
a: 0.05 + Math.random() * 0.2,
});
}
}
function accent() {
return (getComputedStyle(document.documentElement).getPropertyValue("--accent") || "#cc5500").trim();
}
var color = accent();
function draw() {
ctx.clearRect(0, 0, width, height);
ctx.fillStyle = color;
for (var i = 0; i < particles.length; i++) {
var p = particles[i];
p.x += p.v;
if (p.x - p.r > width) { p.x = -p.r; p.y = Math.random() * height; }
ctx.globalAlpha = p.a;
ctx.beginPath();
ctx.arc(p.x, p.y, p.r, 0, Math.PI * 2);
ctx.fill();
}
ctx.globalAlpha = 1;
raf = requestAnimationFrame(draw);
}
window.addEventListener("resize", function () { resize(); seed(); });
window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", function () {
color = accent();
});
resize();
seed();
raf = requestAnimationFrame(draw);
})();
</script>
</body>
</html>