Spaces:
Runtime error
Runtime error
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Cass AI Terminal</title> | |
| <link rel="stylesheet" href="style.css"> | |
| </head> | |
| <body> | |
| <div class="terminal"> | |
| <h1>Cass AI Terminal</h1> | |
| <div class="chat-window" id="chat-window"> | |
| {% for msg in history %} | |
| {% if msg.role == "user" %} | |
| <p class="user">> {{ msg.content }}</p> | |
| {% else %} | |
| <p class="ai">Cass: {{ msg.content }}</p> | |
| {% endif %} | |
| {% endfor %} | |
| </div> | |
| <form method="post" onsubmit="scrollTerminal()"> | |
| <input type="text" name="user_input" placeholder="Type command..." autofocus autocomplete="off" required> | |
| <button type="submit">Enter</button> | |
| </form> | |
| </div> | |
| <script> | |
| function scrollTerminal() { | |
| setTimeout(() => { | |
| const terminal = document.getElementById('chat-window'); | |
| terminal.scrollTop = terminal.scrollHeight; | |
| }, 50); | |
| } | |
| // Optional: blinking cursor effect | |
| const input = document.querySelector('input[name="user_input"]'); | |
| input.addEventListener('focus', () => input.classList.add('active-cursor')); | |
| input.addEventListener('blur', () => input.classList.remove('active-cursor')); | |
| </script> | |
| </body> | |
| </html> | |