Spaces:
Running
Running
Create an online chat forum
Browse filesFiles changed (6)
- README.md+8-5
- components/navbar.jsAdded+65
- components/sidebar.jsAdded+63
- index.html+102-19
- script.jsAdded+100
- style.css+32-18
12345234567891011101213---title: Chatterbox Havenemoji: 📊colorFrom: indigocolorTo: pinktitle: ChatterBox Haven 🗨️colorFrom: yellowcolorTo: purpleemoji: 🐳sdk: staticpinned: falsetags: - deepsite-v3---
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference# Welcome to your new DeepSite project!This project was created with [DeepSite](https://huggingface.co/deepsite).1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465class CustomNavbar extends HTMLElement { connectedCallback() { this.attachShadow({ mode: 'open' }); this.shadowRoot.innerHTML = ` <style> .navbar { background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); } .nav-link:hover { background-color: rgba(255, 255, 255, 0.1); } .search-input:focus { outline: none; box-shadow: 0 0 0 2px rgba(165, 180, 252, 0.5); } </style> <nav class="navbar text-white shadow-lg"> <div class="container mx-auto px-4 py-3"> <div class="flex items-center justify-between"> <div class="flex items-center space-x-4"> <a href="/" class="flex items-center space-x-2"> <i data-feather="message-square" class="w-6 h-6"></i> <span class="text-xl font-bold">ChatterBox</span> </a> </div> <div class="hidden md:flex items-center space-x-1"> <a href="#" class="nav-link px-4 py-2 rounded-lg font-medium">Home</a> <a href="#" class="nav-link px-4 py-2 rounded-lg font-medium">Categories</a> <a href="#" class="nav-link px-4 py-2 rounded-lg font-medium">Members</a> <a href="#" class="nav-link px-4 py-2 rounded-lg font-medium">About</a> </div> <div class="flex items-center space-x-4"> <div class="relative hidden md:block"> <input type="text" placeholder="Search..." class="search-input bg-indigo-700 text-white placeholder-indigo-200 rounded-lg pl-10 pr-4 py-2 focus:bg-indigo-600 transition duration-200"> <i data-feather="search" class="absolute left-3 top-2.5 text-indigo-200 w-5 h-5"></i> </div> <div class="flex items-center space-x-2"> <a href="#" class="bg-white bg-opacity-10 hover:bg-opacity-20 p-2 rounded-full transition duration-200"> <i data-feather="bell" class="w-5 h-5"></i> </a> <a href="#" class="bg-white bg-opacity-10 hover:bg-opacity-20 p-2 rounded-full transition duration-200"> <i data-feather="mail" class="w-5 h-5"></i> </a> <a href="#" class="flex items-center space-x-2 bg-white bg-opacity-10 hover:bg-opacity-20 px-3 py-1 rounded-full transition duration-200"> <div class="w-8 h-8 rounded-full bg-indigo-300 flex items-center justify-center"> <i data-feather="user" class="w-4 h-4 text-indigo-700"></i> </div> <span class="font-medium">Login</span> </a> </div> </div> <button class="md:hidden p-2 rounded-lg hover:bg-white hover:bg-opacity-10"> <i data-feather="menu" class="w-6 h-6"></i> </button> </div> </div> </nav> `; }}customElements.define('custom-navbar', CustomNavbar);123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263class CustomSidebar extends HTMLElement { connectedCallback() { this.attachShadow({ mode: 'open' }); this.shadowRoot.innerHTML = ` <style> .sidebar-item:hover { background-color: #f3f4f6; } .sidebar-item.active { background-color: #e5e7eb; border-left: 4px solid #4f46e5; } .category-badge { font-size: 0.7rem; } </style> <aside class="w-full lg:w-64"> <div class="bg-white rounded-xl shadow-md p-4 sticky top-8"> <h3 class="font-bold text-gray-800 mb-4 flex items-center gap-2"> <i data-feather="hash" class="w-5 h-5 text-gray-500"></i> Categories </h3> <nav class="space-y-1"> <a href="#" class="sidebar-item flex items-center justify-between px-3 py-2 rounded-lg"> <span class="text-gray-700">All Discussions</span> <span class="bg-gray-100 text-gray-600 px-2 py-0.5 rounded-full text-xs category-badge">128</span> </a> <a href="#" class="sidebar-item active flex items-center justify-between px-3 py-2 rounded-lg"> <span class="text-gray-700">Technology</span> <span class="bg-blue-100 text-blue-600 px-2 py-0.5 rounded-full text-xs category-badge">42</span> </a> <a href="#" class="sidebar-item flex items-center justify-between px-3 py-2 rounded-lg"> <span class="text-gray-700">Work & Career</span> <span class="bg-green-100 text-green-600 px-2 py-0.5 rounded-full text-xs category-badge">28</span> </a> <a href="#" class="sidebar-item flex items-center justify-between px-3 py-2 rounded-lg"> <span class="text-gray-700">Lifestyle</span> <span class="bg-purple-100 text-purple-600 px-2 py-0.5 rounded-full text-xs category-badge">19</span> </a> <a href="#" class="sidebar-item flex items-center justify-between px-3 py-2 rounded-lg"> <span class="text-gray-700">Entertainment</span> <span class="bg-yellow-100 text-yellow-600 px-2 py-0.5 rounded-full text-xs category-badge">15</span> </a> <a href="#" class="sidebar-item flex items-center justify-between px-3 py-2 rounded-lg"> <span class="text-gray-700">Health & Fitness</span> <span class="bg-red-100 text-red-600 px-2 py-0.5 rounded-full text-xs category-badge">12</span> </a> <a href="#" class="sidebar-item flex items-center justify-between px-3 py-2 rounded-lg"> <span class="text-gray-700">Education</span> <span class="bg-indigo-100 text-indigo-600 px-2 py-0.5 rounded-full text-xs category-badge">8</span> </a> </nav> <div class="mt-6 pt-4 border-t border-gray-200"> <h3 class="font-bold text-gray-800 mb-3 flex items-center gap-2"> <i data-feather="users" class="w-5 h-5 text-gray-500"></i> Online Now </h3> <div class="flex flex-wrap gap-2"> <div class="w-8 h-8 rounded-full bg-blue-200 flex items-center justify-center relative"> <span class="w-2 h-2 bg-green-500 rounded-full absolute bottom-0 right-0 border border-white"></span12345678910111213141516171819123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102<!doctype html><html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width" /> <title>My static Space</title> <link rel="stylesheet" href="style.css" /> </head> <body> <div class="card"> <h1>Welcome to your static Space!</h1> <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p> <p> Also don't forget to check the <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>. </p> </div> </body></html><!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>ChatterBox Haven - Online Chat Forum</title> <link rel="stylesheet" href="style.css"> <script src="https://cdn.tailwindcss.com"></script> <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script> <script src="https://unpkg.com/feather-icons"></script></head><body class="bg-gray-100"> <custom-navbar></custom-navbar> <main class="container mx-auto px-4 py-8"> <div class="flex flex-col lg:flex-row gap-8"> <!-- Sidebar --> <custom-sidebar></custom-sidebar> <!-- Main Content --> <div class="flex-1"> <div class="bg-white rounded-xl shadow-md p-6 mb-6"> <h1 class="text-3xl font-bold text-gray-800 mb-4">Welcome to ChatterBox Haven</h1> <p class="text-gray-600 mb-6">Join the conversation with people from around the world. Share your thoughts, ask questions, and connect with like-minded individuals.</p> <div class="flex flex-wrap gap-4 mb-8"> <div class="bg-blue-50 rounded-lg p-4 flex-1 min-w-[200px]"> <div class="flex items-center gap-3"> <i data-feather="users" class="text-blue-500"></i> <h3 class="font-semibold text-gray-800">Active Users</h3> </div> <p class="text-2xl font-bold text-blue-600 mt-2" id="active-users">1,234</p> </div> <div class="bg-green-50 rounded-lg p-4 flex-1 min-w-[200px]"> <div class="flex items-center gap-3"> <i data-feather="message-square" class="text-green-500"></i> <h3 class="font-semibold text-gray-800">Total Posts</h3> </div> <p class="text-2xl font-bold text-green-600 mt-2" id="total-posts">5,678</p> </div> <div class="bg-purple-50 rounded-lg p-4 flex-1 min-w-[200px]"> <div class="flex items-center gap-3"> <i data-feather="hash" class="text-purple-500"></i> <h3 class="font-semibold text-gray-800">Topics</h3> </div> <p class="text-2xl font-bold text-purple-600 mt-2" id="total-topics">42</p> </div> </div> <div class="bg-gray-50 rounded-lg p-6"> <h2 class="text-xl font-semibold text-gray-800 mb-4">Start a new conversation</h2> <form id="new-post-form"> <div class="mb-4"> <input type="text" placeholder="Title" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500"> </div> <div class="mb-4"> <textarea placeholder="What's on your mind?" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500" rows="4"></textarea> </div> <div class="flex justify-end"> <button type="submit" class="bg-blue-600 hover:bg-blue-700 text-white px-6 py-2 rounded-lg font-medium transition duration-200">Post</button> </div> </form> </div> </div> <div class="bg-white rounded-xl shadow-md p-6"> <div class="flex justify-between items-center mb-6"> <h2 class="text-2xl font-bold text-gray-800">Recent Discussions</h2> <div class="flex items-center gap-2"> <i data-feather="filter" class="text-gray-500"></i> <select class="bg-gray-50 border border-gray-300 text-gray-700 py-1 px-3 rounded-lg focus:ring-2 focus:ring-blue-500"> <option>Newest</option> <option>Popular</option> <option>Unanswered</option> </select> </div> </div> <div id="discussions-list" class="space-y-4"> <!-- Discussions will be loaded here --> </div> <div class="mt-6 flex justify-center"> <button class="bg-gray-100 hover:bg-gray-200 text-gray-700 px-4 py-2 rounded-lg font-medium transition duration-200">Load More</button> </div> </div> </div> </div> </main> <custom-footer></custom-footer> <script src="components/navbar.js"></script> <script src="components/sidebar.js"></script> <script src="components/footer.js"></script> <script src="script.js"></script> <script> feather.replace(); </script><script src="https://huggingface.co/deepsite/deepsite-badge.js"></script></body></html>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100document.addEventListener('DOMContentLoaded', function() { // Mock data for demonstration const discussions = [ { id: 1, title: "What's your favorite programming language?", author: "CodeMaster", replies: 24, views: 156, lastActivity: "2 hours ago", category: "Technology" }, { id: 2, title: "Best practices for remote work", author: "RemoteWorker", replies: 18, views: 98, lastActivity: "5 hours ago", category: "Work" }, { id: 3, title: "Show off your latest projects!", author: "CreativeMind", replies: 32, views: 210, lastActivity: "1 day ago", category: "Showcase" }, { id: 4, title: "How do you stay productive?", author: "ProductivityGuru", replies: 15, views: 87, lastActivity: "3 days ago", category: "Lifestyle" } ];
// Render discussions const discussionsList = document.getElementById('discussions-list'); discussions.forEach(discussion => { const discussionElement = document.createElement('div'); discussionElement.className = 'bg-gray-50 hover:bg-gray-100 rounded-lg p-4 transition duration-200 new-message'; discussionElement.innerHTML = ` <div class="flex items-start gap-4"> <div class="bg-blue-100 text-blue-600 rounded-full p-3"> <i data-feather="message-square" class="w-5 h-5"></i> </div> <div class="flex-1"> <h3 class="font-semibold text-gray-800 mb-1">${discussion.title}</h3> <div class="flex flex-wrap items-center gap-3 text-sm text-gray-500"> <span>by ${discussion.author}</span> <span>•</span> <span>${discussion.replies} replies</span> <span>•</span> <span>${discussion.views} views</span> <span>•</span> <span class="bg-${getCategoryColor(discussion.category)}-100 text-${getCategoryColor(discussion.category)}-600 px-2 py-1 rounded-full text-xs"> ${discussion.category} </span> </div> </div> <div class="text-sm text-gray-500"> ${discussion.lastActivity} </div> </div> `; discussionsList.appendChild(discussionElement); });
// Update stats document.getElementById('active-users').textContent = Math.floor(Math.random() * 2000) + 500; document.getElementById('total-posts').textContent = Math.floor(Math.random() * 8000) + 2000; document.getElementById('total-topics').textContent = Math.floor(Math.random() * 100) + 20;
// Form submission document.getElementById('new-post-form').addEventListener('submit', function(e) { e.preventDefault(); alert('Your post has been submitted!'); this.reset(); });
// Initialize feather icons feather.replace();});
function getCategoryColor(category) { const colors = { 'Technology': 'blue', 'Work': 'green', 'Showcase': 'purple', 'Lifestyle': 'orange', 'General': 'gray' }; return colors[category] || 'gray';}1223345667878910111211121314151314151617181920212223181920212226272324252627282930313233343536373839404142/* Base styles */body { padding: 2rem; font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif; font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif; line-height: 1.6;}
h1 { font-size: 16px; margin-top: 0;/* Custom scrollbar */::-webkit-scrollbar { width: 8px; height: 8px;}
p { color: rgb(107, 114, 128); font-size: 15px; margin-bottom: 10px; margin-top: 5px;::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px;}
.card { max-width: 620px; margin: 0 auto; padding: 16px; border: 1px solid lightgray; border-radius: 16px;::-webkit-scrollbar-thumb { background: #888; border-radius: 10px;}
.card p:last-child { margin-bottom: 0;::-webkit-scrollbar-thumb:hover { background: #555;}
/* Animation for new messages */@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); }}
.new-message { animation: fadeIn 0.3s ease-out;}
/* Responsive adjustments */@media (max-width: 768px) { .chat-container { flex-direction: column; }}README.md+8-5
components/navbar.jsAdded+65
components/sidebar.jsAdded+63
index.html+102-19
script.jsAdded+100
style.css+32-18