rafmacalaba commited on
Commit
960f294
·
verified ·
1 Parent(s): 66eabcc

add theme toggle, intro section, and cat emoji

Browse files
Files changed (2) hide show
  1. README.md +1 -0
  2. index.html +95 -23
README.md CHANGED
@@ -1,5 +1,6 @@
1
  ---
2
  title: Data-use Extraction — WebGPU
 
3
  colorFrom: indigo
4
  colorTo: blue
5
  sdk: static
 
1
  ---
2
  title: Data-use Extraction — WebGPU
3
+ emoji: 🐈
4
  colorFrom: indigo
5
  colorTo: blue
6
  sdk: static
index.html CHANGED
@@ -151,12 +151,25 @@
151
  transition: opacity .55s var(--ease), visibility .55s;
152
  }
153
  .loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
154
- .loader-inner { width: min(860px, 92vw); text-align: left; }
 
 
 
 
 
 
 
 
 
 
 
 
 
155
  .loader-layout {
156
  display: grid;
157
- grid-template-columns: minmax(0, 1.15fr) minmax(200px, 0.85fr);
158
  align-items: center;
159
- gap: clamp(1.5rem, 5vw, 4rem);
160
  }
161
  .loader-copy { min-width: 0; }
162
  .loader-visual {
@@ -165,6 +178,38 @@
165
  justify-content: center;
166
  position: relative;
167
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
168
  .cat-sculpture {
169
  width: 100%;
170
  max-width: 280px;
@@ -235,6 +280,9 @@
235
  .loader-brand { margin-bottom: 1.2rem; }
236
  .loader-pct { font-size: 54px; }
237
  .loader-cta { margin-top: 1.4rem; width: 100%; }
 
 
 
238
  }
239
 
240
  /* Header ---------------------------------------------------------- */
@@ -881,6 +929,11 @@
881
  </head>
882
  <body>
883
  <div class="loader" id="loader" data-state="sleeping">
 
 
 
 
 
884
  <div class="loader-inner">
885
  <div class="loader-layout">
886
  <div class="loader-copy">
@@ -1052,6 +1105,21 @@
1052
  </g>
1053
  </svg>
1054
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1055
  </div>
1056
  </div>
1057
  </div>
@@ -1072,10 +1140,10 @@
1072
  </div>
1073
  <div class="header-actions">
1074
  <div class="status-pill" id="status-pill"><span class="status-dot" aria-hidden="true"></span><span id="status">Initialising…</span></div>
1075
- <button class="icon-btn" id="theme-toggle" title="Toggle light/dark" aria-label="Toggle theme">
1076
- <svg id="theme-icon-moon" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"/></svg>
1077
- <svg id="theme-icon-sun" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" style="display:none"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/></svg>
1078
- <span id="theme-label">Dark</span>
1079
  </button>
1080
  </div>
1081
  </header>
@@ -1240,25 +1308,29 @@
1240
 
1241
  <script>
1242
  (function () {
1243
- var btn = document.getElementById("theme-toggle");
1244
- var moon = document.getElementById("theme-icon-moon");
1245
- var sun = document.getElementById("theme-icon-sun");
1246
- var label = document.getElementById("theme-label");
1247
- function apply() {
1248
  var dark = document.documentElement.getAttribute("data-theme") === "dark";
1249
- moon.style.display = dark ? "none" : "block";
1250
- sun.style.display = dark ? "block" : "none";
1251
- label.textContent = dark ? "Light" : "Dark";
1252
- btn.title = dark ? "Switch to light mode" : "Switch to dark mode";
 
 
 
 
 
1253
  }
1254
- btn.addEventListener("click", function () {
1255
- var dark = document.documentElement.getAttribute("data-theme") === "dark";
1256
- if (dark) document.documentElement.removeAttribute("data-theme");
1257
- else document.documentElement.setAttribute("data-theme", "dark");
1258
- try { localStorage.setItem("datause-theme", dark ? "light" : "dark"); } catch (e) {}
1259
- apply();
 
 
1260
  });
1261
- apply();
1262
  })();
1263
  </script>
1264
 
 
151
  transition: opacity .55s var(--ease), visibility .55s;
152
  }
153
  .loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
154
+ .loader-theme-toggle {
155
+ position: absolute; top: 24px; right: 28px; z-index: 101;
156
+ display: inline-flex; align-items: center; gap: 0.5rem;
157
+ font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
158
+ text-transform: uppercase;
159
+ color: var(--text-muted); background: var(--surface);
160
+ border: 1px solid var(--border); border-radius: 999px;
161
+ padding: 0.5rem 0.85rem; cursor: pointer;
162
+ box-shadow: var(--shadow-sm);
163
+ transition: color .2s var(--ease), border-color .2s var(--ease);
164
+ }
165
+ .loader-theme-toggle:hover { color: var(--text); border-color: var(--accent-2); }
166
+ .loader-theme-toggle svg { width: 14px; height: 14px; }
167
+ .loader-inner { width: min(1120px, 94vw); text-align: left; }
168
  .loader-layout {
169
  display: grid;
170
+ grid-template-columns: minmax(0, 1.1fr) minmax(200px, 0.85fr) minmax(0, 1fr);
171
  align-items: center;
172
+ gap: clamp(1.5rem, 4vw, 3.25rem);
173
  }
174
  .loader-copy { min-width: 0; }
175
  .loader-visual {
 
178
  justify-content: center;
179
  position: relative;
180
  }
