Absolutely! Below is a single HTML file that recreates a simple version of the ChatGPT website interface. This is a static mockup—it does not connect to OpenAI or provide real AI responses, but it mimics the look and feel of the chat interface. You can copy and run this as an .html file.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>ChatGPT Mockup</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
:root {
--bg: #343541;
--sidebar: #202123;
--input-bg: #40414f;
--user-msg: #2a2b32;
--ai-msg: #444654;
--text: #ececf1;
--accent: #10a37f;
}
body {
margin: 0;
padding: 0;
background: var(--bg);
color: var(--text);
font-family: 'Segoe UI', 'Arial', sans-serif;
height: 100vh;
display: flex;
}
.sidebar {
background: var(--sidebar);
width: 240px;
min-width: 180px;
padding: 24px 0;
display: flex;
flex-direction: column;
gap: 16px;
border-right: 1px solid #2a2b32;
height: 100vh;
}
.sidebar h1 {
font-size: 1.3em;
font-weight: 700;
color: var(--accent);
margin: 0 0 24px 24px;
letter-spacing: 1px;
}
.sidebar button {
background: var(--input-bg);
color: var(--text);
border: none;
border-radius: 6px;
padding: 12px 24px;
margin: 0 24px;
font-size: 1em;
cursor: pointer;
transition: background 0.2s;
}
.sidebar button:hover {
background: var(--ai-msg);
}
.sidebar .nav {
margin-top: auto;
display: flex;
flex-direction: column;
gap: 8px;
margin-bottom: 24px;
}
.sidebar .nav a {
color: #b4bcd0;
text-decoration: none;
font-size: 0.95em;
margin-left: 24px;
transition: color 0.2s;
}
.sidebar .nav a:hover {
color: var(--accent);
}
.main {
flex: 1;
display: flex;
flex-direction: column;
height: 100vh;
justify-content: flex-end;
background: var(--bg);
}
.chat-container {
flex: 1;
overflow-y: auto;
padding: 32px 0 16px 0;
display: flex;
flex-direction: column;
gap: 16px;
max-width: 700px;
margin: 0 auto;
width: 100%;
}
.message {
display: flex;
gap: 16px;
align-items: flex-start;
padding: 16px 24px;
border-radius: 8px;
max-width: 90%;
margin: 0 auto;
font-size: 1.08em;
line-height: 1.6;
}
.message.user {
background: var(--user-msg);
align-self: flex-end;
flex-direction: row-reverse;
}
.message.ai {
background: var(--ai-msg);
align-self: flex-start;
}
.avatar {
width: 36px;
height: 36px;
border-radius: 50%;
background: var(--accent);
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
font-size: 1.1em;
color: #fff;
flex-shrink: 0;
}
.message.user .avatar {
background: #5c5e70;
}
.input-area {
background: linear-gradient(to top, var(--bg) 80%, transparent 100%);
padding: 24px 0 24px 0;
display: flex;
justify-content: center;
align-items: center;
border-top: 1px solid #2a2b32;
}
.input-box {
display: flex;
align-items: center;
background: var(--input-bg);
border-radius: 8px;
padding: 8px 12px;
width: 100%;
max-width: 700px;
box-sizing: border-box;
}
.input-box textarea {
background: transparent;
border: none;
color: var(--text);
font-size: 1.1em;
resize: none;
width: 100%;
outline: none;
padding: 8px 0;
min-height: 32px;
max-height: 120px;
line-height: 1.5;
}
.input-box button {
background: var(--accent);
border: none;
color: #fff;
border-radius: 6px;
padding: 8px 16px;
margin-left: 8px;
font-size: 1em;
cursor: pointer;
transition: background 0.2s;
}
.input-box button:active {
background: #0d8a6b;
}
@media (max-width: 800px) {
.sidebar {
width: 60px;
min-width: 60px;
padding: 12px 0;
}
.sidebar h1, .sidebar .nav a, .sidebar button {
display: none;
}
}
@media (max-width: 600px) {
.main, .chat-container, .input-box {
max-width: 100vw;
}
.chat-container {
padding: 16px 0 8px 0;
}
}
</style>
</head>
<body>
<div class="sidebar">
<h1>ChatGPT</h1>
<button onclick="clearChat()">+ New Chat</button>
<div class="nav">
<a href="#">Upgrade to Plus</a>
<a href="#">Settings</a>
<a href="#">Log out</a>
</div>
</div>
<div class="main">
<div class="chat-container" id="chat">
<div class="message ai">
<div class="avatar">🤖</div>
<div>Hello! I am ChatGPT. How can I help you today?</div>
</div>
</div>
<form class="input-area" id="chat-form" autocomplete="off">
<div class="input-box">
<textarea id="user-input" rows="1" placeholder="Send a message..." required></textarea>
<button type="submit">➤</button>
</div>
</form>
</div>
<script>
const chat = document.getElementById('chat');
const form = document.getElementById('chat-form');
const input = document.getElementById('user-input');
// Simple fake AI responses
const aiReplies = [
"I'm here to help! Ask me anything.",
"That's interesting. Tell me more.",
"I'm an AI developed by OpenAI.",
"Could you please clarify your question?",
"Sure! Here's what I found...",
"Let me think about that for a moment.",
"I'm glad to assist you.",
"Can you provide more details?",
"Absolutely! Let's dive in.",
"I'm here if you need anything else."
];
function addMessage(text, sender = 'user') {
const msg = document.createElement('div');
msg.className = 'message ' + sender;
const avatar = document.createElement('div');
avatar.className = 'avatar';
avatar.textContent = sender === 'user' ? '🧑' : '🤖';
const content = document.createElement('div');
content.textContent = text;
msg.appendChild(avatar);
msg.appendChild(content);
chat.appendChild(msg);
chat.scrollTop = chat.scrollHeight;
}
function fakeAIResponse() {
const reply = aiReplies[Math.floor(Math.random() * aiReplies.length)];
setTimeout(() => {
addMessage(reply, 'ai');
}, 700 + Math.random() * 800);
}
form.addEventListener('submit', function(e) {
e.preventDefault();
const text = input.value.trim();
if (!text) return;
addMessage(text, 'user');
input.value = '';
input.style.height = '32px';
fakeAIResponse();
});
// Auto-resize textarea
input.addEventListener('input', function() {
this.style.height = '32px';
this.style.height = (this.scrollHeight) + 'px';
});
// New Chat button
function clearChat() {
chat.innerHTML = `
<div class="message ai">
<div class="avatar">🤖</div>
<div>Hello! I am ChatGPT. How can I help you today?</div>
</div>
`;
}
window.clearChat = clearChat;
</script>
</body>
</html>
Features:
- Responsive sidebar and main chat area
- User and AI message bubbles with avatars
- "New Chat" button clears the chat
- Fake AI responses for demo purposes
- Auto-resizing input box
- Simple, clean styling inspired by ChatGPT
Note:
This is a static demo and does not connect to OpenAI's API. For a real chatbot, you would need to add backend integration.