@ywkrlerche/richardwho 1.0.31 → 1.0.32
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 +8 -5
- package/index.html +6 -2
- package/package.json +1 -1
- package/style.css +19 -3
package/app.js
CHANGED
|
@@ -474,12 +474,13 @@
|
|
|
474
474
|
function startClock() {
|
|
475
475
|
clockIs24 = store.get(CLOCK_KEY, false);
|
|
476
476
|
const timeEl = $("clock-time"), metaEl = $("clock-meta");
|
|
477
|
+
// Intl formats the time; the AM/PM part goes in the small label beside it
|
|
478
|
+
const fmt12 = new Intl.DateTimeFormat(undefined, { hour: "numeric", minute: "2-digit", hour12: true });
|
|
479
|
+
const fmt24 = new Intl.DateTimeFormat(undefined, { hour: "2-digit", minute: "2-digit", hourCycle: "h23" });
|
|
477
480
|
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; }
|
|
481
|
+
const parts = (clockIs24 ? fmt24 : fmt12).formatToParts(new Date());
|
|
482
|
+
timeEl.textContent = parts.filter((p) => p.type !== "dayPeriod").map((p) => p.value).join("").trim();
|
|
483
|
+
metaEl.textContent = clockIs24 ? "24H" : (parts.find((p) => p.type === "dayPeriod")?.value || "").toUpperCase();
|
|
483
484
|
};
|
|
484
485
|
$("clock").addEventListener("click", () => setClock24(!clockIs24));
|
|
485
486
|
clockTick();
|
|
@@ -488,6 +489,7 @@
|
|
|
488
489
|
|
|
489
490
|
function applyTheme(t) {
|
|
490
491
|
document.documentElement.dataset.theme = t;
|
|
492
|
+
$("theme-color").content = t === "dark" ? "#000000" : "#f6f6f8"; // phone browser bar matches the page
|
|
491
493
|
$("theme-btn").title = t === "dark" ? "Switch to light mode" : "Switch to dark mode";
|
|
492
494
|
try { localStorage.setItem(THEME_KEY, t); } catch {}
|
|
493
495
|
}
|
|
@@ -1248,6 +1250,7 @@
|
|
|
1248
1250
|
toast(`Drag it up to your bookmarks bar, or press ${/Mac/.test(navigator.platform) ? "⌘" : "Ctrl"}+D`);
|
|
1249
1251
|
});
|
|
1250
1252
|
$("latest-btn").addEventListener("click", goLatest);
|
|
1253
|
+
$("skip-link").addEventListener("click", () => $("main").focus());
|
|
1251
1254
|
$("report-btn").addEventListener("click", () => { const g = currentLoad && byId.get(currentLoad.id); if (g) openReport("broken", g); });
|
|
1252
1255
|
$("request-btn").addEventListener("click", () => openReport("request"));
|
|
1253
1256
|
$("request-btn-2").addEventListener("click", () => openReport("request", null, els.search.value.trim()));
|
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>
|
|
@@ -208,7 +212,7 @@
|
|
|
208
212
|
</select>
|
|
209
213
|
</label>
|
|
210
214
|
<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">
|
|
215
|
+
<input id="set-panic-custom" type="url" placeholder="https://…" spellcheck="false" autocomplete="off">
|
|
212
216
|
</label>
|
|
213
217
|
<div class="set-row"><span>Panic key</span>
|
|
214
218
|
<button class="pill-btn key-btn" type="button" id="set-panic-key">`</button>
|
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; }
|