Spaces:
Running
Running
Update playground.html
Browse files- playground.html +39 -18
playground.html
CHANGED
@@ -553,25 +553,46 @@
|
|
553 |
<div class="flex-1 overflow-y-auto p-4 space-y-5" id="chatMessages"></div>
|
554 |
|
555 |
<!-- Input Area -->
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
<
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
575 |
</div>
|
576 |
</div>
|
577 |
|
|
|
553 |
<div class="flex-1 overflow-y-auto p-4 space-y-5" id="chatMessages"></div>
|
554 |
|
555 |
<!-- Input Area -->
|
556 |
+
<div class="border-t border-light-darker dark:border-dark-input p-4 bg-light-card dark:bg-dark-lighter">
|
557 |
+
<div class="relative">
|
558 |
+
<button id="fullscreenButton" class="absolute right-3 top-3 text-gray-400 hover:text-primary dark:hover:text-primary-light transition-colors" aria-label="Fullscreen">
|
559 |
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
560 |
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
561 |
+
d="M4 4h6M4 4v6M4 4l6 6M20 20h-6M20 20v-6M20 20l-6-6" />
|
562 |
+
</svg>
|
563 |
+
</button>
|
564 |
+
|
565 |
+
<textarea id="chatInput"
|
566 |
+
class="w-full p-3 pr-12 rounded-xl border border-light-darker dark:border-dark-input bg-light-input dark:bg-dark-input focus:outline-none focus:ring-2 focus:ring-primary dark:focus:ring-primary-light text-gray-800 dark:text-white transition-all shadow-inner resize-none min-h-[50px] max-h-[150px]"
|
567 |
+
placeholder="Type your message..." rows="1"></textarea>
|
568 |
+
<button id="sendButton" class="absolute right-3 bottom-3 text-gray-400 hover:text-primary dark:hover:text-primary-light transition-colors" aria-label="Send message">
|
569 |
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" id="sendIcon" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
570 |
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 19l9 2-9-18-9 18 9-2zm0 0v-8" />
|
571 |
+
</svg>
|
572 |
+
<div id="sendLoader" class="hidden">
|
573 |
+
<div class="w-5 h-5 border-2 border-primary-light border-t-transparent rounded-full animate-spin"></div>
|
574 |
</div>
|
575 |
+
</button>
|
576 |
+
</div>
|
577 |
+
<div class="flex justify-between items-center mt-2">
|
578 |
+
<p class="text-gray-500 text-xs">Ctrl+Enter to send</p>
|
579 |
+
<p class="text-gray-500 text-xs">Models may make mistakes. Check important information.</p>
|
580 |
+
</div>
|
581 |
+
</div>
|
582 |
+
|
583 |
+
<script>
|
584 |
+
const chatInput = document.getElementById('chatInput');
|
585 |
+
const fullscreenButton = document.getElementById('fullscreenButton');
|
586 |
+
|
587 |
+
fullscreenButton.addEventListener('click', () => {
|
588 |
+
if (!document.fullscreenElement) {
|
589 |
+
chatInput.requestFullscreen();
|
590 |
+
} else {
|
591 |
+
document.exitFullscreen();
|
592 |
+
}
|
593 |
+
});
|
594 |
+
</script>
|
595 |
+
|
596 |
</div>
|
597 |
</div>
|
598 |
|