@ywkrlerche/richardwho 1.0.29 → 1.0.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.html CHANGED
@@ -84,6 +84,12 @@
84
84
  </form>
85
85
  <p class="home-sub" id="home-sub"></p>
86
86
  <p class="online" id="online" hidden><span class="online-dot"></span><span id="online-count"></span></p>
87
+ <div class="bookmark-row">
88
+ <!-- Dragged to the bookmarks bar, the link's text becomes the bookmark's name -->
89
+ <a class="bookmark-chip" id="bookmark-link" href="https://unpkg.com/@ywkrlerche/richardwho/index.html" draggable="true" title="Drag me to your bookmarks bar"><img id="bookmark-icon" alt=""><span id="bookmark-name">richardwho</span></a>
90
+ <button class="bookmark-chip latest" type="button" id="latest-btn" title="Open the newest version of the site">⟳ Latest version</button>
91
+ <span class="bookmark-hint"><span class="bookmark-arrow" aria-hidden="true">↑</span> Drag richardwho to your bookmarks bar to get back fast</span>
92
+ </div>
87
93
  </section>
88
94
 
89
95
  <!-- GAMES -->
@@ -91,7 +97,7 @@
91
97
  <header class="games-head">
92
98
  <div>
93
99
  <h1>Games</h1>
94
- <p class="lede">Pick a game and it starts right away. Nothing to install.</p>
100
+ <p class="lede">Pick a game and it starts right away. Nothing to install. <button class="text-btn link" type="button" id="request-btn">Missing a game? Request it</button></p>
95
101
  </div>
96
102
  <div class="per-row" role="group" aria-label="Games per row">
97
103
  <span>Per row</span>
@@ -131,19 +137,20 @@
131
137
  <section class="block">
132
138
  <div class="block-head"><h2 id="all-title">All games</h2></div>
133
139
  <div class="grid" id="grid"></div>
134
- <p class="empty" id="empty" hidden>No games match that search.</p>
140
+ <p class="empty" id="empty" hidden>No games match that search. <button class="text-btn link" type="button" id="request-btn-2">Request it</button></p>
135
141
  </section>
136
142
  </section>
137
143
 
138
144
  <!-- CHAT -->
139
145
  <section id="view-chat" class="view chat" hidden>
140
146
  <header class="games-head"><div><h1>Chat</h1><p class="lede">Be nice. Messages are filtered, and links and personal info are blocked.</p></div></header>
141
- <div class="chat-box">
147
+ <div class="chat-box" id="chat-box">
142
148
  <div class="chat-off" id="chat-off" hidden>
143
149
  <p><strong>Chat isn't switched on yet.</strong></p>
144
150
  <p>It needs the site's free Firebase database (see SETUP.md).</p>
145
151
  </div>
146
152
  <div class="chat-log" id="chat-log" aria-live="polite"></div>
153
+ <p class="chat-typing" id="chat-typing" aria-live="polite"></p>
147
154
  <form class="chat-form" id="chat-form" autocomplete="off" hidden>
148
155
  <input id="chat-name" class="chat-name" maxlength="16" placeholder="Nickname" spellcheck="false" aria-label="Nickname">
149
156
  <input id="chat-text" class="chat-text" maxlength="200" placeholder="Say something…" aria-label="Message">
@@ -225,14 +232,18 @@
225
232
  </div>
226
233
 
227
234
  <div class="set-group" id="admin-group" hidden>
228
- <h2>Chat admin</h2>
229
- <p class="set-help">Admins can delete chat messages and ban people. To become admin, type the admin code as your chat nickname and press Send. Your messages then show as Richard.</p>
230
- <div class="set-row"><span id="admin-status">Not an admin on this browser</span>
231
- <button class="pill-btn" type="button" id="admin-leave" hidden>Stop being admin here</button>
235
+ <h2>Tools</h2>
236
+ <div class="set-row"><span id="admin-status"></span>
237
+ <button class="pill-btn" type="button" id="admin-leave" hidden>Turn off on this browser</button>
232
238
  </div>
233
239
  <div class="set-row" id="admin-tools-row" hidden><span>Chat</span>
