File size: 19,087 Bytes
7b6c2a5 |
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 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>WhatsApp Clone</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>
.chat-container {
height: calc(100vh - 128px);
}
.sidebar {
height: calc(100vh - 64px);
}
.message-input {
resize: none;
}
.typing-indicator::after {
content: '...';
animation: typing 1.5s infinite;
}
@keyframes typing {
0% { content: '.'; }
33% { content: '..'; }
66% { content: '...'; }
}
.unread-badge {
animation: pulse 2s infinite;
}
@keyframes pulse {
0% { opacity: 1; }
50% { opacity: 0.5; }
100% { opacity: 1; }
}
</style>
</head>
<body class="bg-gray-100">
<!-- Navigation Bar -->
<nav class="bg-emerald-700 text-white p-4 shadow-md">
<div class="container mx-auto flex justify-between items-center">
<div class="flex items-center space-x-4">
<i class="fab fa-whatsapp text-2xl"></i>
<span class="text-xl font-semibold">WhatsApp</span>
</div>
<div class="flex items-center space-x-4">
<button class="p-2 rounded-full hover:bg-emerald-600">
<i class="fas fa-search"></i>
</button>
<button class="p-2 rounded-full hover:bg-emerald-600">
<i class="fas fa-ellipsis-vertical"></i>
</button>
</div>
</div>
</nav>
<div class="container mx-auto flex">
<!-- Sidebar -->
<div class="w-1/3 sidebar bg-white border-r border-gray-200 hidden md:block">
<!-- User Profile -->
<div class="p-3 bg-gray-50 flex items-center space-x-3">
<div class="relative">
<img src="https://randomuser.me/api/portraits/men/1.jpg" alt="Profile" class="w-10 h-10 rounded-full">
<div class="absolute bottom-0 right-0 w-3 h-3 bg-green-500 rounded-full border-2 border-white"></div>
</div>
<div>
<p class="font-semibold">John Doe</p>
<p class="text-xs text-gray-500">Online</p>
</div>
</div>
<!-- Chat List -->
<div class="overflow-y-auto h-full">
<div class="p-3 border-b border-gray-100 flex items-center space-x-3 hover:bg-gray-50 cursor-pointer bg-gray-100">
<div class="relative">
<img src="https://randomuser.me/api/portraits/women/2.jpg" alt="Profile" class="w-12 h-12 rounded-full">
<div class="absolute bottom-0 right-0 w-3 h-3 bg-green-500 rounded-full border-2 border-white"></div>
</div>
<div class="flex-1">
<div class="flex justify-between items-center">
<p class="font-semibold">Sarah Smith</p>
<span class="text-xs text-gray-500">10:30 AM</span>
</div>
<div class="flex justify-between items-center">
<p class="text-sm text-gray-600 truncate">Hey, how are you doing?</p>
<span class="bg-green-500 text-white text-xs rounded-full h-5 w-5 flex items-center justify-center unread-badge">2</span>
</div>
</div>
</div>
<div class="p-3 border-b border-gray-100 flex items-center space-x-3 hover:bg-gray-50 cursor-pointer">
<div class="relative">
<img src="https://randomuser.me/api/portraits/men/3.jpg" alt="Profile" class="w-12 h-12 rounded-full">
<div class="absolute bottom-0 right-0 w-3 h-3 bg-gray-400 rounded-full border-2 border-white"></div>
</div>
<div class="flex-1">
<div class="flex justify-between items-center">
<p class="font-semibold">Work Group</p>
<span class="text-xs text-gray-500">Yesterday</span>
</div>
<div class="flex justify-between items-center">
<p class="text-sm text-gray-600 truncate">Mike: The meeting is at 3pm</p>
<i class="fas fa-check-double text-gray-400"></i>
</div>
</div>
</div>
<div class="p-3 border-b border-gray-100 flex items-center space-x-3 hover:bg-gray-50 cursor-pointer">
<div class="relative">
<img src="https://randomuser.me/api/portraits/women/4.jpg" alt="Profile" class="w-12 h-12 rounded-full">
<div class="absolute bottom-0 right-0 w-3 h-3 bg-green-500 rounded-full border-2 border-white"></div>
</div>
<div class="flex-1">
<div class="flex justify-between items-center">
<p class="font-semibold">Emma Johnson</p>
<span class="text-xs text-gray-500">Yesterday</span>
</div>
<div class="flex justify-between items-center">
<p class="text-sm text-gray-600 truncate typing-indicator">Emma is typing</p>
<i class="fas fa-check-double text-blue-500"></i>
</div>
</div>
</div>
<!-- More chat items... -->
</div>
</div>
<!-- Chat Area -->
<div class="flex-1 flex flex-col bg-gray-50">
<!-- Chat Header -->
<div class="p-3 bg-gray-100 border-b border-gray-200 flex items-center justify-between">
<div class="flex items-center space-x-3">
<button id="backButton" class="p-2 rounded-full hover:bg-gray-200 md:hidden">
<i class="fas fa-arrow-left"></i>
</button>
<div class="relative">
<img src="https://randomuser.me/api/portraits/women/2.jpg" alt="Profile" class="w-10 h-10 rounded-full">
<div class="absolute bottom-0 right-0 w-3 h-3 bg-green-500 rounded-full border-2 border-white"></div>
</div>
<div>
<p class="font-semibold">Sarah Smith</p>
<p class="text-xs text-gray-500">Online</p>
</div>
</div>
<div class="flex items-center space-x-4">
<button class="p-2 rounded-full hover:bg-gray-200">
<i class="fas fa-phone"></i>
</button>
<button class="p-2 rounded-full hover:bg-gray-200">
<i class="fas fa-video"></i>
</button>
<button class="p-2 rounded-full hover:bg-gray-200">
<i class="fas fa-search"></i>
</button>
<button class="p-2 rounded-full hover:bg-gray-200">
<i class="fas fa-ellipsis-vertical"></i>
</button>
</div>
</div>
<!-- Messages -->
<div class="flex-1 chat-container overflow-y-auto p-4 space-y-3">
<!-- Date divider -->
<div class="flex justify-center">
<span class="bg-gray-200 text-xs text-gray-600 px-2 py-1 rounded-full">TODAY</span>
</div>
<!-- Incoming message -->
<div class="flex items-start space-x-2">
<img src="https://randomuser.me/api/portraits/women/2.jpg" alt="Profile" class="w-8 h-8 rounded-full mt-1">
<div class="max-w-xs md:max-w-md">
<div class="bg-white p-3 rounded-lg rounded-tl-none shadow">
<p>Hey there! How are you doing?</p>
</div>
<span class="text-xs text-gray-500 mt-1">10:30 AM</span>
</div>
</div>
<!-- Outgoing message -->
<div class="flex justify-end">
<div class="max-w-xs md:max-w-md">
<div class="bg-emerald-100 p-3 rounded-lg rounded-tr-none shadow">
<p>I'm good, thanks! Just working on some projects.</p>
</div>
<div class="flex justify-end items-center space-x-1">
<span class="text-xs text-gray-500">10:32 AM</span>
<i class="fas fa-check-double text-blue-500 text-xs"></i>
</div>
</div>
</div>
<!-- Incoming message -->
<div class="flex items-start space-x-2">
<img src="https://randomuser.me/api/portraits/women/2.jpg" alt="Profile" class="w-8 h-8 rounded-full mt-1">
<div class="max-w-xs md:max-w-md">
<div class="bg-white p-3 rounded-lg rounded-tl-none shadow">
<p>That's great! Would you like to meet for coffee this weekend?</p>
</div>
<span class="text-xs text-gray-500 mt-1">10:33 AM</span>
</div>
</div>
<!-- Outgoing message -->
<div class="flex justify-end">
<div class="max-w-xs md:max-w-md">
<div class="bg-emerald-100 p-3 rounded-lg rounded-tr-none shadow">
<p>Sure, that sounds good. How about Saturday at 2pm?</p>
</div>
<div class="flex justify-end items-center space-x-1">
<span class="text-xs text-gray-500">10:35 AM</span>
<i class="fas fa-check-double text-blue-500 text-xs"></i>
</div>
</div>
</div>
<!-- Incoming message -->
<div class="flex items-start space-x-2">
<img src="https://randomuser.me/api/portraits/women/2.jpg" alt="Profile" class="w-8 h-8 rounded-full mt-1">
<div class="max-w-xs md:max-w-md">
<div class="bg-white p-3 rounded-lg rounded-tl-none shadow">
<p>Perfect! See you then at the usual place.</p>
</div>
<span class="text-xs text-gray-500 mt-1">10:36 AM</span>
</div>
</div>
<!-- Typing indicator -->
<div class="flex items-start space-x-2">
<img src="https://randomuser.me/api/portraits/women/2.jpg" alt="Profile" class="w-8 h-8 rounded-full mt-1">
<div class="max-w-xs md:max-w-md">
<div class="bg-white p-3 rounded-lg rounded-tl-none shadow">
<p class="typing-indicator"></p>
</div>
</div>
</div>
</div>
<!-- Message Input -->
<div class="p-3 bg-gray-100 border-t border-gray-200">
<div class="flex items-center space-x-2">
<button class="p-2 rounded-full hover:bg-gray-200">
<i class="far fa-face-smile text-gray-600"></i>
</button>
<button class="p-2 rounded-full hover:bg-gray-200">
<i class="fas fa-paperclip text-gray-600"></i>
</button>
<div class="flex-1">
<textarea id="messageInput" class="w-full message-input p-2 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:border-transparent" rows="1" placeholder="Type a message"></textarea>
</div>
<button id="sendButton" class="p-2 rounded-full bg-emerald-600 text-white hover:bg-emerald-700">
<i class="fas fa-paper-plane"></i>
</button>
</div>
</div>
</div>
</div>
<!-- Mobile bottom navigation -->
<div class="md:hidden fixed bottom-0 left-0 right-0 bg-white border-t border-gray-200">
<div class="flex justify-around items-center p-2">
<button class="p-3 text-gray-600">
<i class="fas fa-comment text-xl"></i>
</button>
<button class="p-3 text-gray-600">
<i class="fas fa-users text-xl"></i>
</button>
<button class="p-3 text-gray-600">
<i class="fas fa-phone text-xl"></i>
</button>
<button class="p-3 text-gray-600">
<i class="fas fa-gear text-xl"></i>
</button>
</div>
</div>
<script>
// Mobile navigation between chat list and chat area
const backButton = document.getElementById('backButton');
const sidebar = document.querySelector('.sidebar');
const chatArea = document.querySelector('.flex-1.flex.flex-col');
if (backButton) {
backButton.addEventListener('click', () => {
chatArea.classList.add('hidden');
sidebar.classList.remove('hidden');
});
}
// Handle sending messages
const messageInput = document.getElementById('messageInput');
const sendButton = document.getElementById('sendButton');
const messagesContainer = document.querySelector('.chat-container');
function sendMessage() {
const message = messageInput.value.trim();
if (message) {
// Create outgoing message element
const messageElement = document.createElement('div');
messageElement.className = 'flex justify-end';
messageElement.innerHTML = `
<div class="max-w-xs md:max-w-md">
<div class="bg-emerald-100 p-3 rounded-lg rounded-tr-none shadow">
<p>${message}</p>
</div>
<div class="flex justify-end items-center space-x-1">
<span class="text-xs text-gray-500">${new Date().toLocaleTimeString([], {hour: '2-digit', minute:'2-digit'})}</span>
<i class="fas fa-check-double text-gray-400 text-xs"></i>
</div>
</div>
`;
// Append to messages container
messagesContainer.appendChild(messageElement);
// Clear input
messageInput.value = '';
// Scroll to bottom
messagesContainer.scrollTop = messagesContainer.scrollHeight;
// Simulate reply after 1-3 seconds
setTimeout(() => {
const replies = [
"Sounds good!",
"I'll get back to you on that.",
"Thanks for letting me know.",
"Can we talk about this later?",
"👍",
"Interesting! Tell me more."
];
const randomReply = replies[Math.floor(Math.random() * replies.length)];
const replyElement = document.createElement('div');
replyElement.className = 'flex items-start space-x-2';
replyElement.innerHTML = `
<img src="https://randomuser.me/api/portraits/women/2.jpg" alt="Profile" class="w-8 h-8 rounded-full mt-1">
<div class="max-w-xs md:max-w-md">
<div class="bg-white p-3 rounded-lg rounded-tl-none shadow">
<p>${randomReply}</p>
</div>
<span class="text-xs text-gray-500 mt-1">${new Date().toLocaleTimeString([], {hour: '2-digit', minute:'2-digit'})}</span>
</div>
`;
messagesContainer.appendChild(replyElement);
messagesContainer.scrollTop = messagesContainer.scrollHeight;
}, 1000 + Math.random() * 2000);
}
}
sendButton.addEventListener('click', sendMessage);
messageInput.addEventListener('keypress', (e) => {
if (e.key === 'Enter' && !e.shiftKey) {
e.preventDefault();
sendMessage();
}
});
// Auto-resize textarea
messageInput.addEventListener('input', function() {
this.style.height = 'auto';
this.style.height = (this.scrollHeight) + 'px';
});
// Simulate notification
setTimeout(() => {
const notificationSound = new Audio('https://assets.mixkit.co/sfx/preview/mixkit-alarm-digital-clock-beep-989.mp3');
notificationSound.play().catch(e => console.log("Audio play failed:", e));
// This would be a system notification in a real app
if (Notification.permission === "granted") {
new Notification("New Message", {
body: "Sarah: Can we talk about the project?",
icon: "https://randomuser.me/api/portraits/women/2.jpg"
});
}
}, 5000);
</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/whatsapp" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |