akhaliq HF Staff commited on
Commit
c2b87a3
·
1 Parent(s): 1eba2d5

UX: collapse prompt to compact bottom bar when output is displayed

Browse files

When output generates, the center prompt card smoothly slides to a
compact re-prompt bar at the bottom-left. The branding caption fades
out. Users can immediately type a new prompt and generate again.
When output is reset, everything returns to the centered layout.

Files changed (1) hide show
  1. index.html +79 -0
index.html CHANGED
@@ -249,6 +249,66 @@
249
  flex-direction: column;
250
  align-items: center;
251
  gap: 20px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
252
  }
253
 
254
  .center-prompt-card {
@@ -2441,6 +2501,7 @@
2441
  bgDownloadLink.href = videoUrl;
2442
  outputActionsCard.style.display = "flex";
2443
  outputTextContainer.style.display = "none";
 
2444
  console.log("Video output displayed:", videoUrl);
2445
  }
2446
  // Output Image generated: Takes up full-screen background
@@ -2458,6 +2519,7 @@
2458
  bgDownloadLink.href = imageUrl;
2459
  outputActionsCard.style.display = "flex";
2460
  outputTextContainer.style.display = "none";
 
2461
  console.log("Image output displayed:", imageUrl);
2462
  }
2463
  // Output Text / Question answers: Rendered in styled overlay card on right
@@ -2465,6 +2527,7 @@
2465
  outputTextContent.textContent = textData;
2466
  outputTextContainer.style.display = "block";
2467
  outputActionsCard.style.display = "none";
 
2468
  console.log("Text output displayed:", textData);
2469
  } else {
2470
  console.warn("displayResult: No usable output found, resetting");
@@ -2493,8 +2556,24 @@
2493
  outputTextContainer.style.display = "none";
2494
  outputTextContent.textContent = "";
2495
 
 
2496
  lucide.createIcons();
2497
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2498
  </script>
2499
  </body>
2500
  </html>
 
249
  flex-direction: column;
250
  align-items: center;
251
  gap: 20px;
252
+ transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
253
+ }
254
+
255
+ /* --- Output Mode: compact re-prompt bar at bottom-left --- */
256
+ .viewport-center-trigger.output-mode {
257
+ top: auto;
258
+ bottom: 24px;
259
+ left: 24px;
260
+ transform: none;
261
+ width: calc(100% - 48px);
262
+ max-width: 560px;
263
+ gap: 0px;
264
+ }
265
+
266
+ .viewport-center-trigger.output-mode .center-prompt-card {
267
+ border-radius: 14px;
268
+ padding: 8px 12px;
269
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
270
+ background: rgba(10, 15, 30, 0.55);
271
+ }
272
+
273
+ .viewport-center-trigger.output-mode .center-prompt-header {
274
+ display: none;
275
+ }
276
+
277
+ .viewport-center-trigger.output-mode .center-prompt-body textarea.prompt-textarea {
278
+ height: 24px;
279
+ font-size: 13px;
280
+ }
281
+
282
+ .viewport-center-trigger.output-mode .center-prompt-footer {
283
+ border-top: none;
284
+ padding-top: 4px;
285
+ margin-top: 0;
286
+ }
287
+
288
+ .viewport-center-trigger.output-mode .center-options-btn {
289
+ padding: 6px 12px;
290
+ font-size: 12px;
291
+ }
292
+
293
+ .viewport-center-trigger.output-mode .center-generate-btn {
294
+ padding: 6px 16px;
295
+ font-size: 12px;
296
+ }
297
+
298
+ .viewport-center-trigger.output-mode .quick-examples-container {
299
+ display: none;
300
+ }
301
+
302
+ /* Hide branding when output is showing */
303
+ .viewport-bottom.output-hidden {
304
+ opacity: 0;
305
+ pointer-events: none;
306
+ transform: translateY(30px);
307
+ transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
308
+ }
309
+
310
+ .viewport-bottom {
311
+ transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
312
  }
313
 
314
  .center-prompt-card {
 
2501
  bgDownloadLink.href = videoUrl;
2502
  outputActionsCard.style.display = "flex";
2503
  outputTextContainer.style.display = "none";
2504
+ enterOutputMode();
2505
  console.log("Video output displayed:", videoUrl);
2506
  }
2507
  // Output Image generated: Takes up full-screen background
 
2519
  bgDownloadLink.href = imageUrl;
2520
  outputActionsCard.style.display = "flex";
2521
  outputTextContainer.style.display = "none";
2522
+ enterOutputMode();
2523
  console.log("Image output displayed:", imageUrl);
2524
  }
2525
  // Output Text / Question answers: Rendered in styled overlay card on right
 
2527
  outputTextContent.textContent = textData;
2528
  outputTextContainer.style.display = "block";
2529
  outputActionsCard.style.display = "none";
2530
+ enterOutputMode();
2531
  console.log("Text output displayed:", textData);
2532
  } else {
2533
  console.warn("displayResult: No usable output found, resetting");
 
2556
  outputTextContainer.style.display = "none";
2557
  outputTextContent.textContent = "";
2558
 
2559
+ exitOutputMode();
2560
  lucide.createIcons();
2561
  }
2562
+
2563
+ // --- Output mode: collapse prompt to bottom, reveal full output ---
2564
+ function enterOutputMode() {
2565
+ const centerPanel = document.querySelector(".viewport-center-trigger");
2566
+ const bottomPanel = document.querySelector(".viewport-bottom");
2567
+ if (centerPanel) centerPanel.classList.add("output-mode");
2568
+ if (bottomPanel) bottomPanel.classList.add("output-hidden");
2569
+ }
2570
+
2571
+ function exitOutputMode() {
2572
+ const centerPanel = document.querySelector(".viewport-center-trigger");
2573
+ const bottomPanel = document.querySelector(".viewport-bottom");
2574
+ if (centerPanel) centerPanel.classList.remove("output-mode");
2575
+ if (bottomPanel) bottomPanel.classList.remove("output-hidden");
2576
+ }
2577
  </script>
2578
  </body>
2579
  </html>