-
Notifications
You must be signed in to change notification settings - Fork 1
/
game.html
346 lines (262 loc) · 16 KB
/
game.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
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-VPGFCSL1JE"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-VPGFCSL1JE');
</script>
<title>The Algorithm</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name=”twitter:card” content=”summary_large_image”>
<meta name="twitter:title" content="The Algorithm">
<meta name="twitter:url" content="https://www.whatsthealgorithm.com/game">
<meta name="twitter:description" content="Test a fictional social media app to understand how recommender systems work, and how they could be different.">
<meta name="twitter:image" content="https://whatsthealgorithm.com/images/thealgorithm_title.jpg">
<html itemscope itemtype="https://www.whatsthealgorithm.com/game">
<meta itemprop="name" content="The Algorithm">
<meta itemprop="description" content="Test a fictional social media app to understand how recommender systems work, and how they could be different.">
<meta itemprop="image" content="https://whatsthealgorithm.com/images/thealgorithm_title.jpg">
<meta property="og:site_name" content="The Algorithm">
<meta name="theme-color" content="#2251F8">
<meta property="og:title" content="The Algorithm">
<meta property="og:url" content="https://www.whatsthealgorithm.com/game">
<meta property="og:description" content="Test a fictional social media app to understand how recommender systems work, and how they could be different.">
<meta property="og:image" content="https://whatsthealgorithm.com/images/thealgorithm_title.jpg">
<meta property="og:type" content="website">
<script async src="https://ga.jspm.io/npm:es-module-shims@1.8.0/dist/es-module-shims.js"></script>
<link rel="icon" type="image/png" sizes="32x32" href="favicon_io_bar/favicon.ico">
<script type="importmap">
{
"imports": {
"recSys": "./modules/recSys.js",
"html2canvas": "./modules/html2canvas.js"
}
}
</script>
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"></script>
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script> -->
<!-- Andy is getting on a plane and so made local versions of p5 and jquery-->
<script src="offline/p5_v1-4-0.js"></script>
<script src="offline/jquery_v1-11-1.js" type="text/javascript"></script>
<script type="module" src="main.js"></script>
<script src="p5/testTemplate.js"></script>
<script src="p5/crimsonRoom.js"></script>
<script src="p5/leParc.js"></script>
<script src="p5/emojiSpiral.js"></script>
<script src="p5/emojiGrid.js"></script>
<script src="p5/emojiBounce.js"></script>
<script src="p5/emojiMandala.js"></script>
<script src="p5/vaporwave.js"></script>
<script src="p5/reactorChamber.js"></script>
<script src="p5/cubeStructure.js"></script>
<script src="p5/tunnel.js"></script>
<script src="p5/textSwipe.js"></script>
<script src="p5/textPop.js"></script>
<script src="p5/textSpotlight.js"></script>
<script src="p5/textBounce.js"></script>
<script src="p5/threeChambers.js"></script>
<script src="p5/threeGrids.js"></script>
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/contentStyle.css">
<link href='https://fonts.googleapis.com/css?family=JetBrains Mono' rel='stylesheet'>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Staatliches">
</head>
<body id="game-body">
<!-- <div id="title-div" class="titles"><a href="./index.html">What's the Algorithm?</a></div> -->
<div id="debug">Saves: <span id="debug-follows"> 0 </span> <br>
Likes: <span id="debug-likes"> 0 </span><br>
Shares: <span id="debug-shares"> 0 </span><br>
<div id="debug-content"></div>
<div id="debug-post-count"></div>
<div id="debug-traits"></div>
</div>
<div class="onboarding" style="display:block">
<div id="onboarding-text">
<p style="padding-top: 5px;"><span><b> 📥 FROM</b></span>: <span style=" background: #E6E6DE; color: #2251F8"><span style="border-bottom: dashed 1px"><b>DECIFER COMPANY TESTING CENTER </b></span></span></p>
<p style="padding-top: 10px">
Hi there! 👋 We run a popular social media app 📱, but we've been getting more complaints recently about <span class="keyword">"the algorithm"</span> which plays an important role in what people see and experience. </p>
<p style="padding-top: 10px"> People don't understand what the algorithm is, why it shows them certain things, and think it might be contributing to bigger problems in the world. </p>
<p style="padding-top: 10px">
To make our app better, we built a simulation to test our <b>algorithm's logic</b>, explain <b>how it works</b>, and <b>seek your input</b>. </p>
<button class="onboarding-button" role="button"> OPEN APP </button>
</div>
</div>
<div class="offboarding">
<div id="offboarding-text">
<p style="padding-top: 5px;"><span>📥 <b>FROM</b></span>: <span style=" background: #E6E6DE; color: #2251F8"><span style="border-bottom: dashed 1px"><b>"THE ALGORITHM" TEAM </b></span></span></p>
<p style="padding-top: 10px">
Thank you for playing! </p>
<p style="padding-top: 10px">While your feed in this game was largely harmless, the impact of algorithms is very real. Instead of a very <span class="assumption-color"></span> feed, people can fall down rabbit holes of increasingly harmful content.</p>
<p style="padding-top: 10px">
In reality, algorithmic feeds are not only influenced by your actions; technology companies also decide what type of behavior to favor and content to show (and not show) based on financial and political incentives. </p>
<p>To learn more about responsible recommender systems and how to join the conversation, check out our resources section.</p>
<a href="resources.html"><button class="onboarding-button" role="button"> RESOURCES </button></a>
</div>
</div>
<div id="content">
<div class="column" id="device-column">
<div class="device" id="device" style="display: none;">
<div id="intro">
<!-- <div id="intro-00" class="intro-page" style="display:none; background-color: #2251F8;">
<div class="intro-title" style="font-size: 4rem; margin-top: 4%; color: #E6E6DE; font-style: bold; margin-left: 5%;">What's The Algo<br>rithm?</div>
<button class="intro-button">Begin</button>
</div> -->
<div id="intro-0" class="intro-page" style="display:none">
<div class="intro-title">Welcome!</div>
<div class="intro-paragraph">We want to improve our <span class="keyword">algorithm</span>, so we need your help.<br><br></div>
<div class="intro-paragraph">In this simulation, we'll be showing you animations of different <span class="keyword">colors</span>, <span class="keyword">shapes</span>, and <span class="keyword">speeds</span> to test our recommendation algorithm's logic.</div><br>
<!-- <div class="intro-paragraph"> This content is...</div> -->
<!-- <div class="intro-paragraph">Click below to start.</div> -->
<button class="intro-button">Start</button>
</div>
<div id="intro-1" class="intro-page" style="display:none">
<div class="welcome-title">Getting <br>started</div>
<div style="width: 100%; margin-bottom: 5%; border: 1px; border: 1px solid #000000;"></div>
<div class="intro-paragraph">Select your preferred <span class="keyword">color</span>, <span class="keyword">shape</span>, and <span class="keyword">speed</span>.</div>
<div id="intro-button-container"></div>
<!-- <div id="lujain"> -->
<div class="button-container">
<span id="error-message" style="color: red; display: none; font-size: 80%; position: absolute; margin-bottom: 10%;">Select one of each trait.</span>
<div id="click-detector" style="position: absolute; width: 100%; height: 100%; top: 35%; left: 0;"></div>
<button class="intro-button" id="interest-finished">Done</button>
</div>
<!-- </div> -->
</div>
<div id="intro-2" class="intro-page" style="display:none">
<div id="intro-loading-ring">
<div class="ring" id="ring1"></div>
<div class="ring" id="ring2"></div>
<div class="ring" id="ring3"></div>
<div class="ring" id="ring4"></div>
</div>
<div class="loading">Collecting data about you...</div>
</div>
<div id="intro-3" class="intro-page" style="display:none">
<div class="intro-paragraph" id="top-intro-paragraph">First, our algorithm will select some content that matches the preferences you just stated, while also adding a few extra <span class="keyword">exploration</span> pieces to learn what else you like. <br><br></div>
<div class="intro-paragraph"></div><br>
<div class="intro-paragraph">Make sure to press <span class="keyword">follow</span>, <span class="keyword">like</span>, and <span class="keyword">save</span> for content you want to see more of. The algorithm uses these <span class="keyword">engagement patterns</span> to make decisions on what type of content to keep showing you.</div>
<button class="intro-button">See content</button>
</div>
</div>
<img id="info-icon" src="images/bar-graph.png">
<div id="info-column"><div id="info" style="top: 600px;">
</div></div>
<div id="device-screen">
<div id="device-buttons">
<img id="like" class="device-button" src="images/like.png"\>
<div class="tooltip" >
<span class="tooltiptext" style="font-size: 70%;">Don't forget to press like, share, or save!</span>
</div>
<!-- <div class="tooltip">
<span class="tooltiptext" style="font-size: 70%;">Check out this menu to see how the algorithm is changing!</span>
</div> -->
<img id="follow" class="device-button" src="images/share.png"\>
<img id="share" class="device-button" src="images/bookmark.png"\>
</div>
<div class="nudge" style="display: none;">
<p style="margin-top: 0; margin-bottom: 0;">Click this to see your new algorithm update!</p>
</div>
<div class="swipe-tutorial-container">
<div id="swipe-animation" class="swipe-animation" style="display:none;">
<img src="images/swipe-up.png" alt="Swipe Up Icon">
<p style="color: gray; background-color: white; border-radius: 6px;">drag the screen</p>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
<template id="weightings-template">
<div class="top-info-row info-row">
<div class="weightings info-subtitle">
Weightings
</div>
<div class="info-exit-button">x</div>
</div>
<div class="info-row bar-container"> Likes:
<div class="bar">
<div class="bar-fill likes-bar"></div>
</div>
</div>
<div class="info-row bar-container"> Shares:
<div class="bar">
<div class="bar-fill shares-bar"></div>
</div>
</div>
<div class="info-row bar-container"> Saves:
<div class="bar">
<div class="bar-fill follows-bar"></div>
</div>
</div>
</template>
<template id="preferences-template">
<div class="preferences info-subtitle info-row">
Your Preferences
</div>
<div class="info-row bar-container pref-0"> <span class="param-0">???:</span>
<div class="bar">
<div class="bar-fill" style="background-color: #EE4813;"></div>
</div>
</div>
<div class="info-row bar-container pref-1"> <span class="param-1">???:</span>
<div class="bar">
<div class="bar-fill" style="background-color: #EE4813;"></div>
</div>
</div>
<div class="info-row bar-container pref-2"> <span class="param-2">???:</span>
<div class="bar">
<div class="bar-fill" style="background-color: #EE4813;"></div>
</div>
</div>
<div class="info-row bar-container pref-3"> <span class="param-3">???:</span>
<div class="bar">
<div class="bar-fill" style="background-color: #EE4813;"></div>
</div>
</div>
</template>
<template id="assumptions-template">
<div class="message-title">Your Profile</div>
<script>
let assumption_index = Math.floor(Math.random() * 3);
console.log("assumption_index: ", assumption_index);
let selected_assumption = document.getElementsByClassName("assumption-subtitle")[assumption_index];
selected_assumption.style.display = "block";
</script>
<div class="assumption-subtitle" >Our algorithm says your favorite color is <b><span class="assumption-color"></span></b>. <br><br> We think this makes you <b><span class="assumption-color-analysis"></span></b>. <br> <br> <span class="question">Is that correct?</span></div>
<div class="assumption-subtitle">Your favorite shape is <b><span class="assumption-shape"></span></b>. <br> <br> We think this means you are <b><span class="assumption-shape-analysis"></span></b>.<br><br><span class="question">Is that correct? </span></div>
<div class="assumption-subtitle">Your favorite speed is <b><span class="assumption-speed"></span><b>.<br><br> We think you like to <b><span class="assumption-speed-analysis"></span><b>.<br><br><span class="question">Is that correct?</span></div>
</template>
<template id="algorithm-select-template">
<div class="alg-card" id="alg-0">
<div class="alg-title"></div>
<div class="alg-subtitle"></div>
<div class="alg-interest-list"></div>
<div class="alg-weightings"></div>
</div>
</template>
<template id="algorithm-create-template">
<div id="algorithm-create-card">
<div class="message-title" style="font-size: 200%; margin-left: 5%; padding-bottom: 0;">
Behind the Algorithm
</div>
<div class="create-weightings">
</div>
<!-- <div class="message-subtitle" style="font-size: 200%; margin-left: 5%">Your Priorities</div> -->
<div class="select-priorities"></div>
</div>
</template>
<template id="algorithm-image-template">
<div class="my-alg"></div>
<!-- <div class="share-icons">
<img class="share-icon" src="images/fb.png"\>
<img class="share-icon" src="images/insta.png"\>
<img class="share-icon" src="images/tik_tok.png"\>
<img class="share-icon" src="images/twitter.png"\>
</div> -->
</template>
</html>