Here’s an enhanced version of the HTML designed to function as a chatbot app interface, complete with interactive elements, modern styling, and responsive design. This includes a simulated chat interface, user/bot message bubbles, and dynamic input handling.
✨ Features Added:
- Interactive chat UI with message bubbles (user vs. bot)
- Responsive design (mobile-friendly)
- Modern gradient backgrounds and animations
- Simulated bot responses
- Enhanced buttons and input fields
📄 Full HTML Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>LM Arena - Chatbot</title>
<style>
:root {
--primary: #007BFF;
--secondary: #28a745;
--bg: #f5f6fa;
--text: #2f3640;
--accent: #7f8fa6;
--user-bg: #dcf8c6;
--bot-bg: #e9ecef;
--border-radius: 12px;
}
body {
margin: 0;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: var(--bg);
color: var(--text);
line-height: 1.6;
}
.container {
max-width: 1000px;
margin: 0 auto;
padding: 1.5rem;
}
header {
text-align: center;
margin-bottom: 2rem;
}
header h1 {
font-size: 2.2rem;
margin-bottom: 0.5rem;
}
.legacy-link {
display: inline-block;
margin-bottom: 1.5rem;
color: var(--accent);
text-decoration: none;
border: 1px solid #ccc;
padding: 0.4rem 1rem;
border-radius: 5px;
font-size: 0.9rem;
}
.hero {
text-align: center;
margin-bottom: 2rem;
}
.hero h2 {
font-size: 1.8rem;
font-weight: 600;
margin-bottom: 0.8rem;
}
.stats {
font-size: 1rem;
color: var(--accent);
margin-bottom: 2rem;
text-align: center;
}
.actions {
display: flex;
justify-content: center;
gap: 1rem;
margin-bottom: 3rem;
flex-wrap: wrap;
}
.actions a {
padding: 0.7rem 1.2rem;
border: 1px solid #ddd;
border-radius: 8px;
text-decoration: none;
color: var(--text);
background: white;
transition: all 0.2s ease;
box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.actions a:hover {
background: var(--primary);
color: white;
border-color: var(--primary);
}
/* Chat Section */
.chat-section {
background: white;
border: 1px solid #ddd;
border-radius: 10px;
padding: 1.5rem;
box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.chat-container {
display: flex;
flex-direction: column;
gap: 1rem;
height: 400px;
overflow-y: auto;
padding: 1rem;
border: 1px solid #eee;
border-radius: 10px;
background: #fafafa;
margin-bottom: 1rem;
}
.message {
max-width: 70%;
padding: 0.8rem 1rem;
border-radius: var(--border-radius);
font-size: 0.95rem;
position: relative;
clear: both;
line-height: 1.4;
}
.user {
background: var(--user-bg);
align-self: flex-end;
border-top-right-radius: 0;
}
.bot {
background: var(--bot-bg);
align-self: flex-start;
border-top-left-radius: 0;
}
.chat-form {
display: flex;
gap: 0.5rem;
}
.chat-form input {
flex: 1;
padding: 0.8rem;
border: 1px solid #ccc;
border-radius: 8px;
font-size: 1rem;
}
.chat-form button {
padding: 0.8rem 1.2rem;
background: var(--primary);
color: white;
border: none;
border-radius: 8px;
font-size: 1rem;
cursor: pointer;
transition: background 0.2s ease;
}
.chat-form button:hover {
background: #0056b3;
}
.disclaimer {
font-size: 0.8rem;
color: #888;
text-align: center;
margin-top: 0.5rem;
}
@media (max-width: 600px) {
.message {
max-width: 90%;
}
}
</style>
</head>
<body>
<div class="container">
<header>
<h1>Battle</h1>
<a href="https://legacy.lmarena.ai" class="legacy-link">Visit legacy.lmarena.ai</a>
</header>
<section class="hero">
<h2>Prompt. Vote. Advance AI.</h2>
<p class="stats">Over 3.5M votes and counting, join the global community shaping AI through collective feedback.</p>
</section>
<div class="actions">
<a href="#">Leaderboard</a>
<a href="#">How it works</a>
<a href="#">Join the Team</a>
</div>
<section class="chat-section">
<h3 style="text-align:center; margin-bottom: 1rem;">Chat</h3>
<div class="chat-container" id="chat">
<!-- Chat messages will be injected here -->
<div class="bot message">Hi! I'm your AI assistant. Ask me anything.</div>
</div>
<form class="chat-form" id="chatForm">
<input type="text" id="chatInput" placeholder="Type your message..." required />
<button type="submit">Send</button>
</form>
<p class="disclaimer">Inputs are processed by third-party AI and responses may be inaccurate.</p>
</section>
</div>
<script>
const chat = document.getElementById('chat');
const form = document.getElementById('chatForm');
const input = document.getElementById('chatInput');
const botResponses = [
"That's an interesting question!",
"Let me think about that...",
"Hmm, I'm not sure. Try rephrasing?",
"I'm still learning!",
"Let me look that up for you.",
"Cool! Tell me more!",
];
form.addEventListener('submit', (e) => {
e.preventDefault();
const userMessage = input.value.trim();
if (!userMessage) return;
// Add user message
const userDiv = document.createElement('div');
userDiv.className = 'message user';
userDiv.textContent = userMessage;
chat.appendChild(userDiv);
// Clear input
input.value = '';
// Simulate bot typing
setTimeout(() => {
const botDiv = document.createElement('div');
botDiv.className = 'message bot';
botDiv.textContent = botResponses[Math.floor(Math.random() * botResponses.length)];
chat.appendChild(botDiv);
chat.scrollTop = chat.scrollHeight;
}, 800);
chat.scrollTop = chat.scrollHeight;
});
</script>
</body>
</html>