181
+ .loader-about {
182
+ min-width: 0;
183
+ padding-left: clamp(1rem, 2vw, 1.5rem);
184
+ border-left: 1px solid var(--border);
185
+ }
186
+ .loader-about h2 {
187
+ margin: 0 0 0.85rem;
188
+ font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em;
189
+ text-transform: uppercase; color: var(--text-muted); font-weight: 600;
190
+ }
191
+ .loader-about p {
192
+ margin: 0 0 0.85rem; color: var(--text-muted);
193
+ font-size: 0.82rem; line-height: 1.6;
194
+ }
195
+ .loader-about p b { color: var(--text); font-weight: 600; }
196
+ .loader-about ul {
197
+ margin: 0; padding: 0; list-style: none;
198
+ display: grid; gap: 0.5rem;
199
+ }
200
+ .loader-about li {
201
+ display: flex; gap: 0.6rem; align-items: flex-start;
202
+ font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.02em;
203
+ color: var(--text-muted); line-height: 1.5;
204
+ }
205
+ .loader-about li::before {
206
+ content: "—"; color: var(--accent-2); flex: none;
207
+ }
208
+ .loader-about .privacy {
209
+ margin-top: 1rem; padding-top: 0.85rem;
210
+ border-top: 1px solid var(--border);
211
+ color: var(--text-subtle); font-size: 0.72rem; line-height: 1.5;
212
+ }
213
  .cat-sculpture {
214
  width: 100%;
215
  max-width: 280px;
 
280
  .loader-brand { margin-bottom: 1.2rem; }
281
  .loader-pct { font-size: 54px; }
282
  .loader-cta { margin-top: 1.4rem; width: 100%; }
283
+ .loader-theme-toggle { top: 16px; right: 16px; }
284
+ .loader-about { border-left: none; padding-left: 0; }
285
+ .loader-about p, .loader-about li { font-size: 0.7rem; }
286
  }
287
 
288
  /* Header ---------------------------------------------------------- */
 
929
  </head>
930
  <body>
931
  <div class="loader" id="loader" data-state="sleeping">
932
+ <button class="loader-theme-toggle theme-toggle" type="button" title="Toggle light/dark" aria-label="Toggle theme">
933
+ <svg class="theme-icon-moon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"/></svg>
934
+ <svg class="theme-icon-sun" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" style="display:none"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/></svg>
935
+ <span class="theme-label">Dark</span>
936
+ </button>
937
  <div class="loader-inner">
938
  <div class="loader-layout">
939
  <div class="loader-copy">
 
1105
  </g>
1106
  </svg>
1107
  </div>
1108
+
1109
+ <div class="loader-about">
1110
+ <h2>While you wait</h2>
1111
+ <p>
1112
+ <b>Data-use extraction</b> runs entirely in your browser on WebGPU —
1113
+ no server, no uploads. It spots data mentions in research text, then
1114
+ attributes each with provenance and usage/impact.
1115
+ </p>
1116
+ <ul>
1117
+ <li><b>GLiNER</b> — detects spans, labels specificity</li>
1118
+ <li><b>LFM2.5-350M</b> — producer, year, geography, acronym</li>
1119
+ <li><b>Usage &amp; impact</b> — action + impact classification</li>
1120
+ </ul>
1121
+ <p class="privacy">Nothing leaves your machine. Models download once, then run offline.</p>
1122
+ </div>
1123
  </div>
1124
  </div>
1125
  </div>
 
1140
  </div>
1141
  <div class="header-actions">
1142
  <div class="status-pill" id="status-pill"><span class="status-dot" aria-hidden="true"></span><span id="status">Initialising…</span></div>
1143
+ <button class="icon-btn theme-toggle" title="Toggle light/dark" aria-label="Toggle theme">
1144
+ <svg class="theme-icon-moon" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"/></svg>
1145
+ <svg class="theme-icon-sun" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" style="display:none"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/></svg>
1146
+ <span class="theme-label">Dark</span>
1147
  </button>
1148
  </div>
1149
  </header>
 
1308
 
1309
  <script>
1310
  (function () {
1311
+ var toggles = document.querySelectorAll(".theme-toggle");
1312
+ function sync() {
 
 
 
1313
  var dark = document.documentElement.getAttribute("data-theme") === "dark";
1314
+ toggles.forEach(function (btn) {
1315
+ var moon = btn.querySelector(".theme-icon-moon");
1316
+ var sun = btn.querySelector(".theme-icon-sun");
1317
+ var label = btn.querySelector(".theme-label");
1318
+ if (moon) moon.style.display = dark ? "none" : "block";
1319
+ if (sun) sun.style.display = dark ? "block" : "none";
1320
+ if (label) label.textContent = dark ? "Light" : "Dark";
1321
+ btn.title = dark ? "Switch to light mode" : "Switch to dark mode";
1322
+ });
1323
  }
1324
+ toggles.forEach(function (btn) {
1325
+ btn.addEventListener("click", function () {
1326
+ var dark = document.documentElement.getAttribute("data-theme") === "dark";
1327
+ if (dark) document.documentElement.removeAttribute("data-theme");
1328
+ else document.documentElement.setAttribute("data-theme", "dark");
1329
+ try { localStorage.setItem("datause-theme", dark ? "light" : "dark"); } catch (e) {}
1330
+ sync();
1331
+ });
1332
  });
1333
+ sync();
1334
  })();
1335
  </script>
1336