-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.html
More file actions
1261 lines (1154 loc) · 42.6 KB
/
Copy pathindex.html
File metadata and controls
1261 lines (1154 loc) · 42.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
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
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cairo University CE 2026 — Class Archive</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,300;0,400;0,700;1,400&display=swap" rel="stylesheet">
<style>
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
:root{
--g:#4bff91;--gd:#2a7a50;--gb:#9effc0;
--a:#1793d1;--ad:#0e5a91;
--m:#3a5a3a;--bg:#0c0f0c;--tx:#b8ccb8;
--y:#f0c060;--w:#e8f0e8;--r:#ff6060;
}
html,body{min-height:100%;background:var(--bg);color:var(--tx);
font-family:'JetBrains Mono',monospace;font-size:14px;line-height:1.6;overflow-x:hidden}
#wm{
position:fixed;top:50%;left:50%;
transform:translate(-50%,-50%);
width:min(52vw,52vh);
height:auto;
opacity:0.08;
pointer-events:none;
z-index:0;
user-select:none;
filter:grayscale(30%) brightness(1.4);
}
body::after{content:'';position:fixed;inset:0;pointer-events:none;z-index:999;
background:repeating-linear-gradient(0deg,transparent,transparent 2px,rgba(0,0,0,.07) 2px,rgba(0,0,0,.07) 4px)}
#terminal{position:relative;z-index:1;max-width:960px;margin:0 auto;
padding:2rem 1.5rem 6rem;min-height:100vh;cursor:text}
.dim{color:var(--m)}.g{color:var(--g)}.gb{color:var(--gb)}.a{color:var(--a)}
.y{color:var(--y)}.w{color:var(--w)}.r{color:var(--r)}.tx{color:var(--tx)}
.ln{display:block;white-space:pre-wrap;word-break:break-word;min-height:1.2em}
.pu{color:var(--a);font-weight:700}.ph{color:var(--g);font-weight:700}
.pp{color:var(--gd)}.ps{color:var(--tx)}
#irow{display:flex;align-items:center;margin-top:.15rem}
#irow .pb{flex-shrink:0;white-space:nowrap}
#iw{position:relative;flex:1;display:flex;align-items:center;min-width:0;overflow:hidden}
#ghost{position:absolute;left:0;top:0;bottom:0;white-space:pre;
pointer-events:none;font:inherit;line-height:inherit}
#ci{position:relative;z-index:2;background:transparent;border:none;outline:none;
color:var(--w);font:inherit;width:100%;caret-color:var(--g);padding:0}
.cmps{display:flex;flex-wrap:wrap;gap:.1rem 1.5rem;margin:.25rem 0}
.cmp{color:var(--a)}
.card{border:1px solid var(--gd);padding:1.5rem;margin:.4rem 0;
position:relative;background:rgba(0,8,0,.5)}
.card::before{content:'/* profile.json */';position:absolute;top:-.55rem;left:1rem;
background:var(--bg);padding:0 .5rem;color:var(--m);font-size:11px}
.ch{display:flex;gap:1.25rem;align-items:flex-start;margin-bottom:1.2rem}
.av{width:90px;height:90px;flex-shrink:0;border:1px solid var(--gd);
background:#081008;display:flex;align-items:center;justify-content:center;overflow:hidden}
.av img{width:100%;height:100%;object-fit:cover;display:block}
.av-i{font-size:1.7rem;font-weight:700;color:var(--gd)}
.cn{font-size:1.25rem;font-weight:700;color:var(--gb);line-height:1.2}
.ct{color:var(--tx);font-style:italic;font-size:13px;margin-top:.25rem}
.cp{font-size:11px;color:var(--m);margin-top:.4rem}
.fds{display:grid;gap:.4rem;margin-bottom:.9rem}
.fd{display:grid;grid-template-columns:185px 1fr;gap:.25rem 1rem;align-items:baseline}
.fk{color:var(--a);text-align:right}.fk::after{content:':'}
.fv{color:var(--tx)}
.tag{display:inline-block;border:1px solid var(--gd);color:var(--g);
padding:0 6px;font-size:12px;margin:1px 2px 1px 0}
.div{border:none;border-top:1px solid var(--gd);margin:1rem 0;opacity:.3}
.ql{border-left:2px solid var(--gd);padding:.1rem 0 .1rem 1rem;
color:var(--y);font-style:italic;font-size:13px;margin-bottom:.9rem}
.ml{border-left:2px solid var(--ad);padding:.1rem 0 .1rem 1rem;font-size:13px;margin-bottom:.9rem}
.sl{font-size:11px;color:var(--m);margin-bottom:.25rem}
.lnk{color:var(--a);text-decoration:none;margin-right:.75rem}
.lnk:hover{text-decoration:underline}
.nf{display:flex;gap:2rem;align-items:flex-start;margin:.3rem 0}
.nfl{color:var(--a);line-height:1.4;flex-shrink:0;font-size:13px;white-space:pre}
.nfi .nr{display:flex;gap:.5rem}
.nk{color:var(--a);font-weight:700}.nv{color:var(--gb)}
.ncs{margin-top:.5rem;display:flex}
.nc{width:20px;height:14px;display:inline-block}
.pg{display:flex;flex-wrap:wrap;gap:.1rem 1.6rem;margin:.3rem 0}
.pf{color:var(--a);cursor:pointer}.pf:hover{text-decoration:underline}
.pfd{color:var(--m);cursor:default}
.countdown-wrap{display:flex;justify-content:center;margin:.8rem 0 1.1rem}
.countdown-shell{
width:min(920px,100%);
border:1px solid var(--a);
background:
linear-gradient(140deg,rgba(23,147,209,.15),rgba(75,255,145,.08)),
rgba(2,12,10,.68);
box-shadow:0 0 0 1px rgba(75,255,145,.24) inset,0 0 28px rgba(23,147,209,.16);
padding:1rem 1rem 1.25rem;
position:relative;
overflow:hidden;
animation:countIn .45s ease-out both;
}
.countdown-shell::before{
content:'';
position:absolute;
inset:0;
background:linear-gradient(120deg,transparent 0%,rgba(158,255,192,.08) 48%,transparent 60%);
transform:translateX(-110%);
animation:sweep 6.5s linear infinite;
pointer-events:none;
}
.countdown-top{display:flex;justify-content:space-between;align-items:baseline;gap:1rem;position:relative;z-index:1}
.countdown-title{font-size:clamp(1rem,2.7vw,1.55rem);font-weight:700;letter-spacing:.07em;color:var(--gb);text-transform:uppercase}
.countdown-target{font-size:12px;color:var(--a)}
.countdown-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.65rem;margin-top:.85rem;position:relative;z-index:1}
.countdown-cell{
border:1px solid var(--gd);
background:rgba(4,20,12,.72);
text-align:center;
padding:.8rem .35rem;
}
.countdown-cell.tick .countdown-num{animation:pop .24s ease-out}
.countdown-num{display:block;font-size:clamp(1.85rem,7.2vw,3.65rem);line-height:1;font-weight:700;color:var(--gb);text-shadow:0 0 18px rgba(75,255,145,.24)}
.countdown-lab{display:block;margin-top:.28rem;font-size:11px;color:var(--a);text-transform:uppercase;letter-spacing:.11em}
.countdown-msg{
min-height:1.6em;
margin-top:.95rem;
text-align:center;
font-size:clamp(1rem,2.3vw,1.45rem);
color:var(--y);
position:relative;
z-index:1;
}
.countdown-shell.done .countdown-grid{display:none}
.countdown-shell.done .countdown-msg{
margin-top:.85rem;
color:var(--gb);
font-size:clamp(1.15rem,3.8vw,2.45rem);
font-weight:700;
animation:successPulse 1.6s ease-in-out infinite;
}
@keyframes countIn{
from{opacity:0;transform:translateY(10px) scale(.99)}
to{opacity:1;transform:translateY(0) scale(1)}
}
@keyframes sweep{
from{transform:translateX(-110%)}
to{transform:translateX(120%)}
}
@keyframes pop{
0%{transform:translateY(2px) scale(.97);opacity:.72}
100%{transform:translateY(0) scale(1);opacity:1}
}
@keyframes successPulse{
0%,100%{text-shadow:0 0 0 rgba(158,255,192,0)}
50%{text-shadow:0 0 16px rgba(158,255,192,.36)}
}
@media(max-width:600px){
.fd{grid-template-columns:1fr}.fk{text-align:left}
.ch{flex-direction:column}
#terminal{padding:1rem .75rem 5rem}
.nf{flex-direction:column;gap:.5rem}
.countdown-top{flex-direction:column;align-items:flex-start;gap:.22rem}
.countdown-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:.5rem}
}
</style>
</head>
<body>
<img id="wm" src="assets/arch-logo.png" alt="" aria-hidden="true">
<div id="terminal"><div id="output"></div></div>
<script>
let ENTRIES=[];
let PROFILES={};
let FOLDERS=[];
const ALL_CMDS=['help','ls','cat','clear','whoami','neofetch','countdown','think','grep','pwd','echo','exit','quit'];
const TOTAL_CLASSMATES=64;
const GRADUATION_AT=new Date(2026,6,2,15,0,0,0).getTime();
let countdownTicker=null;
function toDisplayNameFromFolder(folder){
return folder
.replace(/[-_]+/g,' ')
.replace(/\s+/g,' ')
.trim()
.replace(/\b\w/g,ch=>ch.toUpperCase());
}
function normalizeProfile(folder, raw){
const src=(raw&&typeof raw==='object')?raw:{};
const linksSrc=(src.links&&typeof src.links==='object')?src.links:{};
const links=Object.fromEntries(
Object.entries(linksSrc)
.filter(([,v])=>typeof v==='string'&&v.trim())
.map(([k,v])=>[k,String(v).trim()])
);
const stack=Array.isArray(src.stack)
?src.stack.filter(s=>typeof s==='string'&&s.trim()).map(s=>s.trim())
:[];
const gp=(src.gp&&typeof src.gp==='object'&&typeof src.gp.title==='string'&&src.gp.title.trim())
?{
title:src.gp.title.trim(),
url:(typeof src.gp.url==='string'&&src.gp.url.trim())?src.gp.url.trim():null,
}
:null;
return {
name:(typeof src.name==='string'&&src.name.trim())?src.name.trim():toDisplayNameFromFolder(folder),
tagline:(typeof src.tagline==='string'&&src.tagline.trim())?src.tagline.trim():'No tagline submitted yet.',
stack,
course:(typeof src.course==='string'&&src.course.trim())?src.course.trim():null,
gp,
quote:(typeof src.quote==='string'&&src.quote.trim())?src.quote.trim():'No quote submitted yet.',
message:(typeof src.message==='string'&&src.message.trim())?src.message.trim():'No message submitted yet.',
fun_fact:(typeof src.fun_fact==='string'&&src.fun_fact.trim())?src.fun_fact.trim():'No fun fact submitted yet.',
links,
image:(typeof src.image==='string'&&src.image.trim())?src.image.trim():null,
};
}
async function fetchJson(path){
const res=await fetch(path,{cache:'no-store'});
if(!res.ok)throw new Error(`${path} -> ${res.status}`);
return res.json();
}
function uniqueFolders(list){
const out=[];
const seen=new Set();
list.forEach(item=>{
if(typeof item!=='string')return;
const folder=item.trim().replace(/^\.\//,'').replace(/\/+$/,'');
if(!folder||folder==='.'||folder==='..'||folder.includes('/'))return;
if(seen.has(folder))return;
seen.add(folder);
out.push(folder);
});
return out;
}
async function discoverFoldersFromIndex(){
try{
const idx=await fetchJson('data/index.json');
if(Array.isArray(idx))return uniqueFolders(idx);
if(Array.isArray(idx?.folders))return uniqueFolders(idx.folders);
}catch(_e){}
return [];
}
async function discoverFoldersFromDirListing(){
try{
const res=await fetch('data/',{cache:'no-store'});
if(!res.ok)return [];
const html=await res.text();
const doc=new DOMParser().parseFromString(html,'text/html');
const folders=[];
doc.querySelectorAll('a[href]').forEach(a=>{
const href=a.getAttribute('href')||'';
if(!href||href.startsWith('?')||href.startsWith('#')||!href.endsWith('/'))return;
let decoded='';
try{decoded=decodeURIComponent(href);}catch(_e){decoded=href;}
folders.push(decoded);
});
return uniqueFolders(folders);
}catch(_e){
return [];
}
}
async function loadProfilesFromData(){
const fromIndex=await discoverFoldersFromIndex();
const fromListing=(window.location.protocol==='file:')
?[]
:await discoverFoldersFromDirListing();
const discovered=uniqueFolders([...fromIndex,...fromListing]);
const profiles={};
await Promise.all(discovered.map(async folder=>{
try{
const safeFolder=encodeURIComponent(folder);
const raw=await fetchJson(`data/${safeFolder}/profile.json`);
profiles[folder]=normalizeProfile(folder,raw);
}catch(_e){}
}));
ENTRIES=discovered.map(folder=>({
folder,
name:profiles[folder]?.name||toDisplayNameFromFolder(folder),
}));
PROFILES=profiles;
FOLDERS=ENTRIES.map(p=>p.folder);
}
const $out=document.getElementById('output');
const $term=document.getElementById('terminal');
const sleep=ms=>new Promise(r=>setTimeout(r,ms));
function mk(tag,cls,html){const e=document.createElement(tag);if(cls)e.className=cls;if(html!==undefined)e.innerHTML=html;return e;}
function aln(html,cls='ln'){const d=mk('div',cls,html);$out.appendChild(d);return d;}
function ph(){return`<span class="pu">grad</span><span class="ps">@</span><span class="ph">cairo-CMP-2026</span><span class="ps">:</span><span class="pp">~/class-archive</span><span class="ps"> $ </span>`;}
function esc(s){return String(s).replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');}
function scrollBot(){window.scrollTo({top:document.body.scrollHeight,behavior:'auto'});}
async function typeIn(el,text,spd=15){for(const ch of text){el.textContent+=ch;await sleep(spd+Math.random()*8);}}
async function boot(){
const blines=[
{h:`<span class="dim">Arch Linux 6.8.9-arch1-1 (tty1)</span>`,p:0},
{h:``,p:60},
{h:`<span class="dim">[ 0.000] Booting kernel... </span>`,p:28},
{h:`<span class="dim">[ 0.312] Mounting filesystems... <span class="g">[ OK ]</span></span>`,p:24},
{h:`<span class="dim">[ 0.819] Starting systemd-journald... <span class="g">[ OK ]</span></span>`,p:22},
{h:`<span class="dim">[ 1.204] Starting class-archive.service <span class="g">[ OK ]</span></span>`,p:70},
{h:``,p:90},
{h:`<span class="gb"> Cairo University — Faculty of Engineering</span>`,p:0},
{h:`<span class="gb"> Computer Engineering · Class of 2026</span>`,p:0},
{h:`<span class="dim"> digital yearbook in terminal mode</span>`,p:0},
{h:``,p:110},
{h:`<span class="dim">Type <span class="g">help</span> for commands. <span class="g">Tab</span> autocompletes. <span class="g">↑↓</span> cycle history.</span>`,p:0},
{h:``,p:40},
];
for(const l of blines){await sleep(l.p);aln(l.h);}
const bl=aln('');
bl.innerHTML=ph()+`<span class="w"></span>`;
await typeIn(bl.querySelector('.w'),'ls data/',22);
await sleep(280);
await loadProfilesFromData();
renderLs();
aln('');
initInput();
scrollBot();
}
function renderLs(){
const g=mk('div','pg');
ENTRIES.forEach(p=>{
const hasProfile=!!PROFILES[p.folder];
const s=mk('span',hasProfile?'pf':'pfd',p.folder+'/');
if(hasProfile){
s.title=`cat data/${p.folder}/profile.json`;
s.addEventListener('click',()=>execCmd('cat data/'+p.folder+'/profile.json'));
}
g.appendChild(s);
});
$out.appendChild(g);
const filled=Object.keys(PROFILES).length;
const awaiting=Math.max(TOTAL_CLASSMATES-filled,0);
aln(`<span class="dim">${FOLDERS.length} entries · <span class="g">${filled} profiles filled</span> · <span class="a">${awaiting} awaiting profile.json</span></span>`);
}
function renderHelp(){
const rows=[
['ls [data/]','list discovered profile folders'],
['cat data/<n>/profile.json','display a profile'],
['grep <query>','search by name or tech stack'],
['neofetch','system info (the important kind)'],
['countdown','time left until graduation'],
['think','just think about it...'],
['whoami','existential inquiry'],
['pwd','current directory'],
['echo <text>','echo text back'],
['clear','clear terminal'],
['exit','restart terminal session'],
];
aln(`<span class="gb">Available commands:</span>`);aln('');
rows.forEach(([c,d])=>aln(` <span class="g">${c.padEnd(36)}</span><span class="dim">${d}</span>`));
aln('');
aln(`<span class="dim">Blue folders in <span class="g">ls</span> have profiles and are clickable. Tab autocompletes. ↑↓ for history.</span>`);
}
function renderProfile(folder,p_data,name){
const p={...p_data,folder,name};
const card=mk('div','card');
const hdr=mk('div','ch');
const av=mk('div','av');
if(p.image){
av.innerHTML=`<img src="data/${p.folder}/${p.image}" alt="${p.name}" loading="lazy">`;
}else{
const init=p.name.split(' ').slice(0,2).map(w=>w[0]).join('');
av.innerHTML=`<span class="av-i">${init}</span>`;
}
const info=mk('div');
info.innerHTML=`<div class="cn">${p.name}</div><div class="ct">"${p.tagline}"</div><div class="cp">~/data/${p.folder}/</div>`;
hdr.appendChild(av);hdr.appendChild(info);card.appendChild(hdr);
const fds=mk('div','fds');
addF(fds,'stack',p.stack.map(s=>`<span class="tag">${s}</span>`).join(''));
addF(fds,'fav_course',p.course
?`<span class="gb">${p.course}</span>`
:`<span class="dim">null <span style="font-size:11px">// couldn't pick one, haseebo</span></span>`);
if(p.gp){
addF(fds,'graduation_project',p.gp.url
?`<a class="lnk" href="${p.gp.url}" target="_blank" rel="noopener">${p.gp.title} ↗</a>`
:`<span class="y">${p.gp.title}</span> <span class="dim">// no public repo yet</span>`);
}
card.appendChild(fds);
card.appendChild(mk('hr','div'));
card.appendChild(mk('div','sl','// fav_quote'));
const qb=mk('div','ql');qb.textContent=p.quote;card.appendChild(qb);
card.appendChild(mk('div','sl','// message_for_those_who_come_after'));
const mb=mk('div','ml');mb.textContent=p.message;card.appendChild(mb);
const ff=mk('div','fds');
addF(ff,'fun_fact',`<span class="y">${p.fun_fact}</span>`);
card.appendChild(ff);
card.appendChild(mk('hr','div'));
const lf=mk('div','fds');
addF(lf,'links',Object.entries(p.links).map(([k,v])=>`<a class="lnk" href="${v}" target="_blank" rel="noopener">[${k}]</a>`).join(''));
card.appendChild(lf);
$out.appendChild(card);
}
function addF(c,k,v){const d=mk('div','fd');d.innerHTML=`<span class="fk">${k}</span><span class="fv">${v}</span>`;c.appendChild(d);}
function renderNeofetch(){
const logo=[
` /\\ `,
` / \\ `,
` / /\\ \\ `,
` / / \\ \\ `,
` / / \\ \\ `,
` / / _____\\ \\ `,
` /_/ /______\\ \\ `,
` /_________________\\`,
];
const info=[
['OS','Arch Linux x86_64'],
['Host','Cairo University, Faculty of Engineering'],
['Kernel','6.8.9-arch1-1'],
['Session','B.Sc. Computer Engineering 2026'],
['Class Archive','Live profiles from data/'],
['WM','i3'],
['CPU','Human Brain (4 cores, always throttled)'],
];
const wrap=mk('div','nf');
const ld=mk('div','nfl');ld.textContent=logo.join('\n');
const id=mk('div','nfi');
id.innerHTML=`<div class="nr"><span class="nk">grad</span><span class="tx">@</span><span class="nk">cairo-CMP-2026</span></div><div class="dim">─────────────────────────────────</div>`;
info.forEach(([k,v])=>{
const r=mk('div','nr');
r.innerHTML=`<span class="nk">${k}</span><span class="tx">: </span><span class="nv">${v}</span>`;
id.appendChild(r);
});
const cs=mk('div','ncs');
['#0c0f0c','#3a5a3a','#4bff91','#1793d1','#f0c060','#9effc0','#b8ccb8','#e8f0e8'].forEach(c=>{
const s=mk('span','nc');s.style.background=c;cs.appendChild(s);
});
id.appendChild(mk('div','',''));id.appendChild(cs);
wrap.appendChild(ld);wrap.appendChild(id);$out.appendChild(wrap);
}
function stopCountdownTicker(){
if(countdownTicker!==null){
clearInterval(countdownTicker);
countdownTicker=null;
}
}
function renderCountdown(){
stopCountdownTicker();
const wrap=mk('div','countdown-wrap');
wrap.innerHTML=`
<div class="countdown-shell">
<div class="countdown-top">
<span class="countdown-title">Graduation Countdown</span>
<span class="countdown-target">2 July 2026, 3:00 PM</span>
</div>
<div class="countdown-grid">
<div class="countdown-cell" data-unit="days"><span class="countdown-num">0</span><span class="countdown-lab">Days</span></div>
<div class="countdown-cell" data-unit="hours"><span class="countdown-num">00</span><span class="countdown-lab">Hours</span></div>
<div class="countdown-cell" data-unit="mins"><span class="countdown-num">00</span><span class="countdown-lab">Mins</span></div>
<div class="countdown-cell" data-unit="secs"><span class="countdown-num">00</span><span class="countdown-lab">Secs</span></div>
</div>
<div class="countdown-msg"></div>
</div>`;
$out.appendChild(wrap);
const shell=wrap.querySelector('.countdown-shell');
const msgEl=wrap.querySelector('.countdown-msg');
const units={
days:wrap.querySelector('[data-unit="days"]'),
hours:wrap.querySelector('[data-unit="hours"]'),
mins:wrap.querySelector('[data-unit="mins"]'),
secs:wrap.querySelector('[data-unit="secs"]'),
};
const nums={
days:units.days.querySelector('.countdown-num'),
hours:units.hours.querySelector('.countdown-num'),
mins:units.mins.querySelector('.countdown-num'),
secs:units.secs.querySelector('.countdown-num'),
};
const prev={days:null,hours:null,mins:null,secs:null};
const paint=(key,val)=>{
const txt=key==='days'?String(val):String(val).padStart(2,'0');
if(prev[key]===txt)return;
nums[key].textContent=txt;
units[key].classList.remove('tick');
void units[key].offsetWidth;
units[key].classList.add('tick');
prev[key]=txt;
};
const update=()=>{
const diff=GRADUATION_AT-Date.now();
if(diff<=0){
shell.classList.add('done');
msgEl.textContent='Successfuly Graduated Alhamdulellah';
stopCountdownTicker();
return;
}
shell.classList.remove('done');
msgEl.textContent='';
const totalSeconds=Math.floor(diff/1000);
const days=Math.floor(totalSeconds/86400);
const hours=Math.floor((totalSeconds%86400)/3600);
const mins=Math.floor((totalSeconds%3600)/60);
const secs=totalSeconds%60;
paint('days',days);
paint('hours',hours);
paint('mins',mins);
paint('secs',secs);
};
update();
if(GRADUATION_AT>Date.now())countdownTicker=setInterval(update,1000);
}
async function renderRubbish() {
const frameEl = mk('div', 'ln');
frameEl.style.whiteSpace = 'pre';
frameEl.style.lineHeight = '1.35';
$out.appendChild(frameEl);
// Using an array of strings for each frame prevents code indentation
// from ruining the ASCII art and guarantees a steady 9-line height.
const frames = [
{ // 1: Idle reading
delay: 1200,
art: [
` `,
` `,
` `,
` o [GP] `,
` /|\\___/ `,
` / \\ __|__`,
` | |`,
` | BIN |`,
` |_____|`
].join('\n')
},
{ // 2: Speech 1
delay: 2000,
art: [
` .--------------------.`,
` ( What is this??!! )`,
` '-------.------------'`,
` o / [GP] `,
` /|\\/__/ `,
` / \\ __|__`,
` | |`,
` | BIN |`,
` |_____|`
].join('\n')
},
{ // 3: Crumple paper
delay: 1000,
art: [
` .--------------------.`,
` ( What is this??!! )`,
` '-------.------------'`,
` o / `,
` /|\\<[##] `,
` / \\ __|__`,
` | |`,
` | BIN |`,
` |_____|`
].join('\n')
},
{ // 4: Dramatic silence
delay: 400,
art: [
` `,
` `,
` `,
` o `,
` /|\\<[##] `,
` / \\ __|__`,
` | |`,
` | BIN |`,
` |_____|`
].join('\n')
},
{ // 5: Wind up the throw
delay: 400,
art: [
` `,
` `,
` [##] `,
` \\o `,
` |\\ `,
` / \\ __|__`,
` | |`,
` | BIN |`,
` |_____|`
].join('\n')
},
{ // 6: Release
delay: 250,
art: [
` `,
` `,
` `,
` o [##] `,
` /|-- `,
` / \\ __|__`,
` | |`,
` | BIN |`,
` |_____|`
].join('\n')
},
{ // 7: Mid-air trajectory 1
delay: 250,
art: [
` `,
` [##] `,
` `,
` o `,
` /|\\ `,
` / \\ __|__`,
` | |`,
` | BIN |`,
` |_____|`
].join('\n')
},
{ // 8: Mid-air trajectory 2 (peak of arc)
delay: 250,
art: [
` [##]`,
` `,
` `,
` o `,
` /|\\ `,
` / \\ __|__`,
` | |`,
` | BIN |`,
` |_____|`
].join('\n')
},
{ // 9: Dropping into the bin
delay: 250,
art: [
` `,
` `,
` `,
` o `,
` /|\\ `,
` / \\ __|__`,
` | [##]|`,
` | BIN |`,
` |_____|`
].join('\n')
},
{ // 10: Sunk in bin
delay: 500,
art: [
` `,
` `,
` `,
` o `,
` /|\\ `,
` / \\ __|__`,
` | |`,
` | BIN |`,
` |_____|`
].join('\n')
},
{ // 11: Final punchline
delay: 1500,
art: [
` .--------------------.`,
` ( It's all rubbish! )`,
` '-------.------------'`,
` o / `,
` /|\\/ `,
` / \\ __|__`,
` | |`,
` | BIN |`,
` |_____|`
].join('\n')
}
];
for (const frame of frames) {
frameEl.textContent = frame.art;
scrollBot();
await sleep(frame.delay);
}
aln(`<span class="dim">*chuckles* -SS</span>`);
aln('');
injectInputRow(true);
scrollBot();
}
async function renderFall() {
const frameEl = mk('div', 'ln');
frameEl.style.whiteSpace = 'pre';
frameEl.style.lineHeight = '1.25';
frameEl.style.fontFamily = 'monospace';
$out.appendChild(frameEl);
const FPS = 60;
const duration = 28.0;
const start = performance.now();
// --- World & Camera Setup ---
const wW = 85; // Increased World Width
const wH = 40;
const vW = 75; // Increased Viewport Width (Fixes clipped floor names)
const vH = 15;
// --- Debris Physics System ---
const debris = [
{ ch: '。', vx: -12.0, vy: -8.0 },
{ ch: '`', vx: -15.0, vy: -12.0 },
{ ch: ',', vx: -8.5, vy: -14.0 },
{ ch: ';', vx: -16.0, vy: -5.5 },
{ ch: ':', vx: -11.0, vy: -10.0 },
{ ch: '.', vx: -18.5, vy: -3.0 },
{ ch: '-', vx: -9.0, vy: -6.5 }
];
while (true) {
const now = performance.now();
const t = (now - start) / 1000;
if (t > duration) break;
frameEl.textContent = renderFrame(t, wW, wH, vW, vH, debris);
scrollBot();
await new Promise(resolve => setTimeout(resolve, 1000 / FPS));
}
aln('');
aln(`<span class="dim">*PROBLEM SOLVED*</span>`);
aln('');
injectInputRow(true);
scrollBot();
}
function renderFrame(t, wW, wH, vW, vH, debris) {
// --- 1. TIMELINE ---
const T_WALK = 0.0;
const T_PAN_UP = 2.5;
const T_WAIT_TOP = 5.0;
const T_SHOCK = 6.0; // Shockwave fires
const T_LAUNCH = 7.0; // Shockwave hits, student becomes a projectile
// Projectile Math: y0 = 5, vy = -6 (upward arc), g = 16 (8*t^2)
// Landing at y = 36. Solving: 8t^2 - 6t - 31 = 0 => t ≈ 2.38s
const FALL_DUR = 2.38;
const IMPACT_T = T_LAUNCH + FALL_DUR; // ~9.38s
const T_STAND = IMPACT_T + 2.0;
const T_PROF_WALK = T_STAND + 1.0;
const T_POKE_1 = T_PROF_WALK + 2.5;
const T_POKE_2 = T_POKE_1 + 1.5;
const T_SPEAK = T_POKE_2 + 2.0;
const T_RESPAWN = T_SPEAK + 4.0;
// --- 2. STATE ---
let camX = 0, camY = wH - vH;
let profX = 5, profY = wH - 4;
let studX = 58, studY = 5, studRot = 0;
let studState = 'stand';
let showShockwave = false, showDots = false, showBubble = false;
// --- 3. PARAMETRIC LOGIC ---
// Prof Initial Walk
if (t > T_WALK && t < T_PAN_UP) profX = lerp(5, 20, (t - T_WALK) / (T_PAN_UP - T_WALK));
else if (t >= T_PAN_UP) profX = 20;
// Camera Pan Up
if (t > T_PAN_UP && t < T_WAIT_TOP) camY = lerp(wH - vH, 0, smoothstep((t - T_PAN_UP) / (T_WAIT_TOP - T_PAN_UP)));
else if (t >= T_WAIT_TOP && t < T_LAUNCH) camY = 0;
// Shockwave starts before launch and keeps traveling left afterward.
if (t >= T_SHOCK) {
showShockwave = true;
if (t < T_LAUNCH) studState = 'lean';
}
// Projectile Fall (Launched by Shockwave)
let timeSinceImpact = t - IMPACT_T;
if (t >= T_LAUNCH) {
studState = 'fall';
// Clamp the physics exactly on impact so he doesn't crawl/sink
let ft = Math.min(Math.max(0, t - T_LAUNCH), FALL_DUR);
// x = x0 + vx * t
studX = 58 - (12 * ft);
// y = y0 + vy * t + 0.5 * g * t^2
studY = 5 - (6 * ft) + (8 * ft * ft);
studRot = Math.floor(ft * 6) % 4;
// Camera Aggressively Tracks the Fall
if (t < IMPACT_T) camY = Math.max(0, studY - vH / 2 + 2);
}
// Impact & Screen Shake
if (t >= IMPACT_T) {
studState = 'dead';
camY = wH - vH; // Lock to ground
if (timeSinceImpact > 0 && timeSinceImpact < 0.8) {
let shake = (0.8 - timeSinceImpact) * 6;
camY += (Math.random() - 0.5) * shake;
camX += (Math.random() - 0.5) * shake;
}
}
// Professor Reaction
let pSprite = [" o ", " /|\\ ", " / \\ "];
if (t >= IMPACT_T && t < T_STAND) {
profX = 14;
pSprite = [
" \\o/ ",
" | ",
" _/\\_"
];
}
else if (t >= T_STAND && t < T_PROF_WALK) {
profX = 14;
}
else if (t >= T_PROF_WALK && t < T_POKE_1) {
profX = lerp(14, studX - 7, smoothstep((t - T_PROF_WALK) / (T_POKE_1 - T_PROF_WALK)));
}
else if (t >= T_POKE_1) {
profX = studX - 7;
}
// Poking FX
if (t > T_POKE_1 && t < T_SPEAK) {
showDots = true;
let p1 = Math.sin((t - T_POKE_1) * Math.PI * 4);
let p2 = (t > T_POKE_2) ? Math.sin((t - T_POKE_2) * Math.PI * 4) : -1;
if ((p1 > 0 && t < T_POKE_1 + 0.5) || (p2 > 0 && t < T_POKE_2 + 0.5)) {
pSprite = [" o ", " /|----", " / \\ "];
}
}
// Speak & Respawn
if (t >= T_SPEAK && t < T_RESPAWN) showBubble = true;
if (t >= T_RESPAWN) {
if (t < T_RESPAWN + 0.8) studState = 'glitch';
else studState = 'respawned';
}
// Bounds
camY = Math.max(0, Math.min(camY, wH - vH));
camX = Math.max(0, Math.min(camX, wW - vW));
// --- 4. RENDER TO GRID ---
const grid = Array.from({ length: wH }, () => Array.from({ length: wW }, () => ' '));
// Ground
for (let i = 0; i < wW; i++) grid[wH - 2][i] = '_';
// Building Geometry (Shifted right so it fully fits in camera)
for (let y = 0; y < wH - 1; y++) {
grid[y][60] = '|';
grid[y][74] = '|';
}
drawText(grid, 62, wH - 3, "[ عمارة ] ");
for (let floor = 1; floor <= 7; floor++) {
let fy = wH - 3 - (floor * 4);
if (fy > 0 && fy < wH) {
drawText(grid, 64, fy, `[FL ${floor}]`);
for (let x = 61; x < 74; x++) if (grid[fy + 2]) grid[fy + 2][x] = '-';
}
}
// Shockwave (Now coming from the right and continues after impact)
if (showShockwave) {
const waveText = "((((( RUBBISH!";
const waveSpeed = (85 - 60) / (T_LAUNCH - T_SHOCK);
const waveX = Math.round(85 - waveSpeed * (t - T_SHOCK));
if (waveX < wW && waveX + waveText.length > 0) {
drawText(grid, waveX, 5, waveText);
}
}
// Debris (Drawn BEFORE the student, so student body doesn't get holes)
if (t >= T_LAUNCH) {
let dt = t - T_LAUNCH;
debris.forEach(p => {
let px = 58 + p.vx * dt;
// Parabolic math for debris too
let py = 5 + p.vy * dt + (12 * dt * dt);
// Clamp to ground so they scatter and stay
if (py >= wH - 2) py = wH - 2;
if (px > 0 && px < wW && py > 0 && py < wH) {
drawText(grid, Math.round(px), Math.round(py), p.ch);
}
});
}
// Draw Professor
drawSprite(grid, Math.round(profX), Math.round(profY), pSprite);
// Draw Student (Fixed rotation sprites so head/body never disappears)
let sSprite;
if (studState === 'stand') sSprite = [" o ", " /|\\ ", " / \\ "];
else if (studState === 'lean') sSprite = [" o\\ ", " /-\\", " /\\ "];
else if (studState === 'fall') {
const rots = [
[" o ", " /|\\ ", " / \\ "], // Upright
[" / ", " --o ", " \\ "], // 90 deg (Sideways)
[" \\ / ", " \\|/ ", " o "], // 180 deg (Upside down)
[" \\ ", " o-- ", " / "] // 270 deg
];
sSprite = rots[studRot];
}
else if (studState === 'dead') sSprite = [" ", " ", "_/-o-\\_"];
else if (studState === 'glitch') sSprite = [" ... ", " :.: ", ".:_:."];
else if (studState === 'respawned') sSprite = [" o ", " /|\\ ", " / \\ "];
drawSprite(grid, Math.round(studX), Math.round(studY), sSprite);
// FX
if (showDots) drawText(grid, Math.round(profX + 3), Math.round(profY - 2), "...");
if (showBubble) {
drawSprite(grid, Math.round(profX - 6), Math.round(profY - 5), [
".-----------------------.",
"( اصل فكر فيها كالاتي ) ",
"'----------.------------'",
" |"
]);
}
// --- 5. CAMERA PROJECTION ---
let view = [];
let cY = Math.round(camY), cX = Math.round(camX);
for (let y = 0; y < vH; y++) {
let wy = cY + y;
let rowStr = "";
if (wy >= 0 && wy < wH) {
let row = grid[wy];
for (let x = 0; x < vW; x++) {
let wx = cX + x;
rowStr += (wx >= 0 && wx < wW) ? row[wx] : " ";
}
} else rowStr = " ".repeat(vW);
view.push(rowStr);
}
return view.join('\n');
}
// --- UTILITY ---
function drawSprite(grid, px, py, sprite) {
sprite.forEach((row, dy) => {
let chars = Array.from(row);
chars.forEach((ch, dx) => {
// Overwrite only if it's not a space
if (ch !== ' ' && ch !== undefined) {
let x = px + dx, y = py + dy;
if (grid[y] && x >= 0 && x < grid[y].length) grid[y][x] = ch;
}
});
});
}
function drawText(grid, x, y, text) {
if (grid[y]) {
let chars = Array.from(text);
for (let i = 0; i < chars.length; i++) {
if (grid[y][x + i]) grid[y][x + i] = chars[i];
}
}
}
function lerp(a, b, t) { return a + (b - a) * Math.max(0, Math.min(1, t)); }
function smoothstep(t) { t = Math.max(0, Math.min(1, t)); return t * t * (3 - 2 * t); }
function renderGrep(q){
if(!q){aln(`<span class="r">grep: missing query. Usage: grep <name or tech></span>`);return;}