undefined - Initial Deployment
Browse files- README.md +7 -5
- index.html +421 -19
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: darkbert
|
| 3 |
+
emoji: 🐳
|
| 4 |
+
colorFrom: green
|
| 5 |
+
colorTo: blue
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,421 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en" class="dark">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>DarkBERT Dashboard</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 9 |
+
<style>
|
| 10 |
+
/* Custom scrollbar */
|
| 11 |
+
::-webkit-scrollbar {
|
| 12 |
+
width: 8px;
|
| 13 |
+
}
|
| 14 |
+
::-webkit-scrollbar-track {
|
| 15 |
+
background: #1e1e2d;
|
| 16 |
+
}
|
| 17 |
+
::-webkit-scrollbar-thumb {
|
| 18 |
+
background: #4b5563;
|
| 19 |
+
border-radius: 4px;
|
| 20 |
+
}
|
| 21 |
+
::-webkit-scrollbar-thumb:hover {
|
| 22 |
+
background: #6b7280;
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
/* Message animation */
|
| 26 |
+
@keyframes fadeIn {
|
| 27 |
+
from { opacity: 0; transform: translateY(10px); }
|
| 28 |
+
to { opacity: 1; transform: translateY(0); }
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
.message {
|
| 32 |
+
animation: fadeIn 0.3s ease-out;
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
/* Gradient text */
|
| 36 |
+
.gradient-text {
|
| 37 |
+
background: linear-gradient(90deg, #8b5cf6, #ec4899);
|
| 38 |
+
-webkit-background-clip: text;
|
| 39 |
+
background-clip: text;
|
| 40 |
+
color: transparent;
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
/* Typewriter effect */
|
| 44 |
+
.typewriter {
|
| 45 |
+
overflow: hidden;
|
| 46 |
+
border-right: 2px solid #8b5cf6;
|
| 47 |
+
white-space: nowrap;
|
| 48 |
+
margin: 0 auto;
|
| 49 |
+
letter-spacing: 1px;
|
| 50 |
+
animation:
|
| 51 |
+
typing 3.5s steps(40, end),
|
| 52 |
+
blink-caret 0.75s step-end infinite;
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
@keyframes typing {
|
| 56 |
+
from { width: 0 }
|
| 57 |
+
to { width: 100% }
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
@keyframes blink-caret {
|
| 61 |
+
from, to { border-color: transparent }
|
| 62 |
+
50% { border-color: #8b5cf6; }
|
| 63 |
+
}
|
| 64 |
+
</style>
|
| 65 |
+
</head>
|
| 66 |
+
<body class="bg-gray-900 text-gray-200 min-h-screen flex flex-col">
|
| 67 |
+
<!-- Header -->
|
| 68 |
+
<header class="bg-gray-800 border-b border-gray-700 p-4">
|
| 69 |
+
<div class="container mx-auto flex justify-between items-center">
|
| 70 |
+
<div class="flex items-center space-x-3">
|
| 71 |
+
<div class="w-10 h-10 bg-purple-600 rounded-full flex items-center justify-center">
|
| 72 |
+
<i class="fas fa-robot text-xl"></i>
|
| 73 |
+
</div>
|
| 74 |
+
<h1 class="text-2xl font-bold gradient-text">Dark<span class="text-white">BERT</span></h1>
|
| 75 |
+
</div>
|
| 76 |
+
<div class="flex items-center space-x-4">
|
| 77 |
+
<button id="theme-toggle" class="p-2 rounded-full hover:bg-gray-700 transition">
|
| 78 |
+
<i class="fas fa-moon text-yellow-400"></i>
|
| 79 |
+
</button>
|
| 80 |
+
<button class="bg-purple-600 hover:bg-purple-700 px-4 py-2 rounded-lg font-medium transition">
|
| 81 |
+
<i class="fas fa-user mr-2"></i>Sign In
|
| 82 |
+
</button>
|
| 83 |
+
</div>
|
| 84 |
+
</div>
|
| 85 |
+
</header>
|
| 86 |
+
|
| 87 |
+
<div class="flex flex-1 overflow-hidden">
|
| 88 |
+
<!-- Sidebar -->
|
| 89 |
+
<aside class="w-64 bg-gray-800 border-r border-gray-700 hidden md:block overflow-y-auto">
|
| 90 |
+
<div class="p-4">
|
| 91 |
+
<div class="mb-6">
|
| 92 |
+
<h2 class="text-lg font-semibold mb-2 text-gray-300">Quick Actions</h2>
|
| 93 |
+
<button class="w-full bg-purple-600 hover:bg-purple-700 text-white py-2 px-3 rounded mb-2 text-left transition">
|
| 94 |
+
<i class="fas fa-plus mr-2"></i>New Chat
|
| 95 |
+
</button>
|
| 96 |
+
<button class="w-full bg-gray-700 hover:bg-gray-600 text-white py-2 px-3 rounded text-left transition">
|
| 97 |
+
<i class="fas fa-history mr-2"></i>History
|
| 98 |
+
</button>
|
| 99 |
+
</div>
|
| 100 |
+
|
| 101 |
+
<div class="mb-6">
|
| 102 |
+
<h2 class="text-lg font-semibold mb-2 text-gray-300">Training & Fine-tuning</h2>
|
| 103 |
+
<div class="space-y-3 mb-4">
|
| 104 |
+
<button class="w-full bg-gray-700 hover:bg-gray-600 text-white py-2 px-3 rounded text-left transition">
|
| 105 |
+
<i class="fas fa-upload mr-2"></i>Upload Training Data
|
| 106 |
+
</button>
|
| 107 |
+
<button class="w-full bg-gray-700 hover:bg-gray-600 text-white py-2 px-3 rounded text-left transition">
|
| 108 |
+
<i class="fas fa-sliders-h mr-2"></i>Fine-tune Parameters
|
| 109 |
+
</button>
|
| 110 |
+
<button class="w-full bg-gray-700 hover:bg-gray-600 text-white py-2 px-3 rounded text-left transition">
|
| 111 |
+
<i class="fas fa-play mr-2"></i>Start Training Session
|
| 112 |
+
</button>
|
| 113 |
+
</div>
|
| 114 |
+
|
| 115 |
+
<h2 class="text-lg font-semibold mb-2 text-gray-300">Saved Prompts</h2>
|
| 116 |
+
<div class="space-y-2">
|
| 117 |
+
<button class="w-full bg-gray-700 hover:bg-gray-600 text-white py-2 px-3 rounded text-left text-sm transition truncate">
|
| 118 |
+
<i class="fas fa-code mr-2"></i>Explain this code snippet...
|
| 119 |
+
</button>
|
| 120 |
+
<button class="w-full bg-gray-700 hover:bg-gray-600 text-white py-2 px-3 rounded text-left text-sm transition truncate">
|
| 121 |
+
<i class="fas fa-book mr-2"></i>Summarize research paper...
|
| 122 |
+
</button>
|
| 123 |
+
<button class="w-full bg-gray-700 hover:bg-gray-600 text-white py-2 px-3 rounded text-left text-sm transition truncate">
|
| 124 |
+
<i class="fas fa-terminal mr-2"></i>Debug this Python script...
|
| 125 |
+
</button>
|
| 126 |
+
</div>
|
| 127 |
+
</div>
|
| 128 |
+
|
| 129 |
+
<div class="mb-6">
|
| 130 |
+
<h2 class="text-lg font-semibold mb-2 text-gray-300">Training & Fine-tuning</h2>
|
| 131 |
+
<div class="space-y-3 mb-4">
|
| 132 |
+
<button class="w-full bg-gray-700 hover:bg-gray-600 text-white py-2 px-3 rounded text-left transition">
|
| 133 |
+
<i class="fas fa-upload mr-2"></i>Upload Training Data
|
| 134 |
+
</button>
|
| 135 |
+
<button class="w-full bg-gray-700 hover:bg-gray-600 text-white py-2 px-3 rounded text-left transition">
|
| 136 |
+
<i class="fas fa-sliders-h mr-2"></i>Fine-tune Parameters
|
| 137 |
+
</button>
|
| 138 |
+
<button class="w-full bg-gray-700 hover:bg-gray-600 text-white py-2 px-3 rounded text-left transition">
|
| 139 |
+
<i class="fas fa-play mr-2"></i>Start Training Session
|
| 140 |
+
</button>
|
| 141 |
+
</div>
|
| 142 |
+
|
| 143 |
+
<h2 class="text-lg font-semibold mb-2 text-gray-300">Model Settings</h2>
|
| 144 |
+
<div class="space-y-3">
|
| 145 |
+
<div>
|
| 146 |
+
<label class="block text-sm text-gray-400 mb-1">Temperature</label>
|
| 147 |
+
<input type="range" min="0" max="1" step="0.1" value="0.7" class="w-full h-2 bg-gray-700 rounded-lg appearance-none cursor-pointer">
|
| 148 |
+
<div class="flex justify-between text-xs text-gray-400">
|
| 149 |
+
<span>Precise</span>
|
| 150 |
+
<span>Creative</span>
|
| 151 |
+
</div>
|
| 152 |
+
</div>
|
| 153 |
+
<div>
|
| 154 |
+
<label class="block text-sm text-gray-400 mb-1">Max Tokens</label>
|
| 155 |
+
<input type="range" min="100" max="4000" step="100" value="2000" class="w-full h-2 bg-gray-700 rounded-lg appearance-none cursor-pointer">
|
| 156 |
+
</div>
|
| 157 |
+
</div>
|
| 158 |
+
</div>
|
| 159 |
+
</div>
|
| 160 |
+
</aside>
|
| 161 |
+
|
| 162 |
+
<!-- Mobile sidebar toggle -->
|
| 163 |
+
<button id="mobile-sidebar-toggle" class="md:hidden fixed bottom-4 left-4 bg-purple-600 p-3 rounded-full z-10 shadow-lg">
|
| 164 |
+
<i class="fas fa-bars"></i>
|
| 165 |
+
</button>
|
| 166 |
+
|
| 167 |
+
<!-- Main content -->
|
| 168 |
+
<main class="flex-1 flex flex-col overflow-hidden">
|
| 169 |
+
<!-- Chat container -->
|
| 170 |
+
<div id="chat-container" class="flex-1 overflow-y-auto p-4 space-y-6">
|
| 171 |
+
<!-- Welcome message -->
|
| 172 |
+
<div class="max-w-3xl mx-auto message">
|
| 173 |
+
<div class="flex items-start space-x-3">
|
| 174 |
+
<div class="w-8 h-8 bg-purple-600 rounded-full flex items-center justify-center flex-shrink-0">
|
| 175 |
+
<i class="fas fa-robot text-sm"></i>
|
| 176 |
+
</div>
|
| 177 |
+
<div class="bg-gray-800 p-4 rounded-lg rounded-tl-none shadow-lg flex-1">
|
| 178 |
+
<div class="typewriter text-lg font-medium mb-1">Welcome to DarkBERT</div>
|
| 179 |
+
<p class="text-gray-300">I'm your AI assistant specialized in cybersecurity, dark web analysis, and advanced technical research. How can I assist you today?</p>
|
| 180 |
+
<div class="mt-3 grid grid-cols-1 md:grid-cols-2 gap-2">
|
| 181 |
+
<button class="prompt-suggestion bg-gray-700 hover:bg-gray-600 text-sm p-2 rounded transition text-left">
|
| 182 |
+
Explain the latest dark web threats
|
| 183 |
+
</button>
|
| 184 |
+
<button class="prompt-suggestion bg-gray-700 hover:bg-gray-600 text-sm p-2 rounded transition text-left">
|
| 185 |
+
Analyze this malware sample
|
| 186 |
+
</button>
|
| 187 |
+
<button class="prompt-suggestion bg-gray-700 hover:bg-gray-600 text-sm p-2 rounded transition text-left">
|
| 188 |
+
Suggest cybersecurity best practices
|
| 189 |
+
</button>
|
| 190 |
+
<button class="prompt-suggestion bg-gray-700 hover:bg-gray-600 text-sm p-2 rounded transition text-left">
|
| 191 |
+
Decode this encrypted message
|
| 192 |
+
</button>
|
| 193 |
+
<button class="prompt-suggestion bg-gray-700 hover:bg-gray-600 text-sm p-2 rounded transition text-left">
|
| 194 |
+
Help me fine-tune my model
|
| 195 |
+
</button>
|
| 196 |
+
</div>
|
| 197 |
+
</div>
|
| 198 |
+
</div>
|
| 199 |
+
</div>
|
| 200 |
+
|
| 201 |
+
<!-- Example conversation (would be dynamically generated in a real app) -->
|
| 202 |
+
<div class="max-w-3xl mx-auto message hidden" id="example-conversation">
|
| 203 |
+
<div class="flex items-start space-x-3">
|
| 204 |
+
<div class="w-8 h-8 bg-gray-700 rounded-full flex items-center justify-center flex-shrink-0">
|
| 205 |
+
<i class="fas fa-user text-sm"></i>
|
| 206 |
+
</div>
|
| 207 |
+
<div class="bg-gray-800 p-4 rounded-lg rounded-tl-none shadow-lg flex-1">
|
| 208 |
+
<p>Explain the Tor network architecture and its security implications</p>
|
| 209 |
+
</div>
|
| 210 |
+
</div>
|
| 211 |
+
|
| 212 |
+
<div class="flex items-start space-x-3 mt-4">
|
| 213 |
+
<div class="w-8 h-8 bg-purple-600 rounded-full flex items-center justify-center flex-shrink-0">
|
| 214 |
+
<i class="fas fa-robot text-sm"></i>
|
| 215 |
+
</div>
|
| 216 |
+
<div class="bg-gray-800 p-4 rounded-lg rounded-tl-none shadow-lg flex-1">
|
| 217 |
+
<p>The Tor (The Onion Router) network is a decentralized anonymity system that routes internet traffic through multiple encrypted relays. Key aspects:</p>
|
| 218 |
+
<ul class="list-disc pl-5 mt-2 space-y-1">
|
| 219 |
+
<li><strong>Layered Encryption:</strong> Uses onion routing with multiple layers of encryption</li>
|
| 220 |
+
<li><strong>Circuit Creation:</strong> Random path through at least 3 nodes (guard, middle, exit)</li>
|
| 221 |
+
<li><strong>Anonymity:</strong> Each node only knows immediate predecessor and successor</li>
|
| 222 |
+
</ul>
|
| 223 |
+
<p class="mt-2">Security considerations include potential exit node eavesdropping and correlation attacks. Would you like me to elaborate on any specific aspect?</p>
|
| 224 |
+
</div>
|
| 225 |
+
</div>
|
| 226 |
+
</div>
|
| 227 |
+
</div>
|
| 228 |
+
|
| 229 |
+
<!-- Input area -->
|
| 230 |
+
<div class="border-t border-gray-700 p-4 bg-gray-800">
|
| 231 |
+
<form id="chat-form" class="max-w-3xl mx-auto">
|
| 232 |
+
<div class="relative">
|
| 233 |
+
<textarea id="message-input" rows="1" class="w-full bg-gray-700 rounded-lg pl-4 pr-16 py-3 text-gray-200 focus:outline-none focus:ring-2 focus:ring-purple-600 resize-none" placeholder="Ask DarkBERT anything..." autofocus></textarea>
|
| 234 |
+
<div class="absolute right-2 bottom-2 flex space-x-1">
|
| 235 |
+
<button type="button" class="p-2 text-gray-400 hover:text-white rounded-full hover:bg-gray-600 transition">
|
| 236 |
+
<i class="fas fa-paperclip"></i>
|
| 237 |
+
</button>
|
| 238 |
+
<button type="submit" class="p-2 bg-purple-600 text-white rounded-full hover:bg-purple-700 transition">
|
| 239 |
+
<i class="fas fa-paper-plane"></i>
|
| 240 |
+
</button>
|
| 241 |
+
</div>
|
| 242 |
+
</div>
|
| 243 |
+
<div class="flex justify-between items-center mt-2 text-xs text-gray-400">
|
| 244 |
+
<div>
|
| 245 |
+
<button type="button" class="hover:text-gray-300 transition">
|
| 246 |
+
<i class="fas fa-magic mr-1"></i>Enhance Prompt
|
| 247 |
+
</button>
|
| 248 |
+
</div>
|
| 249 |
+
<div>
|
| 250 |
+
<span id="char-count">0</span>/4000
|
| 251 |
+
</div>
|
| 252 |
+
</div>
|
| 253 |
+
</form>
|
| 254 |
+
</div>
|
| 255 |
+
</main>
|
| 256 |
+
</div>
|
| 257 |
+
|
| 258 |
+
<!-- Mobile sidebar (hidden by default) -->
|
| 259 |
+
<div id="mobile-sidebar" class="fixed inset-0 bg-gray-900 bg-opacity-90 z-20 hidden">
|
| 260 |
+
<div class="h-full w-64 bg-gray-800 overflow-y-auto">
|
| 261 |
+
<div class="p-4">
|
| 262 |
+
<div class="flex justify-between items-center mb-6">
|
| 263 |
+
<h2 class="text-xl font-bold">Menu</h2>
|
| 264 |
+
<button id="close-mobile-sidebar" class="p-2 rounded-full hover:bg-gray-700">
|
| 265 |
+
<i class="fas fa-times"></i>
|
| 266 |
+
</button>
|
| 267 |
+
</div>
|
| 268 |
+
|
| 269 |
+
<div class="mb-6">
|
| 270 |
+
<button class="w-full bg-purple-600 hover:bg-purple-700 text-white py-2 px-3 rounded mb-2 text-left transition">
|
| 271 |
+
<i class="fas fa-plus mr-2"></i>New Chat
|
| 272 |
+
</button>
|
| 273 |
+
<button class="w-full bg-gray-700 hover:bg-gray-600 text-white py-2 px-3 rounded text-left transition">
|
| 274 |
+
<i class="fas fa-history mr-2"></i>History
|
| 275 |
+
</button>
|
| 276 |
+
</div>
|
| 277 |
+
|
| 278 |
+
<div class="mb-6">
|
| 279 |
+
<h2 class="text-lg font-semibold mb-2 text-gray-300">Saved Prompts</h2>
|
| 280 |
+
<div class="space-y-2">
|
| 281 |
+
<button class="w-full bg-gray-700 hover:bg-gray-600 text-white py-2 px-3 rounded text-left text-sm transition truncate">
|
| 282 |
+
<i class="fas fa-code mr-2"></i>Explain this code snippet...
|
| 283 |
+
</button>
|
| 284 |
+
<button class="w-full bg-gray-700 hover:bg-gray-600 text-white py-2 px-3 rounded text-left text-sm transition truncate">
|
| 285 |
+
<i class="fas fa-book mr-2"></i>Summarize research paper...
|
| 286 |
+
</button>
|
| 287 |
+
<button class="w-full bg-gray-700 hover:bg-gray-600 text-white py-2 px-3 rounded text-left text-sm transition truncate">
|
| 288 |
+
<i class="fas fa-terminal mr-2"></i>Debug this Python script...
|
| 289 |
+
</button>
|
| 290 |
+
</div>
|
| 291 |
+
</div>
|
| 292 |
+
</div>
|
| 293 |
+
</div>
|
| 294 |
+
</div>
|
| 295 |
+
|
| 296 |
+
<script>
|
| 297 |
+
// DOM elements
|
| 298 |
+
const chatForm = document.getElementById('chat-form');
|
| 299 |
+
const messageInput = document.getElementById('message-input');
|
| 300 |
+
const chatContainer = document.getElementById('chat-container');
|
| 301 |
+
const charCount = document.getElementById('char-count');
|
| 302 |
+
const themeToggle = document.getElementById('theme-toggle');
|
| 303 |
+
const mobileSidebarToggle = document.getElementById('mobile-sidebar-toggle');
|
| 304 |
+
const mobileSidebar = document.getElementById('mobile-sidebar');
|
| 305 |
+
const closeMobileSidebar = document.getElementById('close-mobile-sidebar');
|
| 306 |
+
const promptSuggestions = document.querySelectorAll('.prompt-suggestion');
|
| 307 |
+
const exampleConversation = document.getElementById('example-conversation');
|
| 308 |
+
|
| 309 |
+
// Auto-resize textarea
|
| 310 |
+
messageInput.addEventListener('input', function() {
|
| 311 |
+
this.style.height = 'auto';
|
| 312 |
+
this.style.height = (this.scrollHeight) + 'px';
|
| 313 |
+
|
| 314 |
+
// Update character count
|
| 315 |
+
charCount.textContent = this.value.length;
|
| 316 |
+
});
|
| 317 |
+
|
| 318 |
+
// Handle form submission
|
| 319 |
+
chatForm.addEventListener('submit', function(e) {
|
| 320 |
+
e.preventDefault();
|
| 321 |
+
const message = messageInput.value.trim();
|
| 322 |
+
|
| 323 |
+
if (message) {
|
| 324 |
+
// Add user message to chat
|
| 325 |
+
addMessageToChat(message, 'user');
|
| 326 |
+
|
| 327 |
+
// Clear input
|
| 328 |
+
messageInput.value = '';
|
| 329 |
+
messageInput.style.height = 'auto';
|
| 330 |
+
charCount.textContent = '0';
|
| 331 |
+
|
| 332 |
+
// Simulate AI response (in a real app, this would be an API call)
|
| 333 |
+
setTimeout(() => {
|
| 334 |
+
const responses = [
|
| 335 |
+
"I'm analyzing your request about '" + message + "'. This is a complex topic that requires careful consideration of multiple factors.",
|
| 336 |
+
"Based on my knowledge base, here's what I can tell you about '" + message + "'. First, we need to consider the security implications...",
|
| 337 |
+
"That's an interesting question about '" + message + "'. From a cybersecurity perspective, there are several key points to address..."
|
| 338 |
+
];
|
| 339 |
+
|
| 340 |
+
const randomResponse = responses[Math.floor(Math.random() * responses.length)];
|
| 341 |
+
addMessageToChat(randomResponse, 'ai');
|
| 342 |
+
}, 1000 + Math.random() * 2000); // Random delay between 1-3 seconds
|
| 343 |
+
}
|
| 344 |
+
});
|
| 345 |
+
|
| 346 |
+
// Add message to chat
|
| 347 |
+
function addMessageToChat(message, sender) {
|
| 348 |
+
const messageDiv = document.createElement('div');
|
| 349 |
+
messageDiv.className = 'max-w-3xl mx-auto message';
|
| 350 |
+
|
| 351 |
+
if (sender === 'user') {
|
| 352 |
+
messageDiv.innerHTML = `
|
| 353 |
+
<div class="flex items-start space-x-3">
|
| 354 |
+
<div class="w-8 h-8 bg-gray-700 rounded-full flex items-center justify-center flex-shrink-0">
|
| 355 |
+
<i class="fas fa-user text-sm"></i>
|
| 356 |
+
</div>
|
| 357 |
+
<div class="bg-gray-800 p-4 rounded-lg rounded-tl-none shadow-lg flex-1">
|
| 358 |
+
<p>${message}</p>
|
| 359 |
+
</div>
|
| 360 |
+
</div>
|
| 361 |
+
`;
|
| 362 |
+
} else {
|
| 363 |
+
messageDiv.innerHTML = `
|
| 364 |
+
<div class="flex items-start space-x-3">
|
| 365 |
+
<div class="w-8 h-8 bg-purple-600 rounded-full flex items-center justify-center flex-shrink-0">
|
| 366 |
+
<i class="fas fa-robot text-sm"></i>
|
| 367 |
+
</div>
|
| 368 |
+
<div class="bg-gray-800 p-4 rounded-lg rounded-tl-none shadow-lg flex-1">
|
| 369 |
+
<p>${message}</p>
|
| 370 |
+
</div>
|
| 371 |
+
</div>
|
| 372 |
+
`;
|
| 373 |
+
}
|
| 374 |
+
|
| 375 |
+
chatContainer.appendChild(messageDiv);
|
| 376 |
+
chatContainer.scrollTop = chatContainer.scrollHeight;
|
| 377 |
+
}
|
| 378 |
+
|
| 379 |
+
// Theme toggle
|
| 380 |
+
themeToggle.addEventListener('click', function() {
|
| 381 |
+
document.documentElement.classList.toggle('dark');
|
| 382 |
+
const icon = this.querySelector('i');
|
| 383 |
+
|
| 384 |
+
if (document.documentElement.classList.contains('dark')) {
|
| 385 |
+
icon.classList.remove('fa-sun');
|
| 386 |
+
icon.classList.add('fa-moon');
|
| 387 |
+
icon.classList.add('text-yellow-400');
|
| 388 |
+
} else {
|
| 389 |
+
icon.classList.remove('fa-moon');
|
| 390 |
+
icon.classList.remove('text-yellow-400');
|
| 391 |
+
icon.classList.add('fa-sun');
|
| 392 |
+
}
|
| 393 |
+
});
|
| 394 |
+
|
| 395 |
+
// Mobile sidebar toggle
|
| 396 |
+
mobileSidebarToggle.addEventListener('click', function() {
|
| 397 |
+
mobileSidebar.classList.remove('hidden');
|
| 398 |
+
});
|
| 399 |
+
|
| 400 |
+
closeMobileSidebar.addEventListener('click', function() {
|
| 401 |
+
mobileSidebar.classList.add('hidden');
|
| 402 |
+
});
|
| 403 |
+
|
| 404 |
+
// Prompt suggestions
|
| 405 |
+
promptSuggestions.forEach(button => {
|
| 406 |
+
button.addEventListener('click', function() {
|
| 407 |
+
messageInput.value = this.textContent.trim();
|
| 408 |
+
messageInput.focus();
|
| 409 |
+
messageInput.dispatchEvent(new Event('input'));
|
| 410 |
+
|
| 411 |
+
// Show example conversation
|
| 412 |
+
exampleConversation.classList.remove('hidden');
|
| 413 |
+
chatContainer.scrollTop = chatContainer.scrollHeight;
|
| 414 |
+
});
|
| 415 |
+
});
|
| 416 |
+
|
| 417 |
+
// Initial character count
|
| 418 |
+
charCount.textContent = messageInput.value.length;
|
| 419 |
+
</script>
|
| 420 |
+
<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=JarlJarle/darkbert" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 421 |
+
</html>
|