-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html
343 lines (290 loc) · 10.5 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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="keywords" content="fantasy, civics, football, sports, chicago, city, ward, alderman, aldermen, 311, graffiti, pot holes, rodent baiting">
<meta name="description" content="A Fantasy Football-style game about Chicago city leaders.">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta property="og:title" content="Fantasy Civics">
<meta property="og:description" content="A Fantasy Football-style game about Chicago city leaders.">
<meta property="og:image" content="https://geliclub.github.io/fantasycivics/assets/logo-color.png">
<link rel="icon" sizes="192x192" href="favicon.ico">
<link rel="image_src" href="assets/logo-color.png">
<title>Fantasy Civics</title>
<script src="https://www.gstatic.com/firebasejs/3.6.9/firebase.js"></script>
<script type="text/javascript" src="./assets/promise.min.js"></script>
<script type="text/javascript" src="./assets/moment.min.js"></script>
<script type="text/javascript" src="./assets/jquery-3.1.1.min.js"></script>
<link href="https://fonts.googleapis.com/css?family=Roboto:400,900" rel="stylesheet">
<!-- Vex Assets -->
<script type="text/javascript" src="assets/vex.combined.min.js"></script>
<script type="text/javascript">vex.defaultOptions.className = 'vex-theme-plain';</script>
<link rel="stylesheet" type="text/css" href="assets/vex.css">
<link rel="stylesheet" type="text/css" href="assets/vex-theme-plain.css">
<!-- Plotly -->
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<!-- Styles -->
<link rel="stylesheet" type="text/css" href="app/reset.css">
<link rel="stylesheet" type="text/css" href="app/temp-style.css">
<style>
html, body, section {
padding: 0;
margin: 0;
}
.center-vertical {
}
.center-horizontal {
text-align: center;
}
.center-horizontal div {
text-align: left;
}
div.roster {
display: inline-block;
text-align: center;
margin: 10px;
}
div.roster table {
display: block;
margin: 10px;
text-align: left;
}
div.roster table tr td {
height: 30px;
line-height: 15px;
}
div.roster table tr td:nth-child(1) {
width: 120px;
}
section {
padding: 5vw 10vw;
min-height: 50vh;
}
section.landing-pane {
/* Center Vertically */
display: flex;
flex-direction: column;
justify-content: center;
resize: vertical;
}
section:nth-child(odd) {
background: rgba(44, 140, 153, 1);
color: white;
}
section:nth-child(even) {
}
section:nth-child(odd) a:link, section:nth-child(odd) a:visited {
color: white;
padding: 0;
}
section:nth-child(odd) a:hover, section:nth-child(odd) a:active {
background: white;
color: rgba(44, 140, 153, 1);
padding: 5px 7.5px;
}
section:nth-child(odd) button.cta-btn {
border-color: white;
color: white;
background: transparent;
}
section:nth-child(odd) button.cta-btn:hover {
background: white;
color: rgba(44, 140, 153, 1);
}
p {
margin: 10px 0;
line-height: 20px;
text-align: left;
}
.center-text {
text-align: center;
}
input {
width: 300px;
margin: 10px auto;
line-height: 30px;
font-size: 20px;
text-align: center;
outline: none;
border: none;
border-bottom: 2px solid rgba(59, 68, 75, 0.1);
}
input:hover, input:focus {
color: rgba(44, 140, 153, 1);
border-bottom: 2px solid rgba(44, 140, 153, 1);
}
button.cta-btn {
height: 40px;
line-height: 25px;
font-size: 20px;
font-weight: bold;
width: 200px;
display: block;
margin: 10px auto;
}
img#splash-logo {
width: 250px;
}
div.splash-pane {
display: inline-block;
vertical-align: middle;
text-align: center;
margin: 20px 10px;
}
div.splash-pane:nth-child(1) {
width: 300px;
}
div.splash-pane:nth-child(1) p {
margin: 20px auto;
}
div.splash-pane:nth-child(2) {
width: 250px;
}
li {
line-height: 20px;
}
.has-scouting-report {
font-weight: bold;
}
.has-scouting-report:hover {
cursor: pointer;
}
.projected-score {
color: rgba(44, 140, 153, 1);
font-style: italic;
}
.explain-text {
font-weight: bold;
}
.explain-text:hover {
opacity: 0.5;
cursor: pointer;
}
#search-error {
color: red;
display: none;
}
</style>
</head>
<body>
<!-- Header -->
<section class="landing-pane">
<div class="center-horizontal">
<div class="splash-pane">
<h1>Fantasy Civics</h1>
<p class="center-text">Fantasy Civics is a Fantasy Football-style game to encourage players to learn more about wards and aldermen in Chicago.</p>
<button class="cta-btn play-game">Sign Up</button>
</div>
<div class="splash-pane">
<img id="splash-logo" src="assets/logo-white.png">
</div>
</div>
</section>
<section class="landing-pane">
<h2>Who is My Alderman?</h2>
<p class="center-text">Enter your address to find out:</p>
<input type="text" id="search-by-address" value="3300 S Federal Street">
<p class="center-text" id="search-error">Error message</p>
<button id="search-by-button" class="cta-btn">Search</button>
</section>
<section class="landing-pane" id="alderman-result">
<h2>Your Alderman Is...</h2>
<h1 id="your-alderman">...</h1>
<h4 id="your-ward">...</h4>
<p class="center-text">...and last week in Fantasy Civics, they scored <span id="your-alderman-score">0</span> points.</p>
</section>
<section class="landing-pane">
<h2>How Does Scoring Work?</h2>
<p>Scores are calculated weekly based on <span class="explain-text" data-explain="311 is the hotline for Chicago citizens to request city services such as graffiti removal and crime reporting.">311 requests</span>.</p>
<p>Completed 311 requests are worth +1 points and unfulfilled requests are worth -1 points.</p>
<p>Here are the types of issues we score on:</p>
<h3>Ward <span id="your-ward-number"></span> Scoring Breakdown</h3>
<ul id="ward-score-breakdown"></ul>
<p>Your alderman doesn't directly deal with these issues, but this is a fun way to see how your ward responds to citizen requests.</p>
<p>You can also see an alderman's historical fantasy scores. <span id="your-alderman-historical" class="scout-anchor" data-pid="playerid0001">Try it here</span>.</p>
</section>
<section class="landing-pane">
<h2>How Does the Game Work?</h2>
<p>You form a league with your friends and play multiple matches against each other.</p>
<p>Each player selects a team of alderman and is then matched up with an opponent to see whose team scores more points. You can have up to five alderman on your team, but only three can be starters.</p>
<p>The full game uses all 50 Chicago aldermen: you can acquire aldermen other than those shown here and trade with other players.</p>
</section>
<section class="landing-pane">
<h2>Try it Out!</h2>
<p>When deciding your starting lineup, you see historical scores. Here are some aldermen and their scores for the first week of <span class="insert-month"></span>. Choose the three aldermen who you think will score the most points in the second week of <span class="insert-month"></span>.</p>
<h3>Scores from the Week of <span id="insert-past-week"></span></h3>
<p class="center-text">Click on a player to view their historical scores.</p>
<div class="center-horizontal">
<div class="roster">
<h4>Your Team</h4>
<table id="visitor-roster"></table>
</div>
<div class="roster">
<h4>Opponent's Teams</h4>
<table id="robot-roster"></table>
</div>
</div>
<p>When you're happy with your roster, click below to find out how the teams score in the second week of <span class="insert-month"></span>.</p>
<button id="submit-roster" class="cta-btn">Who Wins?</button>
</section>
<section class="landing-pane" id="game-result">
<h2>Sample Game Results</h2>
<p id="demo-outcome" class="center-text"></p>
<p class="center-text">Click on a player to compare their actual scores to the projections.</p>
<h3>Scores from the Week of <span id="insert-next-week"></span></h3>
<div class="center-horizontal">
<div class="roster">
<h4>Your Scores</h4>
<table id="visitor-result"></table>
</div>
<div class="roster">
<h4>Opponent's Scores</h4>
<table id="robot-result"></table>
</div>
</div>
</section>
<section class="landing-pane">
<h2>Play Fantasy Civics</h2>
<p class="center-text">Now you know how to play Fantasy Civics! Get some friends, you can play a full game in 15 minutes!</p>
<button class="cta-btn play-game">Sign Up</button>
</section>
<section class="landing-pane">
<h2>Frequently Asked Questions</h2>
<h4>How do you win?</h4>
<p>You win the game by picking a team of high-scoring aldermen and winning the most matches in your league. You win in real life by learning about Chicago wards and getting involved in civics!</p>
<h4>Who created this?</h4>
<p>Fantasy Civics was created by students at the Illinois Institute of Technology with the help and support of <a href="https://chihacknight.org" target="_blank">ChiHackNight</a>, Chicago's weekly gathering to build, share, and learn about civic tech.</p>
<h4>How can I contribute?</h4>
<p>Post any feedback or bugs on our <a href="https://github.com/GeliClub/fantasycivics" target="_blank">GitHub repository</a> or fork the codebase! We would also love contributions from writers and designers to help clearly explain the rules of the game.</p>
</section>
<!-- Footer -->
<!-- script -->
<script type="text/javascript" src="./lib/util.js"></script>
<script type="text/javascript" src="./database/player.js"></script>
<script type="text/javascript" src="./database/league.js"></script>
<script type="text/javascript" src="./database/scoring.js"></script>
<script type="text/javascript" src="./database/auth.js"></script>
<script type="text/javascript" src="./database/database.js"></script>
<script type="text/javascript" src="findmyward.js"></script>
<script type="text/javascript" src="./lib/scouting.js"></script>
<script type="text/javascript" src="home.js"></script>
<script type="text/javascript">
var exps = document.getElementsByClassName('explain-text');
for(var i = 0; i < exps.length; i++){
var exp = exps[i];
exp.addEventListener('click', e => {
vex.dialog.alert(e.target.dataset.explain);
});
}
vex.dialog.alert({
message: 'Want to go to our new site?',
callback: function(value) {
if (value) {
window.location = 'https://fantasycivics.github.io';
}
}
});
</script>
</body>
</html>