fffiloni commited on
Commit
e6bfcbc
·
verified ·
1 Parent(s): 57f6077

Publish CDN Live v0.1.3 with a resilient mobile startup

Browse files
Files changed (10) hide show
  1. .gitignore +1 -0
  2. README.md +3 -2
  3. app.mjs +30 -13
  4. build.mjs +15 -0
  5. feed.mjs +18 -4
  6. globe.mjs +1 -1
  7. index.html +25 -5
  8. package-lock.json +499 -0
  9. package.json +12 -0
  10. styles.css +4 -6
.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ node_modules/
README.md CHANGED
@@ -4,13 +4,14 @@ emoji: 🌐
4
  colorFrom: green
5
  colorTo: gray
6
  sdk: static
 
7
  app_file: index.html
8
  short_description: Explore the live Hugging Face CDN telemetry on a 3D globe
9
  ---
10
 
11
  # CDN Live
12
 
13
- Version 0.1.2. A buildless Three.js app for the Hugging Face Static Space SDK.
14
 
15
  The globe displays public [Hugging Face CDN telemetry](https://huggingface.co/buckets/huggingface/cdn-live). Drag to orbit, scroll or pinch to zoom, and select a point of presence on the globe or in the list. Keyboard users can select any point in the list and use the arrow keys, plus, and minus on the globe. Pause motion hides the animated particles.
16
 
@@ -22,7 +23,7 @@ The network total sums reported point-of-presence rates. A route links one repor
22
 
23
  ## Run locally
24
 
25
- Serve this directory with `python3 -m http.server 7860` and open `http://localhost:7860/`. The globe uses WebGL 2 where available and an interactive Canvas renderer elsewhere. To deploy, place the contents of this directory at the root of a Static Space.
26
 
27
  ## Credits
28
 
 
4
  colorFrom: green
5
  colorTo: gray
6
  sdk: static
7
+ app_build_command: npm ci --include=dev --ignore-scripts --no-audit --no-fund && npm run build
8
  app_file: index.html
9
  short_description: Explore the live Hugging Face CDN telemetry on a 3D globe
10
  ---
11
 
12
  # CDN Live
13
 
14
+ Version 0.1.3. An interactive Three.js app for the Hugging Face Static Space SDK.
15
 
16
  The globe displays public [Hugging Face CDN telemetry](https://huggingface.co/buckets/huggingface/cdn-live). Drag to orbit, scroll or pinch to zoom, and select a point of presence on the globe or in the list. Keyboard users can select any point in the list and use the arrow keys, plus, and minus on the globe. Pause motion hides the animated particles.
17
 
 
23
 
24
  ## Run locally
25
 
26
+ Run `npm ci --ignore-scripts` and `npm run build`, then serve this directory with `python3 -m http.server 7860` and open `http://localhost:7860/`. The globe uses WebGL 2 where available and an interactive Canvas renderer elsewhere. The Static Space builds the browser scripts from the same source.
27
 
28
  ## Credits
29
 
app.mjs CHANGED
@@ -7,6 +7,7 @@ const list = byId("locations");
7
  const status = byId("feed-status");
8
  const retry = byId("retry");
9
  const clearSelection = byId("clear-selection");
 
10
 
11
  let globe;
12
  let snapshot;
@@ -57,6 +58,7 @@ function updateFeedStatus() {
57
  }
58
  retry.hidden = !failed;
59
  retry.disabled = fetching;
 
60
  byId("feed-timestamp").hidden = !snapshot;
61
  const initialMessage = byId("initial-message");
62
  initialMessage.hidden = !!snapshot;
@@ -162,6 +164,32 @@ function updateMotion() {
162
  globe?.setMotion(!pausedMotion);
163
  }
164
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
  clearSelection.addEventListener("click", () => {
166
  const formerId = selectedId;
167
  selectedId = undefined;
@@ -179,6 +207,7 @@ byId("motion").addEventListener("click", () => {
179
  updateMotion();
180
  });
181
 
 
182
  refresh();
183
  setInterval(() => {
184
  if (!document.hidden && Date.now() - lastAttempt >= POLL_MS - 500) refresh();
@@ -187,16 +216,4 @@ document.addEventListener("visibilitychange", () => {
187
  if (!document.hidden && Date.now() - lastAttempt >= POLL_MS) refresh();
188
  });
189
 
190
- try {
191
- const { createGlobe } = await import("./globe.mjs");
192
- globe = createGlobe(byId("globe"), byId("map-markers"), selectPop);
193
- byId("stage-tools").hidden = false;
194
- updateMotion();
195
- if (snapshot) {
196
- globe.setSnapshot(snapshot);
197
- renderSelection();
198
- }
199
- } catch (error) {
200
- byId("globe-help").hidden = false;
201
- console.warn("Three.js globe unavailable", error);
202
- }
 
7
  const status = byId("feed-status");
8
  const retry = byId("retry");
9
  const clearSelection = byId("clear-selection");
10
+ const embedded = window.self !== window.top;
11
 
12
  let globe;
13
  let snapshot;
 
58
  }
59
  retry.hidden = !failed;
60
  retry.disabled = fetching;
61
+ byId("open-app").hidden = !failed || !embedded;
62
  byId("feed-timestamp").hidden = !snapshot;
63
  const initialMessage = byId("initial-message");
64
  initialMessage.hidden = !!snapshot;
 
164
  globe?.setMotion(!pausedMotion);
165
  }
166
 
167
+ async function startGlobe() {
168
+ try {
169
+ await new Promise((resolve, reject) => {
170
+ const script = document.createElement("script");
171
+ script.src = "./globe.js?v=0.1.3";
172
+ script.onload = () => { clearTimeout(timeout); resolve(); };
173
+ script.onerror = () => { clearTimeout(timeout); reject(new Error("Globe script unavailable")); };
174
+ const timeout = setTimeout(() => {
175
+ script.remove();
176
+ reject(new Error("Globe script load timed out"));
177
+ }, 12_000);
178
+ document.head.append(script);
179
+ });
180
+ globe = window.CdnLiveGlobe.createGlobe(byId("globe"), byId("map-markers"), selectPop);
181
+ byId("stage-tools").hidden = false;
182
+ updateMotion();
183
+ if (snapshot) {
184
+ globe.setSnapshot(snapshot);
185
+ renderSelection();
186
+ }
187
+ } catch (error) {
188
+ byId("globe-help").hidden = false;
189
+ console.warn("Three.js globe unavailable", error);
190
+ }
191
+ }
192
+
193
  clearSelection.addEventListener("click", () => {
194
  const formerId = selectedId;
195
  selectedId = undefined;
 
207
  updateMotion();
208
  });
209
 
210
+ document.documentElement.setAttribute("data-cdn-started", "");
211
  refresh();
212
  setInterval(() => {
213
  if (!document.hidden && Date.now() - lastAttempt >= POLL_MS - 500) refresh();
 
216
  if (!document.hidden && Date.now() - lastAttempt >= POLL_MS) refresh();
217
  });
218
 
219
+ startGlobe();
 
 
 
 
 
 
 
 
 
 
 
 
build.mjs ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { build } from "esbuild";
2
+
3
+ const browserBuild = {
4
+ bundle: true,
5
+ format: "iife",
6
+ target: ["safari14", "chrome89", "firefox89"],
7
+ legalComments: "eof",
8
+ };
9
+ await Promise.all([
10
+ build({ ...browserBuild, entryPoints: ["app.mjs"], outfile: "app.js" }),
11
+ build({
12
+ ...browserBuild, entryPoints: ["globe.mjs"], outfile: "globe.js",
13
+ globalName: "CdnLiveGlobe", minify: true, alias: { three: "./vendor/three.module.min.js" },
14
+ }),
15
+ ]);
feed.mjs CHANGED
@@ -47,9 +47,23 @@ export function feedStatus(snapshot, failed, now = Date.now()) {
47
  }
48
 
49
  export async function loadSnapshot() {
50
- const response = await fetch(FEED_URL, {
51
- cache: "no-store", credentials: "omit", signal: AbortSignal.timeout(15_000),
 
 
 
 
 
52
  });
53
- if (!response.ok) throw new Error(`CDN feed returned HTTP ${response.status}`);
54
- return normalizeSnapshot(await response.json());
 
 
 
 
 
 
 
 
 
55
  }
 
47
  }
48
 
49
  export async function loadSnapshot() {
50
+ const controller = new AbortController();
51
+ let timeout;
52
+ const deadline = new Promise((_, reject) => {
53
+ timeout = setTimeout(() => {
54
+ reject(new Error("CDN feed request timed out"));
55
+ controller.abort();
56
+ }, 12_000);
57
  });
58
+ try {
59
+ const request = fetch(FEED_URL, {
60
+ cache: "no-store", credentials: "omit", signal: controller.signal,
61
+ }).then(async response => {
62
+ if (!response.ok) throw new Error(`CDN feed returned HTTP ${response.status}`);
63
+ return normalizeSnapshot(await response.json());
64
+ });
65
+ return await Promise.race([request, deadline]);
66
+ } finally {
67
+ clearTimeout(timeout);
68
+ }
69
  }
globe.mjs CHANGED
@@ -2,7 +2,7 @@ import * as THREE from "three";
2
  import { OrbitControls } from "./vendor/OrbitControls.js";
3
  import { createCanvasRenderer } from "./canvas-globe.mjs";
4
 
5
- const MAP_IMAGE = new URL("./assets/earth.webp", import.meta.url);
6
  const DEG = Math.PI / 180;
7
  const STEPS = 28;
8
 
 
2
  import { OrbitControls } from "./vendor/OrbitControls.js";
3
  import { createCanvasRenderer } from "./canvas-globe.mjs";
4
 
5
+ const MAP_IMAGE = new URL("./assets/earth.webp", document.baseURI);
6
  const DEG = Math.PI / 180;
7
  const STEPS = 28;
8
 
index.html CHANGED
@@ -6,11 +6,8 @@
6
  <meta name="theme-color" content="#091113">
7
  <meta name="description" content="Explore the public Hugging Face CDN telemetry on an interactive globe.">
8
  <title>CDN Live · Hugging Face traffic</title>
9
- <link rel="stylesheet" href="./styles.css">
10
- <script type="importmap">
11
- {"imports":{"three":"./vendor/three.module.min.js"}}
12
- </script>
13
- <script type="module" src="./app.mjs"></script>
14
  </head>
15
  <body>
16
  <header class="masthead">
@@ -22,6 +19,7 @@
22
  <span id="feed-status" class="status" role="status" data-state="connecting">Connecting</span>
23
  <span id="feed-timestamp" class="feed-time" hidden>Measured <time id="measured-at"></time></span>
24
  <button id="retry" class="quiet-button" type="button" hidden>Retry</button>
 
25
  </div>
26
  </header>
27
  <main class="dashboard">
@@ -51,6 +49,10 @@
51
  <button id="clear-selection" class="quiet-button" type="button" hidden>Show all</button>
52
  </div>
53
  <p id="initial-message" class="dim">Connecting to the public CDN feed…</p>
 
 
 
 
54
  <ul id="locations" class="data-list location-list"></ul>
55
  <section id="selection" class="selection" aria-label="Selected point of presence" hidden>
56
  <div class="selection-heading"><h3 id="selected-name"></h3><span id="selected-ratio"></span></div>
@@ -68,5 +70,23 @@
68
  <p>Data <a href="https://huggingface.co/buckets/huggingface/cdn-live">Hugging Face CDN</a> · Original visualization <a href="https://huggingface.co/hlarcher">Hugo Larcher and team</a> · Imagery <a href="https://svs.gsfc.nasa.gov/2915/">NASA GSFC</a></p>
69
  <p>UI/UX <a href="https://huggingface.co/fffiloni">Sylvain Filoni</a></p>
70
  </footer>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  </body>
72
  </html>
 
6
  <meta name="theme-color" content="#091113">
7
  <meta name="description" content="Explore the public Hugging Face CDN telemetry on an interactive globe.">
8
  <title>CDN Live · Hugging Face traffic</title>
9
+ <link rel="stylesheet" href="./styles.css?v=0.1.3">
10
+ <script defer src="./app.js?v=0.1.3"></script>
 
 
 
11
  </head>
12
  <body>
13
  <header class="masthead">
 
19
  <span id="feed-status" class="status" role="status" data-state="connecting">Connecting</span>
20
  <span id="feed-timestamp" class="feed-time" hidden>Measured <time id="measured-at"></time></span>
21
  <button id="retry" class="quiet-button" type="button" hidden>Retry</button>
22
+ <a id="open-app" class="open-app" href="./index.html" target="_blank" rel="noopener" hidden>Open full screen</a>
23
  </div>
24
  </header>
25
  <main class="dashboard">
 
49
  <button id="clear-selection" class="quiet-button" type="button" hidden>Show all</button>
50
  </div>
51
  <p id="initial-message" class="dim">Connecting to the public CDN feed…</p>
52
+ <noscript>
53
+ <style>#initial-message, #feed-status { display: none; }</style>
54
+ <p class="dim">Enable JavaScript to load the live map.</p>
55
+ </noscript>
56
  <ul id="locations" class="data-list location-list"></ul>
57
  <section id="selection" class="selection" aria-label="Selected point of presence" hidden>
58
  <div class="selection-heading"><h3 id="selected-name"></h3><span id="selected-ratio"></span></div>
 
70
  <p>Data <a href="https://huggingface.co/buckets/huggingface/cdn-live">Hugging Face CDN</a> · Original visualization <a href="https://huggingface.co/hlarcher">Hugo Larcher and team</a> · Imagery <a href="https://svs.gsfc.nasa.gov/2915/">NASA GSFC</a></p>
71
  <p>UI/UX <a href="https://huggingface.co/fffiloni">Sylvain Filoni</a></p>
72
  </footer>
73
+ <script>
74
+ (function () {
75
+ var root = document.documentElement;
76
+ var retry = document.getElementById("retry");
77
+ retry.addEventListener("click", function () {
78
+ if (!root.hasAttribute("data-cdn-started")) window.location.reload();
79
+ });
80
+ window.setTimeout(function () {
81
+ if (root.hasAttribute("data-cdn-started")) return;
82
+ var status = document.getElementById("feed-status");
83
+ status.setAttribute("data-state", "unavailable");
84
+ status.textContent = "Unavailable";
85
+ document.getElementById("initial-message").textContent = "The app couldn’t start in this view.";
86
+ retry.hidden = false;
87
+ document.getElementById("open-app").hidden = window.self === window.top;
88
+ }, 10000);
89
+ })();
90
+ </script>
91
  </body>
92
  </html>
package-lock.json ADDED
@@ -0,0 +1,499 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "hf-cdn-live",
3
+ "version": "0.1.3",
4
+ "lockfileVersion": 3,
5
+ "requires": true,
6
+ "packages": {
7
+ "": {
8
+ "name": "hf-cdn-live",
9
+ "version": "0.1.3",
10
+ "devDependencies": {
11
+ "esbuild": "0.25.12"
12
+ }
13
+ },
14
+ "node_modules/@esbuild/aix-ppc64": {
15
+ "version": "0.25.12",
16
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz",
17
+ "integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==",
18
+ "cpu": [
19
+ "ppc64"
20
+ ],
21
+ "dev": true,
22
+ "license": "MIT",
23
+ "optional": true,
24
+ "os": [
25
+ "aix"
26
+ ],
27
+ "engines": {
28
+ "node": ">=18"
29
+ }
30
+ },
31
+ "node_modules/@esbuild/android-arm": {
32
+ "version": "0.25.12",
33
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.12.tgz",
34
+ "integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==",
35
+ "cpu": [
36
+ "arm"
37
+ ],
38
+ "dev": true,
39
+ "license": "MIT",
40
+ "optional": true,
41
+ "os": [
42
+ "android"
43
+ ],
44
+ "engines": {
45
+ "node": ">=18"
46
+ }
47
+ },
48
+ "node_modules/@esbuild/android-arm64": {
49
+ "version": "0.25.12",
50
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz",
51
+ "integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==",
52
+ "cpu": [
53
+ "arm64"
54
+ ],
55
+ "dev": true,
56
+ "license": "MIT",
57
+ "optional": true,
58
+ "os": [
59
+ "android"
60
+ ],
61
+ "engines": {
62
+ "node": ">=18"
63
+ }
64
+ },
65
+ "node_modules/@esbuild/android-x64": {
66
+ "version": "0.25.12",
67
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.12.tgz",
68
+ "integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==",
69
+ "cpu": [
70
+ "x64"
71
+ ],
72
+ "dev": true,
73
+ "license": "MIT",
74
+ "optional": true,
75
+ "os": [
76
+ "android"
77
+ ],
78
+ "engines": {
79
+ "node": ">=18"
80
+ }
81
+ },
82
+ "node_modules/@esbuild/darwin-arm64": {
83
+ "version": "0.25.12",
84
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz",
85
+ "integrity": "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==",
86
+ "cpu": [
87
+ "arm64"
88
+ ],
89
+ "dev": true,
90
+ "license": "MIT",
91
+ "optional": true,
92
+ "os": [
93
+ "darwin"
94
+ ],
95
+ "engines": {
96
+ "node": ">=18"
97
+ }
98
+ },
99
+ "node_modules/@esbuild/darwin-x64": {
100
+ "version": "0.25.12",
101
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz",
102
+ "integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==",
103
+ "cpu": [
104
+ "x64"
105
+ ],
106
+ "dev": true,
107
+ "license": "MIT",
108
+ "optional": true,
109
+ "os": [
110
+ "darwin"
111
+ ],
112
+ "engines": {
113
+ "node": ">=18"
114
+ }
115
+ },
116
+ "node_modules/@esbuild/freebsd-arm64": {
117
+ "version": "0.25.12",
118
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz",
119
+ "integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==",
120
+ "cpu": [
121
+ "arm64"
122
+ ],
123
+ "dev": true,
124
+ "license": "MIT",
125
+ "optional": true,
126
+ "os": [
127
+ "freebsd"
128
+ ],
129
+ "engines": {
130
+ "node": ">=18"
131
+ }
132
+ },
133
+ "node_modules/@esbuild/freebsd-x64": {
134
+ "version": "0.25.12",
135
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz",
136
+ "integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==",
137
+ "cpu": [
138
+ "x64"
139
+ ],
140
+ "dev": true,
141
+ "license": "MIT",
142
+ "optional": true,
143
+ "os": [
144
+ "freebsd"
145
+ ],
146
+ "engines": {
147
+ "node": ">=18"
148
+ }
149
+ },
150
+ "node_modules/@esbuild/linux-arm": {
151
+ "version": "0.25.12",
152
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz",
153
+ "integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==",
154
+ "cpu": [
155
+ "arm"
156
+ ],
157
+ "dev": true,
158
+ "license": "MIT",
159
+ "optional": true,
160
+ "os": [
161
+ "linux"
162
+ ],
163
+ "engines": {
164
+ "node": ">=18"
165
+ }
166
+ },
167
+ "node_modules/@esbuild/linux-arm64": {
168
+ "version": "0.25.12",
169
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz",
170
+ "integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==",
171
+ "cpu": [
172
+ "arm64"
173
+ ],
174
+ "dev": true,
175
+ "license": "MIT",
176
+ "optional": true,
177
+ "os": [
178
+ "linux"
179
+ ],
180
+ "engines": {
181
+ "node": ">=18"
182
+ }
183
+ },
184
+ "node_modules/@esbuild/linux-ia32": {
185
+ "version": "0.25.12",
186
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz",
187
+ "integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==",
188
+ "cpu": [
189
+ "ia32"
190
+ ],
191
+ "dev": true,
192
+ "license": "MIT",
193
+ "optional": true,
194
+ "os": [
195
+ "linux"
196
+ ],
197
+ "engines": {
198
+ "node": ">=18"
199
+ }
200
+ },
201
+ "node_modules/@esbuild/linux-loong64": {
202
+ "version": "0.25.12",
203
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz",
204
+ "integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==",
205
+ "cpu": [
206
+ "loong64"
207
+ ],
208
+ "dev": true,
209
+ "license": "MIT",
210
+ "optional": true,
211
+ "os": [
212
+ "linux"
213
+ ],
214
+ "engines": {
215
+ "node": ">=18"
216
+ }
217
+ },
218
+ "node_modules/@esbuild/linux-mips64el": {
219
+ "version": "0.25.12",
220
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz",
221
+ "integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==",
222
+ "cpu": [
223
+ "mips64el"
224
+ ],
225
+ "dev": true,
226
+ "license": "MIT",
227
+ "optional": true,
228
+ "os": [
229
+ "linux"
230
+ ],
231
+ "engines": {
232
+ "node": ">=18"
233
+ }
234
+ },
235
+ "node_modules/@esbuild/linux-ppc64": {
236
+ "version": "0.25.12",
237
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz",
238
+ "integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==",
239
+ "cpu": [
240
+ "ppc64"
241
+ ],
242
+ "dev": true,
243
+ "license": "MIT",
244
+ "optional": true,
245
+ "os": [
246
+ "linux"
247
+ ],
248
+ "engines": {
249
+ "node": ">=18"
250
+ }
251
+ },
252
+ "node_modules/@esbuild/linux-riscv64": {
253
+ "version": "0.25.12",
254
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz",
255
+ "integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==",
256
+ "cpu": [
257
+ "riscv64"
258
+ ],
259
+ "dev": true,
260
+ "license": "MIT",
261
+ "optional": true,
262
+ "os": [
263
+ "linux"
264
+ ],
265
+ "engines": {
266
+ "node": ">=18"
267
+ }
268
+ },
269
+ "node_modules/@esbuild/linux-s390x": {
270
+ "version": "0.25.12",
271
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz",
272
+ "integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==",
273
+ "cpu": [
274
+ "s390x"
275
+ ],
276
+ "dev": true,
277
+ "license": "MIT",
278
+ "optional": true,
279
+ "os": [
280
+ "linux"
281
+ ],
282
+ "engines": {
283
+ "node": ">=18"
284
+ }
285
+ },
286
+ "node_modules/@esbuild/linux-x64": {
287
+ "version": "0.25.12",
288
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz",
289
+ "integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==",
290
+ "cpu": [
291
+ "x64"
292
+ ],
293
+ "dev": true,
294
+ "license": "MIT",
295
+ "optional": true,
296
+ "os": [
297
+ "linux"
298
+ ],
299
+ "engines": {
300
+ "node": ">=18"
301
+ }
302
+ },
303
+ "node_modules/@esbuild/netbsd-arm64": {
304
+ "version": "0.25.12",
305
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz",
306
+ "integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==",
307
+ "cpu": [
308
+ "arm64"
309
+ ],
310
+ "dev": true,
311
+ "license": "MIT",
312
+ "optional": true,
313
+ "os": [
314
+ "netbsd"
315
+ ],
316
+ "engines": {
317
+ "node": ">=18"
318
+ }
319
+ },
320
+ "node_modules/@esbuild/netbsd-x64": {
321
+ "version": "0.25.12",
322
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz",
323
+ "integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==",
324
+ "cpu": [
325
+ "x64"
326
+ ],
327
+ "dev": true,
328
+ "license": "MIT",
329
+ "optional": true,
330
+ "os": [
331
+ "netbsd"
332
+ ],
333
+ "engines": {
334
+ "node": ">=18"
335
+ }
336
+ },
337
+ "node_modules/@esbuild/openbsd-arm64": {
338
+ "version": "0.25.12",
339
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz",
340
+ "integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==",
341
+ "cpu": [
342
+ "arm64"
343
+ ],
344
+ "dev": true,
345
+ "license": "MIT",
346
+ "optional": true,
347
+ "os": [
348
+ "openbsd"
349
+ ],
350
+ "engines": {
351
+ "node": ">=18"
352
+ }
353
+ },
354
+ "node_modules/@esbuild/openbsd-x64": {
355
+ "version": "0.25.12",
356
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz",
357
+ "integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==",
358
+ "cpu": [
359
+ "x64"
360
+ ],
361
+ "dev": true,
362
+ "license": "MIT",
363
+ "optional": true,
364
+ "os": [
365
+ "openbsd"
366
+ ],
367
+ "engines": {
368
+ "node": ">=18"
369
+ }
370
+ },
371
+ "node_modules/@esbuild/openharmony-arm64": {
372
+ "version": "0.25.12",
373
+ "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz",
374
+ "integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==",
375
+ "cpu": [
376
+ "arm64"
377
+ ],
378
+ "dev": true,
379
+ "license": "MIT",
380
+ "optional": true,
381
+ "os": [
382
+ "openharmony"
383
+ ],
384
+ "engines": {
385
+ "node": ">=18"
386
+ }
387
+ },
388
+ "node_modules/@esbuild/sunos-x64": {
389
+ "version": "0.25.12",
390
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz",
391
+ "integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==",
392
+ "cpu": [
393
+ "x64"
394
+ ],
395
+ "dev": true,
396
+ "license": "MIT",
397
+ "optional": true,
398
+ "os": [
399
+ "sunos"
400
+ ],
401
+ "engines": {
402
+ "node": ">=18"
403
+ }
404
+ },
405
+ "node_modules/@esbuild/win32-arm64": {
406
+ "version": "0.25.12",
407
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz",
408
+ "integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==",
409
+ "cpu": [
410
+ "arm64"
411
+ ],
412
+ "dev": true,
413
+ "license": "MIT",
414
+ "optional": true,
415
+ "os": [
416
+ "win32"
417
+ ],
418
+ "engines": {
419
+ "node": ">=18"
420
+ }
421
+ },
422
+ "node_modules/@esbuild/win32-ia32": {
423
+ "version": "0.25.12",
424
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz",
425
+ "integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==",
426
+ "cpu": [
427
+ "ia32"
428
+ ],
429
+ "dev": true,
430
+ "license": "MIT",
431
+ "optional": true,
432
+ "os": [
433
+ "win32"
434
+ ],
435
+ "engines": {
436
+ "node": ">=18"
437
+ }
438
+ },
439
+ "node_modules/@esbuild/win32-x64": {
440
+ "version": "0.25.12",
441
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz",
442
+ "integrity": "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==",
443
+ "cpu": [
444
+ "x64"
445
+ ],
446
+ "dev": true,
447
+ "license": "MIT",
448
+ "optional": true,
449
+ "os": [
450
+ "win32"
451
+ ],
452
+ "engines": {
453
+ "node": ">=18"
454
+ }
455
+ },
456
+ "node_modules/esbuild": {
457
+ "version": "0.25.12",
458
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz",
459
+ "integrity": "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==",
460
+ "dev": true,
461
+ "hasInstallScript": true,
462
+ "license": "MIT",
463
+ "bin": {
464
+ "esbuild": "bin/esbuild"
465
+ },
466
+ "engines": {
467
+ "node": ">=18"
468
+ },
469
+ "optionalDependencies": {
470
+ "@esbuild/aix-ppc64": "0.25.12",
471
+ "@esbuild/android-arm": "0.25.12",
472
+ "@esbuild/android-arm64": "0.25.12",
473
+ "@esbuild/android-x64": "0.25.12",
474
+ "@esbuild/darwin-arm64": "0.25.12",
475
+ "@esbuild/darwin-x64": "0.25.12",
476
+ "@esbuild/freebsd-arm64": "0.25.12",
477
+ "@esbuild/freebsd-x64": "0.25.12",
478
+ "@esbuild/linux-arm": "0.25.12",
479
+ "@esbuild/linux-arm64": "0.25.12",
480
+ "@esbuild/linux-ia32": "0.25.12",
481
+ "@esbuild/linux-loong64": "0.25.12",
482
+ "@esbuild/linux-mips64el": "0.25.12",
483
+ "@esbuild/linux-ppc64": "0.25.12",
484
+ "@esbuild/linux-riscv64": "0.25.12",
485
+ "@esbuild/linux-s390x": "0.25.12",
486
+ "@esbuild/linux-x64": "0.25.12",
487
+ "@esbuild/netbsd-arm64": "0.25.12",
488
+ "@esbuild/netbsd-x64": "0.25.12",
489
+ "@esbuild/openbsd-arm64": "0.25.12",
490
+ "@esbuild/openbsd-x64": "0.25.12",
491
+ "@esbuild/openharmony-arm64": "0.25.12",
492
+ "@esbuild/sunos-x64": "0.25.12",
493
+ "@esbuild/win32-arm64": "0.25.12",
494
+ "@esbuild/win32-ia32": "0.25.12",
495
+ "@esbuild/win32-x64": "0.25.12"
496
+ }
497
+ }
498
+ }
499
+ }
package.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "hf-cdn-live",
3
+ "version": "0.1.3",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "build": "node build.mjs"
8
+ },
9
+ "devDependencies": {
10
+ "esbuild": "0.25.12"
11
+ }
12
+ }
styles.css CHANGED
@@ -39,8 +39,9 @@ a { color: inherit; text-underline-offset: .2em; }
39
  .status[data-state="live"]::before { content: ""; width: .38rem; height: .38rem; border-radius: 50%; background: currentColor; }
