-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
433 lines (420 loc) · 16.4 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
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
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8"/>
<title>Portle</title>
<link rel="icon" type="image/x-icon" href="images/favicon.png"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<link rel="stylesheet" href="h-tags.css"/>
<script src="h-tags.js" defer></script>
<link rel="stylesheet" href="style.css"/>
<script src="wordlist.js"></script>
<script src="script.js"></script>
<link href="https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@900&family=Work+Sans:wght@400;600;700&display=swap" rel="stylesheet"/>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.0/css/all.css"
integrity="sha384-lZN37f5QGtY3VHgisS14W3ExzMWZxybE1SJSEsQp9S+oqd12jhcu+A56Ebc1zFSJ" crossorigin="anonymous"/>
<meta name="author" content="HugoBDesigner">
<meta name="twitter:site" content="@HugoBDesigner" />
<meta name="twitter:creator" content="@HugoBDesigner" />
<meta name="twitter:card" content="summary" />
<meta property="og:title" content="Portle - A Portal-themed word guessing game" />
<meta property="og:url" content="https://hugobdesigner.github.io/Portle/" />
<meta property="og:type" content="website" />
<meta property="og:description" content="Portle is an online word-guessing game heavily inspired by Wordle, but themed and developed around the Portal video-game franchise. A new Portle game is available every day." />
<meta property="og:locale" content="en_US" />
<meta property="og:image" content="https://hugobdesigner.github.io/Portle/images/card.png" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
</head>
<body onloadstart="initializeThemes()" onload="initializeBoard(); processTags(); checkFirstGame();">
<div id="game">
<header>
<div class="header">
<div style="width: 9em" class="h-desktop">
<a class="link" onclick="showAbout()">About</a>
</div>
<h-container render="practiceMode">
<div style="width: 9em" class="h-desktop">
<h-button
id="new-game"
icon="fa fa-plus"
label="New Game"
onclick="newGame()">
</h-button>
</div>
</h-container>
<div class="logo-container" style="width: 100%; display: inline-flex; justify-content: center;">
<div class="logo">
<h1>Portle</h1>
</div>
<div>
<h1><h-var var="gameNumberOrPractice"></h-var></h1>
</div>
</div>
<h-container render="practiceMode">
<div style="width: 9em" class="h-desktop"></div>
<div class="h-desktop"></div>
</h-container>
<div class="h-desktop">
<a class="far fa-question-circle"
onclick="showHowto()">
</a>
</div>
<h-container render="!practiceMode">
<div class="h-desktop">
<a class="fa fa-chart-bar"
onclick="showStats()">
</a>
</div>
</h-container>
<div>
<a class="fa fa-bars"
onclick="showMenu()">
</a>
</div>
</div>
</header>
<div id="board" class="board">
</div>
<div id="keyboard" class="keyboard">
</div>
</div>
<h-sidebar id="menu" modal="true" onhide="menuOpen=false;unpauseGame()">
<div class="title"><span>Options</span></div>
<hr/>
<div class="h-mobile">
<h-container render="practiceMode">
<h-button
id="new-game"
icon="fa fa-plus"
label="New Game"
onclick="newGame()">
</h-button>
<hr/>
</h-container>
<a onclick="showHowto()">
<span class="far fa-question-circle"></span>
<span>How to Play</span>
</a>
<hr/>
<h-container render="!practiceMode">
<a onclick="showStats()">
<span class="fa fa-chart-bar"></span>
<span>Statistics</span>
</a>
<hr/>
</h-container>
</div>
<span>Theme:<br/></span>
<h-switch
left="Light Theme" right="Dark Theme"
var="darkTheme" onclick="toggleDarkTheme()"></h-switch>
<br/>
<br/>
<span>Tile colors:<br/></span>
<h-switch
left="Original Colors" right="Portal Colors"
var="portalColors" onclick="togglePortalColors()"></h-switch>
<hr/>
<h-container render="practiceMode">
<p>
You are currently in <span style="white-space: nowrap"><b><u>Practice Mode</u></b></span>.
<a onclick="showPracticeInfo()" class="link"><span class="far fa-question-circle"></span></a>
</p>
<h-button icon="fas fa-sign-in-alt" label="Exit Practice Mode" onclick="window.top.location.href = 'index.html'"></h-button>
</h-container>
<h-container render="!practiceMode">
<p>
You are currently in the <span style="white-space: nowrap"><b><u>Official Game Mode</u></b></span>.
<a onclick="showPracticeInfo()" class="link"><span class="far fa-question-circle"></span></a>
</p>
<h-button icon="fas fa-sign-out-alt" label="Enter Practice Mode" onclick="window.location.href = 'practice.html'"></h-button>
</h-container>
<br/>
<br/>
<hr/>
<div style="text-align: right"><a class="link" onclick="showAbout()">About</a></div>
</h-sidebar>
<h-dialog id="stats" header="Statistics" onhide="statsOpen=false;unpauseGame()"
width="" height="">
<div class="stats-grid">
<div>
<span><h-var id="stats-played" var="playedGames" default="0"></h-var></span>
<span>Played</span>
</div>
<div>
<span><h-var id="stats-wins" var="winPercent" default="0"></h-var>%</span>
<span>Win %</span>
</div>
<div>
<span><h-var id="stats-curstreak" var="currentStreak" default="0"></h-var></span>
<span>Current Streak</span>
</div>
<div>
<span><h-var id="stats-maxstreak" var="maxStreak" default="0"></h-var></span>
<span>Max Streak</span>
</div>
</div>
<br/>
<hr/>
<br/>
<div class="stats-distributionbox">
<span class="title">Guess Distribution</span>
<table class="stats-chart">
<tr class="stats-chart-row">
<td>
<span>1</span>
</td>
<td>
<h-progressbar var="guessDist1" inline="true"
id="guess-dist-1" max="guessDistMax">
</h-progressbar>
</td>
</tr>
<tr class="stats-chart-row">
<td>
<span>2</span>
</td>
<td>
<h-progressbar var="guessDist2" inline="true"
id="guess-dist-2" max="guessDistMax">
</h-progressbar>
</td>
</tr>
<tr class="stats-chart-row">
<td>
<span>3</span>
</td>
<td>
<h-progressbar var="guessDist3" inline="true"
id="guess-dist-3" max="guessDistMax">
</h-progressbar>
</td>
</tr>
<tr class="stats-chart-row">
<td>
<span>4</span>
</td>
<td>
<h-progressbar var="guessDist4" inline="true"
id="guess-dist-4" max="guessDistMax">
</h-progressbar>
</td>
</tr>
<tr class="stats-chart-row">
<td>
<span>5</span>
</td>
<td>
<h-progressbar var="guessDist5" inline="true"
id="guess-dist-5" max="guessDistMax">
</h-progressbar>
</td>
</tr>
<tr class="stats-chart-row">
<td>
<span>6</span>
</td>
<td>
<h-progressbar var="guessDist6" inline="true"
id="guess-dist-6" max="guessDistMax">
</h-progressbar>
</td>
</tr>
</table>
</div>
<h-container id="share-container" render="gameOver">
<br/>
<hr/>
<br/>
<div style="display: flex; width: 100%; align-items: center">
<div style="flex: 1; display: inline-grid; grid-auto-flow: row">
<span>
Next Portle in:
<h-container id="long-timer-button" render="longTimerInfo">
<a onclick="showTimerInfo()" class="link"><span class="far fa-question-circle"></span></a>
</h-container>
</span>
<span style="font-size: 2em; width: 4.5em">
<h-var
id="game-timer" var="gameTimer"
autoupdate="true" autoupdate-function="gameTimerUpdate()">
</h-var>
</span>
</div>
<div style="flex: 0">
<h-button
label="Share" icon="fa fa-share" onclick="share()"
style="font-size: 2em">
</h-button>
</div>
</div>
</h-container>
</h-dialog>
<h-dialog
id="howto" header="How to play" onhide="howtoOpen=false;unpauseGame()"
height="95">
<h-container render="practiceMode">
<p>
You are currently in <u><b>Practice Mode</b></u>.
<a onclick="showPracticeInfo()" class="link"><span class="far fa-question-circle"></span></a>
</p>
<p>To play the <u><b>Official Game Mode</b></u>, click the corresponding button in the <span class="fa fa-bars"></span> menu.</p>
<hr/>
</h-container>
<p>You must guess the <b>Portle</b> word of the day in 6 or fewer tries.</p>
<p>Words must be <u>at least</u> 4 characters long and <u>at most</u> 10 characters long. Hit Enter to submit.</p>
<p>Words in this game relate to keywords in the <b>Portal</b> video game franchise.
That means that the words must show up in either Portal, Portal 2, or the official Lab Rat comic.</p>
<p>After each guess, the colors of the tiles will change to reflect how close you are to the right word.</p>
<hr/>
<p>For example:</p>
<div style="display: flex">
<div class="board-box green noanim">P</div>
<div class="board-box empty">O</div>
<div class="board-box empty">R</div>
<div class="board-box empty">T</div>
<div class="board-box empty">A</div>
<div class="board-box empty">L</div>
<div class="board-box empty extra"></div>
<div class="board-box empty extra"></div>
<div class="board-box empty extra"></div>
<div class="board-box empty extra"></div>
</div>
The letter <b>P</b> was in the correct spot for the right word.<br/>
<br/>
<div style="display: flex">
<div class="board-box empty">C</div>
<div class="board-box yellow noanim">U</div>
<div class="board-box empty">B</div>
<div class="board-box empty">E</div>
<div class="board-box empty extra"></div>
<div class="board-box empty extra"></div>
<div class="board-box empty extra"></div>
<div class="board-box empty extra"></div>
<div class="board-box empty extra"></div>
<div class="board-box empty extra"></div>
</div>
The letter <b>U</b> was in the right word, but in a different spot.<br/>
<br/>
<div style="display: flex">
<div class="board-box empty">N</div>
<div class="board-box empty">E</div>
<div class="board-box empty">U</div>
<div class="board-box black noanim">R</div>
<div class="board-box empty">O</div>
<div class="board-box empty">T</div>
<div class="board-box empty">O</div>
<div class="board-box empty">X</div>
<div class="board-box empty">I</div>
<div class="board-box empty">N</div>
</div>
The letter <b>R</b> was not in the right word.<br/>
<br/>
<p>Note that different-sized words can be used to guess the right word.</p>
<hr/>
<p>A new <b>Portle</b> game will be available every day.</p>
<h-container render="practiceMode">
<p>Games played in <b><u>Practice Mode</u></b> will not count towards your current game or game statistics.</p>
</h-container>
</h-dialog>
<h-dialog id="about" header="About" onhide="aboutOpen=false;unpauseGame()">
<div style="display: inline-flex; width: 100%" id="about-anim">
<div class="board-box empty"></div>
<div class="board-box empty"></div>
<div class="board-box empty"></div>
<div class="board-box empty"></div>
<div class="board-box empty extra"></div>
<div class="board-box empty extra"></div>
</div>
<p><b>Portle</b> is an online word-guessing game heavily inspired by
<a class="external link" href="https://www.nytimes.com/games/wordle/index.html" target="_blank">Wordle</a>,
but themed and developed around the
<a class="external link" href="https://www.thinkwithportals.com/" target="_blank">Portal</a>
video-game franchise.</p>
<hr/>
<p><b><u>On cookies and data</u></b></p>
<span style="text-align: justify; text-indent: 2em">
<p>
<b>Portle</b> requires the use of cookies in order to function.
<u>However</u>, no personal data is ever stored or distributed.
All cookies used are <u>strictly</u> for game functions, such as keeping track
of the current game, your game statistics, streaks, <span style="white-space: nowrap">and so on.</span>
</p>
<p>
<b>Portle</b> is a completely <u>offline</u> game, meaning that no
server communication happens. We do not collect or process any data
anywhere, nor do we store any information in any database. In fact, you could
download the project and run it in your own computer with no <span style="white-space: nowrap">impact in execution.</span>
</p>
<p>
<b>Portle</b> runs no ads and does not use any third party scripts. The only two
external resources used are
<a class="external link" href="https://fonts.google.com/" target="_blank">Google fonts</a> and
<a class="external link" href="https://fontawesome.com/" target="_blank">FontAwesome fonts</a>, both of which are
visual elements only and do not execute any external scripts, store cookies, <span style="white-space: nowrap">or collect data.</span>
</p>
</span>
<hr/>
<p>This is a hobby, open-source project. You can find the source code and more about
how it works on the game's <a class="external link" href="https://github.com/HugoBDesigner/Portle" target="_blank">GitHub repository</a>.</p>
<div style="display: inline-grid; width: 100%; grid-auto-flow: column">
<span>
This project is licensed under the
<a class="external link" href="https://creativecommons.org/licenses/by-sa/4.0/" target="_blank">Creative Commons Attribution-ShareAlike 4.0 License</a>.
</span>
<div>
<img src="images/cc_by_sa.png" style="float: right"></img>
</div>
</div>
<hr/>
<p>Portle is developed by
<span style="font-weight: bold; text-shadow: 0px 1px 2px #65981A">HugoBDesigner</span>. You can find my socials here:</p>
<div style="display: inline-flex; width: 100%">
<a target="_blank" href="https://mastodon.art/@HugoBDesigner" class="social" style="color:#6161F7">
<span title="Mastodon" class="fab fa-mastodon"></span>
</a>
<a target="_blank" href="https://twitter.com/HugoBDesigner" class="social" style="color:#00ACEE">
<span title="Twitter" class="fab fa-twitter"></span>
</a>
<a target="_blank" href="https://www.youtube.com/c/HugoBDesigner/" class="social" style="color:#FF0302">
<span title="YouTube" class="fab fa-youtube"></span>
</a>
<a target="_blank" href="https://github.com/HugoBDesigner/" class="social" style="color:#6e5494">
<span title="GitHub" class="fab fa-github"></span>
</a>
<a target="_blank" href="https://hugobdesigner.blogspot.com/" class="social" style="color:#92B41E">
<span title="Blog" class="fa fa-globe"></span>
</a>
</div>
</h-dialog>
<h-dialog id="timer-info" width="" height="" modal="true">
<span>
For the first game, the timer is set to
<span style="white-space: nowrap">48 hours</span>,
in order to allow for different timezones to catch up.
</span>
</h-dialog>
<h-dialog id="practice-info" width="" height="" modal="true">
<span>
<p>When playing the <u><b>Official Game Mode</b></u>, you are given the word of the day to guess.<br/>
Your tries are all registered and, once you finish the game, your score is accounted for in your statistics.<br/>
Game streaks are also tracked in this mode.</p>
<p>When playing the <u><b>Practice Mode</b></u>, you are given an arbitrary word to guess.<br/>
If you refresh the page or exit, your progress will be lost.<br/>
If you finish the game, your score will not be accounted for, nor will your game streaks.</p>
<p>Keep in mind that playing <u><b>Practice Mode</b></u> will <u>NOT</u> count towards your daily streaks.</p>
<hr/>
<p>To toggle between the <u><b>Official Game Mode</b></u> and the <u><b>Practice Mode</b></u>,
click the corresponding button in the <span class="fa fa-bars"></span> menu.</p>
</span>
</h-dialog>
<!-- <h-dialog id="expired" header="Session expired!" closeable="false"
width="" height="" modal="true" onhide="unpauseGame()">
<div style="width: 100%; text-align: center">Please refresh the page to continue playing.</div>
</h-dialog> -->
<h-notification id="notifications">
<!-- <h-notification-message class="opening">TESTING!!!</h-notification-message> -->
</h-notification>
</body>
</html>