-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstats_template.html
More file actions
1563 lines (1507 loc) · 52.7 KB
/
stats_template.html
File metadata and controls
1563 lines (1507 loc) · 52.7 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">
<title>GitHub contribution stats</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<style>
:root {
--bg: #0d1117;
--panel: #161b22;
--panel-2: #21262d;
--border: #30363d;
--fg: #e6edf3;
--muted: #8b949e;
--accent: #58a6ff;
--plus: #3fb950;
--minus: #f85149;
--heat-0: #161b22;
--heat-1: #0e4429;
--heat-2: #006d32;
--heat-3: #26a641;
--heat-4: #39d353;
--max-width: 1400px;
}
* { box-sizing: border-box; }
html, body {
background: var(--bg); color: var(--fg);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial,
system-ui, sans-serif;
margin: 0; padding: 0;
-webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
header {
padding: 40px 20px 24px;
max-width: var(--max-width);
margin: 0 auto;
border-bottom: 1px solid var(--border);
}
header h1 {
margin: 0 0 4px 0;
font-size: 28px;
font-weight: 600;
letter-spacing: -0.5px;
}
header .sub {
color: var(--muted);
font-size: 14px;
}
.profile-chips {
display: flex;
gap: 8px;
flex-wrap: wrap;
align-items: center;
max-width: 360px;
justify-content: flex-end;
}
.pchip {
background: var(--panel-2);
border: 1px solid var(--border);
border-radius: 20px;
padding: 5px 11px;
font-size: 12px;
color: var(--muted);
display: inline-flex;
align-items: center;
gap: 4px;
text-decoration: none;
transition: border-color 0.1s;
}
.pchip:hover { border-color: var(--accent); color: var(--fg); }
.pchip .v {
color: var(--fg);
font-weight: 600;
font-variant-numeric: tabular-nums;
}
.pchip.sponsor-chip { border-color: #ea4aaa; }
.pchip.sponsor-chip:hover { background: rgba(234,74,170,0.1); }
.sponsor-avatars {
display: inline-flex;
margin-left: 4px;
}
.sponsor-avatars img {
width: 18px; height: 18px;
border-radius: 50%;
border: 1px solid var(--border);
margin-left: -6px;
}
.sponsor-avatars img:first-child { margin-left: 0; }
main {
max-width: var(--max-width);
margin: 0 auto;
padding: 24px 20px 64px;
}
section {
background: var(--panel);
border: 1px solid var(--border);
border-radius: 8px;
padding: 20px;
margin-bottom: 24px;
}
section h2 {
margin: 0 0 16px 0;
font-size: 16px;
font-weight: 600;
color: var(--fg);
}
/* totals strip */
.totals {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 12px;
}
.stat {
background: var(--panel-2);
border: 1px solid var(--border);
border-radius: 6px;
padding: 16px;
}
.stat .label {
font-size: 12px;
text-transform: uppercase;
letter-spacing: 0.05em;
color: var(--muted);
margin-bottom: 6px;
}
.stat .value {
font-size: 28px;
font-weight: 600;
font-variant-numeric: tabular-nums;
}
.stat .delta {
font-size: 12px;
color: var(--muted);
margin-top: 4px;
}
.delta .plus { color: var(--plus); }
.delta .minus { color: var(--minus); }
/* heatmap */
.heatmap-wrap {
overflow-x: auto;
margin-top: 12px;
}
.heatmap {
display: grid;
grid-template-columns: 28px 1fr;
gap: 4px;
min-width: 800px;
}
.heatmap-year-label {
color: var(--muted);
font-size: 11px;
font-variant-numeric: tabular-nums;
align-self: center;
padding-right: 4px;
}
.heatmap-row {
display: grid;
grid-template-rows: repeat(7, 11px);
grid-auto-columns: 11px;
grid-auto-flow: column;
gap: 2px;
}
.day {
width: 11px; height: 11px; border-radius: 2px;
background: var(--heat-0);
transition: outline 0.06s, opacity 0.06s;
cursor: pointer;
}
/* Default green ramp (used when no company color is applied) */
.day.l1 { background: var(--heat-1); }
.day.l2 { background: var(--heat-2); }
.day.l3 { background: var(--heat-3); }
.day.l4 { background: var(--heat-4); }
/* When a per-day company color is provided as --co inline-style, use it
and vary intensity via opacity. */
.day.cc { background: var(--co); }
.day.cc.l1 { opacity: 0.35; }
.day.cc.l2 { opacity: 0.55; }
.day.cc.l3 { opacity: 0.80; }
.day.cc.l4 { opacity: 1.00; }
.day:hover { outline: 1px solid var(--fg); outline-offset: 0; }
.heatmap-months {
grid-column: 2;
display: grid;
grid-template-columns: repeat(12, 1fr);
color: var(--muted);
font-size: 10px;
padding-bottom: 2px;
}
.heatmap-legend {
margin-top: 12px;
color: var(--muted);
font-size: 11px;
display: flex;
align-items: center;
gap: 6px;
}
.heatmap-legend .day { cursor: default; }
/* year cards */
.years-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 12px;
}
.year-card {
background: var(--panel-2);
border: 1px solid var(--border);
border-radius: 6px;
padding: 14px 16px;
position: relative;
}
.year-card.sabbatical {
background: #1a1d24;
border-style: dashed;
opacity: 0.78;
}
.year-card .annot {
display: inline-block;
margin-left: 6px;
padding: 1px 6px;
border-radius: 8px;
background: rgba(139, 148, 158, 0.15);
color: var(--muted);
font-size: 10px;
text-transform: lowercase;
letter-spacing: 0.04em;
vertical-align: middle;
font-weight: 400;
}
.year-card .y {
font-size: 20px;
font-weight: 600;
margin-bottom: 6px;
}
.year-card .row {
display: flex;
justify-content: space-between;
font-size: 13px;
color: var(--muted);
margin-top: 4px;
}
.year-card .row .v {
color: var(--fg);
font-variant-numeric: tabular-nums;
}
.year-card .bar {
height: 4px;
border-radius: 2px;
background: var(--panel);
margin-top: 10px;
overflow: hidden;
display: flex;
}
.year-card .bar .add { background: var(--plus); }
.year-card .bar .del { background: var(--minus); }
.year-card .co-stack {
height: 6px;
border-radius: 3px;
overflow: hidden;
display: flex;
margin: 4px 0;
background: var(--panel);
}
.year-card .co-badges {
display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px;
}
.co-badge {
font-size: 9px;
padding: 1px 5px;
border-radius: 8px;
border: 1px solid;
background: rgba(0,0,0,0.15);
white-space: nowrap;
}
/* repo table */
table.repos {
width: 100%;
border-collapse: collapse;
font-size: 13px;
}
table.repos th, table.repos td {
text-align: left;
padding: 8px 10px;
border-bottom: 1px solid var(--border);
font-variant-numeric: tabular-nums;
}
table.repos th {
color: var(--muted);
font-weight: 500;
text-transform: uppercase;
font-size: 11px;
letter-spacing: 0.05em;
user-select: none;
cursor: pointer;
}
table.repos th[data-sort-active]::after {
content: " ▾";
color: var(--accent);
}
table.repos th[data-sort-active="asc"]::after { content: " ▴"; }
table.repos tr:hover { background: var(--panel-2); }
table.repos tr.repo-row td:first-child {
border-left: 3px solid transparent;
}
td.num { text-align: right; }
.co-dot {
display: inline-block;
width: 8px; height: 8px;
border-radius: 50%;
margin-right: 6px;
vertical-align: middle;
}
td.plus { color: var(--plus); }
td.minus { color: var(--minus); }
.repo-link { color: var(--accent); }
.tags { display: inline-flex; gap: 4px; }
.tag {
display: inline-block;
padding: 1px 6px;
border-radius: 10px;
border: 1px solid var(--border);
color: var(--muted);
font-size: 10px;
text-transform: uppercase;
letter-spacing: 0.05em;
}
.tag.owned { color: var(--plus); border-color: #1f6028; }
.tag.local { color: var(--accent); border-color: #1f4d7a; }
/* split charts */
.grid-2 {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 16px;
}
@media (max-width: 800px) {
.grid-2 { grid-template-columns: 1fr; }
}
/* tooltip */
#tt {
position: fixed;
pointer-events: none;
z-index: 1000;
background: var(--panel-2);
border: 1px solid var(--border);
border-radius: 4px;
padding: 6px 8px;
font-size: 12px;
color: var(--fg);
box-shadow: 0 4px 12px rgba(0,0,0,0.4);
display: none;
line-height: 1.4;
}
#tt .tt-date { color: var(--muted); font-size: 11px; }
/* bar chart of per-year */
.barchart {
display: grid;
grid-template-columns: 50px 1fr 90px;
gap: 8px;
align-items: center;
font-size: 12px;
}
.barchart .y { color: var(--muted); font-variant-numeric: tabular-nums; }
.barchart.sabbatical { opacity: 0.55; }
.barchart.sabbatical .y::after {
content: " ⌛";
font-size: 9px;
color: var(--muted);
}
.heatmap-year-label.sabbatical { opacity: 0.55; }
.heatmap-row.sabbatical { opacity: 0.78; }
.barchart .bar {
height: 16px;
background: var(--panel);
border-radius: 3px;
overflow: hidden;
display: flex;
}
.barchart .bar .seg-c {
background: var(--accent);
height: 100%;
}
.barchart .bar .seg-co {
height: 100%;
transition: filter 0.06s;
}
.barchart .bar .seg-co:hover { filter: brightness(1.2); }
.barchart .v { text-align: right; font-variant-numeric: tabular-nums; }
/* career timeline (gantt) */
#career-timeline {
display: grid;
grid-template-columns: 220px 1fr;
gap: 4px 8px;
font-size: 12px;
align-items: center;
}
.ct-axis {
display: grid;
grid-template-columns: repeat(var(--years, 14), 1fr);
color: var(--muted);
font-size: 10px;
font-variant-numeric: tabular-nums;
border-bottom: 1px solid var(--border);
padding-bottom: 3px;
margin-bottom: 2px;
}
.ct-axis .y { text-align: center; }
.ct-name {
display: flex; align-items: center; gap: 6px;
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ct-name a {
color: var(--fg);
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ct-name a:hover { text-decoration: underline; }
.ct-role {
color: var(--muted); font-size: 10px;
margin-left: 6px;
}
.ct-track {
position: relative;
height: 18px;
background: var(--panel);
border-radius: 3px;
overflow: hidden;
}
.ct-bar {
position: absolute;
top: 0; bottom: 0;
border-radius: 3px;
opacity: 0.85;
cursor: pointer;
box-shadow: inset 0 -2px 0 rgba(0,0,0,0.15);
transition: opacity 0.1s, transform 0.1s;
}
.ct-bar:hover { opacity: 1; transform: scaleY(1.06); }
.ct-bar.ongoing::after {
content: "→";
position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
color: rgba(255,255,255,0.7); font-size: 11px;
}
.ct-bar-label {
position: absolute; inset: 0;
display: flex; align-items: center; padding: 0 6px;
color: rgba(255,255,255,0.9); font-size: 10px;
text-shadow: 0 1px 1px rgba(0,0,0,0.4);
pointer-events: none;
white-space: nowrap; overflow: hidden;
}
/* hour-of-day histogram */
#hour-histogram {
display: grid;
grid-template-columns: repeat(24, 1fr);
gap: 2px;
align-items: end;
height: 110px;
margin: 8px 0 4px;
}
.hh-bar {
background: var(--accent);
border-radius: 2px 2px 0 0;
min-height: 2px;
position: relative;
cursor: pointer;
transition: filter 0.1s;
}
.hh-bar:hover { filter: brightness(1.3); }
.hh-label {
grid-column: span 24;
display: grid;
grid-template-columns: repeat(24, 1fr);
gap: 2px;
color: var(--muted);
font-size: 9px;
font-variant-numeric: tabular-nums;
text-align: center;
margin-top: 4px;
}
.hh-night { background: #4c5169 !important; }
.hh-morning { background: #8b9af3 !important; }
.hh-afternoon { background: var(--accent) !important; }
.hh-evening { background: #d97706 !important; }
/* language breakdown */
.lang-year-grid {
display: grid;
grid-template-columns: 50px 1fr;
gap: 4px 8px;
align-items: center;
font-size: 11px;
}
.lang-year-grid .y { color: var(--muted); font-variant-numeric: tabular-nums; }
.lang-year-bar {
display: flex;
height: 14px;
border-radius: 3px;
overflow: hidden;
background: var(--panel);
}
.lang-seg { height: 100%; transition: filter 0.06s; }
.lang-seg:hover { filter: brightness(1.3); }
/* dow×hour heatmap */
.dow-heatmap-wrap { overflow-x: auto; }
#dow-heatmap {
display: grid;
grid-template-columns: 40px repeat(24, 1fr);
gap: 3px;
min-width: 700px;
font-size: 10px;
color: var(--muted);
}
.dh-hour-header {
text-align: center;
padding: 2px 0;
}
.dh-dow-label {
padding-right: 4px;
text-align: right;
align-self: center;
}
.dh-cell {
height: 22px;
background: var(--heat-0);
border-radius: 3px;
cursor: pointer;
}
.dh-cell:hover { outline: 1px solid var(--fg); }
.dh-cell.l1 { background: var(--heat-1); }
.dh-cell.l2 { background: var(--heat-2); }
.dh-cell.l3 { background: var(--heat-3); }
.dh-cell.l4 { background: var(--heat-4); }
/* top bars */
.topbars { display: flex; flex-direction: column; gap: 4px; }
.topbar {
display: grid;
grid-template-columns: 200px 1fr 130px;
gap: 8px;
align-items: center;
font-size: 12px;
}
.topbar-name {
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar-bar {
height: 14px;
background: var(--panel);
border-radius: 3px;
overflow: hidden;
}
.topbar-fill { background: var(--accent); height: 100%; }
.topbar-val {
text-align: right;
font-variant-numeric: tabular-nums;
color: var(--muted);
}
/* controls */
.controls {
display: flex;
gap: 8px;
align-items: center;
margin-bottom: 12px;
font-size: 13px;
color: var(--muted);
}
.controls input[type=search] {
background: var(--panel-2);
border: 1px solid var(--border);
color: var(--fg);
border-radius: 4px;
padding: 6px 10px;
font-size: 13px;
min-width: 240px;
font-family: inherit;
}
.controls input[type=search]:focus {
outline: none;
border-color: var(--accent);
}
.footer-note {
color: var(--muted);
font-size: 11px;
text-align: center;
margin-top: 24px;
}
.refresh-btn {
display: inline-block; margin-left: 10px;
padding: 3px 10px; border-radius: 4px;
background: var(--panel-2); border: 1px solid var(--border);
color: var(--muted); cursor: pointer; font: inherit;
font-size: 11px;
}
.refresh-btn:hover:not(:disabled) {
color: var(--fg); border-color: var(--accent);
}
.refresh-btn:disabled { opacity: 0.6; cursor: progress; }
.refresh-msg {
font-size: 11px; color: var(--muted); margin-top: 6px;
text-align: center;
}
.refresh-msg.err { color: #f85149; }
/* Mining-in-progress banner (shown only when DATA.mining_status !== "complete") */
#mining-banner {
position: sticky; top: 0; z-index: 100;
background: linear-gradient(90deg, #1f6028, #58a6ff);
color: white; text-align: center; padding: 8px 16px;
font-size: 13px; display: none;
box-shadow: 0 1px 6px rgba(0,0,0,0.35);
}
#mining-banner .spin {
display: inline-block; width: 12px; height: 12px;
border: 2px solid rgba(255,255,255,0.4); border-top-color: white;
border-radius: 50%; animation: mb-spin 0.9s linear infinite;
vertical-align: -2px; margin-right: 8px;
}
@keyframes mb-spin { to { transform: rotate(360deg); } }
</style>
</head>
<body>
<div id="mining-banner">
<span class="spin"></span>
<strong>Mining in progress</strong> — partial data shown. Auto-refreshing every <span id="mb-secs">30</span>s · phase: <code id="mb-phase">—</code>
</div>
<header>
<div style="display:flex;gap:14px;align-items:center;">
<img id="hdr-avatar" src="" alt="" style="width:64px;height:64px;border-radius:50%;display:none;border:1px solid var(--border);">
<div style="flex:1;">
<h1 id="hdr-name">Nick Sweeting</h1>
<div class="sub">
<span id="hdr-handle">@pirate</span> ·
<span id="hdr-bio" style="color:var(--muted);"></span>
</div>
<div class="sub" style="margin-top:6px;">
Git contribution dashboard · <span id="hdr-range">—</span>
</div>
</div>
<div id="hdr-profile" class="profile-chips"></div>
</div>
</header>
<main>
<section>
<h2>Totals across all time</h2>
<div class="totals" id="totals"></div>
</section>
<section id="career-section">
<h2>Career timeline <span style="color:var(--muted);font-weight:400;font-size:12px;">(click a row to view the blog entry)</span></h2>
<div id="career-timeline"></div>
</section>
<section>
<h2>Contribution heatmap</h2>
<div class="heatmap-wrap">
<div id="heatmap"></div>
</div>
<div class="heatmap-legend">
<span>Less</span>
<span class="day"></span>
<span class="day l1"></span>
<span class="day l2"></span>
<span class="day l3"></span>
<span class="day l4"></span>
<span>More</span>
</div>
</section>
<section>
<div class="grid-2">
<div>
<h2>Commits per year</h2>
<div id="bar-commits" class="bars"></div>
</div>
<div>
<h2>Lines changed per year</h2>
<div id="bar-lines" class="bars"></div>
</div>
</div>
</section>
<section>
<h2>Sleep schedule <span style="color:var(--muted);font-weight:400;font-size:12px;">(hour-of-day in commit-local time, adjusted for PST/EST moves)</span></h2>
<div id="hour-histogram"></div>
</section>
<section>
<h2>Language breakdown <span style="color:var(--muted);font-weight:400;font-size:12px;">(by file extension; excludes vendored/lock files)</span></h2>
<div class="grid-2">
<div>
<div id="lang-bars" class="topbars"></div>
</div>
<div>
<div id="lang-by-year" class="lang-year-grid"></div>
</div>
</div>
</section>
<section>
<h2>Year-by-year breakdown</h2>
<div id="years" class="years-grid"></div>
</section>
<section>
<h2>Top contributions</h2>
<div class="grid-2">
<div>
<div style="font-size:12px;color:var(--muted);margin-bottom:6px;">
Top 20 by commits
</div>
<div id="top-by-commits" class="topbars"></div>
</div>
<div>
<div style="font-size:12px;color:var(--muted);margin-bottom:6px;">
Top 20 by lines changed
</div>
<div id="top-by-lines" class="topbars"></div>
</div>
</div>
<div class="grid-2" style="margin-top:16px;">
<div>
<div style="font-size:12px;color:var(--muted);margin-bottom:6px;">
Top 20 by stars ⭐
</div>
<div id="top-by-stars" class="topbars"></div>
</div>
<div>
<div style="font-size:12px;color:var(--muted);margin-bottom:6px;">
Top 10 by merged PRs
</div>
<div id="top-by-pri" class="topbars"></div>
</div>
</div>
</section>
<section>
<h2>All repositories</h2>
<div class="controls">
<input type="search" id="repo-filter" placeholder="filter repos…">
<span id="repo-count"></span>
</div>
<table class="repos" id="repos">
<thead>
<tr>
<th data-sort="repo">Repository</th>
<th data-sort="commits" class="num">Commits</th>
<th data-sort="add" class="num">+Lines</th>
<th data-sort="del" class="num">-Lines</th>
<th data-sort="stars" class="num">⭐</th>
<th data-sort="prs_merged" class="num">PRs✓</th>
<th data-sort="prs" class="num">PRs</th>
<th data-sort="issues" class="num">Iss</th>
<th data-sort="span">Active span</th>
<th data-sort="years" class="num">Yrs</th>
</tr>
</thead>
<tbody></tbody>
</table>
</section>
<div class="footer-note" id="footer-note"></div>
<div class="refresh-msg" id="refresh-msg"></div>
</main>
<div id="tt"></div>
<script id="DATA" type="application/json">/*__DATA__*/null</script>
<script>
"use strict";
// Parse the embedded JSON data block.
const DATA = JSON.parse(document.getElementById("DATA").textContent);
// Empty-account short-circuit — show a friendly message instead of an
// empty dashboard shell when the user has no public activity at all.
if (DATA.user && DATA.user.profile &&
(DATA.totals || {}).commits === 0 &&
(DATA.totals || {}).prs === 0 &&
(DATA.totals || {}).issues === 0 &&
(DATA.totals || {}).stars === 0 &&
DATA.mining_status === "complete") {
const u = DATA.user;
const p = u.profile || {};
document.body.innerHTML = `
<style>
.empty-card {
max-width: 540px; margin: 80px auto; padding: 40px;
text-align: center; border: 1px solid var(--border);
border-radius: 12px; background: var(--panel);
}
.empty-card img { width: 80px; height: 80px; border-radius: 50%;
border: 1px solid var(--border); }
.empty-card h1 { font-size: 22px; margin: 16px 0 4px; }
.empty-card .handle { color: var(--muted); font-size: 14px; }
.empty-card .msg { color: var(--muted); line-height: 1.6;
font-size: 13px; margin-top: 20px; }
.empty-card a { color: var(--accent); }
</style>
<div class="empty-card">
${p.avatar_url ? `<img src="${p.avatar_url}" alt="">` : ""}
<h1>${u.name || u.login}</h1>
<div class="handle"><a href="https://github.com/${u.login}">@${u.login}</a></div>
<div class="msg">
This account has no public contributions yet.<br>
${p.created_at ? `Joined GitHub <strong>${p.created_at.slice(0,10)}</strong>.` : ""}
${p.public_repos === 0 ? "No public repositories." : ""}
</div>
</div>`;
// Bail out — none of the section rendering applies.
throw new Error("empty-account-shortcircuit");
}
// Company → color lookup, built from the jobs list.
const COMPANY_COLOR = {};
for (const j of ((DATA.annotations || {}).jobs || [])) {
COMPANY_COLOR[j.company] = j.color;
}
function companyColor(name) {
return COMPANY_COLOR[name] || null;
}
// ---------- helpers ----------
const fmt = n => n == null ? "—" :
n >= 1e6 ? (n/1e6).toFixed(2).replace(/\.?0+$/, "") + "M"
: n >= 1e3 ? (n/1e3).toFixed(1).replace(/\.0$/, "") + "K"
: String(n);
const fmtExact = n => n == null ? "—" : n.toLocaleString();
const isoToDate = s => { const [y,m,d] = s.split("-").map(Number); return new Date(Date.UTC(y, m-1, d)); };
const dateToISO = d => d.toISOString().slice(0, 10);
const dayOfWeek = d => (d.getUTCDay() + 6) % 7; // Mon=0..Sun=6 (GH uses Sun=0)
// Tooltip
const tt = document.getElementById("tt");
function showTip(e, html) {
tt.innerHTML = html;
tt.style.display = "block";
const r = tt.getBoundingClientRect();
let x = e.clientX + 12, y = e.clientY + 12;
if (x + r.width > window.innerWidth) x = e.clientX - r.width - 12;
if (y + r.height > window.innerHeight) y = e.clientY - r.height - 12;
tt.style.left = x + "px";
tt.style.top = y + "px";
}
function hideTip() { tt.style.display = "none"; }
document.addEventListener("scroll", hideTip, true);
// ---------- mining-in-progress banner ----------
{
const status = DATA.mining_status || "complete";
if (status !== "complete") {
const banner = document.getElementById("mining-banner");
if (banner) {
banner.style.display = "block";
const phaseEl = document.getElementById("mb-phase");
if (phaseEl) phaseEl.textContent = DATA.mining_phase || status;
// Auto-reload every 30s to pick up newer partial / final renders.
// Cache-bust with a query param so CDN doesn't return stale.
setTimeout(() => {
const u = new URL(location.href);
u.searchParams.set("_t", Date.now().toString());
location.replace(u.toString());
}, 30000);
}
}
}
// ---------- header ----------
document.getElementById("hdr-name").textContent = DATA.user.name;
document.title = `${DATA.user.name || DATA.user.login} (@${DATA.user.login}) — GitHub contribution stats`;
document.getElementById("hdr-handle").innerHTML =
`<a href="https://github.com/${DATA.user.login}">@${DATA.user.login}</a>`;
if (DATA.totals.first_day && DATA.totals.last_day) {
document.getElementById("hdr-range").textContent =
`${DATA.totals.first_day} → ${DATA.totals.last_day}`;
}
{
const p = (DATA.user.profile) || {};
if (p.avatar_url) {
const a = document.getElementById("hdr-avatar");
a.src = p.avatar_url; a.style.display = "block";
}
if (p.bio) document.getElementById("hdr-bio").textContent = p.bio;
const chips = [];
if (p.followers != null) {
chips.push(`<a class="pchip" href="https://github.com/${DATA.user.login}?tab=followers" target="_blank" title="Followers">
<span class="v">${fmtExact(p.followers)}</span> followers</a>`);
}
if (p.following != null) {
chips.push(`<a class="pchip" href="https://github.com/${DATA.user.login}?tab=following" target="_blank" title="Following">
<span class="v">${fmtExact(p.following)}</span> following</a>`);
}
if (p.sponsors && (p.sponsors_count || 0) > 0) {
const url = p.sponsors_url || `https://github.com/sponsors/${DATA.user.login}`;
const avatars = p.sponsors.slice(0, 6).map(s =>
`<img src="${s.avatar_url || ''}" alt="${s.login || ''}" title="${s.name || s.login || ''} (@${s.login || ''})">`
).join("");
chips.push(`<a class="pchip sponsor-chip" href="${url}" target="_blank" title="GitHub Sponsors">
💖 <span class="v">${fmtExact(p.sponsors_count)}</span> sponsors
${avatars ? `<span class="sponsor-avatars">${avatars}</span>` : ""}</a>`);
} else if (p.has_sponsors_listing) {
const url = p.sponsors_url || `https://github.com/sponsors/${DATA.user.login}`;
chips.push(`<a class="pchip sponsor-chip" href="${url}" target="_blank">💖 sponsor</a>`);
}
if (p.created_at) {
const yr = p.created_at.slice(0, 4);
chips.push(`<span class="pchip" title="GitHub account creation date">
since <span class="v">${yr}</span></span>`);
}
document.getElementById("hdr-profile").innerHTML = chips.join("");
}
// ---------- totals strip ----------
{
const t = DATA.totals;
const yrs = (t.first_day && t.last_day)
? (parseInt(t.last_day) - parseInt(t.first_day) + 1) : 0;
const totalsEl = document.getElementById("totals");
const stats = [
{ label: "Commits", value: fmtExact(t.commits),
delta: yrs ? `over ${yrs} years` : "" },
{ label: "Lines added", value: fmtExact(t.additions),
delta: `<span class="plus">+</span>` },
{ label: "Lines removed", value: fmtExact(t.deletions),
delta: `<span class="minus">−</span>` },
{ label: "Repositories", value: fmtExact(t.repos), delta: "" },
{ label: "Stars earned", value: fmtExact(t.stars || 0),
delta: "from repos where you authored ≥15% of commits" },
{ label: "PRs merged", value: fmtExact(t.prs_merged || 0),
delta: `of ${fmtExact(t.prs || 0)} authored` },
{ label: "Issues filed", value: fmtExact(t.issues || 0), delta: "" },
{ label: "Active days", value: fmtExact(Object.keys(DATA.by_day).length),
delta: "" },
];
totalsEl.innerHTML = stats.map(s => `
<div class="stat">
<div class="label">${s.label}</div>
<div class="value">${s.value}</div>
<div class="delta">${s.delta}</div>
</div>`).join("");
}
// ---------- career timeline ----------
{
const allJobs = (DATA.annotations && DATA.annotations.jobs) || [];
// Synthetic entries (color-only, no dates) are used for company colors
// in generic --user runs. Don't show those in the career-timeline UI.
const jobs = allJobs.filter(j => j && !j.synthetic && j.start);
const jobsUrl = (DATA.annotations && DATA.annotations.jobs_url) || "#";
const el = document.getElementById("career-timeline");
if (!jobs.length) {
document.getElementById("career-section").style.display = "none";
} else {
// Determine year range from data
const yearsArr = Object.keys(DATA.by_year).map(Number).sort();
const minY = yearsArr[0];
const maxY = yearsArr[yearsArr.length - 1];
const nYears = maxY - minY + 1;
// Parse "YYYY-MM" → fractional year (e.g. 2014-07 → 2014.5)
const parseDate = (s, fallbackEnd) => {
if (!s) return fallbackEnd;
const [y, m] = s.split("-").map(Number);
return y + ((m || 1) - 1) / 12;
};
const now = new Date();
const nowFrac = now.getUTCFullYear() + now.getUTCMonth() / 12;
// Sort jobs by start date so the timeline reads naturally
const sorted = [...jobs].sort((a, b) =>
parseDate(a.start, 0) - parseDate(b.start, 0));
// Build axis (one column per year)
const axisCells = [];
for (let y = minY; y <= maxY; y++) axisCells.push(`<div class="y">${y}</div>`);
const rows = [`
<div></div>
<div class="ct-axis" style="--years:${nYears}">${axisCells.join("")}</div>`];
for (const j of sorted) {
const startFrac = parseDate(j.start, minY);
const endFrac = j.end ? parseDate(j.end, nowFrac) : nowFrac;
const leftPct = ((startFrac - minY) / nYears) * 100;
const widthPct = ((endFrac - startFrac) / nYears) * 100;