ozatech / index.html
kingpbaz's picture
Add 3 files
329b83e verified
Raw History Blame Contribute Delete
31.4 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ChatApp - Realtime Messaging</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>
/* Custom scrollbar */
.custom-scrollbar::-webkit-scrollbar {
width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
background: #f1f1f1;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
background: #888;
border-radius: 3px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
background: #555;
}
/* Animation for new messages */
@keyframes slideIn {
from {
transform: translateY(10px);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
}
.new-message {
animation: slideIn 0.3s ease-out;
}
/* Online status indicator */
.online-indicator {
width: 12px;
height: 12px;
background-color: #4ade80;
border-radius: 50%;
border: 2px solid white;
position: absolute;
bottom: 0;
right: 0;
}
/* Typing indicator */
.typing-indicator {
display: flex;
align-items: center;
}
.typing-dot {
width: 8px;
height: 8px;
background-color: #9ca3af;
border-radius: 50%;
margin: 0 2px;
animation: typingAnimation 1.4s infinite ease-in-out;
}
.typing-dot:nth-child(1) {
animation-delay: 0s;
}
.typing-dot:nth-child(2) {
animation-delay: 0.2s;
}
.typing-dot:nth-child(3) {
animation-delay: 0.4s;
}
@keyframes typingAnimation {
0%, 60%, 100% {
transform: translateY(0);
}
30% {
transform: translateY(-5px);
}
}
</style>
</head>
<body class="bg-gray-100 h-screen flex items-center justify-center">
<div class="container mx-auto bg-white rounded-lg shadow-xl overflow-hidden" style="width: 90%; max-width: 1400px; height: 90vh;">
<div class="flex h-full">
<!-- Sidebar -->
<div class="w-1/3 border-r border-gray-200 bg-gray-50 flex flex-col">
<!-- Header -->
<div class="p-4 bg-gray-100 flex justify-between items-center border-b border-gray-200">
<div class="flex items-center">
<img src="https://ui-avatars.com/api/?name=User+Name" alt="Profile" class="w-10 h-10 rounded-full">
<span class="ml-3 font-semibold">My Profile</span>
</div>
<div class="flex space-x-4 text-gray-500">
<button class="hover:text-gray-700">
<i class="fas fa-users"></i>
</button>
<button class="hover:text-gray-700">
<i class="fas fa-comment-dots"></i>
</button>
<button class="hover:text-gray-700">
<i class="fas fa-ellipsis-v"></i>
</button>
</div>
</div>
<!-- Search -->
<div class="p-3 bg-white">
<div class="relative">
<input type="text" placeholder="Search or start new chat" class="w-full py-2 px-4 pl-10 bg-gray-100 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500">
<i class="fas fa-search absolute left-3 top-3 text-gray-400"></i>
</div>
</div>
<!-- Chat list -->
<div class="flex-1 overflow-y-auto custom-scrollbar">
<!-- Chat item -->
<div class="flex items-center p-3 border-b border-gray-100 hover:bg-gray-100 cursor-pointer bg-blue-50">
<div class="relative">
<img src="https://ui-avatars.com/api/?name=John+Doe" alt="Profile" class="w-12 h-12 rounded-full">
<span class="online-indicator"></span>
</div>
<div class="ml-3 flex-1">
<div class="flex justify-between items-center">
<span class="font-semibold">John Doe</span>
<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-blue-500 text-white rounded-full w-5 h-5 flex items-center justify-center text-xs">3</span>
</div>
</div>
</div>
<!-- Group chat item -->
<div class="flex items-center p-3 border-b border-gray-100 hover:bg-gray-100 cursor-pointer">
<div class="relative">
<div class="w-12 h-12 rounded-full bg-purple-100 flex items-center justify-center">
<i class="fas fa-users text-purple-500"></i>
</div>
</div>
<div class="ml-3 flex-1">
<div class="flex justify-between items-center">
<span class="font-semibold">Dev Team</span>
<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">Meeting at 3 PM tomorrow</p>
<span class="bg-blue-500 text-white rounded-full w-5 h-5 flex items-center justify-center text-xs">1</span>
</div>
</div>
</div>
<!-- More chat items -->
<div class="flex items-center p-3 border-b border-gray-100 hover:bg-gray-100 cursor-pointer">
<div class="relative">
<img src="https://ui-avatars.com/api/?name=Jane+Smith" alt="Profile" class="w-12 h-12 rounded-full">
</div>
<div class="ml-3 flex-1">
<div class="flex justify-between items-center">
<span class="font-semibold">Jane Smith</span>
<span class="text-xs text-gray-500">Monday</span>
</div>
<div class="flex justify-between items-center">
<p class="text-sm text-gray-600 truncate">Did you see the new design?</p>
</div>
</div>
</div>
<!-- Chat with typing indicator -->
<div class="flex items-center p-3 border-b border-gray-100 hover:bg-gray-100 cursor-pointer">
<div class="relative">
<img src="https://ui-avatars.com/api/?name=Mike+Johnson" alt="Profile" class="w-12 h-12 rounded-full">
<span class="online-indicator"></span>
</div>
<div class="ml-3 flex-1">
<div class="flex justify-between items-center">
<span class="font-semibold">Mike Johnson</span>
<span class="text-xs text-gray-500">Just now</span>
</div>
<div class="flex items-center">
<div class="typing-indicator">
<div class="typing-dot"></div>
<div class="typing-dot"></div>
<div class="typing-dot"></div>
</div>
<span class="text-sm text-gray-500 ml-2">typing...</span>
</div>
</div>
</div>
</div>
</div>
<!-- Chat area -->
<div class="flex-1 flex flex-col">
<!-- Chat header -->
<div class="p-4 bg-gray-100 flex justify-between items-center border-b border-gray-200">
<div class="flex items-center">
<img src="https://ui-avatars.com/api/?name=John+Doe" alt="Profile" class="w-10 h-10 rounded-full">
<div class="ml-3">
<div class="font-semibold">John Doe</div>
<div class="text-xs text-gray-500 flex items-center">
<span class="w-2 h-2 rounded-full bg-green-500 mr-1"></span>
<span>online</span>
</div>
</div>
</div>
<div class="flex space-x-4 text-gray-500">
<button class="hover:text-gray-700">
<i class="fas fa-phone"></i>
</button>
<button class="hover:text-gray-700">
<i class="fas fa-video"></i>
</button>
<button class="hover:text-gray-700">
<i class="fas fa-search"></i>
</button>
<button class="hover:text-gray-700">
<i class="fas fa-ellipsis-v"></i>
</button>
</div>
</div>
<!-- Messages -->
<div class="flex-1 p-4 overflow-y-auto custom-scrollbar bg-gray-50" id="messages-container">
<!-- Date divider -->
<div class="flex justify-center my-4">
<div class="bg-gray-200 text-xs text-gray-600 px-2 py-1 rounded-full">Today</div>
</div>
<!-- Incoming message -->
<div class="flex mb-4 new-message">
<img src="https://ui-avatars.com/api/?name=John+Doe" alt="Profile" class="w-8 h-8 rounded-full mr-2">
<div>
<div class="bg-white p-3 rounded-lg shadow-sm max-w-xs lg:max-w-md">
<p>Hey there! How are you doing?</p>
</div>
<div class="text-xs text-gray-500 mt-1">10:30 AM</div>
</div>
</div>
<!-- Outgoing message -->
<div class="flex justify-end mb-4 new-message">
<div class="text-right">
<div class="bg-blue-500 text-white p-3 rounded-lg shadow-sm max-w-xs lg:max-w-md">
<p>I'm good, thanks! Just working on that new project.</p>
</div>
<div class="text-xs text-gray-500 mt-1 flex items-center justify-end">
10:32 AM
<i class="fas fa-check-double text-blue-500 ml-1"></i>
</div>
</div>
</div>
<!-- Incoming message with image -->
<div class="flex mb-4 new-message">
<img src="https://ui-avatars.com/api/?name=John+Doe" alt="Profile" class="w-8 h-8 rounded-full mr-2">
<div>
<div class="bg-white p-1 rounded-lg shadow-sm max-w-xs">
<img src="https://images.unsplash.com/photo-1682686580391-615b4f716f2b?ixlib=rb-4.0.3&ixid=M3wxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1170&q=80" alt="Shared image" class="rounded-lg w-full">
</div>
<div class="text-xs text-gray-500 mt-1">10:33 AM</div>
</div>
</div>
<!-- Outgoing message with document -->
<div class="flex justify-end mb-4 new-message">
<div class="text-right">
<div class="bg-blue-500 text-white p-2 rounded-lg shadow-sm max-w-xs">
<div class="flex items-center p-2">
<i class="fas fa-file-pdf text-2xl mr-2"></i>
<div>
<div class="font-medium">Project_Proposal.pdf</div>
<div class="text-xs">2.4 MB</div>
</div>
</div>
</div>
<div class="text-xs text-gray-500 mt-1 flex items-center justify-end">
10:35 AM
<i class="fas fa-check-double text-blue-500 ml-1"></i>
</div>
</div>
</div>
<!-- Incoming voice message -->
<div class="flex mb-4 new-message">
<img src="https://ui-avatars.com/api/?name=John+Doe" alt="Profile" class="w-8 h-8 rounded-full mr-2">
<div>
<div class="bg-white p-3 rounded-lg shadow-sm max-w-xs flex items-center">
<button class="w-8 h-8 rounded-full bg-blue-100 text-blue-500 flex items-center justify-center mr-2">
<i class="fas fa-play"></i>
</button>
<div class="flex-1">
<div class="h-1 bg-gray-200 rounded-full mb-1">
<div class="h-1 bg-blue-500 rounded-full" style="width: 60%;"></div>
</div>
<div class="text-xs text-gray-500">0:12 / 0:45</div>
</div>
</div>
<div class="text-xs text-gray-500 mt-1">10:36 AM</div>
</div>
</div>
<!-- Typing indicator -->
<div class="flex mb-4">
<img src="https://ui-avatars.com/api/?name=John+Doe" alt="Profile" class="w-8 h-8 rounded-full mr-2">
<div class="bg-white p-3 rounded-lg shadow-sm">
<div class="typing-indicator">
<div class="typing-dot"></div>
<div class="typing-dot"></div>
<div class="typing-dot"></div>
</div>
</div>
</div>
</div>
<!-- Message input -->
<div class="p-3 bg-gray-100 border-t border-gray-200">
<div class="flex items-center">
<button class="w-10 h-10 rounded-full text-gray-500 hover:text-gray-700 hover:bg-gray-200 flex items-center justify-center">
<i class="fas fa-paperclip"></i>
</button>
<button class="w-10 h-10 rounded-full text-gray-500 hover:text-gray-700 hover:bg-gray-200 flex items-center justify-center">
<i class="fas fa-image"></i>
</button>
<button class="w-10 h-10 rounded-full text-gray-500 hover:text-gray-700 hover:bg-gray-200 flex items-center justify-center">
<i class="fas fa-microphone"></i>
</button>
<div class="flex-1 mx-2">
<input type="text" placeholder="Type a message" class="w-full py-2 px-4 bg-white rounded-full focus:outline-none focus:ring-2 focus:ring-blue-500">
</div>
<button class="w-10 h-10 rounded-full bg-blue-500 text-white hover:bg-blue-600 flex items-center justify-center">
<i class="fas fa-paper-plane"></i>
</button>
</div>
</div>
</div>
<!-- Right sidebar (optional) -->
<div class="w-1/4 border-l border-gray-200 bg-white hidden lg:flex flex-col">
<!-- Profile header -->
<div class="p-4 bg-gray-100 border-b border-gray-200">
<div class="flex justify-between items-center">
<h3 class="font-semibold">Contact Info</h3>
<button class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times"></i>
</button>
</div>
</div>
<!-- Profile content -->
<div class="flex-1 overflow-y-auto custom-scrollbar p-4">
<div class="flex flex-col items-center mb-6">
<img src="https://ui-avatars.com/api/?name=John+Doe" alt="Profile" class="w-24 h-24 rounded-full mb-3">
<h3 class="font-semibold text-lg">John Doe</h3>
<p class="text-gray-500 text-sm">Software Developer</p>
<div class="flex mt-3 space-x-4">
<button class="w-10 h-10 rounded-full bg-blue-100 text-blue-500 hover:bg-blue-200 flex items-center justify-center">
<i class="fas fa-phone"></i>
</button>
<button class="w-10 h-10 rounded-full bg-green-100 text-green-500 hover:bg-green-200 flex items-center justify-center">
<i class="fas fa-video"></i>
</button>
<button class="w-10 h-10 rounded-full bg-purple-100 text-purple-500 hover:bg-purple-200 flex items-center justify-center">
<i class="fas fa-search"></i>
</button>
</div>
</div>
<div class="mb-6">
<h4 class="font-medium text-gray-700 mb-2">About</h4>
<p class="text-sm text-gray-600">Hey there! I'm using ChatApp to stay connected with friends and colleagues.</p>
</div>
<div class="mb-6">
<h4 class="font-medium text-gray-700 mb-2">Media, links, and docs</h4>
<div class="grid grid-cols-3 gap-2">
<div class="aspect-square bg-gray-100 rounded-lg overflow-hidden">
<img src="https://images.unsplash.com/photo-1682686580391-615b4f716f2b?ixlib=rb-4.0.3&ixid=M3wxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1170&q=80" alt="Media" class="w-full h-full object-cover">
</div>
<div class="aspect-square bg-gray-100 rounded-lg flex items-center justify-center">
<i class="fas fa-file-pdf text-3xl text-red-500"></i>
</div>
<div class="aspect-square bg-gray-100 rounded-lg overflow-hidden">
<img src="https://images.unsplash.com/photo-1682686580391-615b4f716f2b?ixlib=rb-4.0.3&ixid=M3wxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1170&q=80" alt="Media" class="w-full h-full object-cover">
</div>
</div>
<button class="text-blue-500 text-sm mt-2 hover:underline">Show all</button>
</div>
<div>
<h4 class="font-medium text-gray-700 mb-2">Group members (4)</h4>
<div class="space-y-3">
<div class="flex items-center">
<img src="https://ui-avatars.com/api/?name=John+Doe" alt="Profile" class="w-8 h-8 rounded-full mr-2">
<span>John Doe</span>
<span class="ml-auto text-xs text-gray-500">Admin</span>
</div>
<div class="flex items-center">
<img src="https://ui-avatars.com/api/?name=Jane+Smith" alt="Profile" class="w-8 h-8 rounded-full mr-2">
<span>Jane Smith</span>
</div>
<div class="flex items-center">
<img src="https://ui-avatars.com/api/?name=Mike+Johnson" alt="Profile" class="w-8 h-8 rounded-full mr-2">
<span>Mike Johnson</span>
</div>
<div class="flex items-center">
<img src="https://ui-avatars.com/api/?name=Sarah+Williams" alt="Profile" class="w-8 h-8 rounded-full mr-2">
<span>Sarah Williams</span>
</div>
</div>
</div>
</div>
<!-- Group actions -->
<div class="p-4 border-t border-gray-200">
<button class="w-full py-2 px-4 bg-red-100 text-red-500 rounded-lg hover:bg-red-200 flex items-center justify-center">
<i class="fas fa-sign-out-alt mr-2"></i>
<span>Exit Group</span>
</button>
</div>
</div>
</div>
</div>
<script>
// Simulate new messages
function addNewMessage() {
const messages = [
{
type: 'incoming',
text: 'Have you seen the latest updates?',
time: '10:40 AM'
},
{
type: 'outgoing',
text: 'Not yet, I\'ll check them out soon.',
time: '10:41 AM'
},
{
type: 'incoming',
text: 'Great! Let me know what you think.',
time: '10:42 AM'
}
];
const container = document.getElementById('messages-container');
messages.forEach((msg, index) => {
setTimeout(() => {
const messageDiv = document.createElement('div');
messageDiv.className = `flex ${msg.type === 'outgoing' ? 'justify-end' : ''} mb-4 new-message`;
if (msg.type === 'incoming') {
messageDiv.innerHTML = `
<img src="https://ui-avatars.com/api/?name=John+Doe" alt="Profile" class="w-8 h-8 rounded-full mr-2">
<div>
<div class="bg-white p-3 rounded-lg shadow-sm max-w-xs lg:max-w-md">
<p>${msg.text}</p>
</div>
<div class="text-xs text-gray-500 mt-1">${msg.time}</div>
</div>
`;
} else {
messageDiv.innerHTML = `
<div class="text-right">
<div class="bg-blue-500 text-white p-3 rounded-lg shadow-sm max-w-xs lg:max-w-md">
<p>${msg.text}</p>
</div>
<div class="text-xs text-gray-500 mt-1 flex items-center justify-end">
${msg.time}
<i class="fas fa-check-double text-blue-500 ml-1"></i>
</div>
</div>
`;
}
container.appendChild(messageDiv);
// Scroll to bottom
container.scrollTop = container.scrollHeight;
}, (index + 1) * 1500);
});
}
// Simulate typing indicator
function showTypingIndicator() {
const container = document.getElementById('messages-container');
const typingDiv = document.createElement('div');
typingDiv.className = 'flex mb-4';
typingDiv.innerHTML = `
<img src="https://ui-avatars.com/api/?name=John+Doe" alt="Profile" class="w-8 h-8 rounded-full mr-2">
<div class="bg-white p-3 rounded-lg shadow-sm">
<div class="typing-indicator">
<div class="typing-dot"></div>
<div class="typing-dot"></div>
<div class="typing-dot"></div>
</div>
</div>
`;
container.appendChild(typingDiv);
container.scrollTop = container.scrollHeight;
// Remove after 3 seconds
setTimeout(() => {
typingDiv.remove();
}, 3000);
}
// Add event listeners
document.addEventListener('DOMContentLoaded', () => {
// Simulate incoming messages after page load
setTimeout(addNewMessage, 2000);
// Simulate typing indicator
setTimeout(showTypingIndicator, 5000);
// Message input functionality
const messageInput = document.querySelector('.p-3.bg-gray-100 input[type="text"]');
const sendButton = document.querySelector('.p-3.bg-gray-100 button.bg-blue-500');
sendButton.addEventListener('click', () => {
if (messageInput.value.trim() !== '') {
sendMessage(messageInput.value);
messageInput.value = '';
}
});
messageInput.addEventListener('keypress', (e) => {
if (e.key === 'Enter' && messageInput.value.trim() !== '') {
sendMessage(messageInput.value);
messageInput.value = '';
}
});
});
function sendMessage(text) {
const container = document.getElementById('messages-container');
const now = new Date();
const timeString = now.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
const messageDiv = document.createElement('div');
messageDiv.className = 'flex justify-end mb-4 new-message';
messageDiv.innerHTML = `
<div class="text-right">
<div class="bg-blue-500 text-white p-3 rounded-lg shadow-sm max-w-xs lg:max-w-md">
<p>${text}</p>
</div>
<div class="text-xs text-gray-500 mt-1 flex items-center justify-end">
${timeString}
<i class="fas fa-check ml-1"></i>
</div>
</div>
`;
container.appendChild(messageDiv);
container.scrollTop = container.scrollHeight;
// Simulate reply after 1 second
setTimeout(() => {
showTypingIndicator();
setTimeout(() => {
const replies = [
"Got it!",
"Thanks for letting me know.",
"I'll get back to you on that.",
"Sounds good!",
"Let me check and confirm."
];
const randomReply = replies[Math.floor(Math.random() * replies.length)];
const now = new Date();
const timeString = now.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
const replyDiv = document.createElement('div');
replyDiv.className = 'flex mb-4 new-message';
replyDiv.innerHTML = `
<img src="https://ui-avatars.com/api/?name=John+Doe" alt="Profile" class="w-8 h-8 rounded-full mr-2">
<div>
<div class="bg-white p-3 rounded-lg shadow-sm max-w-xs lg:max-w-md">
<p>${randomReply}</p>
</div>
<div class="text-xs text-gray-500 mt-1">${timeString}</div>
</div>
`;
container.appendChild(replyDiv);
container.scrollTop = container.scrollHeight;
}, 2000);
}, 1000);
}
</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=kingpbaz/ozatech" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>