-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
1026 lines (958 loc) · 46.8 KB
/
index.html
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>GiveHub</title>
<link rel="stylesheet" href="style.css" />
<script>
// Check authentication immediately before loading the rest of the page
(function checkAuth() {
const accessToken = localStorage.getItem('accessToken');
if (!accessToken) {
console.log('No access token found, redirecting to login');
top.location.href = '/pages/login.html';
}
})();
</script>
</head>
<body>
<!-- Header -->
<header class="app-header">
<div class="header-content">
<div class="logo-section">
<button class="menu-trigger" id="menuTrigger">
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2">
<line x1="3" y1="12" x2="21" y2="12"></line>
<line x1="3" y1="6" x2="21" y2="6"></line>
<line x1="3" y1="18" x2="21" y2="18"></line>
</svg>
</button>
<img src="/img/white-logo.svg" width="32" height="32" />
<span style="font-weight: 600; font-size: 1.25rem">The Give Hub</span>
</div>
<div class="user-section">
<button class="new-campaign-btn">
<svg
width="20"
height="20"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2">
<line x1="12" y1="5" x2="12" y2="19"></line>
<line x1="5" y1="12" x2="19" y2="12"></line>
</svg>
<span>Create Campaign</span>
</button>
<button
class="icon-button"
id="themeToggle"
aria-label="Toggle theme">
<!-- Moon icon for light mode -->
<svg
class="moon-icon"
width="20"
height="20"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2">
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path>
</svg>
<!-- Sun icon for dark mode (hidden by default) -->
<svg
class="sun-icon hidden"
width="20"
height="20"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2">
<circle cx="12" cy="12" r="5"></circle>
<line x1="12" y1="1" x2="12" y2="3"></line>
<line x1="12" y1="21" x2="12" y2="23"></line>
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
<line x1="1" y1="12" x2="3" y2="12"></line>
<line x1="21" y1="12" x2="23" y2="12"></line>
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
</svg>
</button>
<button class="icon-button">
<svg
width="20"
height="20"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2">
<path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"></path>
<path d="M13.73 21a2 2 0 0 1-3.46 0"></path>
</svg>
</button>
<div class="user-avatar"></div>
</div>
</div>
</header>
<!-- Sidebar -->
<aside class="app-sidebar" id="sidebar">
<nav class="nav-section">
<div class="nav-title">Dashboard</div>
<ul class="nav-menu">
<li class="nav-item">
<a
href="/pages/dashboard.html"
onclick="app.loadContent(this.getAttribute('href'));return false"
class="nav-link">
<svg
width="20"
height="20"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2">
<rect x="3" y="3" width="7" height="7"></rect>
<rect x="14" y="3" width="7" height="7"></rect>
<rect x="14" y="14" width="7" height="7"></rect>
<rect x="3" y="14" width="7" height="7"></rect>
</svg>
Overview
</a>
</li>
<li class="nav-item has-submenu">
<a href="#" class="nav-link submenu-toggle">
<div
style="
height: 20px;
width: 20px;
overflow: visible;
position: relative;
left: -5px;
top: -5px;
">
<svg
fill="currentColor"
height="32"
width="32"
version="1.1"
id="Capa_1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 483.656 483.656"
xml:space="preserve">
<g id="SVGRepo_bgCarrier" stroke-width="0"></g>
<g
id="SVGRepo_tracerCarrier"
stroke-linecap="round"
stroke-linejoin="round"></g>
<g id="SVGRepo_iconCarrier">
<g>
<path
d="M173.062,92.822c-2.868,2.868-5.234,6.107-7.117,9.665c-1.271,2.402-22.561,55.043-22.561,55.043 c-16.308,39.85-40.015,75.493-70.461,105.939l-14.875,14.875c-30.985,30.985-31.393,81.136-0.91,111.796 c14.871,14.957,34.665,23.192,55.735,23.192c0.021,0,0.043,0,0.065,0c11.676,0,22.961-2.539,33.237-7.341l27.615,27.615 c1.464,1.465,3.384,2.197,5.303,2.197c1.763,0,3.521-0.626,4.932-1.861l38.884,38.884c7.22,7.22,16.704,10.83,26.188,10.83 c9.484,0,18.968-3.61,26.188-10.83c14.44-14.44,14.44-37.935,0-52.375l-38.866-38.866l5.254-5.254 c1.407-1.406,2.197-3.314,2.197-5.303s-0.79-3.897-2.197-5.303l-21.867-21.867c21.578-16.055,45.081-29.328,70.271-39.637 c0,0,52.504-21.121,56.655-23.442c4.351-2.432,8.057-6.231,8.057-6.231c28.427-26.493,9.089-88.913-41.862-139.864 C261.975,83.732,200.539,65.344,173.062,92.822z M159.476,398.08c3.174-2.342,6.197-4.935,9.039-7.777l15.621-15.621 c2.372-2.372,4.786-4.687,7.22-6.977l18.864,18.865l-31.127,31.127L159.476,398.08z M233.516,462.22l-38.866-38.866l14.772-14.772 l38.869,38.87c4.161,4.161,6.452,9.693,6.452,15.578c0,0.017,0,0.034,0,0.051c-0.008,3.13-2.667,5.579-5.797,5.562 C243.353,468.612,237.774,466.478,233.516,462.22z M264.678,431.058c6.711,6.711,8.155,16.702,4.381,24.852 c-1.39-7.178-4.877-13.78-10.161-19.064l-38.87-38.87l5.784-5.784L264.678,431.058z M225.763,371.028l-4.936,4.936l-18.3-18.3 c1.775-1.521,3.558-3.029,5.363-4.508L225.763,371.028z M284.394,290.338c-41.703,17.067-79.003,41.876-110.864,73.738 l-15.621,15.621c-12.018,12.018-27.987,18.635-44.977,18.635c-0.018,0-0.036,0-0.053,0c-17.052,0-33.071-6.665-45.104-18.768 c-24.668-24.811-24.274-65.46,0.879-90.613l14.875-14.875c31.862-31.862,56.67-69.162,73.737-110.864l5.902-14.421 c6.597,26.437,24.522,56.664,51.755,83.896c23.677,23.677,50.77,41.268,76.291,49.533c2.59,0.839,5.136,1.571,7.638,2.201 L284.394,290.338z M225.578,174.843c0.114,0.385,0.22,0.767,0.346,1.156c3.029,9.352,9.4,19.205,17.941,27.746 c9.326,9.326,19.522,15.562,28.88,18.299l-21.893,21.893c-8.685-6.409-17.204-13.74-25.322-21.858 c-8.119-8.119-15.452-16.639-21.861-25.327L225.578,174.843z M287.515,207.276L287.515,207.276l-0.001-0.001l-0.016,0.016 c-3.789,3.736-18.864,0.01-33.027-14.152c-6.795-6.795-11.999-14.727-14.277-21.761c-1.681-5.192-1.627-9.515,0.141-11.283 c0.909-0.909,2.492-1.365,4.523-1.365c1.919,0,4.237,0.408,6.76,1.225c7.034,2.278,14.965,7.482,21.761,14.277 C287.56,188.413,291.278,203.512,287.515,207.276z M344.181,263.942c-1.73,1.73-2.546,2.479-5.479,4.098 c-2.933,1.619-5.832,2.457-5.832,2.457c-9.679,2.964-22.5,2.159-37.034-2.548c-10.586-3.428-21.513-8.677-32.353-15.431 l34.615-34.615c0.008-0.007,0.016-0.014,0.024-0.021c11.436-11.437,5.358-34.762-14.137-54.257 c-8.541-8.541-18.394-14.912-27.746-17.941c-11.06-3.582-20.477-2.231-26.512,3.804l0,0l-0.004-0.004l-34.636,34.636 c-6.752-10.839-11.999-21.764-15.427-32.348c-4.715-14.558-5.516-27.398-2.535-37.083c0,0,0.974-3.228,2.14-5.229 c1.166-2.001,2.661-4.292,4.402-6.033c5.725-5.725,13.985-8.424,23.861-8.424c26.024,0,63.254,18.75,94.791,50.286 C345.823,188.794,364.993,243.13,344.181,263.942z"></path>
<path
d="M441.617,176.572h-68.6c-4.142,0-7.5,3.358-7.5,7.5s3.358,7.5,7.5,7.5h68.6c4.142,0,7.5-3.358,7.5-7.5 S445.759,176.572,441.617,176.572z"></path>
<path
d="M341.779,145.392c1.272,2.729,3.978,4.332,6.802,4.332c1.062,0,2.14-0.227,3.165-0.705l75.91-35.4 c3.754-1.751,5.378-6.213,3.627-9.967s-6.213-5.377-9.967-3.627l-75.91,35.4C341.653,137.176,340.029,141.638,341.779,145.392z"></path>
<path
d="M315.146,116.937c1.405,1.179,3.116,1.755,4.817,1.755c2.14,0,4.266-0.911,5.749-2.679l56.35-67.15 c2.663-3.173,2.249-7.904-0.924-10.566c-3.174-2.663-7.905-2.249-10.566,0.924l-56.35,67.15 C311.559,109.544,311.973,114.274,315.146,116.937z"></path>
<path
d="M283.326,92.646c0.65,0.174,1.303,0.257,1.946,0.257c3.311,0,6.342-2.21,7.24-5.561l20.87-77.9 c1.072-4.001-1.303-8.114-5.304-9.186c-3.998-1.072-8.113,1.302-9.186,5.304l-20.87,77.9 C276.95,87.462,279.325,91.574,283.326,92.646z"></path>
</g>
</g>
</svg>
</div>
Campaigns
<svg
class="submenu-arrow"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2">
<polyline points="6 9 12 15 18 9"></polyline>
</svg>
</a>
<ul class="submenu">
<li class="submenu-item">
<a
href="/pages/browse.html"
onclick="app.loadContent(this.getAttribute('href'));return false"
class="submenu-link">
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 38 38.003"
height="24"
style="translate: -4px 6px">
<path
fill="currentColor"
fill-opacity="0.403922"
stroke-width="0.2"
stroke-linejoin="round"
d="M 38 0 L 38 7 L 31 7 L 31 0 L 38 0 Z M 29 0 L 29 7 L 22 7 L 22 0 L 29 0 Z M 20 0 L 20 7 L 13 7 L 13 0 L 20 0 Z M 38 9 L 38 16 L 31 16 L 31 9 L 38 9 Z M 29 9 L 29 16 L 22 16 L 22 9 L 29 9 Z M 20 9 L 20 16 L 13 16 L 13 9 L 20 9 Z M 38 18 L 38 25 L 31 25 L 31 18 L 38 18 Z M 29 18 L 29 25 L 22 25 L 22 18 L 29 18 Z M 20 18 L 20 25 L 13 25 L 13 18 L 20 18 Z"></path>
<path
fill="currentColor"
fill-opacity="1"
stroke-width="0.2"
stroke-linejoin="round"
d="M 4.651 37.205 C 3.587 38.269 1.862 38.269 0.798 37.205 C -0.266 36.141 -0.266 34.416 0.798 33.353 L 8.672 25.48 C 7.611 23.74 7 21.69 7 19.5 C 7 13.15 12.149 8 18.5 8 C 24.852 8 30 13.15 30 19.5 C 30 25.85 24.852 31.003 18.5 31.003 C 16.312 31.003 14.266 30.392 12.525 29.331 L 4.651 37.205 Z M 18.5 12 C 14.358 12 11 15.36 11 19.5 C 11 23.65 14.358 27 18.5 27 C 22.642 27 26 23.65 26 19.5 C 26 15.36 22.642 12 18.5 12 Z"></path>
</svg>
Browse Campaigns
</a>
</li>
<li class="submenu-item">
<a
href="/pages/my-campaigns.html"
onclick="app.loadContent(this.getAttribute('href'));return false"
class="submenu-link">
<svg
height="24"
style="translate: -4px 6px; fill: currentColor"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 144.6366 132.5207"
xmlns:bx="https://boxy-svg.com">
<path
style="stroke-width: 0.25px"
d="M 42.5092 55.8546 L 51.2474 64.5928 L 51.6115 28.7298 C 51.2504 24.8357 53.0824 22.7519 55.0703 21.8122 L 129.163 21.6302 C 134.474 21.5657 135.262 24.3616 135.08 28.1838 L 134.534 117.653 C 134.271 118.945 134.451 122.527 130.437 122.114 L 56.1626 122.114 C 54.0647 121.335 52.0536 121.124 51.0653 118.745 L 51.3371 105.912 L 42.5092 97.2661 L 42.5092 125.481 C 42.5092 125.481 44.6373 133.054 53.2499 132.491 L 136.262 132.034 C 141.177 132.146 144.411 129.678 144.637 123.66 L 144.09 22.7224 C 143.914 18.101 141.639 12.3835 131.347 12.1638 L 55.4344 12.5279 C 47.9014 12.944 42.849 17.964 42.5092 24.907 L 42.5092 55.8546 Z"></path>
<g
style="transform-origin: 41.8172px 149.59px"
transform="matrix(0.707107, -0.707107, 0.681986, 0.681986, -2.477895, -75.941317)">
<rect
x="32.2784"
y="122.334"
width="18.9962"
height="54.1213"></rect>
<path
d="M 38.1357 101.9 H 46.0285 A 5.427 4.9347 0 0 1 51.4555 106.8347 V 118.4935 H 33.3246 A 0.6159 0.56 0 0 1 32.7087 117.9335 V 106.8347 A 5.427 4.9347 0 0 1 38.1357 101.9 Z"
bx:shape="rect 32.7087 101.9 18.7468 16.5935 5.427 5.427 0 0.6159 4.9347 4.9347 0 0.56 1@3219cbdd"
style="stroke-width: 0.8376"></path>
<path
d="M -41.5894 -197.28 L -32.1788 -180.1841 L -51 -180.1841 L -41.5894 -197.28 Z"
style="stroke-width: 0.9074"
transform="matrix(-1, 0, 0, -1, 0, 0)"></path>
</g>
<g transform="matrix(1, 0, 0, 1, -32.221112, -53.117101)">
<path
d="M 136.6938 68.6308 L 115.2253 68.6724 C 115.2253 58.477 119.6907 53.1171 125.672 53.1171 C 131.6533 53.1171 136.6938 58.9903 136.6938 68.6308 Z"
style="
stroke-width: 7.3056;
fill: none;
stroke: rgb(139, 138, 138);
"></path>
<path
style="stroke-width: 0.25px; fill: rgb(165, 165, 165)"
d="M 95.2914 89.1537 C 95.2914 89.1537 98.8763 79.1538 102.3837 75.3524 C 104.5983 72.9522 110.71 70.1889 110.71 70.1889 L 141.1038 69.9853 C 141.1038 69.9853 146.8518 72.6963 148.9629 74.9691 C 152.4647 78.7391 156.2469 88.5787 156.2469 88.5787 L 95.2914 89.1537 Z"></path>
</g>
<rect
x="65.3672"
y="42.5583"
width="16.74"
height="15.5443"
rx="2"
ry="2"
style="
fill: none;
stroke: currentColor;
stroke-width: 4px;
"></rect>
<path
d="M 72.7239 98.6259 L 79.4639 98.6259 C 80.5679 98.6259 81.4639 99.5209 81.4639 100.626 L 81.4639 112.17 C 81.4639 113.275 80.5679 114.17 79.4639 114.17 L 67.7237 114.17 C 66.6187 114.17 65.7233 113.275 65.7233 112.17 L 65.7748 106.306"
style="
fill: none;
stroke: currentColor;
stroke-width: 4px;
"></path>
<path
d="M 66.9684 83.9173 L 66.7402 72.159 C 66.6677 70.2244 66.9418 70.4476 69.6789 70.1739 L 80.0299 70.1739 C 81.1349 70.1739 82.0299 71.0689 82.0299 72.1739 L 82.0299 83.7179 C 82.0299 84.8229 81.1349 85.7179 80.0299 85.7179 L 69.8911 85.6483 C 69.8911 85.6483 66.7658 85.9726 66.9684 83.9173 Z"
style="
fill: none;
stroke: currentColor;
stroke-width: 4px;
"></path>
<line
style="stroke-width: 8px; stroke: currentColor"
x1="93.0569"
y1="49.6179"
x2="120.911"
y2="49.6179"></line>
<line
style="stroke-width: 8px; stroke: currentColor"
x1="93.6049"
y1="103.923"
x2="121.458"
y2="103.923"></line>
<line
style="stroke-width: 8px; stroke: currentColor"
x1="93.6049"
y1="76.6869"
x2="121.459"
y2="76.6869"></line>
</svg>
My Campaigns
</a>
</li>
<li class="submenu-item">
<a
href="/user-guide.html"
onclick="app.loadContent(this.getAttribute('href'));return false"
class="submenu-link">
<svg
style="position: relative; top: 6px; left: -3px"
height="28"
viewBox="0 0 1024 1024"
class="icon"
xmlns="http://www.w3.org/2000/svg"
fill="currentColor">
<g id="SVGRepo_bgCarrier" stroke-width="0"></g>
<g
id="SVGRepo_tracerCarrier"
stroke-linecap="round"
stroke-linejoin="round"></g>
<g id="SVGRepo_iconCarrier">
<path
fill="currentColor"
d="M640 608h-64V416h64v192zm0 160v160a32 32 0 01-32 32H416a32 32 0 01-32-32V768h64v128h128V768h64zM384 608V416h64v192h-64zm256-352h-64V128H448v128h-64V96a32 32 0 0132-32h192a32 32 0 0132 32v160z"></path>
<path
fill="currentColor"
d="M220.8 256l-71.232 80 71.168 80H768V256H220.8zm-14.4-64H800a32 32 0 0132 32v224a32 32 0 01-32 32H206.4a32 32 0 01-23.936-10.752l-99.584-112a32 32 0 010-42.496l99.584-112A32 32 0 01206.4 192zm678.784 496l-71.104 80H266.816V608h547.2l71.168 80zm-56.768-144H234.88a32 32 0 00-32 32v224a32 32 0 0032 32h593.6a32 32 0 0023.936-10.752l99.584-112a32 32 0 000-42.496l-99.584-112A32 32 0 00828.48 544z"></path>
</g>
</svg>
User Guide
</a>
</li>
</ul>
</li>
<li class="nav-item">
<a
href="/pages/donors.html"
onclick="app.loadContent(this.getAttribute('href'));return false"
class="nav-link">
<svg
width="20"
height="20"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2">
<path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
<circle cx="9" cy="7" r="4"></circle>
<path d="M23 21v-2a4 4 0 0 0-3-3.87"></path>
<path d="M16 3.13a4 4 0 0 1 0 7.75"></path>
</svg>
Donors
</a>
</li>
<li class="nav-item">
<a
href="/pages/volunteer.html"
onclick="app.loadContent(this.getAttribute('href'));return false"
class="nav-link">
<svg
width="20"
fill="currentColor"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 202.73 297">
<g
id="SVGRepo_iconCarrier"
transform="matrix(1, 0, 0, 1, -47.132974, 0)">
<path
d="M47.156,188.376c0,2.861,1.109,14.855,9.212,29.09c6.86,12.052,19.88,26.147,43.843,29.262v40.243 c0,5.538,4.49,10.029,10.029,10.029c5.538,0,10.028-4.491,10.028-10.029v-49.644c0-5.538-4.49-10.029-10.028-10.029 c-16.487,0-28.643-6.465-36.128-19.216c-5.521-9.402-6.922-17.345-6.922-20.844c0-21.168,0-82.294,0-82.294 c0-1.782,0-6.519,8.237-6.519c8.235,0,8.235,4.736,8.235,6.519v34.548c0,2.736,1.117,5.354,3.095,7.246 c1.977,1.891,4.639,2.905,7.374,2.773c0.024-0.011,5.862,0.022,13.244,4.191c11.333,6.402,20.478,19.249,26.445,37.151 c1.752,5.255,7.432,8.097,12.686,6.344c5.255-1.752,8.095-7.432,6.343-12.686c-12.976-38.932-35.79-50.37-49.128-53.701V38.037 c0-2.17,0-5.803,8.236-5.803c8.235,0,8.235,3.633,8.235,5.803v54.73c0,5.539,4.491,10.029,10.029,10.029s10.028-4.49,10.028-10.029 V25.86c0-2.17,0-5.803,8.236-5.803c8.235,0,8.235,3.633,8.235,5.803v66.907c0,5.539,4.491,10.029,10.029,10.029 s10.029-4.49,10.029-10.029v-54.73c0-2.17,0-5.803,8.235-5.803c8.236,0,8.236,3.633,8.236,5.803v71.278 c0,5.538,4.491,10.029,10.029,10.029c5.539,0,10.029-4.491,10.029-10.029V71.849c0-1.782,0-6.519,8.236-6.519 c8.236,0,8.244,4.736,8.244,6.519v116.402c0.011,0.177,0.717,18.087-9.919,29.341c-6.086,6.441-15.135,9.706-26.894,9.706 c-5.539,0-10.029,4.491-10.029,10.029v49.644c0,5.538,4.49,10.029,10.029,10.029c5.538,0,10.028-4.491,10.028-10.029v-40.253 c12.868-1.712,23.415-6.855,31.443-15.35c15.825-16.745,15.516-40.586,15.391-43.899V71.849c0-15.647-11.636-26.577-28.294-26.577 c-2.912,0-5.667,0.342-8.236,0.977v-8.211c0-15.469-11.371-25.86-28.295-25.86c-3.986,0-7.66,0.583-10.954,1.667 C169.732,5.253,160.514,0,148.487,0c-12.028,0-21.245,5.253-25.575,13.844c-3.294-1.084-6.968-1.667-10.954-1.667 c-16.924,0-28.295,10.392-28.295,25.86v41.307c-2.569-0.635-5.324-0.976-8.235-0.976c-16.66,0-28.295,10.93-28.295,26.577 C47.132,104.944,47.156,166.737,47.156,188.376z"></path>
</g>
</svg>
Volunteers
</a>
</li>
</ul>
<div class="nav-title" style="margin-top: 2rem">Management</div>
<ul class="nav-menu">
<li class="nav-item has-submenu">
<a href="#" class="nav-link submenu-toggle">
<svg
width="20"
height="20"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2">
<circle cx="12" cy="12" r="3"></circle>
<path
d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path>
</svg>
Settings
<svg
class="submenu-arrow"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2">
<polyline points="6 9 12 15 18 9"></polyline>
</svg>
</a>
<ul class="submenu">
<li class="submenu-item">
<a
href="/pages/settings.html"
onclick="app.loadContent(this.getAttribute('href'));return false"
class="submenu-link">
<svg
width="20"
height="20"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2">
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
<circle cx="12" cy="7" r="4"></circle>
</svg>
Profile
</a>
</li>
<li class="submenu-item">
<a
href="/pages/id-verify.html"
onclick="app.loadContent(this.getAttribute('href'));return false"
class="submenu-link">
<svg
width="20"
height="20"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2">
<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
<polyline points="22 4 12 14.01 9 11.01"></polyline>
</svg>
ID Verification
</a>
</li>
</ul>
</li>
<li class="nav-item">
<a
href="/user-guide.html"
onclick="app.loadContent(this.getAttribute('href'));return false"
class="nav-link">
<svg
style="position: relative; top: 6px; left: -3px"
height="28"
viewBox="0 0 1024 1024"
class="icon"
xmlns="http://www.w3.org/2000/svg"
fill="currentColor">
<g id="SVGRepo_bgCarrier" stroke-width="0"></g>
<g
id="SVGRepo_tracerCarrier"
stroke-linecap="round"
stroke-linejoin="round"></g>
<g id="SVGRepo_iconCarrier">
<path
fill="currentColor"
d="M640 608h-64V416h64v192zm0 160v160a32 32 0 01-32 32H416a32 32 0 01-32-32V768h64v128h128V768h64zM384 608V416h64v192h-64zm256-352h-64V128H448v128h-64V96a32 32 0 0132-32h192a32 32 0 0132 32v160z"></path>
<path
fill="currentColor"
d="M220.8 256l-71.232 80 71.168 80H768V256H220.8zm-14.4-64H800a32 32 0 0132 32v224a32 32 0 01-32 32H206.4a32 32 0 01-23.936-10.752l-99.584-112a32 32 0 010-42.496l99.584-112A32 32 0 01206.4 192zm678.784 496l-71.104 80H266.816V608h547.2l71.168 80zm-56.768-144H234.88a32 32 0 00-32 32v224a32 32 0 0032 32h593.6a32 32 0 0023.936-10.752l99.584-112a32 32 0 000-42.496l-99.584-112A32 32 0 00828.48 544z"></path>
</g>
</svg>
User Guide
</a>
</li>
<li class="nav-item">
<a
href="/pages/logout.html"
onclick="app.loadContent(this.getAttribute('href'));return false"
class="nav-link">
<svg
width="20"
height="20"
fill="currentColor"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 512 512">
<path
d="M377.9 105.9L500.7 228.7c7.2 7.2 11.3 17.1 11.3 27.3s-4.1 20.1-11.3 27.3L377.9 406.1c-6.4 6.4-15 9.9-24 9.9c-18.7 0-33.9-15.2-33.9-33.9l0-62.1-128 0c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32l128 0 0-62.1c0-18.7 15.2-33.9 33.9-33.9c9 0 17.6 3.6 24 9.9zM160 96L96 96c-17.7 0-32 14.3-32 32l0 256c0 17.7 14.3 32 32 32l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c-53 0-96-43-96-96L0 128C0 75 43 32 96 32l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32z" />
</svg>
Logout
</a>
</li>
</ul>
</nav>
</aside>
<!-- Overlay for mobile -->
<div class="overlay" id="overlay"></div>
<!-- Main Content -->
<main class="app-main">
<div class="frame-loader" id="frameLoader"></div>
<div class="frame-error" id="frameError">
<div class="frame-error-content">
<h2>Unable to Load Content</h2>
<p>
There was a problem loading the requested page. Please try again.
</p>
<button class="retry-button" onclick="reloadFrame()">Retry</button>
</div>
</div>
<iframe
id="contentFrame"
class="content-frame"
src="about:blank"
title="Content Area">
</iframe>
</main>
<script type="module">
// Import the functions you need from the SDKs you need
import { initializeApp } from 'https://www.gstatic.com/firebasejs/11.0.2/firebase-app.js';
import { getAnalytics } from 'https://www.gstatic.com/firebasejs/11.0.2/firebase-analytics.js';
// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.com/docs/web/setup#available-libraries
// Your web app's Firebase configuration
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
const firebaseConfig = {
apiKey: 'AIzaSyBD46eiABWftJ6WdJpFsQxF5iUknUoTFIo',
authDomain: 'the-givehub.firebaseapp.com',
projectId: 'the-givehub',
storageBucket: 'the-givehub.firebasestorage.app',
messagingSenderId: '503214679990',
appId: '1:503214679990:web:88bb2bc6116709931ec317',
measurementId: 'G-8SWNP3PJ94',
};
// Initialize Firebase
const app = initializeApp(firebaseConfig);
const analytics = getAnalytics(app);
</script>
<script>
(function () {
const $ = (str) => document.querySelector(str);
const $$ = (str) => document.querySelectorAll(str);
let app = {
init() {
// Handle navigation clicks
document.querySelectorAll('.nav-link').forEach((link) => {
link.addEventListener('click', (e) => {
e.preventDefault();
// Remove active class from all links
document
.querySelectorAll('.nav-link')
.forEach((l) => l.classList.remove('active'));
// Add active class to clicked link
link.classList.add('active');
// Close sidebar on mobile
if (window.innerWidth <= 768) {
app.elements.sidebar.classList.remove('active');
app.elements.overlay.classList.remove('active');
}
// Load content based on href
const url = link.getAttribute('href');
if (url && url !== '#') {
app.loadContent(url);
}
});
});
// Setup event listeners for expanding nav items with children
document.querySelectorAll('.submenu-toggle').forEach((toggle) => {
toggle.addEventListener('click', (e) => {
e.preventDefault();
// Get the parent li with class 'has-submenu'
const parent = toggle.closest('.has-submenu');
// Toggle active class
parent.classList.toggle('active');
// If this is in a mobile view, adjust sidebar height
if (window.innerWidth <= 768) {
app.adjustSidebarHeight();
}
});
});
// Preserve sub-menu state when navigating
document.querySelectorAll('.submenu-link').forEach((link) => {
link.addEventListener('click', (e) => {
// Remove active class from all links
document
.querySelectorAll('.nav-link, .submenu-link')
.forEach((l) => l.classList.remove('active'));
// Add active class to clicked link
link.classList.add('active');
// Also mark the parent toggle as active
const parentToggle = link
.closest('.has-submenu')
.querySelector('.submenu-toggle');
if (parentToggle) {
parentToggle.classList.add('active');
}
// Close sidebar on mobile
if (window.innerWidth <= 768) {
app.elements.sidebar.classList.remove('active');
app.elements.overlay.classList.remove('active');
}
// Load content based on href
const url = link.getAttribute('href');
if (url && url !== '#') {
app.loadContent(url);
}
});
});
// Handle clicking new campaign button
$('.new-campaign-btn').addEventListener('click', function (e) {
e.preventDefault();
app.loadContent('/pages/new-campaign.html');
return false;
});
app.auth.init();
app.theme.init();
// Initialize with default content
app.loadContent('/pages/browse.html');
// Event listeners
app.elements.menuTrigger.addEventListener(
'click',
app.toggleSidebar
);
app.elements.overlay.addEventListener('click', app.toggleSidebar);
// Close sidebar on window resize if in mobile view
window.addEventListener('resize', () => {
if (
window.innerWidth > 768 &&
app.elements.sidebar.classList.contains('active')
) {
app.elements.sidebar.classList.remove('active');
app.elements.overlay.classList.remove('active');
}
});
},
theme: {
init() {
const themeToggle = document.getElementById('themeToggle');
const moonIcon = themeToggle.querySelector('.moon-icon');
const sunIcon = themeToggle.querySelector('.sun-icon');
// Check for saved theme preference or system preference
const savedTheme = localStorage.getItem('theme');
const prefersDark = window.matchMedia(
'(prefers-color-scheme: dark)'
).matches;
// Set initial theme
if (savedTheme === 'dark' || (!savedTheme && prefersDark)) {
document.documentElement.setAttribute('data-theme', 'dark');
moonIcon.classList.add('hidden');
sunIcon.classList.remove('hidden');
}
// Toggle theme
themeToggle.addEventListener('click', () => {
const isDark =
document.documentElement.getAttribute('data-theme') ===
'dark';
if (isDark) {
document.documentElement.removeAttribute('data-theme');
localStorage.setItem('theme', 'light');
moonIcon.classList.remove('hidden');
sunIcon.classList.add('hidden');
} else {
document.documentElement.setAttribute('data-theme', 'dark');
localStorage.setItem('theme', 'dark');
moonIcon.classList.add('hidden');
sunIcon.classList.remove('hidden');
}
});
},
},
config: {
account: {
id: 1,
name: 'Better Living',
},
user: {
id: 1,
name: 'Chris Robison',
username: 'cdr',
pic: '/img/profilepics/cdr.png',
},
navUrls: {
overview: '/dashboard.html',
campaigns: '/browse.html',
donors: '/donors.html',
settings: '/pages/settings.html',
},
},
elements: {
menuTrigger: document.getElementById('menuTrigger'),
sidebar: document.getElementById('sidebar'),
overlay: document.getElementById('overlay'),
contentFrame: document.getElementById('contentFrame'),
frameLoader: document.getElementById('frameLoader'),
frameError: document.getElementById('frameError'),
},
state: {
loaded: false,
},
data: {
mycampaigns: [],
},
// Toggle sidebar
toggleSidebar() {
this.elements.sidebar.classList.toggle('active');
this.elements.overlay.classList.toggle('active');
},
loadContent(url) {
// First, check authentication
if (!this.auth.isAuthenticated()) {
top.location.href = '/pages/login.html';
return;
}
this.elements.frameLoader.classList.add('active');
this.elements.frameError.classList.remove('active');
this.elements.contentFrame.onload = () => {
this.elements.frameLoader.classList.remove('active');
};
this.elements.contentFrame.onerror = () => {
this.elements.frameLoader.classList.remove('active');
this.elements.frameError.classList.add('active');
};
try {
this.elements.contentFrame.src = url;
} catch (error) {
this.elements.frameLoader.classList.remove('active');
this.elements.frameError.classList.add('active');
}
},
reloadFrame() {
if (this.elements.contentFrame.src !== 'about:blank') {
this.loadContent(this.elements.contentFrame.src);
}
},
adjustSidebarHeight() {
// If any submenu is open, make sure the sidebar can scroll
const activeSubmenus = document.querySelectorAll(
'.has-submenu.active'
);
if (activeSubmenus.length > 0) {
this.elements.sidebar.style.overflowY = 'auto';
} else {
this.elements.sidebar.style.overflowY = '';
}
},
};
// Replace the existing auth object in your app
app.auth = {
init() {
// Check if user is authenticated first using local storage
const accessToken = localStorage.getItem('accessToken');
if (!accessToken) {
console.log('No access token found, redirecting to login');
top.location.href = '/pages/login.html';
return;
}
// If we have a token, verify it's valid by making a request to the server
fetch('/api/User/me', {
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
}
})
.then(response => {
if (!response.ok) {
throw new Error('Invalid token');
}
return response.json();
})
.then(userData => {
// User is authenticated, update UI
console.log('User is authenticated:', userData);
document.body.setAttribute('data-auth-status', 'authenticated');
// Update avatar if available
if (userData.profile && userData.profile.avatar) {
const avatarURL = `/img/avatars/${userData.profile.avatar}`;
const avatar = document.querySelector('.user-avatar');
const initials = userData.username ? userData.username.substring(0, 2).toUpperCase() : 'US';
console.log('Avatar URL:', avatarURL);
if (avatar) {
avatar.innerHTML = `<img src="${avatarURL}" alt="${userData.username}" class="user-avatar-img" />`;
} else {
// If no avatar, use initials
document.querySelector('.user-avatar').textContent = initials;
}
}
})
.catch(error => {
console.error('Authentication error:', error);
// Token is invalid, clear storage and redirect
localStorage.removeItem('accessToken');
localStorage.removeItem('refreshToken');
top.location.href = '/pages/login.html';
});
},
// Helper method to check current auth status
isAuthenticated() {
return localStorage.getItem('accessToken') !== null;
},
// Logout function
logout() {
localStorage.removeItem('accessToken');
localStorage.removeItem('refreshToken');
top.location.href = '/pages/login.html';
}
};
window.app = app;
app.init();
app.profileCompletion = {
init() {
// Only initialize if the sidebar exists
if (document.querySelector('.app-sidebar')) {
this.createCompletionIndicator();
this.fetchProfileCompletionData();
}
},
createCompletionIndicator() {
// Create the profile completion HTML
const completionHTML = `
<div class="profile-completion-indicator">
<div class="indicator-header">
<h3>Profile Completion</h3>
<span id="completion-percentage">0%</span>
</div>
<div class="indicator-progress">
<div id="completion-progress-bar"></div>
</div>
<div class="indicator-message">
<p>Complete your profile to get the most out of GiveHub</p>
<a
href="/pages/settings.html"
onclick="app.loadContent(this.getAttribute('href'));return false"
id="complete-profile-link">Complete Profile →</a>
</div>
</div>
`;
// Find the sidebar
const sidebar = document.querySelector('.app-sidebar');
// Append the indicator to the bottom of the sidebar
const indicatorContainer = document.createElement('div');
indicatorContainer.className = 'profile-completion-container';
indicatorContainer.innerHTML = completionHTML;
sidebar.appendChild(indicatorContainer);
},
fetchProfileCompletionData() {
// Check if we're logged in
const token = localStorage.getItem('accessToken');
if (!token) {
console.log('User not logged in, not showing profile completion');
document.querySelector(
'.profile-completion-indicator'
).style.display = 'none';
return;
}
// Try to fetch real profile data if possible
fetch('/api/user/me', {
headers: {
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json',
},
})
.then((response) => {
if (!response.ok) {
throw new Error('Failed to fetch profile data');
}
return response.json();
})
.then((userData) => {
this.calculateCompletion(userData);
})
.catch((error) => {
console.error('Error fetching profile data:', error);
// Use mock data for demonstration
const mockData = {
displayName: true,
email: true,
personalInfo: {
firstName: true,
lastName: true,
phone: false,
location: false,
},
profile: {
bio: false,
avatar: true,
},
};
this.calculateCompletion(mockData);
});
},
calculateCompletion(userData) {
// Define the required fields and their paths in the user object
const requiredFields = [
{ name: 'displayName', path: 'displayName' },
{ name: 'email', path: 'email' },
{ name: 'firstName', path: 'personalInfo.firstName' },
{ name: 'lastName', path: 'personalInfo.lastName' },
{ name: 'phone', path: 'personalInfo.phone' },
{ name: 'location', path: 'personalInfo.location' },
{ name: 'bio', path: 'profile.bio' },
{ name: 'avatar', path: 'profile.avatar' },
];
// Count completed fields
let completedCount = 0;
requiredFields.forEach((field) => {
// Navigate the path to check if the field exists and has a value
const parts = field.path.split('.');
let value = userData;
for (const part of parts) {
if (value && value[part]) {
value = value[part];
} else {
value = null;
break;
}
}
if (value) {
completedCount++;
}
});
// Calculate percentage
const percentage = Math.round(
(completedCount / requiredFields.length) * 100
);
// Update the UI
this.updateCompletionUI(percentage);
},
updateCompletionUI(percentage) {
const percentageElement = document.getElementById(
'completion-percentage'
);
const progressBar = document.getElementById(
'completion-progress-bar'
);
const message = document.querySelector('.indicator-message');
// Update percentage text
if (percentageElement) {
percentageElement.textContent = `${percentage}%`;
}
// Update progress bar width
if (progressBar) {
progressBar.style.width = `${percentage}%`;
}
// Hide message if profile is complete