File size: 15,452 Bytes
d90d2da |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Flutter Chat App UI</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
.sidebar {
transition: all 0.3s ease;
}
.chat-container {
height: calc(100vh - 130px);
}
@media (max-width: 768px) {
.sidebar {
position: absolute;
left: -100%;
z-index: 50;
}
.sidebar.active {
left: 0;
}
}
.message-input:focus {
outline: none;
}
.chat-bubble {
max-width: 70%;
}
.chat-bubble.sent {
border-radius: 18px 4px 18px 18px;
}
.chat-bubble.received {
border-radius: 4px 18px 18px 18px;
}
</style>
</head>
<body class="bg-gray-100 font-sans">
<div class="flex h-screen overflow-hidden">
<!-- Sidebar -->
<div class="sidebar w-80 bg-white shadow-lg">
<!-- Header -->
<div class="p-4 border-b border-gray-200 flex justify-between items-center bg-indigo-600 text-white">
<h1 class="text-xl font-bold">Chat App</h1>
<button id="closeSidebar" class="md:hidden">
<i class="fas fa-times"></i>
</button>
</div>
<!-- User profile -->
<div class="p-4 border-b border-gray-200 flex items-center space-x-3">
<div class="w-10 h-10 rounded-full bg-indigo-100 flex items-center justify-center">
<i class="fas fa-user text-indigo-600"></i>
</div>
<div>
<p class="font-medium">John Doe</p>
<p class="text-xs text-gray-500">Online</p>
</div>
</div>
<!-- Navigation -->
<div class="p-2">
<a href="#" class="flex items-center p-2 rounded-lg text-indigo-600 bg-indigo-50">
<i class="fas fa-comment-dots mr-3"></i>
<span>Chats</span>
</a>
<a href="#" class="flex items-center p-2 rounded-lg text-gray-600 hover:bg-gray-100">
<i class="fas fa-user-friends mr-3"></i>
<span>Contacts</span>
</a>
<a href="#" class="flex items-center p-2 rounded-lg text-gray-600 hover:bg-gray-100">
<i class="fas fa-cog mr-3"></i>
<span>Settings</span>
</a>
</div>
<!-- Chat list -->
<div class="overflow-y-auto" style="height: calc(100vh - 230px)">
<div class="p-2">
<div class="flex items-center p-2 rounded-lg hover:bg-gray-100 cursor-pointer">
<div class="relative">
<div class="w-10 h-10 rounded-full bg-purple-100 flex items-center justify-center">
<i class="fas fa-user text-purple-600"></i>
</div>
<span class="absolute bottom-0 right-0 w-3 h-3 bg-green-500 rounded-full border-2 border-white"></span>
</div>
<div class="ml-3 flex-1">
<div class="flex justify-between items-center">
<p class="font-medium">Sarah Johnson</p>
<span class="text-xs text-gray-500">2 min</span>
</div>
<p class="text-sm text-gray-500 truncate">Hey, how are you doing?</p>
</div>
</div>
<div class="flex items-center p-2 rounded-lg hover:bg-gray-100 cursor-pointer">
<div class="relative">
<div class="w-10 h-10 rounded-full bg-blue-100 flex items-center justify-center">
<i class="fas fa-user text-blue-600"></i>
</div>
<span class="absolute bottom-0 right-0 w-3 h-3 bg-gray-300 rounded-full border-2 border-white"></span>
</div>
<div class="ml-3 flex-1">
<div class="flex justify-between items-center">
<p class="font-medium">Mike Peterson</p>
<span class="text-xs text-gray-500">1 hr</span>
</div>
<p class="text-sm text-gray-500 truncate">Let's meet tomorrow</p>
</div>
</div>
<div class="flex items-center p-2 rounded-lg hover:bg-gray-100 cursor-pointer">
<div class="relative">
<div class="w-10 h-10 rounded-full bg-green-100 flex items-center justify-center">
<i class="fas fa-user text-green-600"></i>
</div>
<span class="absolute bottom-0 right-0 w-3 h-3 bg-green-500 rounded-full border-2 border-white"></span>
</div>
<div class="ml-3 flex-1">
<div class="flex justify-between items-center">
<p class="font-medium">Emma Wilson</p>
<span class="text-xs text-gray-500">3 hr</span>
</div>
<p class="text-sm text-gray-500 truncate">Did you see the news?</p>
</div>
</div>
</div>
</div>
</div>
<!-- Main content -->
<div class="flex-1 flex flex-col">
<!-- Chat header -->
<div class="p-4 border-b border-gray-200 bg-white flex items-center justify-between">
<div class="flex items-center space-x-3">
<button id="toggleSidebar" class="md:hidden">
<i class="fas fa-bars"></i>
</button>
<div class="relative">
<div class="w-10 h-10 rounded-full bg-purple-100 flex items-center justify-center">
<i class="fas fa-user text-purple-600"></i>
</div>
<span class="absolute bottom-0 right-0 w-3 h-3 bg-green-500 rounded-full border-2 border-white"></span>
</div>
<div>
<p class="font-medium">Sarah Johnson</p>
<p class="text-xs text-gray-500">Online</p>
</div>
</div>
<div class="flex items-center space-x-4">
<button class="text-gray-600 hover:text-indigo-600">
<i class="fas fa-phone"></i>
</button>
<button class="text-gray-600 hover:text-indigo-600">
<i class="fas fa-video"></i>
</button>
<button class="text-gray-600 hover:text-indigo-600">
<i class="fas fa-ellipsis-v"></i>
</button>
</div>
</div>
<!-- Chat messages -->
<div class="chat-container overflow-y-auto p-4 bg-gray-50">
<div class="space-y-3">
<!-- Date divider -->
<div class="flex items-center justify-center my-4">
<span class="px-3 py-1 bg-white rounded-full text-xs text-gray-500 shadow-sm">Today</span>
</div>
<!-- Received message -->
<div class="flex">
<div class="chat-bubble received bg-white p-3 shadow-sm">
<p>Hey there! How are you doing?</p>
<p class="text-right text-xs text-gray-400 mt-1">10:30 AM</p>
</div>
</div>
<!-- Sent message -->
<div class="flex justify-end">
<div class="chat-bubble sent bg-indigo-100 p-3 shadow-sm">
<p>I'm good, thanks! Just working on some projects.</p>
<p class="text-right text-xs text-gray-500 mt-1">10:32 AM</p>
</div>
</div>
<!-- Received message -->
<div class="flex">
<div class="chat-bubble received bg-white p-3 shadow-sm">
<p>That's great! Would you like to grab coffee later?</p>
<p class="text-right text-xs text-gray-400 mt-1">10:33 AM</p>
</div>
</div>
<!-- Sent message -->
<div class="flex justify-end">
<div class="chat-bubble sent bg-indigo-100 p-3 shadow-sm">
<p>Sure, how about 3pm at the usual place?</p>
<p class="text-right text-xs text-gray-500 mt-1">10:35 AM</p>
</div>
</div>
<!-- Received message -->
<div class="flex">
<div class="chat-bubble received bg-white p-3 shadow-sm">
<p>Perfect! See you then 😊</p>
<p class="text-right text-xs text-gray-400 mt-1">10:36 AM</p>
</div>
</div>
</div>
</div>
<!-- Message input -->
<div class="p-4 bg-white border-t border-gray-200">
<div class="flex items-center space-x-2">
<button class="w-10 h-10 rounded-full bg-gray-100 flex items-center justify-center text-gray-600 hover:bg-gray-200">
<i class="fas fa-plus"></i>
</button>
<div class="flex-1 relative">
<input type="text" placeholder="Type a message" class="message-input w-full py-2 px-4 bg-gray-100 rounded-full focus:bg-gray-200 focus:ring-2 focus:ring-indigo-200">
<button class="absolute right-3 top-2 text-gray-500 hover:text-indigo-600">
<i class="far fa-smile"></i>
</button>
</div>
<button class="w-10 h-10 rounded-full bg-indigo-600 flex items-center justify-center text-white hover:bg-indigo-700">
<i class="fas fa-paper-plane"></i>
</button>
</div>
</div>
</div>
</div>
<script>
// Toggle sidebar on mobile
const toggleSidebar = document.getElementById('toggleSidebar');
const closeSidebar = document.getElementById('closeSidebar');
const sidebar = document.querySelector('.sidebar');
toggleSidebar.addEventListener('click', () => {
sidebar.classList.add('active');
});
closeSidebar.addEventListener('click', () => {
sidebar.classList.remove('active');
});
// Simulate sending a message
const messageInput = document.querySelector('.message-input');
const sendButton = document.querySelector('.fa-paper-plane').parentElement;
const chatContainer = document.querySelector('.chat-container');
sendButton.addEventListener('click', sendMessage);
messageInput.addEventListener('keypress', (e) => {
if (e.key === 'Enter') {
sendMessage();
}
});
function sendMessage() {
const message = messageInput.value.trim();
if (message) {
const now = new Date();
const timeString = now.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
const messageElement = document.createElement('div');
messageElement.className = 'flex justify-end';
messageElement.innerHTML = `
<div class="chat-bubble sent bg-indigo-100 p-3 shadow-sm">
<p>${message}</p>
<p class="text-right text-xs text-gray-500 mt-1">${timeString}</p>
</div>
`;
chatContainer.querySelector('.space-y-3').appendChild(messageElement);
messageInput.value = '';
chatContainer.scrollTop = chatContainer.scrollHeight;
// Simulate reply after 1 second
setTimeout(() => {
const replies = [
"That's interesting!",
"I see what you mean.",
"Let me think about that.",
"Sounds good to me!",
"What else is new?",
"I agree with you."
];
const randomReply = replies[Math.floor(Math.random() * replies.length)];
const replyElement = document.createElement('div');
replyElement.className = 'flex';
replyElement.innerHTML = `
<div class="chat-bubble received bg-white p-3 shadow-sm">
<p>${randomReply}</p>
<p class="text-right text-xs text-gray-400 mt-1">${new Date().toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}</p>
</div>
`;
chatContainer.querySelector('.space-y-3').appendChild(replyElement);
chatContainer.scrollTop = chatContainer.scrollHeight;
}, 1000);
}
}
// Auto-scroll to bottom of chat
chatContainer.scrollTop = chatContainer.scrollHeight;
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=ALIMHGFY/chat-app" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |