Spaces:
Running
Running
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Chatbot</title> | |
<style> | |
body { | |
font-family: Arial, sans-serif; | |
text-align: center; | |
} | |
.container { | |
width: 50%; | |
margin: 0 auto; | |
} | |
.chat-container { | |
display: flex; | |
flex-direction: column; | |
align-items: center; | |
padding: 20px; | |
border: 1px solid #ddd; | |
border-radius: 10px; | |
margin-bottom: 20px; | |
} | |
.chat-message { | |
margin-bottom: 10px; | |
} | |
.chat-message:first-child { | |
margin-top: 0; | |
} | |
.chat-message:last-child { | |
margin-bottom: 0; | |
} | |
.chat-user { | |
font-weight: bold; | |
} | |
.chat-bot { | |
color: #666; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="container"> | |
<h1>Chatbot</h1> | |
<form action="/chat" method="POST"> | |
<input type="text" name="message" placeholder="Type a message..." /> | |
<button type="submit">Send</button> | |
</form> | |
<div class="chat-container"> | |
{% if message %} | |
<div class="chat-message"> | |
<span class="chat-user">You:</span> | |
{{ message }} | |
</div> | |
{% endif %} | |
{% if response %} | |
<div class="chat-message"> | |
<span class="chat-bot">Bot:</span> | |
{{ response }} | |
</div> | |
{% endif %} | |
</div> | |
</div> | |
</body> | |
</html> | |