@ywkrlerche/richardwho 1.0.41 → 1.0.43

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 CHANGED
@@ -836,6 +836,10 @@
836
836
  // Newest first. Add an entry here with every publish; its version should match package.json.
837
837
  // Each has: new (features), games (added/removed/fixed games), fixes (bugs). Leave a list out if empty.
838
838
  const CHANGELOG = [
839
+ { version: "1.0.43", date: "2026-11-10",
840
+ new: [], fixes: ["The .svg version now shows your tab disguise (like Google Classroom) in the browser tab", "In the .svg version, the link back to the normal site is at the bottom of the Games page and opens its Games page"] },
841
+ { version: "1.0.42", date: "2026-11-10",
842
+ new: ["The site also opens as an .svg link, for places where the normal link is blocked: find it on the home page and the Games page"], fixes: [] },
839
843
  { version: "1.0.41", date: "2026-11-03",
840
844
  new: [], fixes: ["Fixed the page turning white after a while (mostly on Chromebooks), like in the chat"] },
841
845
  { version: "1.0.40", date: "2026-10-30",
@@ -1103,8 +1107,19 @@
1103
1107
 
1104
1108
  // Home page bookmark chip: the no-version link, which unpkg always sends to the newest version
1105
1109
  const LATEST_URL = `https://unpkg.com/${CFG.npmPackage || "@ywkrlerche/richardwho"}/index.html`;
1110
+ // The same site also opens as an .svg (index.svg loads this page inside itself). Each version links to the other.
1111
+ const SVG_URL = `https://unpkg.com/${CFG.npmPackage || "@ywkrlerche/richardwho"}/index.svg`;
1112
+ const VIA_SVG = (() => { try { return window.parent !== window && /\.svg$/i.test(window.parent.location.pathname); } catch { return false; } })();
1106
1113
  function renderBookmark() {
1107
- $("bookmark-link").href = LATEST_URL;
1114
+ $("bookmark-link").href = VIA_SVG ? SVG_URL : LATEST_URL;
1115
+ for (const id of ["alt-link-home", "alt-link-games"]) {
1116
+ const a = $(id);
1117
+ a.href = VIA_SVG ? LATEST_URL + (id === "alt-link-games" ? "#games" : "") : SVG_URL;
1118
+ a.textContent = VIA_SVG ? "🔗 Normal link" : "🔗 NEW VERSION OF SITE";
1119
+ a.title = VIA_SVG ? "Open the regular version of the site" : "Open the site as an .svg, for when the normal link is blocked";
1120
+ }
1121
+ // in the .svg version the Games page's link sits at the bottom of the page instead of the header
1122
+ if (VIA_SVG && $("alt-link-games").parentElement !== $("games-foot")) $("games-foot").appendChild($("alt-link-games"));
1108
1123
  $("bookmark-name").textContent = "richardwho";
1109
1124
  $("bookmark-icon").src = REAL_ICON;
1110
1125
  }
package/index.html CHANGED
@@ -131,6 +131,7 @@
131
131
  <!-- Dragged to the bookmarks bar, the link's text becomes the bookmark's name -->
132
132
  <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>
133
133
  <button class="bookmark-chip latest" type="button" id="latest-btn" title="Open the newest version of the site">⟳ Latest version</button>
134
+ <a class="bookmark-chip latest alt-link" id="alt-link-home" target="_blank" rel="noopener"></a>
134
135
  </div>
135
136
  <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>
136
137
  </div>
@@ -138,7 +139,7 @@
138
139
 
139
140
  <!-- GAMES -->
140
141
  <section id="view-games" class="view games" hidden>
141
- <header class="games-head"><h1>Games</h1></header>
142
+ <header class="games-head"><h1>Games</h1><a class="bookmark-chip latest alt-link" id="alt-link-games" target="_blank" rel="noopener"></a></header>
142
143
 
143
144
  <div class="toolbar">
144
145
  <label class="search">
@@ -172,6 +173,7 @@
172
173
  <div class="grid" id="grid"></div>
173
174
  <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>
174
175
  </section>
176
+ <p class="games-foot" id="games-foot"></p>
175
177
  </section>
176
178
 
177
179
  <!-- TRIVIA: a quick quiz (questions from Open Trivia Database) plus links to daily puzzle sites -->
package/index.svg ADDED
@@ -0,0 +1,71 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:html="http://www.w3.org/1999/xhtml" width="100%" height="100%">
2
+ <title id="tab-title">Google Classroom</title>
3
+ <html:link id="tab-icon" rel="icon" href="https://ssl.gstatic.com/classroom/favicon.png"/>
4
+ <!--
5
+ jsDelivr/unpkg serve .svg as image/svg+xml, which browsers open as a real document that can run scripts.
6
+ This launcher fetches index.html from the same folder, points its relative links (style.css, app.js,
7
+ games.json) back here with a <base> tag, and shows it full-screen in an iframe. The browser tab shows
8
+ this file's title and icon, so they're copied from the site inside (the tab disguise from Settings).
9
+ -->
10
+ <style><![CDATA[
11
+ html, body, svg { margin: 0; padding: 0; width: 100%; height: 100%; background: #0b0d14; overflow: hidden; }
12
+ iframe { position: fixed; inset: 0; width: 100%; height: 100%; border: 0; background: #0b0d14; }
13
+ .msg { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
14
+ color: #8b90ab; font: 15px system-ui, "Segoe UI", sans-serif; }
15
+ ]]></style>
16
+ <foreignObject width="100%" height="100%">
17
+ <div xmlns="http://www.w3.org/1999/xhtml" id="root" style="width:100%;height:100%">
18
+ <div class="msg" id="msg">Loading…</div>
19
+ </div>
20
+ </foreignObject>
21
+ <script><![CDATA[
22
+ (async () => {
23
+ const titleEl = document.getElementById("tab-title");
24
+ let iconEl = document.getElementById("tab-icon");
25
+ const setTab = (title, icon) => {
26
+ if (title && titleEl.textContent !== title) titleEl.textContent = title;
27
+ if (icon && iconEl.getAttribute("href") !== icon) {
28
+ // a fresh element makes the browser pick up the new icon
29
+ const fresh = iconEl.cloneNode();
30
+ fresh.setAttribute("href", icon);
31
+ iconEl.replaceWith(fresh);
32
+ iconEl = fresh;
33
+ }
34
+ };
35
+ // the saved disguise, right away (the site saves it as tabTitle / tabIcon)
36
+ try {
37
+ const s = JSON.parse(localStorage.getItem("rug-settings") || "{}");
38
+ setTab(s.tabTitle || (s.disguise === "off" ? "Richards Unblocked Games" : null), s.tabIcon);
39
+ } catch (e) {}
40
+
41
+ const base = location.href.replace(/[?#].*$/, "").replace(/[^/]*$/, "");
42
+ const msg = document.getElementById("msg");
43
+ try {
44
+ const res = await fetch(base + "index.html", { cache: "no-cache" });
45
+ if (!res.ok) throw new Error("HTTP " + res.status);
46
+ let html = await res.text();
47
+ html = html.replace(/<head([^>]*)>/i, '<head$1><base href="' + base + '">');
48
+ const frame = document.createElementNS("http://www.w3.org/1999/xhtml", "iframe");
49
+ frame.setAttribute("allow", "fullscreen; autoplay; gamepad; pointer-lock; camera; microphone");
50
+ frame.setAttribute("allowfullscreen", "");
51
+ document.getElementById("root").appendChild(frame);
52
+ // Write the page into a blank frame so it keeps this real https:// address (games need it)
53
+ const doc = frame.contentDocument;
54
+ doc.open();
55
+ doc.write(html);
56
+ doc.close();
57
+ msg.remove();
58
+ frame.contentWindow.focus();
59
+ // keep the tab's name and icon in step with the site (disguise changes, game names)
60
+ setInterval(() => {
61
+ try {
62
+ const d = frame.contentDocument, icon = d.getElementById("tab-icon");
63
+ setTab(d.title, icon && icon.href);
64
+ } catch (e) {}
65
+ }, 500);
66
+ } catch (err) {
67
+ msg.textContent = "Couldn't load the site (" + err.message + "). Try refreshing.";
68
+ }
69
+ })();
70
+ ]]></script>
71
+ </svg>
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@ywkrlerche/richardwho",
3
- "version": "1.0.41",
3
+ "version": "1.0.43",
4
4
  "description": "Richards Unblocked Games",
5
5
  "license": "UNLICENSED",
6
6
  "files": [
7
7
  "index.html",
8
+ "index.svg",
8
9
  "style.css",
9
10
  "app.js",
10
11
  "config.js",
package/style.css CHANGED
@@ -1048,3 +1048,9 @@ html.fest[data-theme="dark"] .festive { display: block; }
1048
1048
  .fallers { left: 0; width: 100%; height: calc(100% - 56px); }
1049
1049
  .festive-prop:nth-of-type(n+3) { display: none; }
1050
1050
  }
1051
+
1052
+ /* ---------- Link to the other version of the site (.svg / normal) ---------- */
1053
+ .alt-link { text-decoration: none; color: inherit; }
1054
+ #view-games .games-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
1055
+ .games-foot { display: flex; justify-content: center; margin: 28px 0 8px; }
1056
+ .games-foot:empty { display: none; }