-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
1451 lines (1360 loc) · 56.6 KB
/
index.js
File metadata and controls
1451 lines (1360 loc) · 56.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
var categories = {
all: "All",
tide: "TIDE",
tideInClass: "In-Class Tools",
resourcesPresentation: "Presentation Material",
tideMathScience: "Math/Science",
tideSpanish: "Spanish",
foothill: "Foothill",
hotlines: "Mental Health",
resources: "Academic Resources", // Support, tools, resources
resourcesGoogle: "Google",
resourcesSupport: "Support",
resourcesGrammar: "English/Grammar",
resourcesMath: "Math",
schedules: "Schedules",
college: "College Apps",
};
var tabs = [
[categories.all, []],
[categories.tide, [
categories.tideInClass,
categories.tideMathScience,
categories.tideSpanish]],
[categories.foothill, []],
[categories.resources, [
categories.resourcesSupport,
categories.resourcesPresentation,
categories.resourcesGrammar,
categories.resourcesMath,
categories.resourcesGoogle]],
[categories.college, []],
];
var selectedCategory;
var categorySectionShowing;
var categoryButtons = {};
var hotlineCategories = {
call: "Call",
text: "Text",
alwaysActive: "24/7",
anonymous: "Anonymous",
emergency: "Immediate Emergency"
}
var clinicCities = {
redwoodCity: "Redwood City",
paloAlto: "Palo Alto",
eastPaloAlto: "East Palo Alto",
mountainView: "Mountain View",
sanJose: "San Jose",
sanMateo: "San Mateo",
sunnyvale: "Sunnyvale",
dalyCity: "Daly City",
sanFrancisco: "San Francisco",
all: "All Nearby Cities"
}
var linkWeights = [];
var infoWeights = [];
var resources = {
links: [
{
link: "https://apstudents.collegeboard.org/",
name: "AP Classroom",
image: "pics/ap_classroom.png",
weightIndex: 7,
categories: [categories.all, categories.tide, categories.tideMathScience],
tags: "ap classroom apclassroom students college board advanced placement math calculus science physics collegeboard assignments"
},
{
link: "https://www.canva.com/",
name: "Canva",
image: "pics/canva.png",
weightIndex: 16,
categories: [categories.all, categories.resources, categories.resourcesPresentation],
tags: "canva presentations posters pamphlets graphic design video editing editor"
},
{
link: "https://www.ck12.org/student/",
name: "CK-12",
image: "pics/ck12.png",
weightIndex: 44,
categories: [categories.all, categories.resources, categories.resourcesMath, categories.tide, categories.tideMathScience],
tags: "ck-12 ck 12 learning lessons education resources"
},
{
link: "https://app.clickup.com/",
name: "ClickUp",
image: "pics/clickup.png",
weightIndex: 36,
categories: [categories.all, categories.tide, categories.tideInClass],
tags: "clickup click up click-up sprint collaboration"
},
{
link: "https://www.collegeboard.org/",
name: "College Board",
image: "pics/college_board.png",
weightIndex: 15,
categories: [categories.all, categories.college],
tags: "college board collegeboard sat psat applications"
},
{
link: "https://apply.commonapp.org/dashboard",
name: "Common App",
image: "pics/common_app.png",
weightIndex: 29,
categories: [categories.all, categories.college],
tags: "commonapp common app applications collegea university universities applying"
},
{
link: "https://conjuguemos.com/",
name: "Conjuguemos",
image: "pics/conjuguemos.jpg",
weightIndex: 47,
categories: [categories.all, categories.tide, categories.tideSpanish],
tags: "conjuguemos spanish conjugations espanol language"
},
{
link: "https://www.calstate.edu/apply",
name: "CSU Apply",
image: "pics/csu.png",
weightIndex: 31,
categories: [categories.all, categories.college],
tags: "california state university universities cal state calstate csu applications applying colleges"
},
{
link: "https://www.desmos.com/calculator",
name: "Desmos",
image: "pics/desmos.png",
weightIndex: 22,
categories: [categories.all, categories.resources, categories.resourcesMath, categories.tide, categories.tideMathScience],
tags: "desmos online graphing calculator science physics mathematics calculus algebra graphs plotting scientific"
},
{
link: "https://www.easybib.com/",
name: "EasyBib",
image: "pics/easy_bib.png",
weightIndex: 19,
categories: [categories.all, categories.resources, categories.resourcesGrammar],
tags: "easybib easy bib bibliography chegg citations citing sources works cited essays"
},
{
link: "https://auth.edgenuity.com/Login/Login/Student",
name: "Edgenuity",
image: "pics/edgenuity.svg",
weightIndex: 2,
categories: [categories.all, categories.tide, categories.tideInClass],
tags: "PE P.E. physical education edgenuity lessons educational assignments"
},
{
link: "https://edpuzzle.com/",
name: "Edpuzzle",
image: "pics/edpuzzle.png",
weightIndex: 46,
categories: [categories.all, categories.tide, categories.tideInClass],
tags: "edpuzzle video lessons"
},
{
link: "https://www.etymonline.com/",
name: "Etymonline",
image: "pics/etymology.png",
weightIndex: 26,
categories: [categories.all, categories.resources, categories.resourcesGrammar],
tags: "etymonline etymology online dictionary definitions words origin history dictionary english grammar writing",
backgroundColor: "#83001d"
},
{
link: "https://info.flip.com/en-us.html",
name: "Flip",
image: "pics/flip.jpg",
weightIndex: 45,
categories: [categories.all, categories.tide],
tags: "flip flipgrid video discussion"
},
{
link: "https://foothillcollege.instructure.com/",
name: "Foothill Canvas",
image: "pics/foothill_canvas.png",
weightIndex: 17,
categories: [categories.all, categories.foothill],
tags: "foothill college canvas fhda instructure assignments homework"
},
{
link: "https://myportal.fhda.edu/uPortal/f/home/normal/render.uP/",
name: "Foothill MyPortal",
image: "pics/foothill_myportal.png",
weightIndex: 4,
categories: [categories.all, categories.foothill],
tags: "foothill college fhda de anza myportal portal information"
},
{
link: "https://foothill.edu/",
name: "Foothill Website",
image: "pics/foothill.png",
weightIndex: 33,
categories: [categories.all, categories.foothill],
tags: "foothill website fhda homepage"
},
{
link: "https://app.formative.com/",
name: "Formative",
image: "pics/formative.png",
weightIndex: 0,
categories: [categories.all, categories.tide, categories.tideInClass],
tags: "english formative instructions class assignments homework"
},
{
link: "https://www.seq.org/Departments/Student-Services/COVID-19-Updates/Resources/Free-Internet-Programs/index.html",
name: "Free Internet Programs",
image: "pics/wifi.jpg",
weightIndex: 49,
categories: [categories.all, categories.tide, categories.resources, categories.resourcesSupport],
tags: "free internet program wifi sequoia SUHSD resources technology application home support"
},
{
link: "https://www.geogebra.org/calculator",
name: "Geogebra",
image: "pics/geogebra.png",
weightIndex: 38,
categories: [categories.all, categories.resources, categories.resourcesMath],
tags: "geogebra geometry mathmatics algebra calculator graphs plotting"
},
{
link: "https://mail.google.com/mail/u/0/#inbox",
name: "Gmail",
image: "pics/gmail.png",
weightIndex: 14,
categories: [categories.all, categories.resources, categories.resourcesGoogle],
tags: "gmail google mail inbox emails message messaging chat"
},
{
link: "https://www.grammarly.com/",
name: "Grammarly",
image: "pics/grammarly.jpg",
weightIndex: 25,
categories: [categories.all, categories.resources, categories.resourcesGrammar],
tags: "grammarly grammar grammer spelling corrections feedback sentences punctuations words english writing support essays"
},
{
link: "https://classroom.google.com/?pli=1",
name: "Google Classroom",
image: "pics/google_classroom.png",
weightIndex: 37,
categories: [categories.all, categories.resources, categories.resourcesGoogle, categories.tide, categories.tideInClass],
tags: "google classroom lessons classes"
},
{
link: "https://docs.google.com/document/u/0/?tgif=c",
name: "Google Docs",
image: "pics/docs.jpg",
weightIndex: 39,
categories: [categories.all, categories.resources, categories.resourcesGoogle],
tags: "google docs documents writing notes"
},
{
link: "https://docs.new/",
name: "New Google Doc",
image: "pics/new_doc.png",
weightIndex: 40,
categories: [categories.all, categories.resources, categories.resourcesGoogle],
tags: "google docs documents writing notes new create"
},
{
link: "https://drive.google.com/?authuser=0",
name: "Google Drive",
image: "pics/drive.png",
weightIndex: 6,
categories: [categories.all, categories.tide, categories.resources, categories.resourcesGoogle],
tags: "google drive files documents folders",
imageCoversFullBox: true
},
{
link: "https://docs.google.com/spreadsheets/u/0/?tgif=d",
name: "Google Sheets",
image: "pics/sheets.png",
weightIndex: 42,
categories: [categories.all, categories.resources, categories.resourcesGoogle],
tags: "google sheets spreadsheets"
},
{
link: "https://sheets.new/",
name: "New Google Sheet",
image: "pics/new_sheet.png",
weightIndex: 43,
categories: [categories.all, categories.resources, categories.resourcesGoogle],
tags: "google sheets spreadsheets new create"
},
{
link: "https://docs.google.com/presentation/u/0/?tgif=d",
name: "Google Slides",
image: "pics/slides.png",
weightIndex: 5,
categories: [categories.all, categories.resources, categories.resourcesGoogle, categories.resourcesPresentation],
tags: "google slides slideshows presentations"
},
{
link: "https://slides.new/",
name: "New Google Slide",
image: "pics/new_slide.png",
weightIndex: 41,
categories: [categories.all, categories.resources, categories.resourcesGoogle, categories.resourcesPresentation],
tags: "google slides slideshows presentations new create"
},
{
link: "https://ic.seq.org",
name: "Infinite Campus",
image: "pics/ic.png",
weightIndex: 3,
categories: [categories.all, categories.tide, categories.college],
tags: "sequoia tide infinite campus ic portal myportal student information schedule grades gradebook calendar attendance transcript",
backgroundColor: "#81cc31"
},
{
link: "https://im.kendallhunt.com/HS/teachers/2/index.html",
name: "Integrated Mathematics",
image: "pics/im.png",
weightIndex: 12,
categories: [categories.all, categories.tide, categories.tideMathScience],
tags: "integrated mathematics im math algebra 1 2 im kendall hunt geometry"
},
{
link: "https://kahoot.it/",
name: "Kahoot",
image: "pics/kahoot.png",
weightIndex: 11,
categories: [categories.all, categories.tide, categories.tideInClass],
tags: "kahoot live quiz"
},
{
link: "https://www.khanacademy.org/",
name: "Khan Academy",
image: "pics/khan_academy.png",
weightIndex: 21,
categories: [categories.all, categories.resources, categories.resourcesSupport],
tags: "khan academy khanacademy educational lessons practice academic support math science studying",
// imageCoversFullBox: true
},
{
link: "https://www.merriam-webster.com/",
name: "Merriam-Webster Dictionary",
image: "pics/dictionary.png",
weightIndex: 23,
categories: [categories.all, categories.resources, categories.resourcesGrammar],
tags: "merriam webster merriam-webster dictionary words english writing definitions grammar",
imageCoversFullBox: true
},
{
link: "https://www.mybib.com/#/",
name: "MyBib",
image: "pics/my_bib.png",
weightIndex: 18,
categories: [categories.all, categories.resources, categories.resourcesGrammar],
tags: "mybib bibliography citations citing sources works cited essays"
},
{
link: "https://nearpod.com/student/",
name: "Nearpod",
image: "pics/nearpod.png",
weightIndex: 35,
categories: [categories.all, categories.tide, categories.tideInClass],
tags: "nearpod near pod lessons"
},
{
link: "https://paper.co/",
name: "Paper Tutoring",
image: "pics/paper.png",
weightIndex: 20,
categories: [categories.all, categories.resources, categories.resourcesSupport],
tags: "paper tutoring help academic support feedback essays papers educational"
},
{
link: "https://app.peardeck.com/join",
name: "Peardeck",
image: "pics/peardeck.png",
weightIndex: 13,
categories: [categories.all, categories.tide, categories.tideInClass],
tags: "peardeck pear deck presentation slideshow live pd joinpd",
imageCoversFullBox: true
},
{
link: "https://quizizz.com/join",
name: "Quizizz",
image: "pics/quizizz.png",
weightIndex: 35,
categories: [categories.all, categories.tide, categories.tideInClass],
tags: "quizizz live"
},
{
link: "https://quizlet.com/",
name: "Quizlet",
image: "pics/quizlet.png",
weightIndex: 9,
categories: [categories.all, categories.tide, categories.tideSpanish, categories.resources, categories.resourcesSupport],
tags: "quizlet spanish flash cards flashcards studying"
},
{
link: "https://quizlet.com/live",
name: "Quizlet Live",
image: "pics/quizlet_live.png",
weightIndex: 10,
categories: [categories.all, categories.tide, categories.tideInClass],
tags: "quizlet live",
backgroundColor: "#2b417c"
},
{
link: "https://app.scoir.com/student/dashboard",
name: "Scoir",
image: "pics/scoir.png",
weightIndex: 28,
categories: [categories.all, categories.college],
tags: "scoir college university universities applications colleges applying information counseling"
},
{
link: "https://www.slidescarnival.com/",
name: "Slides Carnival",
image: "pics/slides_carnival.png",
weightIndex: 27,
categories: [categories.all, categories.resources, categories.resourcesPresentation],
tags: "slidescarnival carnival slides slideshow templates themes decorations presentations"
},
{
link: "https://sequoia.instructure.com/",
name: "TIDE Canvas",
image: "pics/tide_canvas.png",
weightIndex: 34,
categories: [categories.all, categories.tide],
tags: "tide canvas sequoia instructure assignments homework"
},
{
link: "https://sequoiauhsd.gethelphss.com/Login/landing",
name: "TIDE Tech Support",
image: "pics/tech_support.png",
weightIndex: 32,
categories: [categories.all, categories.resources, categories.resourcesSupport, categories.tide],
tags: "sequoia tide help technical support computer problems gethelp broken fix"
},
{
link: "https://www.thesaurus.com/",
name: "Thesaurus",
image: "pics/thesaurus.png",
weightIndex: 24,
categories: [categories.all, categories.resources, categories.resourcesGrammar],
tags: "thesaurus words dictionary synonyms antonyms english writing grammar support"
},
{
link: "https://www.tideacademy.org/",
name: "TIDE Website",
image: "pics/tide.png",
weightIndex: 1,
categories: [categories.all, categories.tide],
tags: "tide academy website T.I.D.E. homepage"
},
{
link: "https://apply.universityofcalifornia.edu/my-application/login",
name: "UC Apply",
image: "pics/uc.png",
weightIndex: 30,
categories: [categories.all, categories.college],
tags: "uc university of california applications applying colleges UCB berkeley UCD davis UCI irvine UCLA los angeles UCM merced UCR riverside UCSD san diego UCSB santa barbara UCSC santa cruz",
imageCoversFullBox: true
},
{
link: "https://www.vhlcentral.com/home",
name: "VHL Central",
image: "pics/vhl.png",
weightIndex: 8,
categories: [categories.all, categories.tide, categories.tideSpanish, categories.tideInClass],
tags: "vhl central vhlcentral vista higher learning spanish espanol assignments lessons"
},
{
link: "https://yearbookavenue.jostens.com/",
name: "Yearbook",
image: "pics/yearbook.jpg",
weightIndex: 48,
categories: [categories.all, categories.tide],
tags: "yearbook year book jostens tide order"
}
],
info: [
{
type: "link",
text: "Bell Schedule",
link: "https://www.tideacademy.org/About/Bell-Schedule/index.html",
image: "pics/bell.png",
weightIndex: 0,
},
{
type: "link",
text: "Class Schedule",
link: "https://ic.seq.org/campus/nav-wrapper/student/portal/student/schedule",
image: "pics/class.png",
weightIndex: 2,
},
{
type: "link",
text: "TIDE Calendar",
link: "https://www.tideacademy.org/Calendar/",
image: "pics/calendar.png",
weightIndex: 6,
},
{
type: "page",
text: "Mental Health Hotlines",
id: "hotlines",
html: `
<div id="info-pullout-category-bar-wrapper"><div id="info-pullout-category-bar"></div></div>
<div id="hotlines-numbers-section"></div>`,
image: "pics/hotlines.png",
weightIndex: 3,
},
{
type: "link",
text: "Staff Directory",
link: "https://www.tideacademy.org/About/Staff-Directory/index.html",
image: "pics/staff.png",
weightIndex: 5,
},
{
type: "link",
text: "Bus Schedule",
link: "https://www.tideacademy.org/Students/Bus-Schedule/index.html",
image: "pics/bus.png",
weightIndex: 1,
},
{
type: "page",
text: "Local Teen Clinics",
// html: "<div style='text-align: center; background-color: white; padding: 10px;'><span style='font-weight: bold;'>NOTE:</span></br>The Local Teen Clinics section is still a work in progress, but it will contain the following information:<img src='pics/local_teen_clinics.png' style='width: 75%; display: block; margin: auto; margin-top: 10px;'></img></div>",
html: `
<div id="info-pullout-category-bar-wrapper"><div id="info-pullout-category-bar"></div></div>
<div id="teen-clinics-section"></div>`,
image: "pics/clinic.png",
id: "clinics",
weightIndex: 4,
},
],
mentalHealthHotlines: [
{
label: "Behavior Health and Recovery Services",
numbers: [
{
categories: [hotlineCategories.call, hotlineCategories.alwaysActive],
number: "800-686-0101"
}
]
},
{
label: "Communities Overcoming Relationship Abuse",
numbers: [
{
number: "800-300-1080",
categories: [hotlineCategories.call, hotlineCategories.alwaysActive, hotlineCategories.anonymous],
}
]
},
{
label: "Crisis Text Line",
numbers: [
{
number: `741-741: "START"`,
categories: [hotlineCategories.text, hotlineCategories.alwaysActive, hotlineCategories.anonymous],
}
]
},
{
label: "Disaster Distress Helpline",
numbers: [
{
number: "800-985-5990",
categories: [hotlineCategories.call, hotlineCategories.alwaysActive],
},
{
number: `6674: "TalkWithUs" or "Hablamos"`,
categories: [hotlineCategories.text, hotlineCategories.alwaysActive],
}
]
},
{
label: "Domestic Violence Hotline",
numbers: [
{
number: "866-799-7233",
categories: [hotlineCategories.call, hotlineCategories.alwaysActive, hotlineCategories.anonymous],
}
]
},
{
label: "Grief Counseling Hotline",
numbers: [
{
number: "415-499-1195",
categories: [hotlineCategories.call, hotlineCategories.alwaysActive],
}
]
},
{
label: "KARA - Grief Support",
numbers: [
{
number: "650-321-5273",
categories: [hotlineCategories.call],
time: "M-Th, 9-4 PM & F, 9-1 PM",
}
]
},
{
label: "Mills Peninsula Burlingame Psychiatric Emergency Services",
numbers: [
{
number: "650-696-5915",
categories: [hotlineCategories.call, hotlineCategories.alwaysActive, hotlineCategories.emergency],
}
]
},
{
label: "National Suicide Prevention Line",
numbers: [
{
number: "988",
categories: [hotlineCategories.call, hotlineCategories.text, hotlineCategories.alwaysActive, hotlineCategories.anonymous, hotlineCategories.emergency],
}
]
},
{
label: "RAINN Sexual Assault Hotline",
numbers: [
{
number: "800-656-4673",
categories: [hotlineCategories.call, hotlineCategories.alwaysActive, hotlineCategories.anonymous],
}
]
},
{
label: "Rape Trauma Services",
numbers: [
{
number: "650-692-7273",
categories: [hotlineCategories.call, hotlineCategories.alwaysActive, hotlineCategories.anonymous, hotlineCategories.emergency],
}
]
},
{
label: "SAMHSA National Helpline",
numbers: [
{
number: "800-662-4357",
categories: [hotlineCategories.call, hotlineCategories.alwaysActive],
}
]
},
{
label: "San Mateo Crisis Intervention and Suicide Prevention Hotline",
numbers: [
{
number: "650-579-0350",
categories: [hotlineCategories.call, hotlineCategories.alwaysActive, hotlineCategories.emergency],
},
{
number: "800-273-8255",
categories: [hotlineCategories.call, hotlineCategories.alwaysActive, hotlineCategories.emergency],
}
]
},
{
label: "San Mateo Medical Center Psychiatric Emergency Services",
numbers: [
{
number: "650-573-2662",
categories: [hotlineCategories.call, hotlineCategories.alwaysActive, hotlineCategories.emergency],
}
]
},
{
label: "Starvista Teen Crisis",
numbers: [
{
number: "650-747-6463",
categories: [hotlineCategories.text],
time: "M-F, 4-10 PM",
}
]
},
{
label: "Trevor Project LGBTQ+",
numbers: [
{
number: "866-799-7233",
categories: [hotlineCategories.call, hotlineCategories.alwaysActive, hotlineCategories.anonymous, hotlineCategories.emergency],
},
{
number: `678-678: "START"`,
categories: [hotlineCategories.text, hotlineCategories.alwaysActive, hotlineCategories.anonymous, hotlineCategories.emergency],
}
]
},
{
label: "TXT 4 HELP",
numbers: [
{
number: `44357: "safe" & current address`,
categories: [hotlineCategories.text, hotlineCategories.alwaysActive],
}
]
},
],
healthClinics: [
{
name: "Daly City Kaiser Teen Clinic (members only)",
city: clinicCities.dalyCity,
website: "www.kaiserpermanente.org",
number: "650-877-5700",
address: "395 Hickey Blvd.",
hours: "M-F, 8:30-5 PM",
},
{
name: "Daly City Youth Health Center",
city: clinicCities.dalyCity,
website: "www.dalycityyouth.org",
number: "650-877-5700",
address: "350 90th St. (3rd Floor)",
hours: "M-F, 9-5:30 PM",
},
{
name: "Fair Oaks Health Center",
city: clinicCities.redwoodCity,
website: "www.sanmateomedicalcenter.org",
number: "650-578-7141",
address: "2710 Middlefield Rd.",
hours: "M-F, 8:30-5 PM",
},
{
name: "Kaiser Teen Clinic (members only)",
city: clinicCities.redwoodCity,
website: "www.kaiserpermanente.org",
number: "650-299-2025",
address: "910 Marshall Rd. (Birch Building)",
hours: "M-F, 9-5 PM",
},
{
name: "Kaiser Teen Clinic (members only)",
city: clinicCities.sanJose,
website: "www.kaiserpermanente.org",
number: "408-362-4740",
address: "276 International Cir",
hours: "M-F, 3:30-5 PM",
},
{
name: "Lucile Packard Teen Clinic (Stanford)",
city: clinicCities.sunnyvale,
website: "www.stanfordchildrens.org/en/service/teens-and-young-adults",
number: "650-497-7201",
address: "1195 W. Fremont Ave.",
hours: "M-Sat, 7:30-5 PM",
},
{
name: "MayView Community Health Center",
city: clinicCities.paloAlto,
website: "www.mayview.org",
number: "650-327-8717",
address: "270 Grant Ave.",
hours: "M, W, Th, F, 8-5 PM & T, 10-5 PM * 4th T/mo, 1-5 PM",
},
{
name: "MayView Community Health Center",
city: clinicCities.mountainView,
website: "www.mayview.org",
number: "650-965-3323",
address: "900 Miramonte Ave. (2nd floor)",
hours: "Contact to confirm hours + app availability",
},
{
name: "Planned Parenthood Blossom Hill",
city: clinicCities.sanJose,
website: "www.ppmarmonte.org",
number: "408-281-9777",
address: "5440 Thornwood Dr. (Suite G)",
hours: "M-F, 8:40-5 PM",
},
{
name: "Planned Parenthood Eastside",
city: clinicCities.sanJose,
website: "www.ppmarmonte.org",
number: "408-729-7600",
address: "3131 Alum Rock Ave.",
hours: "M-F, 8:40-5 PM",
},
{
name: "Planned Parenthood Mar Monte",
city: clinicCities.sanJose,
website: "www.ppmarmonte.org",
number: "408-274-7100",
address: "2470 Alvin Ave. (Suite G)",
hours: "M-F, 8-6 PM & Sat, 8-5 PM & Sun, 8-4 PM",
},
{
name: "Planned Parenthood Mountain View",
city: clinicCities.mountainView,
website: "www.ppmarmonte.org",
number: "650-948-0807",
address: "2500 California St.",
hours: "M-F, 9-5 PM",
},
{
name: "Planned Parenthood Redwood City",
city: clinicCities.redwoodCity,
website: "www.ppmarmonte.org",
number: "650-503-7810",
address: "2907 El Camino Real",
hours: "M-F, 9-5 PM",
},
{
name: "Planned Parenthood San Mateo",
city: clinicCities.sanMateo,
website: "www.ppmarmonte.org",
number: "650-235-7940",
address: "29 Baywood Ave.",
hours: "M-F, 8:30-5 PM",
},
{
name: "Planned Parenthood San Jose Central",
city: clinicCities.sanJose,
website: "www.ppmarmonte.org",
number: "408-287-7526",
address: "1691 The Alameda",
hours: "M-Th, 8-8 PM & F, 8-5 PM & Sat-Sun, 8-4 PM",
},
{
name: "Planned Parenthood South SF",
city: clinicCities.sanFrancisco,
website: "www.ppmarmonte.org",
number: "877-855-7526",
address: "435 Grand Ave.",
hours: "M-F, 9-5 PM",
},
{
name: "Ravenswood Family Health Center",
city: clinicCities.eastPaloAlto,
website: "www.ravenswoodfhc.org",
number: "650-330-7400",
address: "1885 Bay Rd. (Suite A)",
hours: "M-Th, 8-7 PM & F, 8-5 PM & Sat, 8-1 PM",
},
{
name: "Redwood City Sequoia Teen Wellness Center",
city: clinicCities.redwoodCity,
website: "www.smchealth.org/location/sequoia-teen-wellness-center",
number: "650-366-2927",
address: "200 James Ave. (Sequoia HS)",
hours: "M-F, 8:30-5 PM",
},
{ // TO LEON: If you reorder these, you might want to make this one last no matter the alphabetical ordering
name: "Stanford Children's Health Teen Van",
city: clinicCities.all,
website: "https://www.stanfordchildrens.org/en/service/teen-van",
number: "650-736-7172 or EMAIL: teenvan@stanfordchildrens.org",
address: `Time and Address Vary: <a href="https://www.stanfordchildrens.org/en/service/teen-van/schedule?">Schedule</a>`,
},
]
}
document.getElementById("links-wrapper").addEventListener("scroll", (event) => {
document.getElementById("links-arrow").classList.add("hidden");
})
document.getElementById("info-section").addEventListener("scroll", (event) => {
document.getElementById("info-arrow").classList.add("hidden");
})
function parseCookie(cookies) {
let parsed = {};
cookies = cookies.split("; ");
for (let i = 0; i < cookies.length; i++) {
let cookie = cookies[i];
for (let j = 0; j < cookie.length; j++) {
if (cookie[j] == "=") {
let [cookieName, cookieVal] = [cookie.substring(0, j), cookie.substring(j + 1)];
parsed[cookieName] = cookieVal;
break;
}
}
}
return parsed;
}
function sortResourcesByWeights() {
// if (linkWeights.length == 0) {
// resources.links.sort((a, b) => a.text > b.text ? 1 : 0);
// } else {
[[resources.links, linkWeights], [resources.info, infoWeights]].forEach(([buttons, weights]) => {
let highestWeightIndex = 0;
for (let i in buttons) {
while (buttons[i].weightIndex >= weights.length) {
weights.push(0.5);
}
highestWeightIndex = Math.max(highestWeightIndex, buttons[i].weightIndex);
}
while (weights.length > highestWeightIndex + 1) { weights.pop(); }
buttons.sort((a, b) => weights[b.weightIndex] - weights[a.weightIndex]);
})
// }
}
function loadWeights() {
let cookie = document.cookie;
let parsedValues = parseCookie(cookie);
linkWeights = "linkWeights" in parsedValues ? parsedValues.linkWeights.split(",") : [];
infoWeights = "infoWeights" in parsedValues ? parsedValues.infoWeights.split(",") : [];
for (i in linkWeights) { linkWeights[i] = Number(linkWeights[i]); }
for (i in infoWeights) { infoWeights[i] = Number(infoWeights[i]); }
sortResourcesByWeights();
}
var expireDate = new Date();
expireDate.setTime(expireDate.getTime() + (365 * 24 * 60 * 60 *
1000));
function saveWeights() {
document.cookie = `linkWeights=${linkWeights}; expires=${expireDate}; path=/`;
document.cookie = `infoWeights=${infoWeights}; expires=${expireDate}; path=/`;
}
function clickedLink(weightIndex, weightType) {
let weights = weightType == "link" ? linkWeights : infoWeights;
let increaseAtLowestWeight = 0.15; // How much the weight changes for the highest weighted link (out of 1)
let increaseAtHighestWeight = 0.01; // How much the weight changes for the lowest weighted link (out of 1)
// console.log(increaseAt0Weight / (1 + weights[weightIndex] * (increaseAt0Weight / increaseAt1Weight - 1)))
let maxWeight = Math.max(weights[weightIndex]) + 0.01;
let minWeight = Math.min(weights[weightIndex]);
let mappedWeight = (weights[weightIndex] - minWeight) / (maxWeight - minWeight);
weights[weightIndex] += (maxWeight - minWeight) * increaseAtLowestWeight / (1 + mappedWeight * (increaseAtLowestWeight / increaseAtHighestWeight - 1));
// See https://www.desmos.com/calculator/162epywbzd for more info ^^^
let avg = weights.reduce((a, b) => a + b) / weights.length
let adjustment = avg - 0.5;
for (let i in weights) {
weights[i] -= adjustment;
}
saveWeights();
sortResourcesByWeights();
addLinks(boxesPerRow);
}
function createLinkBoxes() {
resources.links.forEach((linkObj) => {
newLinkBox = document.createElement("a");
newLinkBox.href = linkObj.link;
newLinkBox.target = "_blank"
newLinkBox.title = linkObj.name;
newLinkBox.classList.add("link-box");
newLinkBox.style.backgroundImage = `url("${linkObj.image}")`;
newLinkBox.style.backgroundColor = "backgroundColor" in linkObj ? linkObj.backgroundColor : "#FFFFFF"
newLinkBox.style.backgroundSize = "imageCoversFullBox" in linkObj && linkObj.imageCoversFullBox ? "cover" : "contain"
// let img = document.createElement('img');
// img.src = linkObj.image;
// img.crossOrigin = "anonymous";
// let canvas = document.createElement('canvas');
// canvas.width = w = img.width;
// canvas.height = h = img.height;
// let ctx = canvas.getContext("2d");
// ctx.drawImage(img, 0, 0);
// let imgData = ctx.getImageData(0, 0, 1, 1);
// console.log(imgData)
linkObj.linkBox = newLinkBox;
})
}
var categorySections = {"searchCategory": document.createElement("div")};
categorySections.searchCategory.classList.add("links-full-container");
for (let categoryID in categories) {
categorySections[categories[categoryID]] = newSection = document.createElement("div");
newSection.classList.add("links-full-container");
}
function addLink(linkObj, categorySection) {
lastRowContainer = categorySection.lastChild;
lastRowIndex = categorySection.childNodes.length - 1;
if (lastRowIndex == -1 ||
(lastRowIndex == 0 && lastRowContainer.childNodes.length == boxesPerRow - 1) ||
(lastRowIndex > 0 && lastRowContainer.childNodes.length == boxesPerRow)) {
lastRowContainer = document.createElement("div")
lastRowContainer.classList.add("links-row-container")
categorySection.appendChild(lastRowContainer)
}
let newLinkBox = linkObj.linkBox.cloneNode();
newLinkBox.weightIndex = linkObj.weightIndex;
newLinkBox.onclick = function () { clickedLink(this.weightIndex, "link"); };
newLinkBox.ondragstart = () => { return false; };
newLinkBox.style.setProperty("--boxes-per-row", boxesPerRow);
lastRowContainer.appendChild(newLinkBox);
}