@ywkrlerche/richardwho 1.0.41 → 1.0.42

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,8 @@
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.42", date: "2026-11-10",
840
+ 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
841
  { version: "1.0.41", date: "2026-11-03",
840
842
  new: [], fixes: ["Fixed the page turning white after a while (mostly on Chromebooks), like in the chat"] },
841
843
  { version: "1.0.40", date: "2026-10-30",
@@ -1103,8 +1105,17 @@
1103
1105
 
1104
1106
  // Home page bookmark chip: the no-version link, which unpkg always sends to the newest version
1105
1107
  const LATEST_URL = `https://unpkg.com/${CFG.npmPackage || "@ywkrlerche/richardwho"}/index.html`;
1108
+ // The same site also opens as an .svg (index.svg loads this page inside itself). Each version links to the other.
1109
+ const SVG_URL = `https://unpkg.com/${CFG.npmPackage || "@ywkrlerche/richardwho"}/index.svg`;
1110
+ const VIA_SVG = (() => { try { return window.parent !== window && /\.svg$/i.test(window.parent.location.pathname); } catch { return false; } })();
1106
1111
  function renderBookmark() {
1107
- $("bookmark-link").href = LATEST_URL;
1112
+ $("bookmark-link").href = VIA_SVG ? SVG_URL : LATEST_URL;
1113
+ for (const id of ["alt-link-home", "alt-link-games"]) {
1114
+ const a = $(id);
1115
+ a.href = VIA_SVG ? LATEST_URL : SVG_URL;
1116
+ a.textContent = VIA_SVG ? "🔗 Normal link" : "🔗 NEW VERSION OF SITE";
1117
+ a.title = VIA_SVG ? "Open the regular version of the site" : "Open the site as an .svg, for when the normal link is blocked";
1118
+ }
1108
1119
  $("bookmark-name").textContent = "richardwho";
1109
1120
  $("bookmark-icon").src = REAL_ICON;
1110
1121
  }
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">
package/index.svg ADDED
@@ -0,0 +1,45 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">
2
+ <title>Richards Unblocked Games</title>
3
+ <!--
4
+ jsDelivr serves .html as text/plain (shown as raw code) but serves .svg as image/svg+xml,
5
+ which browsers open as a real document that can run scripts. This launcher fetches
6
+ index.html from the same folder, points its relative links (style.css, app.js, games.json)
7
+ back at jsDelivr with a <base> tag, and shows it full-screen in an iframe.
8
+ -->
9
+ <style><![CDATA[
10
+ html, body, svg { margin: 0; padding: 0; width: 100%; height: 100%; background: #0b0d14; overflow: hidden; }
11
+ iframe { position: fixed; inset: 0; width: 100%; height: 100%; border: 0; background: #0b0d14; }
12
+ .msg { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
13
+ color: #8b90ab; font: 15px system-ui, "Segoe UI", sans-serif; }
14
+ ]]></style>
15
+ <foreignObject width="100%" height="100%">
16
+ <div xmlns="http://www.w3.org/1999/xhtml" id="root" style="width:100%;height:100%">
17
+ <div class="msg" id="msg">Loading…</div>
18
+ </div>
19
+ </foreignObject>
20
+ <script><![CDATA[
21
+ (async () => {
22
+ const base = location.href.replace(/[?#].*$/, "").replace(/[^/]*$/, "");
23
+ const msg = document.getElementById("msg");
24
+ try {
25
+ const res = await fetch(base + "index.html", { cache: "no-cache" });
26
+ if (!res.ok) throw new Error("HTTP " + res.status);
27
+ let html = await res.text();
28
+ html = html.replace(/<head([^>]*)>/i, '<head$1><base href="' + base + '">');
29
+ const frame = document.createElementNS("http://www.w3.org/1999/xhtml", "iframe");
30
+ frame.setAttribute("allow", "fullscreen; autoplay; gamepad; pointer-lock");
31
+ frame.setAttribute("allowfullscreen", "");
32
+ document.getElementById("root").appendChild(frame);
33
+ // Write the page into a blank frame so it keeps this real https:// address (games need it)
34
+ const doc = frame.contentDocument;
35
+ doc.open();
36
+ doc.write(html);
37
+ doc.close();
38
+ msg.remove();
39
+ frame.contentWindow.focus();
40
+ } catch (err) {
41
+ msg.textContent = "Couldn't load the site (" + err.message + "). Try refreshing.";
42
+ }
43
+ })();
44
+ ]]></script>
45
+ </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.42",
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,7 @@ 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; }