-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
401 lines (398 loc) · 23.4 KB
/
index.html
File metadata and controls
401 lines (398 loc) · 23.4 KB
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Simulation of Pixels</title>
<link rel="icon" href="./img/aprilFoolsFavicon.png" type="image/x-icon">
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="gameContainer" style="display: none;">
<canvas id="canvas"></canvas>
<canvas id="overlayCanvas"></canvas>
<div id="controlSettings">
<button id="playButton" class="button"></button>
<button id="stepButton" class="button"></button>
<button id="simulateButton" class="button"></button>
<button id="slowmodeButton" class="button"></button>
<button id="menuButton" class="button"></button>
<button id="settingsButton" class="button"></button>
<button id="screenshotButton" class="button"></button>
<button id="resetButton" class="button"></button>
</div>
<div id="saveCodeSettings" class="hidden" style="display: flex; flex-direction: column;">
<div style="display: flex; justify-content: center;">
<button id="downloadSaveCodeButton" class="button"></button>
<button id="uploadSaveCodeButton" class="button"></button>
<button id="generateSaveCodeButton" class="button"></button>
</div>
<div id="saveCodeText">Save Code:</div>
<textarea id="saveCode" style="flex-grow: 1;" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"></textarea>
<div id="saveCodeSettingsToggle">
<div></div>
</div>
<div id="blueprintSettingsContainer" class="hidden">
<div id="blueprintSettings" style="display: flex; flex-direction: column;">
<div style="display: flex; justify-content: center;">
<button id="saveBlueprintButton" class="button"></button>
<button id="uploadBlueprintButton" class="button"></button>
</div>
<div id="blueprintsListText">Saved Blueprints:</div>
<div id="blueprintsList"></div>
</div>
</div>
<div id="blueprintSettingsToggle" class="hidden">
<div></div>
</div>
</div>
<div id="history">
<!-- asdf -->
</div>
<div id="pixelPicker"></div>
<div id="puzzleOverlay">
<div id="puzzleInformation" style="display: flex; flex-direction: column;">
<div id="puzzleName">Return of Scenic Pond</div>
<div id="puzzleAuthor">sp</div>
</div>
<div id="puzzleObjectives" style="display: flex; flex-direction: column;">
<!-- <div class="puzzleObjective">
Fix RPS
<div class="puzzleObjectiveProgress">
<div class="puzzleObjectiveProgressBackground"></div>
<div class="puzzleObjectiveProgressText">0/1</div>
</div>
</div>
<div class="puzzleObjective">
<div class="puzzleObjectiveName">Destroy Monsters</div>
<div class="puzzleObjectiveProgress">
<div class="puzzleObjectiveProgressBackground"></div>
<div class="puzzleObjectiveProgressText">1/3</div>
</div>
</div> -->
</div>
</div>
<div id="multiplayerOverlay">
<div class="multiplayerTeam">
<div class="multiplayerTeamName">Team Alpha</div>
<div class="multiplayerScore">0/0</div>
<div class="multiplayerPixelInventory">
<div class="multiplayerPixel">1</div>
<div class="multiplayerPixel">1</div>
<div class="multiplayerPixel">1</div>
</div>
</div>
<div class="multiplayerTeam">
<div class="multiplayerTeamName">Team Beta</div>
<div class="multiplayerScore">0/0</div>
<div class="multiplayerPixelInventory">
<div class="multiplayerPixel">1</div>
<div class="multiplayerPixel">1</div>
<div class="multiplayerPixel">1</div>
</div>
</div>
</div>
<div id="multiplayerWinContainer">
<div id="multiplayerWinTitle"></div>
<div id="multiplayerWinSubtitle"></div>
</div>
<template id="multiplayerTeamTemplate">
<div class="multiplayerTeam">
<div class="multiplayerTeamName">Team Alpha</div>
<div class="multiplayerScore">0 / 0</div>
<div class="multiplayerPixelInventory"></div>
</div>
</template>
<dialog id="settingsContainer">
<div style="position: absolute; width: calc(100% - 8px); height: calc(100% - 8px); padding: 4px; display: flex; overflow-y: scroll; flex-direction: column; align-items: center;">
<div id="settingsGrid"></div>
</div>
<button id="settingsCloseButton" class="button"></button>
</dialog>
<dialog id="addKeybindContainer"></dialog>
<div id="tooltip">
<div id="tooltipName"></div>
<div id="tooltipDescription"></div>
</div>
<div id="congratulationsContainer" class="hidden">
<div id="congratulations">
<div id="congratulationsTitle">Congratulations!</div>
<div id="congratulationsSubtitle"></div>
<div id="congratulationsButtons">
<button id="congratulationsResetButton" class="congratulationsButton">Reset</button>
<button id="congratulationsContinueButton" class="congratulationsButton">Continue</button>
</div>
</div>
</div>
</div>
<div id="menuContainer">
<!-- <img id="menuTitle" src="/img/title.png"> -->
<canvas id="menuCanvas"></canvas>
<div id="titleContainer">
<div id="sandboxButtonContainer" class="menuButtonContainer">
<button id="sandboxButton" class="menuButton">Sandbox</button>
</div>
<div id="puzzlesButtonContainer" class="menuButtonContainer">
<button id="puzzlesButton" class="menuButton">Puzzles</button>
</div>
<div id="multiplayerButtonContainer" class="menuButtonContainer">
<button id="multiplayerButton" class="menuButton">Multiplayer</button>
</div>
</div>
<div id="puzzlesContainer" style="display: none;">
<div id="puzzlesTitle">Puzzles</div>
<div style="display: flex;">
<button id="officialPuzzlesButton" class="puzzlesHeaderButton">Official Puzzles</button>
<button id="customPuzzlesButton" class="puzzlesHeaderButton">Custom Puzzles</button>
</div>
<div id="puzzlesList">
<div id="officialPuzzlesList"></div>
<div id="customPuzzlesList">
<button id="uploadCustomPuzzleButton">Upload Puzzle</button>
<button id="createCustomPuzzleButton">Create Puzzle</button>
</div>
<div id="createCustomPuzzleContainer">
<div id="createCustomPuzzleTitle">Create Custom Puzzle</div>
<div id="createCustomPuzzleSettings">
<label for="createCustomPuzzleId">Id:</label>
<input type="text" id="createCustomPuzzleId">
<label for="createCustomPuzzleName">Name:</label>
<input type="text" id="createCustomPuzzleName">
<label for="createCustomPuzzleAuthor">Author:</label>
<input type="text" id="createCustomPuzzleAuthor">
<label for="createCustomPuzzleWorld">World:</label>
<input type="text" id="createCustomPuzzleWorld">
<label for="createCustomPuzzleSaveCode">Save Code:</label>
<textarea id="createCustomPuzzleSaveCode"></textarea>
<label for="createCustomPuzzleInventory">Inventory:</label>
<div style="display: grid;">
<input type="text" id="createCustomPuzzleInventory" placeholder="Search:">
<div id="createCustomPuzzleInventoryList"></div>
</div>
<label>Objectives:</label>
<div id="createCustomPuzzleObjectivesList">
<!-- <div class="createCustomPuzzleObjective">
<label for="createCustomPuzzleObjectiveType1">Type:</label>
<select id="createCustomPuzzleObjectiveType1" class="createCustomPuzzleObjectiveType">
<option value="destroyMonsters">Destroy Monsters</option>
<option value="ticks">Ticks</option>
<option value="pixels">Pixels</option>
</select>
<label for="createCustomPuzzleObjectiveTargetAll1">Target All:</label>
<input id="createCustomPuzzleObjectiveTargetAll1" type="checkbox" class="createCustomPuzzleObjectiveTargetAll">
<label for="createCustomPuzzleObjectiveTarget1">Target:</label>
<input id="createCustomPuzzleObjectiveTarget1" type="number" class="createCustomPuzzleObjectiveTarget">
<label for="createCustomPuzzleObjectiveMin1">Min:</label>
<input type="number" class="createCustomPuzzleObjectiveMin">
<label for="createCustomPuzzleObjectiveMax1">Max:</label>
<input type="number" class="createCustomPuzzleObjectiveMax">
<button class="createCustomPuzzleObjectiveDeleteButton">x</button>
</div> -->
<template id="createCustomPuzzleObjectiveTemplate">
<div class="createCustomPuzzleObjective">
<label for="createCustomPuzzleObjectiveType1">Type:</label>
<select id="createCustomPuzzleObjectiveType1" class="createCustomPuzzleObjectiveType">
<option value="destroyMonsters">Destroy Monsters</option>
<option value="ticks">Ticks</option>
<option value="pixels">Pixels</option>
<option value="custom">Custom</option>
</select>
<label for="createCustomPuzzleObjectiveTargetAll1">Target All:</label>
<input id="createCustomPuzzleObjectiveTargetAll1" type="checkbox" class="createCustomPuzzleObjectiveTargetAll">
<label for="createCustomPuzzleObjectiveTarget1">Target:</label>
<input id="createCustomPuzzleObjectiveTarget1" type="number" class="createCustomPuzzleObjectiveTarget">
<label for="createCustomPuzzleObjectiveMin1">Min:</label>
<input type="number" class="createCustomPuzzleObjectiveMin">
<label for="createCustomPuzzleObjectiveMax1">Max:</label>
<input type="number" class="createCustomPuzzleObjectiveMax">
<label for="createCustomPuzzleObjectiveRun">Run:</label>
<textarea class="createCustomPuzzleObjectiveRun"></textarea>
<button class="createCustomPuzzleObjectiveDeleteButton">Delete Objective</button>
</div>
</template>
<button id="createCustomPuzzleAddObjectiveButton">Add Objective</button>
</div>
<label for="createCustomPuzzleMusic">Music:</label>
<select id="createCustomPuzzleMusic">
</select>
<!-- buh what is this id name createCustomPuzzleFinishButton -->
<button id="createCustomPuzzleFinishButton">Create Puzzle</button>
</div>
<button id="createCustomPuzzleCloseButton" class="button"></button>
</div>
</div>
<button id="puzzlesCloseButton" class="button"></button>
</div>
<div id="multiplayerContainer" style="display: none;">
<div id="multiplayerTitle">Multiplayer</div>
<div id="multiplayerContainers">
<div id="multiplayerMenuContainer">
<div style="display: grid; grid-gap: 4px; min-height: 0px; margin-top: 40px; margin-bottom: 4px;">
<div class="multiplayerSignedInText"></div>
<button id="multiplayerProfileButton">Profile</button>
<button id="multiplayerGameListButton">Games</button>
<button id="multiplayerLogOutButton">Log Out</button>
</div>
</div>
<div id="multiplayerSignInContainer">
<div style="display: grid; grid-gap: 4px; min-height: 0px; margin-bottom: 4px;">
<div class="multiplayerTitle">Sign In:</div>
<label for="multiplayerSignInUsername">Username:</label>
<input id="multiplayerSignInUsername" type="text" maxlength="32">
<label for="multiplayerSignInPassword">Password:</label>
<input id="multiplayerSignInPassword" type="password">
<label id="multiplayerSignInRetypePasswordLabel" for="multiplayerSignInRetypePassword" style="display: none;">Retype Password:</label>
<input id="multiplayerSignInRetypePassword" type="password" style="display: none;">
<div id="multiplayerSignInResponse"></div>
<button id="multiplayerSignInButton">Sign In</button>
<button id="multiplayerCreateAccountButton">Create Account</button>
</div>
</div>
<div id="multiplayerProfileContainer">
<button id="multiplayerProfileBackButton" class="multiplayerBackButton">< Back to Menu</button>
<div style="display: grid; grid-gap: 4px; min-height: 0px; margin-bottom: 4px;">
<div class="multiplayerTitle">Profile:</div>
<div class="multiplayerSignedInText"></div>
<label for="multiplayerProfilePassword">Password:</label>
<input id="multiplayerProfilePassword" type="password">
<div id="multiplayerProfileResponse"></div>
<div class="multiplayerProfileGroup">
<label for="multiplayerProfileNewUsername">New Username:</label>
<input id="multiplayerProfileNewUsername" type="text" maxlength="32">
<button id="multiplayerChangeUsernameButton">Change Username</button>
</div>
<div class="multiplayerProfileGroup">
<label for="multiplayerProfileNewPassword">New Password:</label>
<input id="multiplayerProfileNewPassword" type="password" maxlength="32">
<label for="multiplayerProfileRetypeNewPassword">Retype New Password:</label>
<input id="multiplayerProfileRetypeNewPassword" type="password" maxlength="32">
<button id="multiplayerChangePasswordButton">Change Password</button>
</div>
<div class="multiplayerProfileGroup">
<label for="multiplayerDeleteAccountPassword">Retype Password:</label>
<input id="multiplayerDeleteAccountPassword" type="password">
<button id="multiplayerDeleteAccountButton">Delete Account</button>
</div>
</div>
</div>
<div id="multiplayerGameListContainer">
<button id="multiplayerGameListBackButton" class="multiplayerBackButton">< Back to Menu</button>
<!-- <div id="multiplayerAccountContainer">
<div id="multiplayerAccount">Signed in as sp</div>
<div id="multiplayerAccountDropdown">
<div id="multiplayerChangeUsernameButton">Change Username</div>
<div id="multiplayerChangePasswordButton">Change Password</div>
<div id="multiplayerDeleteAccountButton">Delete Account</div>
<div id="multiplayerLogOutButton">Log Out</div>
</div>
</div> -->
<div style="display: grid; grid-gap: 4px; min-height: 0px; margin-bottom: 4px;">
<div class="multiplayerTitle">Games:</div>
<input id="multiplayerGameIdInput" type="text">
<button id="multiplayerJoinGameButton">Join Game</button>
<div id="multiplayerGameList">
No Active Games
<template id="multiplayerGameTemplate">
<div class="multiplayerGame">
<div style="flex-grow: 1;">
<div class="multiplayerGameTitle"></div>
<div class="multiplayerGameSubtitle"></div>
</div>
<div class="multiplayerGameJoinGameButton">Join Game</div>
</div>
</template>
</div>
<button id="multiplayerCreateGameButton">Create Game</button>
</div>
</div>
<div id="multiplayerGameLobbyContainer">
<button id="multiplayerLeaveGameButton" class="multiplayerBackButton">< Leave Game</button>
<div style="display: grid; grid-gap: 4px; max-height: calc(100% - 4px);">
<div class="multiplayerTitle">Game Lobby</div>
<label for="multiplayerGameLobbyId">Join Code:</label>
<input type="text" id="multiplayerGameLobbyId" disabled>
<label for="multiplayerGameLobbyPublic">Public:</label>
<input type="checkbox" id="multiplayerGameLobbyPublic" disabled>
<div style="grid-column: span 2; text-align: center;">Map:</div>
<div id="multiplayerGameLobbyMap" class="multiplayerGameLobbyMap"></div>
<div id="multiplayerGameLobbyMaps"></div>
<div id="multiplayerGameLobbyPlayers"></div>
<button id="multiplayerStartGameButton">Start Game</button>
</div>
</div>
<div id="multiplayerLoadingContainer">
<div id="multiplayerLoadingSquares">
<div id="multiplayerLoadingSquare1" class="multiplayerLoadingSquare"></div>
<div id="multiplayerLoadingSquare2" class="multiplayerLoadingSquare"></div>
<div id="multiplayerLoadingSquare3" class="multiplayerLoadingSquare"></div>
</div>
<div id="multiplayerLoadingTitle">Connecting to server...</div>
</div>
</div>
<button id="multiplayerCloseButton" class="button"></button>
</div>
<div id="volumeSliderButton"></div>
<div id="volumeSliderContainer">
<input type="range" id="volumeSlider" min="0" max="100" step="1">
</div>
<div id="menuInformation">
Licensed under the <a href="https://github.com/SampleProvider/Pixel-Simulator/blob/main/LICENSE" target="_blank">GNU General Public License v3.0</a>
<br>
All code open source on <a href="https://github.com/SampleProvider/Pixel-Simulator/" target="_blank">Github</a>
<br>
Join the <a href="https://discord.gg/NYaWXu3aQ2" target="_blank"> Pixel Simulator Discord!</a>
</div>
<div id="menuTooltip">
<div id="menuTooltipName"></div>
<div id="menuTooltipDescription"></div>
</div>
<div id="multiplayerGameLobbyDraggingPlayer" class="multiplayerGameLobbyPlayer" style="display: none;"></div>
</div>
<div id="transitionContainer" style="display: none;">
<div id="transitionTop"></div>
<div id="transitionBottom"></div>
</div>
<dialog id="modalContainer">
<div id="modalTitle"></div>
<div id="modalContent"></div>
<div id="modalButtons" style="display: flex; justify-content: center;">
<!-- <button id="modalYes" class="modalButton button">Yes</button>
<button id="modalNo" class="modalButton button">No</button>
<button id="modalOk" class="modalButton button">Ok</button> -->
<button id="modalYes" class="modalButton">Yes</button>
<button id="modalNo" class="modalButton">No</button>
<button id="modalOk" class="modalButton">Ok</button>
</div>
</dialog>
<template id="blueprintTemplate">
<div class="blueprint" style="display: flex;">
<div class="blueprintImg"></div>
<div style="display: flex; flex-direction: column;">
<div style="display: flex; position: relative;">
<input class="blueprintName" type="text">
</div>
<div style="display: flex;">
<button class="blueprintCopyButton button"></button>
<button class="blueprintDownloadButton button"></button>
<button class="blueprintDeleteButton button"></button>
</div>
</div>
</div>
</template>
<template id="puzzleObjectiveTemplate">
<div class="puzzleObjective">
<div class="puzzleObjectiveName"></div>
<div class="puzzleObjectiveProgress">
<div class="puzzleObjectiveProgressBackground"></div>
<div class="puzzleObjectiveProgressText">1/3</div>
</div>
</div>
</template>
<!-- <script src="pixels.js" type="module"></script> -->
<!-- <script src="https://cdn.socket.io/4.8.1/socket.io.min.js"></script> -->
<script src="socket.io.min.js"></script>
<script src="game.js" type="module" defer></script>
<!-- <script src="sound.js" type="module" defer></script> -->
<!-- <script src="renderer.js" type="module" defer></script> -->
</body>
</html>