md896 commited on
Commit
e6d1a8f
·
1 Parent(s): f5c939b

HTML demo: fix diagram crop; click-to-zoom lightbox with pan and +/- zoom.

Browse files

Diagram uses scrollable wrap without max-height crop; all figures zoomable with full-size viewer, Ctrl+wheel zoom, Esc/backdrop close.

Made-with: Cursor

Files changed (1) hide show
  1. server/demo_page.html +270 -8
server/demo_page.html CHANGED
@@ -302,18 +302,29 @@
302
  }
303
  .diagram-wrap {
304
  border-radius: var(--radius);
305
- overflow: hidden;
 
306
  background: var(--diagram-bg);
307
  border: 1px solid var(--diagram-border);
308
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
 
309
  }
310
  .diagram-wrap img {
311
  display: block;
312
  width: 100%;
 
313
  height: auto;
314
- max-height: min(68vh, 820px);
315
  object-fit: contain;
316
  object-position: center top;
 
 
 
 
 
 
 
 
317
  }
318
  .figure-footer {
319
  display: flex;
@@ -550,6 +561,126 @@
550
  grid-template-columns: repeat(3, minmax(0, 1fr));
551
  }
552
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
553
  .link-list a {
554
  color: var(--accent);
555
  text-decoration: none;
@@ -670,7 +801,7 @@
670
  <p class="caption">Runtime flow (solid) vs training and ops (dashed). Reviewer-guarded path optional for safer rollouts.</p>
671
  </div>
672
  <div class="diagram-wrap">
673
- <img src="/static/diagram-end-to-end-workflow.png" alt="End-to-end workflow: Client, FastAPI, environment core, data and reward layer, training and deployment." width="1600" height="900" loading="eager" decoding="async" />
674
  </div>
675
  <div class="figure-footer">
676
  <div class="legend">
@@ -788,15 +919,15 @@ import wandb
788
  </div>
789
  <div class="benchmark-chart-grid">
790
  <figure class="proof-card">
791
- <img src="/static/chart-performance-leap.png" alt="Performance leap: baseline versus RL on a Spider-style headline view" width="900" height="520" loading="lazy" decoding="async" />
792
  <figcaption>Performance leap (Spider-style)</figcaption>
793
  </figure>
794
  <figure class="proof-card">
795
- <img src="/static/chart-comparison-shift.png" alt="Comparison of models and reward distribution shift" width="900" height="520" loading="lazy" decoding="async" />
796
  <figcaption>Comparison + reward shift</figcaption>
797
  </figure>
798
  <figure class="proof-card">
799
- <img src="/static/chart-spider-benchmark.png" alt="Spider-style benchmark headline chart across industry baseline, Qwen-7B base, and RL agent" width="900" height="520" loading="lazy" decoding="async" />
800
  <figcaption>Spider-style headline chart</figcaption>
801
  </figure>
802
  </div>
@@ -810,11 +941,11 @@ import wandb
810
  </div>
811
  <div class="proof-grid">
812
  <figure class="proof-card">
813
- <img src="/static/proof-combo.png" alt="Presentation combo chart from training run" width="1200" height="800" loading="lazy" decoding="async" />
814
  <figcaption>Presentation combo — logged metrics.</figcaption>
815
  </figure>
816
  <figure class="proof-card">
817
- <img src="/static/proof-distribution-shift.png" alt="Reward distribution shift" width="1200" height="800" loading="lazy" decoding="async" />
818
  <figcaption>Per-sample reward shift (baseline vs trained).</figcaption>
819
  </figure>
820
  </div>
@@ -920,6 +1051,27 @@ J(pi) = E_{tau ~ pi}[sum_{t=0..T} gamma^t * R_t]</code>
920
  </footer>
921
  </div>
922
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
923
  <script>
924
  (function () {
925
  var btn = document.getElementById("btnOpenTab");
@@ -989,6 +1141,116 @@ J(pi) = E_{tau ~ pi}[sum_{t=0..T} gamma^t * R_t]</code>
989
  setLoading("btnSubmit", false);
990
  }
991
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
992
  </script>
993
  </body>
994
  </html>
 
302
  }
303
  .diagram-wrap {
304
  border-radius: var(--radius);
305
+ overflow: auto;
306
+ -webkit-overflow-scrolling: touch;
307
  background: var(--diagram-bg);
308
  border: 1px solid var(--diagram-border);
309
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
310
+ max-height: min(92vh, 1400px);
311
  }
312
  .diagram-wrap img {
313
  display: block;
314
  width: 100%;
315
+ max-width: 100%;
316
  height: auto;
317
+ max-height: none;
318
  object-fit: contain;
319
  object-position: center top;
320
+ cursor: zoom-in;
321
+ }
322
+ img.sde-zoomable {
323
+ cursor: zoom-in;
324
+ transition: box-shadow 0.15s ease, transform 0.12s ease;
325
+ }
326
+ img.sde-zoomable:hover {
327
+ box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35);
328
  }
