-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
182 lines (166 loc) · 6.81 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
<!-- MVP.css quickstart template: https://github.com/andybrewer/mvp/ -->
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="icon" href="">
<link rel="stylesheet" href="https://unpkg.com/mvp.css">
<style>
header, nav, header nav img, footer, hr {
margin: 0 auto;
}
footer, header, main {
padding: 1rem 1rem;
}
section header {
padding: 0rem 1rem;
}
table td {
text-align: left;
}
form {
min-width: 0;
}
a {
color: darkorange;
}
:root {
--color: royalblue;
--color-accent: aliceblue;
}
</style>
<script src="https://cdn.jsdelivr.net/gh/alpinejs/[email protected]/dist/alpine.min.js" defer></script>
<script>
function openStatus(date) {
const dayOfWeek = date.getDay();
const hour = date.getHours();
const minutes = date.getMinutes();
const beforeOpening = (hour < 8) && (minutes < 30);
const afterClosing = (hour >= 18);
if ((dayOfWeek === 6) && afterClosing) { // Saturday after 6:00 p.m.
return "open Monday at 8:30 a.m.";
} else if ((dayOfWeek === 0) || afterClosing) { // Sunday or after closing
return "open tomorrow at 8:30 a.m.";
} else if (beforeOpening) { // non-Sunday before opening
return "open today at 8:30 a.m.";
} else {
return "are currently open until 6:00 p.m.";
}
}
let locations = {
data: [],
fetchLocations: async function() {
let response = await fetch('locations.json');
let locationData = await response.json();
this.data = locationData;
},
addressLine1: function(location) {
return location.street;
},
addressLine2: function(location) {
return `${location.city}, ${location.state} ${location.zipcode}`;
},
googleMaps: function(location) {
return `http://maps.google.com/?q=${location.name}+${location.street}+${location.city}+${location.state}+${location.zipcode}`
}
}
</script>
<meta charset="utf-8">
<meta name="description" content="Information on Fulton County Early Voting">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Fulton County Early Voting Locations</title>
</head>
<body>
<header>
<nav>
<a href="/"><img alt="Logo" src="fulton-logo.png" height="50"></a>
</nav>
<h1>Fulton County Early Voting Locations</h1>
<p>Polls <mark id="open-status" x-data="{ openStatus: openStatus(new Date()) }" x-text="openStatus"></mark></p>
</header>
<main>
<section id="open-days">
<table>
<thead>
<tr>
<th>Week</th>
<th>Days</th>
</tr>
</thead>
<tbody>
<tr>
<td>Week 1</td>
<td>Mon 7/20 to Sat 7/25</td>
</tr>
<tr>
<td>Week 2</td>
<td>Mon 7/27 to Sat 8/1</td>
</tr>
<tr>
<td>Week 3</td>
<td>Mon 8/3 to Fri 8/7</td>
</tr>
</tbody>
</table>
</section>
<section id="open-times">
<p>Polls are open 8:30 a.m. to 6:00 p.m.</p>
</section>
<section id="locations">
<header>
<h2>Locations (north to south)</h2>
</header>
<section id="locations-list" x-init="fetchLocations()" x-data="locations">
<template x-for="location in locations.data" :key="location">
<aside>
<h3 x-text="location.name"></h3>
<p>
<template x-if="location.special">
<strong x-text="location.special"></strong><br>
</template>
<span x-text="addressLine1(location)"></span><br>
<span x-text="addressLine2(location)"></span><br>
<a x-bind:href="googleMaps(location)" target="_blank">Open on map</a><br>
Wait time: <mark>Under 5 minutes</mark><br>
</p>
<details>
<summary>Report wait time</summary>
<form>
<label for="waited">I waited:</label>
<select name="waited" id="waited">
<option value="0">No wait</option>
<option value="1" selected="1">Under 5 minutes</option>
<option value="5">5 minutes</option>
<option value="10">10 minutes</option>
<option value="15">15 minutes</option>
<option value="20">20 minutes</option>
<option value="25">25 minutes</option>
<option value="30">30 minutes</option>
<option value="40">40 minutes</option>
<option value="50">50 minutes</option>
<option value="60">60 minutes</option>
<option value="70">70 minutes</option>
<option value="80">80 minutes</option>
<option value="90">90 minutes</option>
<option value="100">Over 90 minutes</option>
</select>
<button type="submit" onclick="">Submit report</button>
</form>
</details>
</aside>
</template>
</div>
</section>
<section id="more-details">
<p>
View more <a href="https://fultoncountyga.gov/inside-fulton-county/fulton-county-departments/registration-and-elections/voting-one-stop-shop">election details</a>.
</p>
</section>
</main>
<hr>
<footer>
<p>
<small>A project of <a href="https://www.codeforatlanta.org">Code for Atlanta</a>.</small>
</p>
</footer>
</body>
</html>