jgkwak commited on
Commit
17d44d6
路
verified 路
1 Parent(s): 641968f

Demo: the summary line and the Add views card share a row

Browse files
Files changed (2) hide show
  1. static/ui.css +8 -3
  2. static/ui.js +5 -2
static/ui.css CHANGED
@@ -78,9 +78,12 @@
78
 
79
  .viewer { height: 640px; }
80
  .stage-host { width: 100%; height: 100%; }
81
- .lab { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
82
- .lab .add-act { width: 100%; max-width: 460px; }
83
- .add-act .act-row { justify-content: flex-end; } /* the old card width, under the stage's right corner */
 
 
 
84
  .sumline:empty { display: none; }
85
  .sumline { font: 12px/1.4 var(--mono); color: var(--ink2); padding: 0 2px; }
86
  .act-row .grow { flex: 1; }
@@ -350,6 +353,8 @@
350
 
351
  @media (max-width: 960px) {
352
  .work { grid-template-columns: minmax(0, 1fr); }
 
 
353
  .viewer { height: auto; aspect-ratio: 4 / 3; }
354
  .d-pane[data-d="conv"] { grid-template-columns: minmax(0, 1fr); }
355
  .ex-row { grid-template-columns: minmax(0, 1fr) 110px; }
 
78
 
79
  .viewer { height: 640px; }
80
  .stage-host { width: 100%; height: 100%; }
81
+ .below { display: flex; align-items: flex-start; gap: 16px; } /* the summary on the left, the panel at the stage's right corner */
82
+ .below .sumline { flex: 1; min-width: 0; }
83
+ .sumline span { white-space: nowrap; }
84
+ .sumline i { font-style: normal; }
85
+ .lab { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 460px; margin-left: auto; }
86
+ .add-act .act-row { justify-content: flex-end; }
87
  .sumline:empty { display: none; }
88
  .sumline { font: 12px/1.4 var(--mono); color: var(--ink2); padding: 0 2px; }
89
  .act-row .grow { flex: 1; }
 
353
 
354
  @media (max-width: 960px) {
355
  .work { grid-template-columns: minmax(0, 1fr); }
356
+ .below { flex-direction: column; }
357
+ .lab { max-width: none; }
358
  .viewer { height: auto; aspect-ratio: 4 / 3; }
359
  .d-pane[data-d="conv"] { grid-template-columns: minmax(0, 1fr); }
360
  .ex-row { grid-template-columns: minmax(0, 1fr) 110px; }
static/ui.js CHANGED
@@ -178,6 +178,7 @@ class App {
178
  <button class="exp" data-kind="npz"><span><b>Cameras and depth</b><em>.npz</em></span>${I.down}</button>
179
  </div>
180
  </div>
 
181
  <div class="sumline"></div>
182
  <div class="lab" hidden>
183
  <div class="act add-act">
@@ -188,6 +189,7 @@ class App {
188
  <div class="act-row"><span class="grow"></span><button class="go keep-go" data-op="keep">Keep solving</button></div>
189
  </div>
190
  </div>
 
191
  </div>
192
  </div>
193
  <section class="examples">
@@ -527,9 +529,10 @@ class App {
527
  if (!kept) this.toggleLab(false);
528
  this.$('.dl').hidden = !s || !!s.cached; if (!s || s.cached) this.$('.dl-menu').hidden = true; // a saved example has no solver state to export
529
  const gb = s?.peak_gb ? `${fmtNum(s.peak_gb, 2)} GB peak GPU memory` : '';
530
- this.$('.sumline').textContent = !s ? '' : (s.kind === 'stream'
531
  ? [`${s.views} frames`, gb]
532
- : [s.fixed_added ? `${plural(s.views, 'view')} (${s.fixed_added} added, scene fixed)` : plural(s.views, 'view'), `${s.calls} calls`, s.ms_call ? `${fmtNum(s.ms_call)} ms per call` : '', gb]).filter(Boolean).join(' 路 ');
 
533
  }
534
 
535
  }
 
178
  <button class="exp" data-kind="npz"><span><b>Cameras and depth</b><em>.npz</em></span>${I.down}</button>
179
  </div>
180
  </div>
181
+ <div class="below">
182
  <div class="sumline"></div>
183
  <div class="lab" hidden>
184
  <div class="act add-act">
 
189
  <div class="act-row"><span class="grow"></span><button class="go keep-go" data-op="keep">Keep solving</button></div>
190
  </div>
191
  </div>
192
+ </div>
193
  </div>
194
  </div>
195
  <section class="examples">
 
529
  if (!kept) this.toggleLab(false);
530
  this.$('.dl').hidden = !s || !!s.cached; if (!s || s.cached) this.$('.dl-menu').hidden = true; // a saved example has no solver state to export
531
  const gb = s?.peak_gb ? `${fmtNum(s.peak_gb, 2)} GB peak GPU memory` : '';
532
+ this.$('.sumline').innerHTML = !s ? '' : (s.kind === 'stream' // items do not break inside: the line may wrap beside the panel
533
  ? [`${s.views} frames`, gb]
534
+ : [s.fixed_added ? `${plural(s.views, 'view')} (${s.fixed_added} added, scene fixed)` : plural(s.views, 'view'), `${s.calls} calls`, s.ms_call ? `${fmtNum(s.ms_call)} ms per call` : '', gb])
535
+ .filter(Boolean).map((x) => `<span>${esc(x)}</span>`).join('<i> 路 </i>');
536
  }
537
 
538
  }