Spaces:
Running
Running
Download index.html from jdjdjejkdje/python-whatsapp-py: direct link, hf CLI and curl.
- Browser
- Download file 25.8 kB
-
https://huggingface.co/spaces/jdjdjejkdje/python-whatsapp-py/resolve/main/index.html
- Command line
-
hf download hf://spaces/jdjdjejkdje/python-whatsapp-py/index.html
-
curl -L -o index.html https://huggingface.co/spaces/jdjdjejkdje/python-whatsapp-py/resolve/main/index.html
25.8 kB
| <html lang="ar" dir="rtl"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>تطبيق الدردشة - تواصل بدون رقم هاتف</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> | |
| @import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700&display=swap'); | |
| body { | |
| font-family: 'Tajawal', sans-serif; | |
| background-color: #f0f2f5; | |
| } | |
| .chat-bubble { | |
| max-width: 70%; | |
| border-radius: 18px; | |
| position: relative; | |
| padding: 12px 16px; | |
| margin-bottom: 8px; | |
| word-wrap: break-word; | |
| } | |
| .chat-bubble.sent { | |
| background-color: #dcf8c6; | |
| align-self: flex-end; | |
| border-bottom-left-radius: 0; | |
| } | |
| .chat-bubble.received { | |
| background-color: white; | |
| align-self: flex-start; | |
| border-bottom-right-radius: 0; | |
| } | |
| .typing-indicator { | |
| display: flex; | |
| padding: 10px; | |
| } | |
| .typing-dot { | |
| width: 8px; | |
| height: 8px; | |
| background-color: #999; | |
| 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); | |
| } | |
| } | |
| .slide-up { | |
| animation: slideUp 0.3s ease-out forwards; | |
| } | |
| @keyframes slideUp { | |
| from { | |
| transform: translateY(100%); | |
| opacity: 0; | |
| } | |
| to { | |
| transform: translateY(0); | |
| opacity: 1; | |
| } | |
| } | |
| .ripple { | |
| position: absolute; | |
| border-radius: 50%; | |
| background-color: rgba(255, 255, 255, 0.4); | |
| transform: scale(0); | |
| animation: ripple 0.6s linear; | |
| pointer-events: none; | |
| } | |
| @keyframes ripple { | |
| to { | |
| transform: scale(4); | |
| opacity: 0; | |
| } | |
| } | |
| /* RTL adjustments */ | |
| .rtl-input { | |
| direction: rtl; | |
| text-align: right; | |
| } | |
| .rtl-text { | |
| direction: rtl; | |
| } | |
| </style> | |
| </head> | |
| <body class="h-screen flex flex-col bg-gray-100"> | |
| <!-- Auth Screen --> | |
| <div id="auth-screen" class="fixed inset-0 bg-white z-50 flex flex-col items-center justify-center p-6 slide-up"> | |
| <div class="w-full max-w-md"> | |
| <div class="text-center mb-8"> | |
| <div class="w-20 h-20 bg-green-500 rounded-full flex items-center justify-center mx-auto mb-4"> | |
| <i class="fas fa-comments text-white text-3xl"></i> | |
| </div> | |
| <h1 class="text-3xl font-bold text-gray-800 mb-2">تطبيق الدردشة</h1> | |
| <p class="text-gray-600">تواصل مع الأصدقاء بدون مشاركة رقم هاتفك</p> | |
| </div> | |
| <div class="bg-white rounded-lg shadow-sm p-6 mb-6"> | |
| <div class="mb-4"> | |
| <label class="block text-gray-700 text-sm font-medium mb-2" for="username"> | |
| اختر اسم مستخدم | |
| </label> | |
| <input id="username" type="text" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-green-500 focus:border-transparent rtl-input" placeholder="مستخدم_123"> | |
| </div> | |
| <div class="mb-6"> | |
| <label class="block text-gray-700 text-sm font-medium mb-2" for="password"> | |
| أنشئ كلمة مرور | |
| </label> | |
| <input id="password" type="password" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-green-500 focus:border-transparent" placeholder="••••••••"> | |
| </div> | |
| <button id="signup-btn" class="w-full bg-green-500 hover:bg-green-600 text-white font-medium py-3 px-4 rounded-lg transition duration-200 flex items-center justify-center relative overflow-hidden"> | |
| <span class="relative z-10">إنشاء حساب</span> | |
| </button> | |
| </div> | |
| <div class="text-center text-sm text-gray-500"> | |
| لديك حساب بالفعل؟ <a href="#" id="login-link" class="text-green-500 font-medium">تسجيل الدخول</a> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Login Screen (hidden initially) --> | |
| <div id="login-screen" class="fixed inset-0 bg-white z-50 flex flex-col items-center justify-center p-6 hidden"> | |
| <div class="w-full max-w-md"> | |
| <div class="text-center mb-8"> | |
| <div class="w-20 h-20 bg-green-500 rounded-full flex items-center justify-center mx-auto mb-4"> | |
| <i class="fas fa-comments text-white text-3xl"></i> | |
| </div> | |
| <h1 class="text-3xl font-bold text-gray-800 mb-2">تسجيل الدخول</h1> | |
| <p class="text-gray-600">أدخل بياناتك للوصول إلى حسابك</p> | |
| </div> | |
| <div class="bg-white rounded-lg shadow-sm p-6 mb-6"> | |
| <div class="mb-4"> | |
| <label class="block text-gray-700 text-sm font-medium mb-2" for="login-username"> | |
| اسم المستخدم | |
| </label> | |
| <input id="login-username" type="text" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-green-500 focus:border-transparent rtl-input" placeholder="مستخدم_123"> | |
| </div> | |
| <div class="mb-6"> | |
| <label class="block text-gray-700 text-sm font-medium mb-2" for="login-password"> | |
| كلمة المرور | |
| </label> | |
| <input id="login-password" type="password" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-green-500 focus:border-transparent" placeholder="••••••••"> | |
| </div> | |
| <button id="login-btn" class="w-full bg-green-500 hover:bg-green-600 text-white font-medium py-3 px-4 rounded-lg transition duration-200 flex items-center justify-center relative overflow-hidden"> | |
| <span class="relative z-10">تسجيل الدخول</span> | |
| </button> | |
| </div> | |
| <div class="text-center text-sm text-gray-500"> | |
| ليس لديك حساب؟ <a href="#" id="signup-link" class="text-green-500 font-medium">إنشاء حساب</a> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Main App Container (hidden initially) --> | |
| <div id="app-container" class="flex flex-col h-full hidden"> | |
| <!-- Header --> | |
| <header class="bg-green-500 text-white p-4 shadow-md"> | |
| <div class="flex items-center justify-between"> | |
| <div class="flex items-center"> | |
| <button id="menu-btn" class="ml-4 focus:outline-none"> | |
| <i class="fas fa-bars text-xl"></i> | |
| </button> | |
| <h1 class="text-xl font-semibold">المحادثات</h1> | |
| </div> | |
| <div class="flex items-center space-x-4"> | |
| <button id="search-btn" class="focus:outline-none"> | |
| <i class="fas fa-search text-xl"></i> | |
| </button> | |
| <button id="more-btn" class="focus:outline-none"> | |
| <i class="fas fa-ellipsis-vertical text-xl"></i> | |
| </button> | |
| </div> | |
| </div> | |
| </header> | |
| <!-- Main Content --> | |
| <main class="flex-1 overflow-hidden flex"> | |
| <!-- Sidebar (hidden on mobile) --> | |
| <aside id="sidebar" class="hidden md:block w-64 bg-white border-l border-gray-200 flex flex-col"> | |
| <div class="p-4 border-b border-gray-200"> | |
| <div class="flex items-center"> | |
| <div class="w-10 h-10 rounded-full bg-gray-300 flex items-center justify-center ml-3"> | |
| <i class="fas fa-user text-gray-600"></i> | |
| </div> | |
| <div> | |
| <p class="font-medium" id="sidebar-username">اسم المستخدم</p> | |
| <p class="text-xs text-gray-500">متصل</p> | |
| </div> | |
| </div> | |
| </div> | |
| <nav class="flex-1 overflow-y-auto"> | |
| <a href="#" class="block px-4 py-3 text-gray-700 hover:bg-gray-100 flex items-center"> | |
| <i class="fas fa-inbox ml-3 text-gray-500"></i> | |
| <span>المحادثات</span> | |
| </a> | |
| <a href="#" class="block px-4 py-3 text-gray-700 hover:bg-gray-100 flex items-center"> | |
| <i class="fas fa-users ml-3 text-gray-500"></i> | |
| <span>جهات الاتصال</span> | |
| </a> | |
| <a href="#" class="block px-4 py-3 text-gray-700 hover:bg-gray-100 flex items-center"> | |
| <i class="fas fa-cog ml-3 text-gray-500"></i> | |
| <span>الإعدادات</span> | |
| </a> | |
| </nav> | |
| <div class="p-4 border-t border-gray-200"> | |
| <button id="logout-btn" class="w-full bg-gray-100 hover:bg-gray-200 text-gray-800 py-2 px-4 rounded-lg transition duration-200"> | |
| <i class="fas fa-sign-out-alt ml-2"></i> تسجيل الخروج | |
| </button> | |
| </div> | |
| </aside> | |
| <!-- Chat Area --> | |
| <div class="flex-1 flex flex-col"> | |
| <!-- Chat Header --> | |
| <div class="bg-white p-4 border-b border-gray-200 flex items-center"> | |
| <button id="back-btn" class="md:hidden mr-3 focus:outline-none"> | |
| <i class="fas fa-arrow-left text-xl"></i> | |
| </button> | |
| <div class="w-10 h-10 rounded-full bg-purple-500 text-white flex items-center justify-center ml-3"> | |
| <span>أح</span> | |
| </div> | |
| <div> | |
| <p class="font-medium">أحمد محمد</p> | |
| <p class="text-xs text-gray-500">متصل</p> | |
| </div> | |
| <div class="mr-auto flex space-x-3"> | |
| <button id="call-btn" class="focus:outline-none"> | |
| <i class="fas fa-phone text-gray-600"></i> | |
| </button> | |
| <button id="video-btn" class="focus:outline-none"> | |
| <i class="fas fa-video text-gray-600"></i> | |
| </button> | |
| </div> | |
| </div> | |
| <!-- Messages --> | |
| <div id="chat-messages" class="flex-1 overflow-y-auto p-4 bg-gray-100 rtl-text"> | |
| <div class="text-center text-gray-500 text-sm mb-4"> | |
| اليوم الساعة 10:30 ص | |
| </div> | |
| <div class="flex flex-col space-y-2"> | |
| <div class="chat-bubble received"> | |
| مرحباً! كيف حالك؟ | |
| <div class="text-xs text-gray-500 mt-1 text-left">10:31 ص</div> | |
| </div> | |
| <div class="chat-bubble sent"> | |
| أنا بخير! فقط أجرب تطبيق المراسلة الجديد هذا. | |
| <div class="text-xs text-gray-500 mt-1 text-left">10:32 ص</div> | |
| </div> | |
| <div class="chat-bubble received"> | |
| جميل! أحب أننا لسنا بحاجة لأرقام الهواتف للتواصل. | |
| <div class="text-xs text-gray-500 mt-1 text-left">10:33 ص</div> | |
| </div> | |
| <div class="chat-bubble sent"> | |
| نعم، إنها طريقة أكثر خصوصية. ما رأيك في التصميم؟ | |
| <div class="text-xs text-gray-500 mt-1 text-left">10:34 ص</div> | |
| </div> | |
| <div class="chat-bubble received"> | |
| <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="bg-white p-3 border-t border-gray-200"> | |
| <div class="flex items-center"> | |
| <button id="attach-btn" class="w-10 h-10 rounded-full bg-gray-100 flex items-center justify-center ml-2 focus:outline-none"> | |
| <i class="fas fa-plus text-gray-600"></i> | |
| </button> | |
| <div class="flex-1 bg-gray-100 rounded-full flex items-center px-4"> | |
| <input id="message-input" type="text" placeholder="اكتب رسالة..." class="flex-1 bg-transparent py-2 focus:outline-none rtl-input"> | |
| <button id="emoji-btn" class="w-8 h-8 rounded-full bg-gray-200 flex items-center justify-center mr-2 focus:outline-none"> | |
| <i class="fas fa-smile text-gray-600"></i> | |
| </button> | |
| </div> | |
| <button id="send-btn" class="w-10 h-10 rounded-full bg-green-500 text-white flex items-center justify-center mr-2 focus:outline-none"> | |
| <i class="fas fa-paper-plane"></i> | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </main> | |
| </div> | |
| <script> | |
| // Ripple effect for buttons | |
| function createRipple(event) { | |
| const button = event.currentTarget; | |
| const circle = document.createElement("span"); | |
| const diameter = Math.max(button.clientWidth, button.clientHeight); | |
| const radius = diameter / 2; | |
| circle.style.width = circle.style.height = `${diameter}px`; | |
| circle.style.left = `${event.clientX - button.getBoundingClientRect().left - radius}px`; | |
| circle.style.top = `${event.clientY - button.getBoundingClientRect().top - radius}px`; | |
| circle.classList.add("ripple"); | |
| const ripple = button.getElementsByClassName("ripple")[0]; | |
| if (ripple) { | |
| ripple.remove(); | |
| } | |
| button.appendChild(circle); | |
| } | |
| // Add ripple effects to all buttons | |
| document.querySelectorAll('button').forEach(button => { | |
| button.addEventListener('click', createRipple); | |
| }); | |
| // DOM Elements | |
| const authScreen = document.getElementById('auth-screen'); | |
| const loginScreen = document.getElementById('login-screen'); | |
| const appContainer = document.getElementById('app-container'); | |
| const signupBtn = document.getElementById('signup-btn'); | |
| const loginBtn = document.getElementById('login-btn'); | |
| const loginLink = document.getElementById('login-link'); | |
| const signupLink = document.getElementById('signup-link'); | |
| const logoutBtn = document.getElementById('logout-btn'); | |
| const menuBtn = document.getElementById('menu-btn'); | |
| const sidebar = document.getElementById('sidebar'); | |
| const backBtn = document.getElementById('back-btn'); | |
| const sendBtn = document.getElementById('send-btn'); | |
| const messageInput = document.getElementById('message-input'); | |
| const chatMessages = document.getElementById('chat-messages'); | |
| // Switch between signup and login screens | |
| loginLink.addEventListener('click', function(e) { | |
| e.preventDefault(); | |
| authScreen.style.display = 'none'; | |
| loginScreen.classList.remove('hidden'); | |
| }); | |
| signupLink.addEventListener('click', function(e) { | |
| e.preventDefault(); | |
| loginScreen.classList.add('hidden'); | |
| authScreen.style.display = 'flex'; | |
| }); | |
| // Handle sign up | |
| signupBtn.addEventListener('click', function() { | |
| const username = document.getElementById('username').value; | |
| const password = document.getElementById('password').value; | |
| if (username && password) { | |
| // Update sidebar username | |
| document.getElementById('sidebar-username').textContent = username; | |
| // Hide auth screen and show app | |
| authScreen.style.display = 'none'; | |
| appContainer.classList.remove('hidden'); | |
| // Simulate typing indicator | |
| simulateTyping(); | |
| } else { | |
| alert('الرجاء إدخال اسم المستخدم وكلمة المرور'); | |
| } | |
| }); | |
| // Handle login | |
| loginBtn.addEventListener('click', function() { | |
| const username = document.getElementById('login-username').value; | |
| const password = document.getElementById('login-password').value; | |
| if (username && password) { | |
| // Update sidebar username | |
| document.getElementById('sidebar-username').textContent = username; | |
| // Hide login screen and show app | |
| loginScreen.classList.add('hidden'); | |
| appContainer.classList.remove('hidden'); | |
| // Simulate typing indicator | |
| simulateTyping(); | |
| } else { | |
| alert('الرجاء إدخال اسم المستخدم وكلمة المرور'); | |
| } | |
| }); | |
| // Handle logout | |
| logoutBtn.addEventListener('click', function() { | |
| appContainer.classList.add('hidden'); | |
| authScreen.style.display = 'flex'; | |
| }); | |
| // Mobile menu toggle | |
| menuBtn.addEventListener('click', function() { | |
| sidebar.classList.remove('hidden'); | |
| }); | |
| backBtn.addEventListener('click', function() { | |
| sidebar.classList.add('hidden'); | |
| }); | |
| // Send message | |
| sendBtn.addEventListener('click', function() { | |
| sendMessage(); | |
| }); | |
| // Send message on Enter key | |
| messageInput.addEventListener('keypress', function(e) { | |
| if (e.key === 'Enter') { | |
| sendMessage(); | |
| } | |
| }); | |
| // Simulate received message after typing | |
| function simulateTyping() { | |
| setTimeout(() => { | |
| const typingIndicator = document.querySelector('.typing-indicator'); | |
| if (typingIndicator) { | |
| typingIndicator.innerHTML = ` | |
| أعتقد أنه يبدو رائعاً! الواجهة نظيفة وعصرية. | |
| <div class="text-xs text-gray-500 mt-1 text-left">10:35 ص</div> | |
| `; | |
| typingIndicator.classList.remove('typing-indicator'); | |
| typingIndicator.classList.add('chat-bubble', 'received'); | |
| // Auto-scroll to bottom | |
| chatMessages.scrollTop = chatMessages.scrollHeight; | |
| } | |
| }, 2000); | |
| } | |
| // Send message function | |
| function sendMessage() { | |
| const messageText = messageInput.value.trim(); | |
| if (messageText) { | |
| // Create message element | |
| const messageDiv = document.createElement('div'); | |
| messageDiv.className = 'chat-bubble sent'; | |
| messageDiv.innerHTML = ` | |
| ${messageText} | |
| <div class="text-xs text-gray-500 mt-1 text-left">${getCurrentTime()}</div> | |
| `; | |
| // Add message to chat | |
| chatMessages.querySelector('.flex.flex-col.space-y-2').appendChild(messageDiv); | |
| // Clear input | |
| messageInput.value = ''; | |
| // Scroll to bottom | |
| chatMessages.scrollTop = chatMessages.scrollHeight; | |
| // Simulate reply after 1 second | |
| setTimeout(() => { | |
| const replyDiv = document.createElement('div'); | |
| replyDiv.className = 'chat-bubble received'; | |
| replyDiv.innerHTML = ` | |
| <div class="typing-indicator"> | |
| <div class="typing-dot"></div> | |
| <div class="typing-dot"></div> | |
| <div class="typing-dot"></div> | |
| </div> | |
| `; | |
| chatMessages.querySelector('.flex.flex-col.space-y-2').appendChild(replyDiv); | |
| chatMessages.scrollTop = chatMessages.scrollHeight; | |
| // Replace typing indicator with actual message after 2 seconds | |
| setTimeout(() => { | |
| replyDiv.innerHTML = ` | |
| لقد تلقيت رسالتك! | |
| <div class="text-xs text-gray-500 mt-1 text-left">${getCurrentTime()}</div> | |
| `; | |
| replyDiv.classList.remove('typing-indicator'); | |
| chatMessages.scrollTop = chatMessages.scrollHeight; | |
| }, 2000); | |
| }, 1000); | |
| } | |
| } | |
| // Get current time in 12-hour format | |
| function getCurrentTime() { | |
| const now = new Date(); | |
| let hours = now.getHours(); | |
| const minutes = now.getMinutes().toString().padStart(2, '0'); | |
| const ampm = hours >= 12 ? 'م' : 'ص'; | |
| hours = hours % 12; | |
| hours = hours ? hours : 12; // the hour '0' should be '12' | |
| return `${hours}:${minutes} ${ampm}`; | |
| } | |
| // Button click handlers | |
| document.getElementById('search-btn').addEventListener('click', function() { | |
| alert('سيتم تنفيذ البحث هنا'); | |
| }); | |
| document.getElementById('more-btn').addEventListener('click', function() { | |
| alert('سيتم عرض المزيد من الخيارات هنا'); | |
| }); | |
| document.getElementById('call-btn').addEventListener('click', function() { | |
| alert('سيتم بدء مكالمة صوتية'); | |
| }); | |
| document.getElementById('video-btn').addEventListener('click', function() { | |
| alert('سيتم بدء مكالمة فيديو'); | |
| }); | |
| document.getElementById('attach-btn').addEventListener('click', function() { | |
| alert('سيتم عرض خيارات إرفاق الملفات'); | |
| }); | |
| document.getElementById('emoji-btn').addEventListener('click', function() { | |
| alert('سيتم عرض لوحة الرموز التعبيرية'); | |
| }); | |
| </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=jdjdjejkdje/python-whatsapp-py" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> | |
| </html> |