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