Download index.html from pierrelev/test-2: direct link, hf CLI and curl.
- Browser
- Download file 33.6 kB
-
https://huggingface.co/spaces/pierrelev/test-2/resolve/main/index.html
- Command line
-
hf download hf://spaces/pierrelev/test-2/index.html
-
curl -L -o index.html https://huggingface.co/spaces/pierrelev/test-2/resolve/main/index.html
33.6 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Community Forum</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 */ | |
| ::-webkit-scrollbar { | |
| width: 8px; | |
| } | |
| ::-webkit-scrollbar-track { | |
| background: #f1f1f1; | |
| } | |
| ::-webkit-scrollbar-thumb { | |
| background: #888; | |
| border-radius: 4px; | |
| } | |
| ::-webkit-scrollbar-thumb:hover { | |
| background: #555; | |
| } | |
| /* Animation for new posts */ | |
| @keyframes highlight { | |
| 0% { background-color: rgba(254, 240, 138, 0.5); } | |
| 100% { background-color: transparent; } | |
| } | |
| .new-post { | |
| animation: highlight 2s ease-out; | |
| } | |
| /* Custom checkbox */ | |
| .custom-checkbox { | |
| appearance: none; | |
| -webkit-appearance: none; | |
| width: 20px; | |
| height: 20px; | |
| border: 2px solid #d1d5db; | |
| border-radius: 4px; | |
| cursor: pointer; | |
| display: flex; | |
| align-items: center; | |
| justify-content: center; | |
| } | |
| .custom-checkbox:checked { | |
| background-color: #3b82f6; | |
| border-color: #3b82f6; | |
| } | |
| .custom-checkbox:checked::after { | |
| content: "✓"; | |
| color: white; | |
| font-size: 12px; | |
| } | |
| </style> | |
| </head> | |
| <body class="bg-gray-100 font-sans"> | |
| <!-- Header --> | |
| <header class="bg-indigo-700 text-white shadow-lg"> | |
| <div class="container mx-auto px-4 py-3 flex justify-between items-center"> | |
| <div class="flex items-center space-x-2"> | |
| <i class="fas fa-comments text-2xl"></i> | |
| <h1 class="text-2xl font-bold">Community Forum</h1> | |
| </div> | |
| <div class="flex items-center space-x-4"> | |
| <div class="relative hidden md:block"> | |
| <input type="text" placeholder="Search forums..." class="px-4 py-2 rounded-full text-gray-800 w-64 focus:outline-none focus:ring-2 focus:ring-indigo-500"> | |
| <button class="absolute right-3 top-2 text-gray-500"> | |
| <i class="fas fa-search"></i> | |
| </button> | |
| </div> | |
| <div class="flex items-center space-x-2"> | |
| <img src="https://randomuser.me/api/portraits/women/44.jpg" alt="Profile" class="w-8 h-8 rounded-full border-2 border-white"> | |
| <span class="hidden md:inline">Sarah</span> | |
| </div> | |
| </div> | |
| </div> | |
| </header> | |
| <!-- Main Content --> | |
| <div class="container mx-auto px-4 py-6 flex flex-col md:flex-row gap-6"> | |
| <!-- Sidebar --> | |
| <aside class="w-full md:w-64 flex-shrink-0"> | |
| <div class="bg-white rounded-lg shadow-md p-4 mb-4"> | |
| <h2 class="text-lg font-semibold mb-4 text-gray-800">Categories</h2> | |
| <ul class="space-y-2"> | |
| <li> | |
| <a href="#" class="flex items-center px-3 py-2 rounded-md bg-indigo-50 text-indigo-700 font-medium"> | |
| <i class="fas fa-home mr-2"></i> Home | |
| </a> | |
| </li> | |
| <li> | |
| <a href="#" class="flex items-center px-3 py-2 rounded-md hover:bg-gray-100 text-gray-700"> | |
| <i class="fas fa-code mr-2"></i> Development | |
| </a> | |
| </li> | |
| <li> | |
| <a href="#" class="flex items-center px-3 py-2 rounded-md hover:bg-gray-100 text-gray-700"> | |
| <i class="fas fa-paint-brush mr-2"></i> Design | |
| </a> | |
| </li> | |
| <li> | |
| <a href="#" class="flex items-center px-3 py-2 rounded-md hover:bg-gray-100 text-gray-700"> | |
| <i class="fas fa-chart-line mr-2"></i> Marketing | |
| </a> | |
| </li> | |
| <li> | |
| <a href="#" class="flex items-center px-3 py-2 rounded-md hover:bg-gray-100 text-gray-700"> | |
| <i class="fas fa-question-circle mr-2"></i> Support | |
| </a> | |
| </li> | |
| <li> | |
| <a href="#" class="flex items-center px-3 py-2 rounded-md hover:bg-gray-100 text-gray-700"> | |
| <i class="fas fa-lightbulb mr-2"></i> Ideas | |
| </a> | |
| </li> | |
| </ul> | |
| </div> | |
| <div class="bg-white rounded-lg shadow-md p-4"> | |
| <h2 class="text-lg font-semibold mb-4 text-gray-800">Forum Stats</h2> | |
| <div class="space-y-3"> | |
| <div class="flex justify-between"> | |
| <span class="text-gray-600">Total Threads</span> | |
| <span class="font-medium">1,245</span> | |
| </div> | |
| <div class="flex justify-between"> | |
| <span class="text-gray-600">Total Posts</span> | |
| <span class="font-medium">8,763</span> | |
| </div> | |
| <div class="flex justify-between"> | |
| <span class="text-gray-600">Members</span> | |
| <span class="font-medium">3,421</span> | |
| </div> | |
| <div class="flex justify-between"> | |
| <span class="text-gray-600">Online Now</span> | |
| <span class="font-medium text-green-600">128</span> | |
| </div> | |
| </div> | |
| </div> | |
| </aside> | |
| <!-- Main Forum Content --> | |
| <main class="flex-1"> | |
| <!-- Breadcrumbs --> | |
| <nav class="flex mb-4" aria-label="Breadcrumb"> | |
| <ol class="inline-flex items-center space-x-1 md:space-x-3"> | |
| <li class="inline-flex items-center"> | |
| <a href="#" class="inline-flex items-center text-sm font-medium text-gray-700 hover:text-indigo-600"> | |
| <i class="fas fa-home mr-2"></i> | |
| Home | |
| </a> | |
| </li> | |
| <li> | |
| <div class="flex items-center"> | |
| <i class="fas fa-chevron-right text-gray-400 mx-1"></i> | |
| <a href="#" class="ml-1 text-sm font-medium text-gray-700 hover:text-indigo-600 md:ml-2">Development</a> | |
| </div> | |
| </li> | |
| <li aria-current="page"> | |
| <div class="flex items-center"> | |
| <i class="fas fa-chevron-right text-gray-400 mx-1"></i> | |
| <span class="ml-1 text-sm font-medium text-indigo-600 md:ml-2">JavaScript</span> | |
| </div> | |
| </li> | |
| </ol> | |
| </nav> | |
| <!-- Forum Header --> | |
| <div class="bg-white rounded-lg shadow-md p-4 mb-4"> | |
| <div class="flex flex-col md:flex-row md:items-center md:justify-between"> | |
| <div> | |
| <h2 class="text-2xl font-bold text-gray-800">JavaScript Discussions</h2> | |
| <p class="text-gray-600">Ask questions and share knowledge about JavaScript and related technologies</p> | |
| </div> | |
| <button id="newThreadBtn" class="mt-4 md:mt-0 bg-indigo-600 hover:bg-indigo-700 text-white px-4 py-2 rounded-md flex items-center"> | |
| <i class="fas fa-plus mr-2"></i> New Thread | |
| </button> | |
| </div> | |
| </div> | |
| <!-- Thread Filters --> | |
| <div class="bg-white rounded-lg shadow-md p-4 mb-4"> | |
| <div class="flex flex-col md:flex-row md:items-center md:justify-between gap-4"> | |
| <div class="flex items-center space-x-2"> | |
| <input type="checkbox" id="unreadOnly" class="custom-checkbox"> | |
| <label for="unreadOnly" class="text-sm text-gray-700">Unread only</label> | |
| </div> | |
| <div class="flex items-center space-x-4"> | |
| <div class="relative"> | |
| <select class="appearance-none bg-gray-100 border border-gray-300 text-gray-700 py-2 px-4 pr-8 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500"> | |
| <option>All Threads</option> | |
| <option>Your Threads</option> | |
| <option>Subscribed</option> | |
| </select> | |
| <div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700"> | |
| <i class="fas fa-chevron-down"></i> | |
| </div> | |
| </div> | |
| <div class="relative"> | |
| <select class="appearance-none bg-gray-100 border border-gray-300 text-gray-700 py-2 px-4 pr-8 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500"> | |
| <option>Newest First</option> | |
| <option>Oldest First</option> | |
| <option>Most Replies</option> | |
| <option>Most Viewed</option> | |
| </select> | |
| <div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700"> | |
| <i class="fas fa-chevron-down"></i> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Thread List --> | |
| <div class="bg-white rounded-lg shadow-md overflow-hidden"> | |
| <div class="divide-y divide-gray-200"> | |
| <!-- Thread Item --> | |
| <div class="p-4 hover:bg-gray-50 transition-colors duration-150 new-post"> | |
| <div class="flex items-start"> | |
| <div class="flex-shrink-0 pt-1"> | |
| <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> | |
| <div class="ml-3 flex-1"> | |
| <div class="flex items-center justify-between"> | |
| <div> | |
| <span class="text-sm font-medium text-gray-900">John Doe</span> | |
| <span class="ml-2 text-xs text-gray-500">2 hours ago</span> | |
| </div> | |
| <div class="flex items-center space-x-2"> | |
| <span class="px-2 py-1 bg-indigo-100 text-indigo-800 text-xs rounded-full">New</span> | |
| <button class="text-gray-400 hover:text-gray-600"> | |
| <i class="fas fa-bookmark"></i> | |
| </button> | |
| </div> | |
| </div> | |
| <h3 class="mt-1 text-lg font-medium text-indigo-600 hover:underline cursor-pointer"> | |
| How to optimize React performance with useMemo? | |
| </h3> | |
| <p class="mt-1 text-sm text-gray-600"> | |
| I'm working on a large React application and noticing some performance issues. When should I use useMemo versus useCallback? What are the best practices... | |
| </p> | |
| <div class="mt-2 flex items-center text-sm text-gray-500 space-x-4"> | |
| <span class="flex items-center"> | |
| <i class="fas fa-comment mr-1"></i> 14 replies | |
| </span> | |
| <span class="flex items-center"> | |
| <i class="fas fa-eye mr-1"></i> 245 views | |
| </span> | |
| <span class="flex items-center"> | |
| <i class="fas fa-heart mr-1 text-red-500"></i> 8 likes | |
| </span> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Thread Item --> | |
| <div class="p-4 hover:bg-gray-50 transition-colors duration-150"> | |
| <div class="flex items-start"> | |
| <div class="flex-shrink-0 pt-1"> | |
| <img src="https://randomuser.me/api/portraits/men/32.jpg" alt="User" class="w-10 h-10 rounded-full"> | |
| </div> | |
| <div class="ml-3 flex-1"> | |
| <div class="flex items-center justify-between"> | |
| <div> | |
| <span class="text-sm font-medium text-gray-900">Michael Chen</span> | |
| <span class="ml-2 text-xs text-gray-500">1 day ago</span> | |
| </div> | |
| <button class="text-gray-400 hover:text-gray-600"> | |
| <i class="fas fa-bookmark"></i> | |
| </button> | |
| </div> | |
| <h3 class="mt-1 text-lg font-medium text-indigo-600 hover:underline cursor-pointer"> | |
| TypeScript vs JavaScript in 2023 - Which one to choose? | |
| </h3> | |
| <p class="mt-1 text-sm text-gray-600"> | |
| With TypeScript gaining popularity, is it worth switching from JavaScript for new projects? What are the pros and cons for a medium-sized team? | |
| </p> | |
| <div class="mt-2 flex items-center text-sm text-gray-500 space-x-4"> | |
| <span class="flex items-center"> | |
| <i class="fas fa-comment mr-1"></i> 27 replies | |
| </span> | |
| <span class="flex items-center"> | |
| <i class="fas fa-eye mr-1"></i> 512 views | |
| </span> | |
| <span class="flex items-center"> | |
| <i class="fas fa-heart mr-1 text-red-500"></i> 15 likes | |
| </span> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Thread Item --> | |
| <div class="p-4 hover:bg-gray-50 transition-colors duration-150"> | |
| <div class="flex items-start"> | |
| <div class="flex-shrink-0 pt-1"> | |
| <div class="w-10 h-10 rounded-full bg-green-100 flex items-center justify-center"> | |
| <i class="fas fa-user-tie text-green-600"></i> | |
| </div> | |
| </div> | |
| <div class="ml-3 flex-1"> | |
| <div class="flex items-center justify-between"> | |
| <div> | |
| <span class="text-sm font-medium text-gray-900">Admin</span> | |
| <span class="ml-2 text-xs text-gray-500">3 days ago</span> | |
| </div> | |
| <div class="flex items-center space-x-2"> | |
| <span class="px-2 py-1 bg-green-100 text-green-800 text-xs rounded-full">Announcement</span> | |
| <button class="text-gray-400 hover:text-gray-600"> | |
| <i class="fas fa-bookmark"></i> | |
| </button> | |
| </div> | |
| </div> | |
| <h3 class="mt-1 text-lg font-medium text-indigo-600 hover:underline cursor-pointer"> | |
| Forum Rules Update - Please Read | |
| </h3> | |
| <p class="mt-1 text-sm text-gray-600"> | |
| We've updated our community guidelines to ensure a better experience for everyone. Please review the changes before posting. | |
| </p> | |
| <div class="mt-2 flex items-center text-sm text-gray-500 space-x-4"> | |
| <span class="flex items-center"> | |
| <i class="fas fa-comment mr-1"></i> 5 replies | |
| </span> | |
| <span class="flex items-center"> | |
| <i class="fas fa-eye mr-1"></i> 1,024 views | |
| </span> | |
| <span class="flex items-center"> | |
| <i class="fas fa-heart mr-1 text-red-500"></i> 42 likes | |
| </span> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Thread Item --> | |
| <div class="p-4 hover:bg-gray-50 transition-colors duration-150"> | |
| <div class="flex items-start"> | |
| <div class="flex-shrink-0 pt-1"> | |
| <img src="https://randomuser.me/api/portraits/women/68.jpg" alt="User" class="w-10 h-10 rounded-full"> | |
| </div> | |
| <div class="ml-3 flex-1"> | |
| <div class="flex items-center justify-between"> | |
| <div> | |
| <span class="text-sm font-medium text-gray-900">Lisa Rodriguez</span> | |
| <span class="ml-2 text-xs text-gray-500">5 days ago</span> | |
| </div> | |
| <button class="text-gray-400 hover:text-gray-600"> | |
| <i class="fas fa-bookmark"></i> | |
| </button> | |
| </div> | |
| <h3 class="mt-1 text-lg font-medium text-indigo-600 hover:underline cursor-pointer"> | |
| Best practices for error handling in Node.js applications | |
| </h3> | |
| <p class="mt-1 text-sm text-gray-600"> | |
| I'm building a Node.js backend and want to implement robust error handling. What are the current best practices for handling and logging errors? | |
| </p> | |
| <div class="mt-2 flex items-center text-sm text-gray-500 space-x-4"> | |
| <span class="flex items-center"> | |
| <i class="fas fa-comment mr-1"></i> 9 replies | |
| </span> | |
| <span class="flex items-center"> | |
| <i class="fas fa-eye mr-1"></i> 187 views | |
| </span> | |
| <span class="flex items-center"> | |
| <i class="fas fa-heart mr-1 text-red-500"></i> 6 likes | |
| </span> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Pagination --> | |
| <div class="mt-6 flex items-center justify-between"> | |
| <div class="text-sm text-gray-600"> | |
| Showing <span class="font-medium">1</span> to <span class="font-medium">4</span> of <span class="font-medium">124</span> threads | |
| </div> | |
| <div class="flex space-x-2"> | |
| <button class="px-3 py-1 rounded-md bg-gray-200 text-gray-700 hover:bg-gray-300"> | |
| <i class="fas fa-chevron-left"></i> | |
| </button> | |
| <button class="px-3 py-1 rounded-md bg-indigo-600 text-white">1</button> | |
| <button class="px-3 py-1 rounded-md bg-white text-gray-700 hover:bg-gray-100">2</button> | |
| <button class="px-3 py-1 rounded-md bg-white text-gray-700 hover:bg-gray-100">3</button> | |
| <span class="px-3 py-1">...</span> | |
| <button class="px-3 py-1 rounded-md bg-white text-gray-700 hover:bg-gray-100">12</button> | |
| <button class="px-3 py-1 rounded-md bg-gray-200 text-gray-700 hover:bg-gray-300"> | |
| <i class="fas fa-chevron-right"></i> | |
| </button> | |
| </div> | |
| </div> | |
| </main> | |
| </div> | |
| <!-- New Thread Modal --> | |
| <div id="newThreadModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden"> | |
| <div class="bg-white rounded-lg shadow-xl w-full max-w-2xl max-h-[90vh] overflow-y-auto"> | |
| <div class="p-6"> | |
| <div class="flex justify-between items-center mb-4"> | |
| <h3 class="text-xl font-bold text-gray-800">Create New Thread</h3> | |
| <button id="closeModalBtn" class="text-gray-500 hover:text-gray-700"> | |
| <i class="fas fa-times"></i> | |
| </button> | |
| </div> | |
| <form id="threadForm"> | |
| <div class="mb-4"> | |
| <label for="threadTitle" class="block text-sm font-medium text-gray-700 mb-1">Title</label> | |
| <input type="text" id="threadTitle" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500" placeholder="Enter your thread title"> | |
| </div> | |
| <div class="mb-4"> | |
| <label for="threadCategory" class="block text-sm font-medium text-gray-700 mb-1">Category</label> | |
| <select id="threadCategory" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500"> | |
| <option>JavaScript</option> | |
| <option>React</option> | |
| <option>Node.js</option> | |
| <option>TypeScript</option> | |
| <option>General Discussion</option> | |
| </select> | |
| </div> | |
| <div class="mb-4"> | |
| <label for="threadContent" class="block text-sm font-medium text-gray-700 mb-1">Content</label> | |
| <div class="border border-gray-300 rounded-md"> | |
| <div class="flex border-b border-gray-300 bg-gray-100 px-3 py-1"> | |
| <button type="button" class="p-1 text-gray-600 hover:text-gray-800"> | |
| <i class="fas fa-bold"></i> | |
| </button> | |
| <button type="button" class="p-1 text-gray-600 hover:text-gray-800"> | |
| <i class="fas fa-italic"></i> | |
| </button> | |
| <button type="button" class="p-1 text-gray-600 hover:text-gray-800"> | |
| <i class="fas fa-link"></i> | |
| </button> | |
| <button type="button" class="p-1 text-gray-600 hover:text-gray-800"> | |
| <i class="fas fa-code"></i> | |
| </button> | |
| <button type="button" class="p-1 text-gray-600 hover:text-gray-800"> | |
| <i class="fas fa-image"></i> | |
| </button> | |
| </div> | |
| <textarea id="threadContent" rows="8" class="w-full px-3 py-2 focus:outline-none resize-none" placeholder="Write your post here..."></textarea> | |
| </div> | |
| </div> | |
| <div class="flex justify-between items-center"> | |
| <div class="flex items-center space-x-2"> | |
| <input type="checkbox" id="subscribeThread" class="custom-checkbox"> | |
| <label for="subscribeThread" class="text-sm text-gray-700">Subscribe to this thread</label> | |
| </div> | |
| <div class="space-x-2"> | |
| <button type="button" id="cancelThreadBtn" class="px-4 py-2 text-gray-700 bg-gray-100 rounded-md hover:bg-gray-200">Cancel</button> | |
| <button type="submit" class="px-4 py-2 text-white bg-indigo-600 rounded-md hover:bg-indigo-700">Post Thread</button> | |
| </div> | |
| </div> | |
| </form> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Footer --> | |
| <footer class="bg-gray-800 text-white py-8 mt-12"> | |
| <div class="container mx-auto px-4"> | |
| <div class="grid grid-cols-1 md:grid-cols-4 gap-8"> | |
| <div> | |
| <h3 class="text-lg font-semibold mb-4">Community Forum</h3> | |
| <p class="text-gray-400">A place to share knowledge and connect with other developers and designers.</p> | |
| </div> | |
| <div> | |
| <h3 class="text-lg font-semibold mb-4">Quick Links</h3> | |
| <ul class="space-y-2"> | |
| <li><a href="#" class="text-gray-400 hover:text-white">Home</a></li> | |
| <li><a href="#" class="text-gray-400 hover:text-white">Categories</a></li> | |
| <li><a href="#" class="text-gray-400 hover:text-white">Popular Threads</a></li> | |
| <li><a href="#" class="text-gray-400 hover:text-white">Members</a></li> | |
| </ul> | |
| </div> | |
| <div> | |
| <h3 class="text-lg font-semibold mb-4">Help</h3> | |
| <ul class="space-y-2"> | |
| <li><a href="#" class="text-gray-400 hover:text-white">FAQ</a></li> | |
| <li><a href="#" class="text-gray-400 hover:text-white">Guidelines</a></li> | |
| <li><a href="#" class="text-gray-400 hover:text-white">Contact Us</a></li> | |
| <li><a href="#" class="text-gray-400 hover:text-white">Privacy Policy</a></li> | |
| </ul> | |
| </div> | |
| <div> | |
| <h3 class="text-lg font-semibold mb-4">Connect</h3> | |
| <div class="flex space-x-4"> | |
| <a href="#" class="text-gray-400 hover:text-white text-xl"><i class="fab fa-twitter"></i></a> | |
| <a href="#" class="text-gray-400 hover:text-white text-xl"><i class="fab fa-facebook"></i></a> | |
| <a href="#" class="text-gray-400 hover:text-white text-xl"><i class="fab fa-github"></i></a> | |
| <a href="#" class="text-gray-400 hover:text-white text-xl"><i class="fab fa-discord"></i></a> | |
| </div> | |
| <p class="mt-4 text-gray-400">Subscribe to our newsletter</p> | |
| <div class="mt-2 flex"> | |
| <input type="email" placeholder="Your email" class="px-3 py-2 text-gray-800 rounded-l-md w-full focus:outline-none"> | |
| <button class="bg-indigo-600 px-4 py-2 rounded-r-md hover:bg-indigo-700">Join</button> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="border-t border-gray-700 mt-8 pt-6 text-center text-gray-400"> | |
| <p>© 2023 Community Forum. All rights reserved.</p> | |
| </div> | |
| </div> | |
| </footer> | |
| <script> | |
| // Modal functionality | |
| const newThreadBtn = document.getElementById('newThreadBtn'); | |
| const newThreadModal = document.getElementById('newThreadModal'); | |
| const closeModalBtn = document.getElementById('closeModalBtn'); | |
| const cancelThreadBtn = document.getElementById('cancelThreadBtn'); | |
| const threadForm = document.getElementById('threadForm'); | |
| newThreadBtn.addEventListener('click', () => { | |
| newThreadModal.classList.remove('hidden'); | |
| }); | |
| closeModalBtn.addEventListener('click', () => { | |
| newThreadModal.classList.add('hidden'); | |
| }); | |
| cancelThreadBtn.addEventListener('click', () => { | |
| newThreadModal.classList.add('hidden'); | |
| }); | |
| threadForm.addEventListener('submit', (e) => { | |
| e.preventDefault(); | |
| const title = document.getElementById('threadTitle').value; | |
| const category = document.getElementById('threadCategory').value; | |
| const content = document.getElementById('threadContent').value; | |
| // Here you would typically send this data to a server | |
| console.log('New thread submitted:', { title, category, content }); | |
| // Show success message | |
| alert('Your thread has been posted successfully!'); | |
| newThreadModal.classList.add('hidden'); | |
| // Reset form | |
| threadForm.reset(); | |
| }); | |
| // Close modal when clicking outside | |
| window.addEventListener('click', (e) => { | |
| if (e.target === newThreadModal) { | |
| newThreadModal.classList.add('hidden'); | |
| } | |
| }); | |
| // Bookmark functionality | |
| const bookmarkButtons = document.querySelectorAll('.fa-bookmark'); | |
| bookmarkButtons.forEach(button => { | |
| button.addEventListener('click', (e) => { | |
| e.stopPropagation(); | |
| const icon = e.target; | |
| if (icon.classList.contains('far')) { | |
| icon.classList.remove('far'); | |
| icon.classList.add('fas', 'text-yellow-500'); | |
| } else { | |
| icon.classList.remove('fas', 'text-yellow-500'); | |
| icon.classList.add('far'); | |
| } | |
| }); | |
| }); | |
| // Like functionality | |
| const likeButtons = document.querySelectorAll('.fa-heart'); | |
| likeButtons.forEach(button => { | |
| button.addEventListener('click', (e) => { | |
| e.stopPropagation(); | |
| const icon = e.target; | |
| const countElement = icon.nextElementSibling; | |
| if (icon.classList.contains('far')) { | |
| icon.classList.remove('far'); | |
| icon.classList.add('fas'); | |
| countElement.textContent = parseInt(countElement.textContent) + 1; | |
| } else { | |
| icon.classList.remove('fas'); | |
| icon.classList.add('far'); | |
| countElement.textContent = parseInt(countElement.textContent) - 1; | |
| } | |
| }); | |
| }); | |
| // Thread click functionality | |
| const threadTitles = document.querySelectorAll('h3.text-indigo-600'); | |
| threadTitles.forEach(title => { | |
| title.addEventListener('click', () => { | |
| // In a real app, this would navigate to the thread page | |
| alert('Navigating to thread: ' + title.textContent); | |
| }); | |
| }); | |
| </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=pierrelev/test-2" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> | |
| </html> |