@ywkrlerche/richardwho 1.0.31 → 1.0.33
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/app.js +66 -7
- package/index.html +18 -2
- package/package.json +1 -1
- package/style.css +36 -4
package/app.js
CHANGED
|
@@ -394,10 +394,11 @@
|
|
|
394
394
|
}
|
|
395
395
|
|
|
396
396
|
// ---------- Routing: "" home, #games, #recent, #play/<id> ----------
|
|
397
|
-
const VIEW_ORDER = ["home", "games", "chat", "stats", "settings"];
|
|
397
|
+
const VIEW_ORDER = ["home", "games", "chat", "stats", "settings", "changelog"];
|
|
398
398
|
let lastView = null;
|
|
399
399
|
function viewFor(hash) {
|
|
400
|
-
return hash === "#games" || hash === "#recent" ? "games" : hash === "#settings" ? "settings" : hash === "#chat" ? "chat"
|
|
400
|
+
return hash === "#games" || hash === "#recent" ? "games" : hash === "#settings" ? "settings" : hash === "#chat" ? "chat"
|
|
401
|
+
: hash === "#stats" ? "stats" : hash === "#changelog" ? "changelog" : "home";
|
|
401
402
|
}
|
|
402
403
|
// Switching pages: the old page slides out while the new one slides in (down the side bar = upward,
|
|
403
404
|
// up the side bar = downward). Uses the browser's view transitions; older browsers just switch.
|
|
@@ -435,6 +436,8 @@
|
|
|
435
436
|
$("view-chat").hidden = view !== "chat";
|
|
436
437
|
lastView = view;
|
|
437
438
|
$("view-stats").hidden = view !== "stats";
|
|
439
|
+
$("view-changelog").hidden = view !== "changelog";
|
|
440
|
+
if (view === "changelog") renderChangelog();
|
|
438
441
|
placeChatBox();
|
|
439
442
|
if (view === "settings") { renderSettings(); renderAdmin(); }
|
|
440
443
|
if (view === "stats") renderStats();
|
|
@@ -474,12 +477,13 @@
|
|
|
474
477
|
function startClock() {
|
|
475
478
|
clockIs24 = store.get(CLOCK_KEY, false);
|
|
476
479
|
const timeEl = $("clock-time"), metaEl = $("clock-meta");
|
|
480
|
+
// Intl formats the time; the AM/PM part goes in the small label beside it
|
|
481
|
+
const fmt12 = new Intl.DateTimeFormat(undefined, { hour: "numeric", minute: "2-digit", hour12: true });
|
|
482
|
+
const fmt24 = new Intl.DateTimeFormat(undefined, { hour: "2-digit", minute: "2-digit", hourCycle: "h23" });
|
|
477
483
|
clockTick = () => {
|
|
478
|
-
const
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
if (clockIs24) { timeEl.textContent = `${String(h).padStart(2, "0")}:${m}`; metaEl.textContent = "24H"; }
|
|
482
|
-
else { const ap = h >= 12 ? "PM" : "AM"; h = h % 12 || 12; timeEl.textContent = `${h}:${m}`; metaEl.textContent = ap; }
|
|
484
|
+
const parts = (clockIs24 ? fmt24 : fmt12).formatToParts(new Date());
|
|
485
|
+
timeEl.textContent = parts.filter((p) => p.type !== "dayPeriod").map((p) => p.value).join("").trim();
|
|
486
|
+
metaEl.textContent = clockIs24 ? "24H" : (parts.find((p) => p.type === "dayPeriod")?.value || "").toUpperCase();
|
|
483
487
|
};
|
|
484
488
|
$("clock").addEventListener("click", () => setClock24(!clockIs24));
|
|
485
489
|
clockTick();
|
|
@@ -488,6 +492,7 @@
|
|
|
488
492
|
|
|
489
493
|
function applyTheme(t) {
|
|
490
494
|
document.documentElement.dataset.theme = t;
|
|
495
|
+
$("theme-color").content = t === "dark" ? "#000000" : "#f6f6f8"; // phone browser bar matches the page
|
|
491
496
|
$("theme-btn").title = t === "dark" ? "Switch to light mode" : "Switch to dark mode";
|
|
492
497
|
try { localStorage.setItem(THEME_KEY, t); } catch {}
|
|
493
498
|
}
|
|
@@ -497,6 +502,58 @@
|
|
|
497
502
|
applyTheme(document.documentElement.dataset.theme === "dark" ? "light" : "dark"));
|
|
498
503
|
}
|
|
499
504
|
|
|
505
|
+
// ---------- What's new (changelog) ----------
|
|
506
|
+
// Newest first. Add an entry here with every publish; its version should match package.json.
|
|
507
|
+
// Each has: new (features), games (added/removed/fixed games), fixes (bugs). Leave a list out if empty.
|
|
508
|
+
const CHANGELOG = [
|
|
509
|
+
{ version: "1.0.33", date: "2026-10-23",
|
|
510
|
+
new: ["What's new page: see every update, new games and bug fixes (you're on it!)"] },
|
|
511
|
+
{ version: "1.0.32", date: "2026-10-23",
|
|
512
|
+
new: ["Phone browsers now match the site's color at the top of the screen", "Keyboard users get a “Skip to content” button on the first Tab press"],
|
|
513
|
+
fixes: ["Search boxes and game tiles show a clear ring when picked with the keyboard",
|
|
514
|
+
"Scrolling to the end of chat or a pop-up no longer scrolls the page behind it",
|
|
515
|
+
"Taps on touch screens respond right away (no double-tap zoom delay)",
|
|
516
|
+
"The green online dot stops pulsing when your device is set to reduce motion"] },
|
|
517
|
+
{ version: "1.0.31", date: "2026-10-23",
|
|
518
|
+
games: ["Fixed Recoil: now runs a working copy", "Fixed Gunspin: now runs a working copy",
|
|
519
|
+
"Removed Five Nights at Epstein's and Get Yoked (they relied on sites that schools block)"] },
|
|
520
|
+
{ version: "1.0.30", date: "2026-10-23",
|
|
521
|
+
new: ["Chat beside your game: hit 💬 Chat in the game bar", "A dot on the chat button when someone posts",
|
|
522
|
+
"@mentions: type @name to ping someone (their dot turns pink)", "See when someone is typing",
|
|
523
|
+
"Delete your own chat messages with 🗑", "⚠ Report a broken game, or request a new one from the Games page",
|
|
524
|
+
"Pages slide when you switch between them", "Drag-to-bookmark button and a ⟳ Latest version button on the home page"],
|
|
525
|
+
games: ["Tested all 840 games; removed 48 that only showed a blank screen"],
|
|
526
|
+
fixes: ["Opening the Games page is much smoother"] },
|
|
527
|
+
{ version: "1.0.29", new: ["Stats & achievements page (🏆 in the side bar)", "New blue look and an animated logo that reacts to your mouse"] },
|
|
528
|
+
{ version: "Earlier", new: ["Settings page, tab disguises and panic button", "Random game wheel", "Live online count and the chat room",
|
|
529
|
+
"Funny loading screen", "Recently played and search", "The site updates itself to the newest version"],
|
|
530
|
+
games: ["Hundreds of games added, including a second big collection"],
|
|
531
|
+
fixes: ["Games that said “failed to fetch” now retry backup servers", "Games can no longer kick you back out of the player"] },
|
|
532
|
+
];
|
|
533
|
+
const SITE_VERSION = CHANGELOG[0].version;
|
|
534
|
+
const CHANGELOG_SEEN_KEY = "rug-changelog-seen";
|
|
535
|
+
const CHANGE_KINDS = [["new", "✨ Updates"], ["games", "🎮 Games"], ["fixes", "🐛 Bug fixes"]];
|
|
536
|
+
function renderChangelog() {
|
|
537
|
+
const fmt = new Intl.DateTimeFormat(undefined, { month: "short", day: "numeric", year: "numeric" });
|
|
538
|
+
$("changelog-list").innerHTML = CHANGELOG.map((c, i) => {
|
|
539
|
+
const date = c.date ? `<span class="cl-date">${fmt.format(new Date(c.date + "T12:00:00"))}</span>` : "";
|
|
540
|
+
const tag = i === 0 ? `<span class="cl-latest">Latest</span>` : "";
|
|
541
|
+
const lists = CHANGE_KINDS.filter(([k]) => c[k]?.length).map(([k, label]) =>
|
|
542
|
+
`<div class="cl-kind cl-${k}"><h3>${label}</h3><ul>${c[k].map((x) => `<li>${escapeHtml(x)}</li>`).join("")}</ul></div>`).join("");
|
|
543
|
+
return `<article class="set-group cl-entry"><h2>${/\d/.test(c.version) ? "v" : ""}${escapeHtml(c.version)} ${tag}${date}</h2>${lists}</article>`;
|
|
544
|
+
}).join("");
|
|
545
|
+
store.set(CHANGELOG_SEEN_KEY, SITE_VERSION);
|
|
546
|
+
$("whats-new-link").classList.remove("has-unread");
|
|
547
|
+
}
|
|
548
|
+
function initChangelog() {
|
|
549
|
+
$("home-version").textContent = `v${SITE_VERSION}`;
|
|
550
|
+
$("set-version").textContent = `v${SITE_VERSION}`;
|
|
551
|
+
// A dot on the home link until you've looked at this version's notes (not on your very first visit)
|
|
552
|
+
const seen = store.get(CHANGELOG_SEEN_KEY, null);
|
|
553
|
+
if (seen === null) store.set(CHANGELOG_SEEN_KEY, SITE_VERSION);
|
|
554
|
+
else if (seen !== SITE_VERSION) $("whats-new-link").classList.add("has-unread");
|
|
555
|
+
}
|
|
556
|
+
|
|
500
557
|
// ---------- Play stats + achievements (saved in this browser) ----------
|
|
501
558
|
// Time counts only while a game is open AND the tab is visible.
|
|
502
559
|
const STATS_KEY = "rug-stats";
|
|
@@ -1248,6 +1305,7 @@
|
|
|
1248
1305
|
toast(`Drag it up to your bookmarks bar, or press ${/Mac/.test(navigator.platform) ? "⌘" : "Ctrl"}+D`);
|
|
1249
1306
|
});
|
|
1250
1307
|
$("latest-btn").addEventListener("click", goLatest);
|
|
1308
|
+
$("skip-link").addEventListener("click", () => $("main").focus());
|
|
1251
1309
|
$("report-btn").addEventListener("click", () => { const g = currentLoad && byId.get(currentLoad.id); if (g) openReport("broken", g); });
|
|
1252
1310
|
$("request-btn").addEventListener("click", () => openReport("request"));
|
|
1253
1311
|
$("request-btn-2").addEventListener("click", () => openReport("request", null, els.search.value.trim()));
|
|
@@ -1662,6 +1720,7 @@
|
|
|
1662
1720
|
bindSettings();
|
|
1663
1721
|
bindWheel();
|
|
1664
1722
|
bindWordmark();
|
|
1723
|
+
initChangelog();
|
|
1665
1724
|
$("chat-form").addEventListener("submit", sendChat);
|
|
1666
1725
|
$("chat-text").addEventListener("input", noteTyping);
|
|
1667
1726
|
$("chat-text").addEventListener("blur", stopTyping);
|
package/index.html
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="utf-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<meta name="theme-color" id="theme-color" content="#000000">
|
|
6
7
|
<title>Google Classroom</title>
|
|
7
8
|
<meta name="description" content="richardwho: Richards Unblocked Games. Hundreds of games, nothing to install.">
|
|
8
9
|
<link rel="icon" id="tab-icon" href="https://ssl.gstatic.com/classroom/favicon.png">
|
|
@@ -11,6 +12,7 @@
|
|
|
11
12
|
<script>
|
|
12
13
|
// Apply saved theme before paint so there's no flash
|
|
13
14
|
try { document.documentElement.dataset.theme = localStorage.getItem("rug-theme") || "dark"; } catch (e) {}
|
|
15
|
+
if (document.documentElement.dataset.theme === "light") document.getElementById("theme-color").content = "#f6f6f8";
|
|
14
16
|
// Apply the saved tab disguise before anything else shows in the tab
|
|
15
17
|
try {
|
|
16
18
|
var s = JSON.parse(localStorage.getItem("rug-settings") || "{}");
|
|
@@ -20,6 +22,8 @@
|
|
|
20
22
|
</script>
|
|
21
23
|
</head>
|
|
22
24
|
<body>
|
|
25
|
+
<!-- Keyboard users: first Tab stop jumps past the side bar. A button, not href="#main", since # links drive the page routing -->
|
|
26
|
+
<button class="skip-link" type="button" id="skip-link">Skip to content</button>
|
|
23
27
|
<!-- Boot screen: shows instantly while the site checks for a newer version and loads the game list -->
|
|
24
28
|
<div class="boot" id="boot" aria-live="polite">
|
|
25
29
|
<div class="boot-inner">
|
|
@@ -73,7 +77,7 @@
|
|
|
73
77
|
<span id="clock-time">--:--</span><small id="clock-meta"></small>
|
|
74
78
|
</button>
|
|
75
79
|
|
|
76
|
-
<main class="main">
|
|
80
|
+
<main class="main" id="main" tabindex="-1">
|
|
77
81
|
<!-- HOME -->
|
|
78
82
|
<section id="view-home" class="view home">
|
|
79
83
|
<h1 class="wordmark">richardwho</h1>
|
|
@@ -90,6 +94,7 @@
|
|
|
90
94
|
<button class="bookmark-chip latest" type="button" id="latest-btn" title="Open the newest version of the site">⟳ Latest version</button>
|
|
91
95
|
<span class="bookmark-hint"><span class="bookmark-arrow" aria-hidden="true">↑</span> Drag richardwho to your bookmarks bar to get back fast</span>
|
|
92
96
|
</div>
|
|
97
|
+
<p class="whats-new-row"><button class="text-btn link whats-new" type="button" data-nav="changelog" id="whats-new-link">What's new in <span id="home-version"></span></button></p>
|
|
93
98
|
</section>
|
|
94
99
|
|
|
95
100
|
<!-- GAMES -->
|
|
@@ -187,6 +192,12 @@
|
|
|
187
192
|
</section>
|
|
188
193
|
|
|
189
194
|
<!-- SETTINGS -->
|
|
195
|
+
<!-- WHAT'S NEW (filled from CHANGELOG in app.js) -->
|
|
196
|
+
<section id="view-changelog" class="view settings changelog" hidden>
|
|
197
|
+
<header class="games-head"><div><h1>What's new</h1><p class="lede">Every update to richardwho: new stuff, games and fixes.</p></div></header>
|
|
198
|
+
<div id="changelog-list"></div>
|
|
199
|
+
</section>
|
|
200
|
+
|
|
190
201
|
<section id="view-settings" class="view settings" hidden>
|
|
191
202
|
<header class="games-head"><div><h1>Settings</h1><p class="lede">Saved on this device only.</p></div></header>
|
|
192
203
|
|
|
@@ -208,7 +219,7 @@
|
|
|
208
219
|
</select>
|
|
209
220
|
</label>
|
|
210
221
|
<label class="set-row" id="set-panic-custom-row" hidden><span>Custom website</span>
|
|
211
|
-
<input id="set-panic-custom" type="url" placeholder="https://…" spellcheck="false">
|
|
222
|
+
<input id="set-panic-custom" type="url" placeholder="https://…" spellcheck="false" autocomplete="off">
|
|
212
223
|
</label>
|
|
213
224
|
<div class="set-row"><span>Panic key</span>
|
|
214
225
|
<button class="pill-btn key-btn" type="button" id="set-panic-key">`</button>
|
|
@@ -246,6 +257,11 @@
|
|
|
246
257
|
</div>
|
|
247
258
|
</div>
|
|
248
259
|
|
|
260
|
+
<div class="set-group">
|
|
261
|
+
<h2>About</h2>
|
|
262
|
+
<div class="set-row"><span>Version <strong id="set-version"></strong></span><button class="pill-btn" type="button" data-nav="changelog">What's new</button></div>
|
|
263
|
+
</div>
|
|
264
|
+
|
|
249
265
|
<div class="set-group">
|
|
250
266
|
<h2>Your data</h2>
|
|
251
267
|
<div class="set-row"><span>Recently played</span><button class="pill-btn" type="button" id="set-clear-recent">Clear</button></div> <div class="set-row"><span>All settings</span><button class="pill-btn danger" type="button" id="set-reset">Reset to default</button></div>
|
package/package.json
CHANGED
package/style.css
CHANGED
|
@@ -144,6 +144,8 @@ body:has(#view-games:not([hidden])) .aurora { opacity: .7; }
|
|
|
144
144
|
.home-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 17px; }
|
|
145
145
|
.home-search input::-webkit-search-cancel-button { display: none; }
|
|
146
146
|
.home-search:focus-within { border-color: color-mix(in srgb, var(--text) 40%, transparent); }
|
|
147
|
+
/* the input itself has no outline, so the box shows a clear ring when the keyboard is in it */
|
|
148
|
+
.home-search:has(input:focus-visible), .search:has(input:focus-visible) { box-shadow: 0 0 0 2px var(--glow-cyan, #22d3ee); }
|
|
147
149
|
/* The light that sweeps along the bottom edge */
|
|
148
150
|
.sweep { position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; overflow: hidden; }
|
|
149
151
|
.sweep::after {
|
|
@@ -192,8 +194,8 @@ body:has(#view-games:not([hidden])) .aurora { opacity: .7; }
|
|
|
192
194
|
background: var(--tile); text-align: left; aspect-ratio: 4 / 3; width: 100%;
|
|
193
195
|
transition: transform .2s ease, border-color .2s, box-shadow .2s;
|
|
194
196
|
}
|
|
195
|
-
.tile:hover, .tile:focus-visible { transform: translateY(-3px); border-color: var(--line-2); box-shadow: 0 18px 40px -12px rgba(0,0,0,.8);
|
|
196
|
-
.tile:focus-visible { border-color: var(--text); }
|
|
197
|
+
.tile:hover, .tile:focus-visible { transform: translateY(-3px); border-color: var(--line-2); box-shadow: 0 18px 40px -12px rgba(0,0,0,.8); }
|
|
198
|
+
.tile:focus-visible { border-color: var(--text); outline: 2px solid var(--glow-cyan, #22d3ee); outline-offset: 2px; }
|
|
197
199
|
.tile-art { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 34px; letter-spacing: -.02em; }
|
|
198
200
|
.tile-art img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
|
|
199
201
|
.tile:hover .tile-art img { transform: scale(1.05); }
|
|
@@ -358,7 +360,21 @@ body:has(#view-games:not([hidden])) .aurora { opacity: .7; }
|
|
|
358
360
|
/* @mention: pink dot instead of cyan */
|
|
359
361
|
.has-unread.has-mention::after { background: #f472b6; box-shadow: 0 0 0 2px var(--bg, #000), 0 0 12px #f472b6; }
|
|
360
362
|
.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; } }
|
|
363
|
+
@media (prefers-reduced-motion: reduce) { .has-unread::after, .online-dot { animation: none; } }
|
|
364
|
+
|
|
365
|
+
/* Scroll areas and pop-ups: scrolling to the end doesn't drag the page behind along */
|
|
366
|
+
.chat-log, .reports, .chat-dock, .wheel-wrap { overscroll-behavior: contain; }
|
|
367
|
+
/* No double-tap-to-zoom delay on taps (Chromebook touch screens, phones) */
|
|
368
|
+
button, a, .tile, select, input, label { touch-action: manipulation; }
|
|
369
|
+
|
|
370
|
+
/* Skip link: hidden until a keyboard user tabs to it */
|
|
371
|
+
.skip-link {
|
|
372
|
+
position: fixed; top: 10px; left: 50%; z-index: 100; transform: translate(-50%, -150%);
|
|
373
|
+
padding: 10px 16px; border: 0; border-radius: 4px; background: var(--text); color: var(--bg); font-weight: 700;
|
|
374
|
+
transition: transform .15s ease;
|
|
375
|
+
}
|
|
376
|
+
.skip-link:focus-visible { transform: translate(-50%, 0); outline: 2px solid var(--glow-cyan, #22d3ee); outline-offset: 2px; }
|
|
377
|
+
.main:focus { outline: none; } /* focused only by the skip link, never by clicking */
|
|
362
378
|
|
|
363
379
|
/* Chat: typing line, @mentions */
|
|
364
380
|
.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; }
|
|
@@ -450,7 +466,23 @@ body.playing { overflow: hidden; }
|
|
|
450
466
|
body:has(#view-games:not([hidden])) .corner-links,
|
|
451
467
|
body:has(#view-stats:not([hidden])) .corner-links,
|
|
452
468
|
body:has(#view-settings:not([hidden])) .corner-links,
|
|
453
|
-
body:has(#view-chat:not([hidden])) .corner-links
|
|
469
|
+
body:has(#view-chat:not([hidden])) .corner-links,
|
|
470
|
+
body:has(#view-changelog:not([hidden])) .corner-links { display: none; }
|
|
471
|
+
|
|
472
|
+
/* What's new */
|
|
473
|
+
.changelog { max-width: 760px; }
|
|
474
|
+
.cl-entry h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 20px; text-wrap: balance; }
|
|
475
|
+
.cl-latest { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 3px 8px; border-radius: 3px; background: var(--glow-cyan, #22d3ee); color: #000; }
|
|
476
|
+
.cl-date { margin-left: auto; color: var(--muted); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
|
|
477
|
+
.cl-kind { margin-top: 12px; }
|
|
478
|
+
.cl-kind h3 { margin: 0 0 6px; font-size: 13px; color: var(--muted); font-weight: 700; }
|
|
479
|
+
.cl-kind ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; line-height: 1.45; }
|
|
480
|
+
.cl-games li::marker { color: #4ade80; }
|
|
481
|
+
.cl-fixes li::marker { color: #f472b6; }
|
|
482
|
+
.cl-new li::marker { color: var(--glow-cyan, #22d3ee); }
|
|
483
|
+
.whats-new-row { text-align: center; margin: 14px 0 0; font-size: 13px; }
|
|
484
|
+
.whats-new { position: relative; padding-right: 14px !important; }
|
|
485
|
+
.whats-new.has-unread::after { top: 0; right: 0; width: 7px; height: 7px; }
|
|
454
486
|
|
|
455
487
|
/* ---------- Responsive ---------- */
|
|
456
488
|
@media (max-width: 1100px) { .grid, .recent-row { grid-template-columns: repeat(min(var(--per-row), 4), minmax(0, 1fr)); } }
|