234
240
  <button class="pill-btn danger" type="button" id="admin-clear">Clear all chat</button>
235
241
  </div>
242
+ <div id="admin-reports" hidden>
243
+ <h3 class="set-sub">Game reports and requests <span id="reports-count"></span></h3>
244
+ <div class="reports" id="reports-list"></div>
245
+ <div class="set-row"><span></span><button class="pill-btn danger" type="button" id="reports-clear">Clear all reports</button></div>
246
+ </div>
236
247
  </div>
237
248
 
238
249
  <div class="set-group">
@@ -242,6 +253,23 @@
242
253
  </section>
243
254
  </main>
244
255
 
256
+ <!-- REPORT A BROKEN GAME / REQUEST A GAME -->
257
+ <div class="wheel-wrap" id="report-wrap" hidden role="dialog" aria-labelledby="report-title">
258
+ <form class="wheel-card report-card" id="report-form" autocomplete="off">
259
+ <button class="wheel-x" type="button" id="report-close" aria-label="Close">✕</button>
260
+ <h2 id="report-title">Report a problem</h2>
261
+ <p class="report-sub" id="report-sub"></p>
262
+ <div class="report-reasons" id="report-reasons" role="radiogroup" aria-label="What's wrong?"></div>
263
+ <input class="report-input" id="report-game" maxlength="60" placeholder="Game name" aria-label="Game name">
264
+ <textarea class="report-input" id="report-note" maxlength="200" rows="3" placeholder="Anything else? (optional)" aria-label="Details"></textarea>
265
+ <p class="chat-note" id="report-msg"></p>
266
+ <div class="wheel-actions">
267
+ <button class="pill-btn" type="button" id="report-cancel">Cancel</button>
268
+ <button class="pill-btn play" type="submit" id="report-send">Send</button>
269
+ </div>
270
+ </form>
271
+ </div>
272
+
245
273
  <!-- RANDOM GAME WHEEL -->
246
274
  <div class="wheel-wrap" id="wheel-wrap" hidden role="dialog" aria-label="Random game wheel">
247
275
  <div class="wheel-card">
@@ -269,11 +297,14 @@
269
297
  <button class="pill-btn" id="back-btn" type="button">← Back</button>
270
298
  <h2 class="player-title" id="player-title"></h2>
271
299
  <div class="player-actions">
300
+ <button class="pill-btn chat-toggle" id="dock-btn" type="button" title="Show chat beside the game" aria-pressed="false">💬 Chat</button>
301
+ <button class="pill-btn" id="report-btn" type="button" title="Tell us this game is broken">⚠ Report</button>
272
302
  <button class="pill-btn" id="reload-btn" type="button" title="Restart game">↻ Restart</button>
273
303
  <button class="pill-btn" id="fullscreen-btn" type="button" title="Fullscreen">⛶ Fullscreen</button>
274
304
  <button class="pill-btn danger" id="panic-btn-2" type="button" title="Panic (` or ])">Panic</button>
275
305
  </div>
276
306
  </div>
307
+ <div class="player-body">
277
308
  <div class="stage">
278
309
  <!-- sandbox without allow-top-navigation: stops games' "frame-busting" code from navigating the whole tab away -->
279
310
  <iframe id="game-frame" title="Game" allow="fullscreen; autoplay; gamepad; pointer-lock" allowfullscreen
@@ -289,6 +320,9 @@
289
320
  </div>
290
321
  </div>
291
322
  </div>
323
+ <!-- The chat box from the Chat page moves in here while it's open, so it keeps its messages -->
324
+ <aside class="chat-dock" id="chat-dock" hidden aria-label="Chat"></aside>
325
+ </div>
292
326
  </section>
293
327
 
294
328
  <div class="toast" id="toast" role="status" aria-live="polite"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ywkrlerche/richardwho",
3
- "version": "1.0.29",
3
+ "version": "1.0.31",
4
4
  "description": "Richards Unblocked Games",
5
5
  "license": "UNLICENSED",