329
  .figure-footer {
330
  display: flex;
 
561
  grid-template-columns: repeat(3, minmax(0, 1fr));
562
  }
563
  }
564
+ /* Full-screen image viewer (click any .sde-zoomable) */
565
+ .img-lightbox {
566
+ position: fixed;
567
+ inset: 0;
568
+ z-index: 200;
569
+ display: flex;
570
+ align-items: center;
571
+ justify-content: center;
572
+ padding: calc(8px + env(safe-area-inset-top, 0px)) calc(8px + env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) calc(8px + env(safe-area-inset-left, 0px));
573
+ box-sizing: border-box;
574
+ }
575
+ .img-lightbox[hidden] {
576
+ display: none !important;
577
+ }
578
+ .img-lightbox-backdrop {
579
+ position: absolute;
580
+ inset: 0;
581
+ border: none;
582
+ padding: 0;
583
+ margin: 0;
584
+ width: 100%;
585
+ height: 100%;
586
+ cursor: zoom-out;
587
+ background: rgba(15, 23, 42, 0.9);
588
+ backdrop-filter: blur(8px);
589
+ -webkit-backdrop-filter: blur(8px);
590
+ }
591
+ .img-lightbox-panel {
592
+ position: relative;
593
+ z-index: 1;
594
+ width: min(98vw, 1920px);
595
+ max-height: min(96vh, 1200px);
596
+ display: flex;
597
+ flex-direction: column;
598
+ background: #0b1220;
599
+ border-radius: var(--radius-lg);
600
+ border: 1px solid rgba(148, 163, 184, 0.35);
601
+ box-shadow: 0 28px 90px rgba(0, 0, 0, 0.55);
602
+ overflow: hidden;
603
+ }
604
+ .img-lightbox-close {
605
+ position: absolute;
606
+ top: 8px;
607
+ right: 10px;
608
+ z-index: 3;
609
+ width: 40px;
610
+ height: 40px;
611
+ border: none;
612
+ border-radius: 10px;
613
+ font-size: 1.5rem;
614
+ line-height: 1;
615
+ cursor: pointer;
616
+ color: #f8fafc;
617
+ background: rgba(30, 41, 59, 0.95);
618
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
619
+ }
620
+ .img-lightbox-close:hover {
621
+ background: rgba(51, 65, 85, 0.98);
622
+ }
623
+ .img-lightbox-toolbar {
624
+ position: absolute;
625
+ top: 8px;
626
+ left: 10px;
627
+ z-index: 3;
628
+ display: flex;
629
+ flex-wrap: wrap;
630
+ gap: 6px;
631
+ }
632
+ .img-lightbox-toolbar button {
633
+ min-width: 40px;
634
+ height: 36px;
635
+ padding: 0 10px;
636
+ font-size: 0.9rem;
637
+ font-weight: 700;
638
+ font-family: inherit;
639
+ border-radius: 8px;
640
+ border: 1px solid rgba(148, 163, 184, 0.4);
641
+ cursor: pointer;
642
+ color: #e2e8f0;
643
+ background: rgba(30, 41, 59, 0.95);
644
+ }
645
+ .img-lightbox-toolbar button:hover {
646
+ background: rgba(51, 65, 85, 0.98);
647
+ }
648
+ .img-lightbox-hint {
649
+ display: block;
650
+ margin-top: 8px;
651
+ font-size: 0.72rem;
652
+ color: rgba(148, 163, 184, 0.95);
653
+ line-height: 1.35;
654
+ }
655
+ .img-lightbox-scroll {
656
+ flex: 1;
657
+ min-height: 120px;
658
+ overflow: auto;
659
+ -webkit-overflow-scrolling: touch;
660
+ padding: 52px 14px 44px;
661
+ text-align: center;
662
+ }
663
+ .img-lightbox-stage {
664
+ display: inline-block;
665
+ margin: 0 auto;
666
+ }
667
+ .img-lightbox-scroll img {
668
+ display: block;
669
+ max-width: none;
670
+ max-height: none;
671
+ margin: 0 auto;
672
+ vertical-align: middle;
673
+ /* width/height set in JS so overflow scroll tracks zoom */
674
+ }
675
+ .img-lightbox-caption {
676
+ margin: 0;
677
+ padding: 10px 14px 12px;
678
+ font-size: 0.8125rem;
679
+ color: #cbd5e1;
680
+ background: rgba(15, 23, 42, 0.6);
681
+ border-top: 1px solid rgba(148, 163, 184, 0.25);
682
+ text-align: center;
683
+ }
684
  .link-list a {
685
  color: var(--accent);
686
  text-decoration: none;
 
801
  <p class="caption">Runtime flow (solid) vs training and ops (dashed). Reviewer-guarded path optional for safer rollouts.</p>
802
  </div>
803
  <div class="diagram-wrap">
804
+ <img class="sde-zoomable" src="/static/diagram-end-to-end-workflow.png" alt="End-to-end workflow: Client, FastAPI, environment core, data and reward layer, training and deployment." width="1600" height="900" loading="eager" decoding="async" title="Click to open full-size viewer (zoom and pan)" />
805
  </div>
806
  <div class="figure-footer">
807
  <div class="legend">
 
919
  </div>
920
  <div class="benchmark-chart-grid">
921
  <figure class="proof-card">
922
+ <img class="sde-zoomable" src="/static/chart-performance-leap.png" alt="Performance leap: baseline versus RL on a Spider-style headline view" width="900" height="520" loading="lazy" decoding="async" title="Click to open full-size viewer (zoom and pan)" />
923
  <figcaption>Performance leap (Spider-style)</figcaption>
924
  </figure>
925
  <figure class="proof-card">
926
+ <img class="sde-zoomable" src="/static/chart-comparison-shift.png" alt="Comparison of models and reward distribution shift" width="900" height="520" loading="lazy" decoding="async" title="Click to open full-size viewer (zoom and pan)" />
927
  <figcaption>Comparison + reward shift</figcaption>
928
  </figure>
929
  <figure class="proof-card">
930
+ <img class="sde-zoomable" src="/static/chart-spider-benchmark.png" alt="Spider-style benchmark headline chart across industry baseline, Qwen-7B base, and RL agent" width="900" height="520" loading="lazy" decoding="async" title="Click to open full-size viewer (zoom and pan)" />
931
  <figcaption>Spider-style headline chart</figcaption>
932
  </figure>
933
  </div>
 
941
  </div>
942
  <div class="proof-grid">
943
  <figure class="proof-card">
944
+ <img class="sde-zoomable" src="/static/proof-combo.png" alt="Presentation combo chart from training run" width="1200" height="800" loading="lazy" decoding="async" title="Click to open full-size viewer (zoom and pan)" />
945
  <figcaption>Presentation combo — logged metrics.</figcaption>
946
  </figure>
947
  <figure class="proof-card">
948
+ <img class="sde-zoomable" src="/static/proof-distribution-shift.png" alt="Reward distribution shift" width="1200" height="800" loading="lazy" decoding="async" title="Click to open full-size viewer (zoom and pan)" />
949
  <figcaption>Per-sample reward shift (baseline vs trained).</figcaption>
950
  </figure>
951
  </div>
 
1051
  </footer>
1052
  </div>
1053
 
1054
+ <div id="imgLightbox" class="img-lightbox" hidden role="dialog" aria-modal="true" aria-label="Full-size image viewer">
1055
+ <button type="button" class="img-lightbox-backdrop" id="imgLightboxBackdrop" aria-label="Close viewer"></button>
1056
+ <div class="img-lightbox-panel">
1057
+ <button type="button" class="img-lightbox-close" id="imgLightboxClose" aria-label="Close">×</button>
1058
+ <div class="img-lightbox-toolbar">
1059
+ <button type="button" id="lbZoomOut" title="Zoom out" aria-label="Zoom out">−</button>
1060
+ <button type="button" id="lbZoomReset" title="Reset zoom" aria-label="Reset zoom">100%</button>
1061
+ <button type="button" id="lbZoomIn" title="Zoom in" aria-label="Zoom in">+</button>
1062
+ </div>
1063
+ <div class="img-lightbox-scroll" id="imgLightboxScroll">
1064
+ <div class="img-lightbox-stage" id="imgLightboxStage">
1065
+ <img id="imgLightboxImg" src="" alt="" decoding="async" />
1066
+ </div>
1067
+ </div>
1068
+ <p class="img-lightbox-caption">
1069
+ <span id="imgLightboxCaption"></span>
1070
+ <span class="img-lightbox-hint">Scroll to pan · +/− or Ctrl+scroll to zoom · dark area or Esc to close</span>
1071
+ </p>
1072
+ </div>
1073
+ </div>
1074
+
1075
  <script>
1076
  (function () {
1077
  var btn = document.getElementById("btnOpenTab");
 
1141
  setLoading("btnSubmit", false);
1142
  }
1143
  }
1144
+
1145
+ (function imageLightbox() {
1146
+ var main = document.querySelector("main");
1147
+ var lb = document.getElementById("imgLightbox");
1148
+ var stage = document.getElementById("imgLightboxStage");
1149
+ var lbImg = document.getElementById("imgLightboxImg");
1150
+ var cap = document.getElementById("imgLightboxCaption");
1151
+ var scrollEl = document.getElementById("imgLightboxScroll");
1152
+ var closeBtn = document.getElementById("imgLightboxClose");
1153
+ var backdrop = document.getElementById("imgLightboxBackdrop");
1154
+ var zIn = document.getElementById("lbZoomIn");
1155
+ var zOut = document.getElementById("lbZoomOut");
1156
+ var zReset = document.getElementById("lbZoomReset");
1157
+ if (!main || !lb || !stage || !lbImg || !scrollEl) return;
1158
+
1159
+ var scale = 1;
1160
+
1161
+ function applyZoomedSize() {
1162
+ var nw = lbImg.naturalWidth;
1163
+ var nh = lbImg.naturalHeight;
1164
+ if (!nw || !nh) return;
1165
+ lbImg.style.width = nw * scale + "px";
1166
+ lbImg.style.height = nh * scale + "px";
1167
+ }
1168
+
1169
+ function clearZoomedSize() {
1170
+ lbImg.style.width = "";
1171
+ lbImg.style.height = "";
1172
+ }
1173
+
1174
+ function setScale(next) {
1175
+ scale = Math.min(4, Math.max(0.25, next));
1176
+ applyZoomedSize();
1177
+ }
1178
+
1179
+ function centerScroll() {
1180
+ var el = scrollEl;
1181
+ el.scrollLeft = Math.max(0, (el.scrollWidth - el.clientWidth) / 2);
1182
+ el.scrollTop = Math.max(0, (el.scrollHeight - el.clientHeight) / 2);
1183
+ }
1184
+
1185
+ function openFrom(thumb) {
1186
+ clearZoomedSize();
1187
+ lbImg.removeAttribute("src");
1188
+ scale = 1;
1189
+ lbImg.onload = function () {
1190
+ lbImg.onload = null;
1191
+ applyZoomedSize();
1192
+ requestAnimationFrame(function () {
1193
+ centerScroll();
1194
+ closeBtn.focus();
1195
+ });
1196
+ };
1197
+ lbImg.src = thumb.currentSrc || thumb.src;
1198
+ lbImg.alt = thumb.getAttribute("alt") || "";
1199
+ var fig = thumb.closest("figure");
1200
+ var fc = fig && fig.querySelector("figcaption");
1201
+ var capText = fc ? fc.textContent.replace(/\s+/g, " ").trim() : "";
1202
+ if (!capText) {
1203
+ capText = (thumb.getAttribute("alt") || "Image").trim();
1204
+ if (capText.length > 140) capText = capText.slice(0, 137) + "…";
1205
+ }
1206
+ cap.textContent = capText;
1207
+ lb.hidden = false;
1208
+ lb.setAttribute("aria-hidden", "false");
1209
+ document.body.style.overflow = "hidden";
1210
+ if (lbImg.complete && lbImg.naturalWidth) {
1211
+ lbImg.onload();
1212
+ }
1213
+ }
1214
+
1215
+ function closeLb() {
1216
+ lb.hidden = true;
1217
+ lb.setAttribute("aria-hidden", "true");
1218
+ lbImg.onload = null;
1219
+ lbImg.removeAttribute("src");
1220
+ clearZoomedSize();
1221
+ scale = 1;
1222
+ document.body.style.overflow = "";
1223
+ }
1224
+
1225
+ main.addEventListener("click", function (ev) {
1226
+ var t = ev.target;
1227
+ if (t && t.tagName === "IMG" && t.classList.contains("sde-zoomable")) {
1228
+ ev.preventDefault();
1229
+ openFrom(t);
1230
+ }
1231
+ });
1232
+
1233
+ closeBtn.addEventListener("click", closeLb);
1234
+ backdrop.addEventListener("click", closeLb);
1235
+ zIn.addEventListener("click", function () { setScale(scale * 1.25); });
1236
+ zOut.addEventListener("click", function () { setScale(scale / 1.25); });
1237
+ zReset.addEventListener("click", function () { setScale(1); centerScroll(); });
1238
+
1239
+ lb.addEventListener("wheel", function (ev) {
1240
+ if (lb.hidden) return;
1241
+ if (!ev.ctrlKey && !ev.metaKey) return;
1242
+ ev.preventDefault();
1243
+ setScale(scale * (ev.deltaY < 0 ? 1.1 : 0.9));
1244
+ }, { passive: false });
1245
+
1246
+ document.addEventListener("keydown", function (ev) {
1247
+ if (lb.hidden) return;
1248
+ if (ev.key === "Escape") {
1249
+ ev.preventDefault();
1250
+ closeLb();
1251
+ }
1252
+ });
1253
+ })();
1254
  </script>
1255
  </body>
1256
  </html>