-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
199 lines (166 loc) · 5.52 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
---
layout: default
---
<div class="home">
<h1 class="page-heading">VacFind - A COVID-19 vaccine resource finder</h1>
<p>Our goal is to make COVID-19 vaccinations as easy and accessible as possible. Thats why we have created a national directory of resources to help you find a COVID vaccine.</p>
<p>Links to official information provided by government entities is listed in <b>bold</b> text. all other links are provided by volunteer groups or other non-government organisations.</p>
<p>You can use the list below to find resources such as:
<ul>
<li>tools to automatically find open appointment slots near you</li>
<li>local vaccine hunting and assistance groups</li>
<li>links to updated information about vaccination programs in your state</li>
<li>... and more!</li>
</ul>
</p>
<p>If you want to help out or suggest a change or addition to our list, please fill out <a href="{{site.links.corrections}}">this form</a> or come chat with our team on <a href="{{site.social.discord}}">Discord</a>!</p>
<p><strong>Looking for international COVID-19 resources?</strong><br>
VacFind is currently only providing links to US-based resources, however, the moderators of the r/COVID19 subreddit have published a list of <a href="https://www.reddit.com/r/COVID19/wiki/faq/vaccinefinder">international resources for finding COVID vaccines</a>.</p>
<div id="link-list"></div>
<noscript>
{% include noscript-backup.html %}
</noscript>
<h2 id="share-this-site">Has VacFind helped you?</h2>
<p>If VacFind has saved you time looking for a vaccine, please consider sharing on social media. It is by far the best way you can help spread the word and help someone else get vaccinated.</p>
{% include sharing.html %}
<script type="module" >
import { loadLinks, retrieveFromStorage, retrieveBackupData } from '/{{ site.baseurl }}assets/js/script.js';
let linkListElement = document.getElementById("link-list");
linkListElement.innerText = "Loading..."
let groups = {
"USA": "National (United States)",
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
"DC": "District Of Columbia",
"FM": "Federated States Of Micronesia",
"FL": "Florida",
"GA": "Georgia",
"GU": "Guam",
"HI": "Hawaii",
"ID": "Idaho",
"IL": "Illinois",
"IN": "Indiana",
"IA": "Iowa",
"KS": "Kansas",
"KY": "Kentucky",
"LA": "Louisiana",
"ME": "Maine",
"MH": "Marshall Islands",
"MD": "Maryland",
"MA": "Massachusetts",
"MI": "Michigan",
"MN": "Minnesota",
"MS": "Mississippi",
"MO": "Missouri",
"MT": "Montana",
"NE": "Nebraska",
"NV": "Nevada",
"NH": "New Hampshire",
"NJ": "New Jersey",
"NM": "New Mexico",
"NY": "New York",
"NC": "North Carolina",
"ND": "North Dakota",
"MP": "Northern Mariana Islands",
"OH": "Ohio",
"OK": "Oklahoma",
"OR": "Oregon",
"PW": "Palau",
"PA": "Pennsylvania",
"PR": "Puerto Rico",
"RI": "Rhode Island",
"SC": "South Carolina",
"SD": "South Dakota",
"TN": "Tennessee",
"TX": "Texas",
"UT": "Utah",
"VT": "Vermont",
"VI": "Virgin Islands",
"VA": "Virginia",
"WA": "Washington",
"WV": "West Virginia",
"WI": "Wisconsin",
"WY": "Wyoming",
"ETC": "Miscellaneous"
}
let stored_records = retrieveFromStorage()
if (!stored_records) {
retrieveBackupData().then(backupdata => {
stored_records = backupdata
processRecords(stored_records)
})
}
let by_group = {}
let filter = {
$not: {
$or: [
{ $textFind: ["dev resource", { $fieldName: 'category' }] },
{ $textFind: ["useless", { $fieldName: 'category' }] },
{ $textFind: ["INTL", { $fieldName: 'group' }] }
]
},
public: true
}
let records = loadLinks(filter);
const processRecords = (records) => {
for (let record of records) {
processRecord(record)
}
populatePage()
}
const processRecord = (record) => {
// console.log(record.fields)
const url = record.fields.url;
//the value of the group this belongs to, default to the "Miscellaneous" group if blank
let group = record.fields.group || "ETC";
const title = record.fields.link_title;
const isofficial = record.fields.verification_status == "government resource";
let listitem = document.createElement("li");
let link = document.createElement("a");
link.innerText = title ? title : url;
link.href = url;
link.className = isofficial ?"verified":"";
link.dataset.recordId = record.fields.id;
listitem.appendChild(link);
if (!by_group[group]) {
by_group[group] = []
}
by_group[group].push(listitem)
}
const populatePage = () => {
linkListElement.innerText = ""
//create headings for each group
for (let group in groups) {
if (!by_group[group]) {
by_group[group] = []
}
if (by_group[group].length > 0) {
let listheading = document.createElement("h3");
listheading.innerText = groups[group];
let list = document.createElement("ul");
list.id = group
for (let link of by_group[group]) {
list.appendChild(link)
}
linkListElement.appendChild(listheading);
linkListElement.appendChild(list);
}
}
};
//populate the page if theres a value from local storage
if (stored_records) {
processRecords(stored_records)
}
records.then((results) => {
by_group = {} //clear out anything that may be present from localstorage
processRecords(results)
});
</script>
</div>