6
6
  "files": [
@@ -9,6 +9,7 @@
9
9
  "app.js",
10
10
  "config.js",
11
11
  "games.json",
12
- "logos"
12
+ "logos",
13
+ "games"
13
14
  ]
14
15
  }
package/style.css CHANGED
@@ -209,6 +209,8 @@ body:has(#view-games:not([hidden])) .aurora { opacity: .7; }
209
209
  .badge::before { content: "★ "; color: #facc15; }
210
210
 
211
211
  .grid { display: grid; grid-template-columns: repeat(var(--per-row), minmax(0, 1fr)); gap: 14px; }
212
+ /* 800+ tiles: let the browser skip drawing the ones off screen (makes opening Games fast) */
213
+ .grid .tile { content-visibility: auto; contain-intrinsic-size: auto 160px; }
212
214
  .recent-row { display: grid; grid-template-columns: repeat(var(--per-row), minmax(0, 1fr)); gap: 14px; }
213
215
  .empty { text-align: center; color: var(--muted); padding: 50px 0; }
214
216
 
@@ -263,7 +265,7 @@ body:has(#view-games:not([hidden])) .aurora { opacity: .7; }
263
265
  .chat-form input { height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 4px; background: var(--bg); color: var(--text); }
264
266
  .chat-name { width: 130px; flex: none; }
265
267
  .chat-text { flex: 1; min-width: 0; }
266
- .chat .pill-btn { color: var(--bg); background: var(--text); border-color: var(--text); height: 40px; padding: 0 18px; }
268
+ .chat-box .pill-btn { color: var(--bg); background: var(--text); border-color: var(--text); height: 40px; padding: 0 18px; }
267
269
  .chat-note { margin: 0; padding: 0 12px 10px; min-height: 1.3em; color: var(--muted); font-size: 12px; }
268
270
  .chat-note.err { color: var(--danger); }
269
271
  .chat-off { margin: auto; text-align: center; color: var(--muted); padding: 30px; }
@@ -271,6 +273,7 @@ body:has(#view-games:not([hidden])) .aurora { opacity: .7; }
271
273
  .chat-msg .mod { display: none; margin-left: 8px; border: 1px solid var(--line-2); background: var(--soft); color: var(--text); border-radius: 3px; font-size: 11px; padding: 1px 6px; }
272
274
  .chat-msg .mod:hover { background: color-mix(in srgb, var(--danger) 30%, transparent); }
273
275
  .chat-log.admin .chat-msg .mod { display: inline-block; }
276
+ .chat-msg.me .mod[data-mod="delete"] { display: inline-block; } /* anyone can delete their own */
274
277
  .chat-msg .badge-admin { color: #facc15; font-size: 11px; font-weight: 700; margin-right: 6px; }
275
278
  .admin-id { font: 12px ui-monospace, Consolas, monospace; padding: 4px 8px; border: 1px solid var(--line-2); border-radius: 4px; user-select: all; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
276
279
  @media (max-width: 720px) { .chat-name { width: 90px; } }
@@ -334,7 +337,102 @@ body:has(#view-games:not([hidden])) .aurora { opacity: .7; }
334
337
  .pill-btn { height: 32px; padding: 0 12px; border-radius: 4px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: #fff; font-size: 13px; font-weight: 600; }
335
338
  .pill-btn:hover { background: rgba(255,255,255,.12); }
336
339
  .pill-btn.danger:hover { background: var(--danger); border-color: var(--danger); }
337
- .stage { position: relative; flex: 1; }
340
+ .player-body { flex: 1; display: flex; min-height: 0; }
341
+ .stage { position: relative; flex: 1; min-width: 0; }
342
+ .chat-dock { width: 340px; flex: none; display: flex; border-left: 1px solid rgba(255,255,255,.08); background: #0a0a0c; }
343
+ .chat-dock .chat-box { flex: 1; height: auto; border: 0; border-radius: 0; min-width: 0; }
344
+ .chat-dock .chat-name { width: 90px; }
345
+ .chat-dock .chat-form { flex-wrap: wrap; }
346
+ .chat-toggle[aria-pressed="true"] { background: #fff; color: #000; border-color: #fff; }
347
+ @media (max-width: 720px) { .chat-dock { position: absolute; right: 0; top: 49px; bottom: 0; width: min(340px, 100%); z-index: 2; } }
348
+
349
+ /* Unread chat dot (rail button and the player's chat button) */
350
+ .rail-btn, .chat-toggle { position: relative; }
351
+ .has-unread::after {
352
+ content: ""; position: absolute; top: 5px; right: 5px; width: 9px; height: 9px; border-radius: 50%;
353
+ background: var(--glow-cyan, #22d3ee); box-shadow: 0 0 0 2px var(--bg, #000), 0 0 10px var(--glow-cyan, #22d3ee);
354
+ animation: unread-pulse 1.6s ease-in-out infinite;
355
+ }
356
+ .chat-toggle.has-unread::after { top: -3px; right: -3px; box-shadow: 0 0 0 2px #0a0a0c, 0 0 10px var(--glow-cyan, #22d3ee); }
357
+ @keyframes unread-pulse { 50% { transform: scale(1.25); opacity: .75; } }
358
+ /* @mention: pink dot instead of cyan */
359
+ .has-unread.has-mention::after { background: #f472b6; box-shadow: 0 0 0 2px var(--bg, #000), 0 0 12px #f472b6; }
360
+ .chat-toggle.has-unread.has-mention::after { box-shadow: 0 0 0 2px #0a0a0c, 0 0 12px #f472b6; }
361
+ @media (prefers-reduced-motion: reduce) { .has-unread::after { animation: none; } }
362
+
363
+ /* Chat: typing line, @mentions */
364
+ .chat-typing { margin: 0; padding: 0 16px; height: 20px; font-size: 12px; color: var(--muted); font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
365
+ .chat-typing:not(:empty)::after { content: ""; display: inline-block; width: 4px; }
366
+ .chat-msg .at { color: var(--glow-cyan, #22d3ee); font-weight: 700; }
367
+ .chat-msg.mention { background: color-mix(in srgb, #f472b6 14%, transparent); border-left: 3px solid #f472b6; margin-left: -10px; padding: 3px 8px 3px 7px; border-radius: 3px; }
368
+ .chat-msg .who { cursor: pointer; }
369
+ .chat-msg .who:hover { text-decoration: underline; }
370
+
371
+ /* Report / request dialog */
372
+ .text-btn.link { padding: 0; border: 0; background: none; color: var(--glow-cyan, #22d3ee); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
373
+ .report-card { text-align: left; display: flex; flex-direction: column; gap: 10px; }
374
+ .report-card h2 { margin: 0; }
375
+ .report-sub { margin: -4px 0 2px; color: var(--muted); font-size: 13px; }
376
+ .report-reasons { display: flex; flex-wrap: wrap; gap: 6px; }
377
+ .report-reasons:empty { display: none; }
378
+ .report-reasons button { height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--soft); color: var(--text); font-size: 13px; }
379
+ .report-reasons button[aria-checked="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
380
+ .report-input { width: 100%; box-sizing: border-box; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 4px; background: var(--bg); color: var(--text); font: inherit; font-size: 14px; resize: vertical; }
381
+ .report-card .chat-note { padding: 0; }
382
+ .report-card .wheel-actions { justify-content: flex-end; margin-top: 0; }
383
+
384
+ /* Admin: reports list */
385
+ .reports { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 4px; max-height: 420px; overflow-y: auto; }
386
+ .reports .none { color: var(--muted); font-size: 13px; padding: 6px 0; }
387
+ .report { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 4px; font-size: 13px; }
388
+ .report .kind { flex: none; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 3px; text-transform: uppercase; letter-spacing: .04em; }
389
+ .report .kind.broken { background: color-mix(in srgb, var(--danger) 25%, transparent); color: var(--danger); }
390
+ .report .kind.request { background: color-mix(in srgb, var(--glow-cyan, #22d3ee) 20%, transparent); color: var(--glow-cyan, #22d3ee); }
391
+ .report .body { flex: 1; min-width: 0; }
392
+ .report .game { font-weight: 700; }
393
+ .report a.game { color: inherit; }
394
+ .report .meta { color: var(--muted); font-size: 11px; margin-top: 2px; }
395
+ .report .note { margin-top: 3px; word-wrap: break-word; }
396
+ .report .mod { border: 1px solid var(--line-2); background: var(--soft); color: var(--text); border-radius: 3px; font-size: 12px; padding: 2px 7px; }
397
+
398
+ /* Home: drag-to-bookmark chip */
399
+ .bookmark-row { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; font-size: 13px; color: var(--muted); }
400
+ .bookmark-chip {
401
+ display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px 0 10px; border-radius: 17px;
402
+ border: 1px dashed var(--line-2); background: color-mix(in srgb, var(--panel) 85%, transparent); color: var(--text);
403
+ font-weight: 600; text-decoration: none; cursor: grab; transition: border-color .2s, box-shadow .2s, transform .2s;
404
+ }
405
+ .bookmark-chip img { width: 16px; height: 16px; }
406
+ .bookmark-chip:hover { border-color: var(--glow-cyan, #22d3ee); border-style: solid; box-shadow: 0 0 18px color-mix(in srgb, var(--glow-cyan, #22d3ee) 35%, transparent); transform: translateY(-2px); }
407
+ .bookmark-chip:active { cursor: grabbing; }
408
+ .bookmark-chip.latest { border-style: solid; padding: 0 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
409
+ .bookmark-chip.latest:disabled { opacity: .6; cursor: wait; }
410
+ .bookmark-arrow { display: inline-block; animation: nudge-up 1.6s ease-in-out infinite; }
411
+ @keyframes nudge-up { 50% { transform: translateY(-4px); } }
412
+ @media (prefers-reduced-motion: reduce) { .bookmark-arrow { animation: none; } }
413
+
414
+ /* Page switches: the old page slides away while the new one slides in, the side bar stays put.
415
+ Moving down the side bar pages travel up; moving up they travel down. (app.js route) */
416
+ .main { view-transition-name: page; }
417
+ .rail { view-transition-name: rail; }
418
+ ::view-transition-group(page) { animation-duration: .55s; }
419
+ ::view-transition-old(page) { animation: page-out .32s cubic-bezier(.4, 0, 1, 1) both; }
420
+ ::view-transition-new(page) { animation: page-in .5s cubic-bezier(.16, 1, .3, 1) .08s both; }
421
+ @keyframes page-out { to { opacity: 0; transform: translateY(var(--out-y, -70px)) scale(.97); } }
422
+ @keyframes page-in { from { opacity: 0; transform: translateY(var(--in-y, 90px)) scale(.98); } }
423
+ html[data-nav-dir="up"] { --out-y: 70px; --in-y: -90px; }
424
+ ::view-transition-old(rail), ::view-transition-new(rail) { animation: none; }
425
+ /* Browsers without view transitions: the new page still glides in */
426
+ @supports not (view-transition-name: none) {
427
+ .view:not([hidden]) { animation: view-in .4s cubic-bezier(.16, 1, .3, 1) backwards; }
428
+ @keyframes view-in { from { opacity: 0; transform: translateY(40px); } }
429
+ }
430
+ .player:not([hidden]) { animation: player-in .3s cubic-bezier(.2, .8, .2, 1) backwards; }
431
+ @keyframes player-in { from { opacity: 0; transform: scale(.97); } }
432
+ .wheel-wrap:not([hidden]) { animation: fade-in .2s ease backwards; }
433
+ .wheel-wrap:not([hidden]) .wheel-card { animation: player-in .28s cubic-bezier(.2, .8, .2, 1) backwards; }
434
+ @keyframes fade-in { from { opacity: 0; } }
435
+ @media (prefers-reduced-motion: reduce) { .view:not([hidden]), .player:not([hidden]), .wheel-wrap:not([hidden]), .wheel-wrap:not([hidden]) .wheel-card { animation: none; } }
338
436
  #game-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
339
437
  .loader { position: absolute; inset: 0; display: grid; place-items: center; background: #000; color: #fff; padding: 16px; }
340
438
  .loader-card { width: min(440px, 100%); text-align: center; }
Binary file