40
  .status[data-state="delayed"], .status[data-state="unavailable"] { color: #f3cb9c; }
41
  .feed-time { color: var(--muted); font-size: .82rem; white-space: nowrap; }
 
42
  .dashboard { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(19.5rem, 23rem); }
43
- .stage { position: relative; min-height: 41rem; overflow: hidden; isolation: isolate; background: radial-gradient(ellipse at 51% 51%, #172d32, #0d191d 44%, #0a1316 80%); }
44
  .globe, .map-markers { position: absolute; inset: 0; }
45
  .globe canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
46
  .globe canvas:active { cursor: grabbing; }
@@ -162,9 +163,9 @@ h2, h3 { margin: 0; font-size: .98rem; font-weight: 650; letter-spacing: -.025em
162
  .repo-list a:hover { text-decoration: underline; }
163
  footer { padding: 1rem clamp(1rem, 3vw, 2.5rem); display: flex; justify-content: space-between; gap: .4rem 1rem; flex-wrap: wrap; border-top: 1px solid var(--line); color: var(--muted); font-size: .76rem; }
164
  footer p { margin: 0; }
165
- @media (max-width: 760px) {
166
  .dashboard { grid-template-columns: minmax(0, 1fr); }
167
- .stage { min-height: clamp(24rem, 97vw, 40rem); }
168
  .rail { border-top: 1px solid var(--line); border-left: 0; }
169
  .metrics > div { padding: .85rem 1rem; }
170
  .rail-body { padding-inline: .75rem; }
@@ -179,6 +180,3 @@ footer p { margin: 0; }
179
  }
180
  .marker[data-muted] { opacity: .55; }
181
  .marker[data-muted]:hover, .marker[data-muted]:focus-visible { opacity: 1; }
182
- @media (min-width: 761px) {
183
- .stage { position: sticky; top: 0; align-self: start; height: max(41rem, calc(100svh - 7.3rem)); }
184
- }
 
39
  .status[data-state="live"]::before { content: ""; width: .38rem; height: .38rem; border-radius: 50%; background: currentColor; }
40
  .status[data-state="delayed"], .status[data-state="unavailable"] { color: #f3cb9c; }
41
  .feed-time { color: var(--muted); font-size: .82rem; white-space: nowrap; }
42
+ .open-app { color: var(--accent); font-size: .8rem; }
43
  .dashboard { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(19.5rem, 23rem); }
44
+ .stage { position: sticky; top: 0; align-self: start; height: max(41rem, calc(100svh - 7.3rem)); min-height: 41rem; overflow: hidden; isolation: isolate; background: radial-gradient(ellipse at 51% 51%, #172d32, #0d191d 44%, #0a1316 80%); }
45
  .globe, .map-markers { position: absolute; inset: 0; }
46
  .globe canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
47
  .globe canvas:active { cursor: grabbing; }
 
163
  .repo-list a:hover { text-decoration: underline; }
164
  footer { padding: 1rem clamp(1rem, 3vw, 2.5rem); display: flex; justify-content: space-between; gap: .4rem 1rem; flex-wrap: wrap; border-top: 1px solid var(--line); color: var(--muted); font-size: .76rem; }
165
  footer p { margin: 0; }
166
+ @media (max-width: 900px), (max-device-width: 760px) and (any-pointer: coarse) {
167
  .dashboard { grid-template-columns: minmax(0, 1fr); }
168
+ .stage { position: relative; height: auto; min-height: clamp(22rem, 90vw, 36rem); align-self: stretch; }
169
  .rail { border-top: 1px solid var(--line); border-left: 0; }
170
  .metrics > div { padding: .85rem 1rem; }
171
  .rail-body { padding-inline: .75rem; }
 
180
  }
181
  .marker[data-muted] { opacity: .55; }
182
  .marker[data-muted]:hover, .marker[data-muted]:focus-visible { opacity: 1; }