alkawthar alhaqq commited on
Commit
f291ed6
·
verified ·
1 Parent(s): dd8571d

the app name is CodeThar and there's option for agent to help it ppl so please updata - Initial Deployment

Browse files
Files changed (2) hide show
  1. README.md +7 -5
  2. index.html +979 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Codethar
3
- emoji: 💻
4
- colorFrom: indigo
5
- colorTo: purple
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: codethar
3
+ emoji: 🐳
4
+ colorFrom: yellow
5
+ colorTo: yellow
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,979 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Thar Agent - AI-Powered Development Assistant</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
+ <script>
10
+ tailwind.config = {
11
+ theme: {
12
+ extend: {
13
+ colors: {
14
+ primary: '#0ea5e9',
15
+ secondary: '#0f172a',
16
+ dark: '#020617'
17
+ }
18
+ }
19
+ }
20
+ }
21
+ </script>
22
+ <style>
23
+ .mode-btn.active {
24
+ background-color: #0ea5e9;
25
+ color: white;
26
+ }
27
+
28
+ .mode-btn:hover {
29
+ background-color: #0ea5e9;
30
+ color: white;
31
+ }
32
+
33
+ .animate-fade-in {
34
+ animation: fadeIn 0.5s ease-in;
35
+ }
36
+
37
+ @keyframes fadeIn {
38
+ from { opacity: 0; }
39
+ to { opacity: 1; }
40
+ }
41
+
42
+ .code-editor {
43
+ font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
44
+ font-size: 14px;
45
+ line-height: 1.5;
46
+ }
47
+
48
+ .output-container {
49
+ max-height: 500px;
50
+ overflow-y: auto;
51
+ }
52
+
53
+ .status-indicator {
54
+ display: inline-block;
55
+ width: 12px;
56
+ height: 12px;
57
+ border-radius: 50%;
58
+ margin-right: 8px;
59
+ }
60
+
61
+ .status-idle { background-color: #64748b; }
62
+ .status-loading { background-color: #f59e0b; }
63
+ .status-success { background-color: #10b981; }
64
+ .status-error { background-color: #ef4444; }
65
+
66
+ .feature-card {
67
+ transition: all 0.3s ease;
68
+ border: 1px solid #334155;
69
+ }
70
+
71
+ .feature-card:hover {
72
+ transform: translateY(-5px);
73
+ border-color: #0ea5e9;
74
+ box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25);
75
+ }
76
+
77
+ .hero-gradient {
78
+ background: linear-gradient(135deg, #0f172a 0%, #020617 100%);
79
+ }
80
+ </style>
81
+ </head>
82
+ <body class="bg-dark text-slate-200 min-h-screen flex flex-col">
83
+ <div class="flex-grow">
84
+ <!-- Header -->
85
+ <header class="bg-secondary border-b border-slate-800">
86
+ <div class="container mx-auto px-4 py-3 flex flex-col sm:flex-row justify-between items-center">
87
+ <div class="flex items-center mb-4 sm:mb-0">
88
+ <div class="bg-primary w-10 h-10 rounded-lg flex items-center justify-center mr-3">
89
+ <i class="fas fa-robot text-white text-xl"></i>
90
+ </div>
91
+ <h1 class="text-2xl font-bold text-white">Thar Agent</h1>
92
+ </div>
93
+
94
+ <nav class="flex flex-wrap justify-center gap-2">
95
+ <button class="mode-btn px-3 py-1.5 rounded-lg text-sm font-medium transition-colors" data-mode="home">
96
+ Home
97
+ </button>
98
+ <button class="mode-btn px-3 py-1.5 rounded-lg text-sm font-medium transition-colors" data-mode="thar-agent">
99
+ Thar Agent
100
+ </button>
101
+ <button class="mode-btn px-3 py-1.5 rounded-lg text-sm font-medium transition-colors" data-mode="design">
102
+ Design
103
+ </button>
104
+ <button class="mode-btn px-3 py-1.5 rounded-lg text-sm font-medium transition-colors" data-mode="generate">
105
+ Generate
106
+ </button>
107
+ <button class="mode-btn px-3 py-1.5 rounded-lg text-sm font-medium transition-colors" data-mode="review">
108
+ Review
109
+ </button>
110
+ <button class="mode-btn px-3 py-1.5 rounded-lg text-sm font-medium transition-colors" data-mode="fix">
111
+ Fix
112
+ </button>
113
+ <button class="mode-btn px-3 py-1.5 rounded-lg text-sm font-medium transition-colors" data-mode="tests">
114
+ Tests
115
+ </button>
116
+ <button class="mode-btn px-3 py-1.5 rounded-lg text-sm font-medium transition-colors" data-mode="devops">
117
+ DevOps
118
+ </button>
119
+ <button class="mode-btn px-3 py-1.5 rounded-lg text-sm font-medium transition-colors" data-mode="data">
120
+ Data
121
+ </button>
122
+ <button class="mode-btn px-3 py-1.5 rounded-lg text-sm font-medium transition-colors" data-mode="research">
123
+ Research
124
+ </button>
125
+ <button class="mode-btn px-3 py-1.5 rounded-lg text-sm font-medium transition-colors" data-mode="security">
126
+ Security
127
+ </button>
128
+ <button class="mode-btn px-3 py-1.5 rounded-lg text-sm font-medium transition-colors" data-mode="docs">
129
+ Docs
130
+ </button>
131
+ </nav>
132
+ </div>
133
+ </header>
134
+
135
+ <!-- Main Content -->
136
+ <main class="flex-grow container mx-auto px-4 py-8">
137
+ <!-- Home View -->
138
+ <div id="home-view" class="animate-fade-in">
139
+ <section class="hero-gradient rounded-2xl p-8 mb-12 text-center">
140
+ <h1 class="text-4xl md:text-5xl font-bold text-white mb-4">AI-Powered Development Assistant</h1>
141
+ <p class="text-xl text-slate-300 max-w-3xl mx-auto mb-8">
142
+ Thar Agent helps you design, generate, review, and improve your code with the power of AI
143
+ </p>
144
+ <div class="flex justify-center">
145
+ <button class="bg-primary hover:bg-cyan-500 text-white font-bold py-3 px-8 rounded-lg transition duration-300 transform hover:scale-105">
146
+ Get Started
147
+ </button>
148
+ </div>
149
+ </section>
150
+
151
+ <section class="mb-16">
152
+ <h2 class="text-3xl font-bold text-center mb-12 text-white">Features</h2>
153
+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
154
+ <div class="feature-card bg-secondary p-6 rounded-xl">
155
+ <div class="text-primary mb-4">
156
+ <i class="fas fa-drafting-compass text-3xl"></i>
157
+ </div>
158
+ <h3 class="text-xl font-bold mb-2 text-white">System Design</h3>
159
+ <p class="text-slate-400">Generate comprehensive system designs from high-level requirements</p>
160
+ </div>
161
+
162
+ <div class="feature-card bg-secondary p-6 rounded-xl">
163
+ <div class="text-primary mb-4">
164
+ <i class="fas fa-code text-3xl"></i>
165
+ </div>
166
+ <h3 class="text-xl font-bold mb-2 text-white">Code Generation</h3>
167
+ <p class="text-slate-400">Create code in multiple languages based on your specifications</p>
168
+ </div>
169
+
170
+ <div class="feature-card bg-secondary p-6 rounded-xl">
171
+ <div class="text-primary mb-4">
172
+ <i class="fas fa-search text-3xl"></i>
173
+ </div>
174
+ <h3 class="text-xl font-bold mb-2 text-white">Code Review</h3>
175
+ <p class="text-slate-400">Get detailed feedback on your code quality and suggestions for improvement</p>
176
+ </div>
177
+
178
+ <div class="feature-card bg-secondary p-6 rounded-xl">
179
+ <div class="text-primary mb-4">
180
+ <i class="fas fa-bug text-3xl"></i>
181
+ </div>
182
+ <h3 class="text-xl font-bold mb-2 text-white">Bug Fixing</h3>
183
+ <p class="text-slate-400">Automatically identify and fix bugs in your code</p>
184
+ </div>
185
+
186
+ <div class="feature-card bg-secondary p-6 rounded-xl">
187
+ <div class="text-primary mb-4">
188
+ <i class="fas fa-vial text-3xl"></i>
189
+ </div>
190
+ <h3 class="text-xl font-bold mb-2 text-white">Test Generation</h3>
191
+ <p class="text-slate-400">Generate comprehensive test suites for your code</p>
192
+ </div>
193
+
194
+ <div class="feature-card bg-secondary p-6 rounded-xl">
195
+ <div class="text-primary mb-4">
196
+ <i class="fas fa-shield-alt text-3xl"></i>
197
+ </div>
198
+ <h3 class="text-xl font-bold mb-2 text-white">Security Scanning</h3>
199
+ <p class="text-slate-400">Identify potential security vulnerabilities in your code</p>
200
+ </div>
201
+ </div>
202
+ </section>
203
+
204
+ <section class="text-center">
205
+ <h2 class="text-3xl font-bold mb-6 text-white">How It Works</h2>
206
+ <div class="flex flex-col md:flex-row justify-center items-center gap-8">
207
+ <div class="flex flex-col items-center">
208
+ <div class="bg-primary w-16 h-16 rounded-full flex items-center justify-center mb-4">
209
+ <i class="fas fa-edit text-white text-2xl"></i>
210
+ </div>
211
+ <h3 class="text-xl font-bold text-white mb-2">1. Describe</h3>
212
+ <p class="text-slate-400 max-w-xs">Tell Thar Agent what you want to build or improve</p>
213
+ </div>
214
+
215
+ <div class="hidden md:block text-primary">
216
+ <i class="fas fa-arrow-right text-3xl"></i>
217
+ </div>
218
+
219
+ <div class="flex flex-col items-center">
220
+ <div class="bg-primary w-16 h-16 rounded-full flex items-center justify-center mb-4">
221
+ <i class="fas fa-magic text-white text-2xl"></i>
222
+ </div>
223
+ <h3 class="text-xl font-bold text-white mb-2">2. Process</h3>
224
+ <p class="text-slate-400 max-w-xs">Our AI analyzes and processes your request</p>
225
+ </div>
226
+
227
+ <div class="hidden md:block text-primary">
228
+ <i class="fas fa-arrow-right text-3xl"></i>
229
+ </div>
230
+
231
+ <div class="flex flex-col items-center">
232
+ <div class="bg-primary w-16 h-16 rounded-full flex items-center justify-center mb-4">
233
+ <i class="fas fa-download text-white text-2xl"></i>
234
+ </div>
235
+ <h3 class="text-xl font-bold text-white mb-2">3. Receive</h3>
236
+ <p class="text-slate-400 max-w-xs">Get high-quality code, designs, or solutions</p>
237
+ </div>
238
+ </div>
239
+ </section>
240
+ </div>
241
+
242
+ <!-- Thar Agent View -->
243
+ <div id="thar-agent-view" class="hidden animate-fade-in">
244
+ <div class="bg-secondary rounded-xl p-6 mb-6">
245
+ <h2 class="text-2xl font-bold text-white mb-4">Thar Agent</h2>
246
+ <div class="mb-4">
247
+ <label class="block text-slate-400 mb-2">Goal</label>
248
+ <textarea
249
+ id="thar-agent-goal"
250
+ class="w-full bg-slate-800 text-white rounded-lg p-4 focus:outline-none focus:ring-2 focus:ring-primary"
251
+ rows="3"
252
+ placeholder="Describe what you want to build..."></textarea>
253
+ </div>
254
+ <button id="run-thar-agent" class="bg-primary hover:bg-cyan-500 text-white font-bold py-2 px-6 rounded-lg transition duration-300">
255
+ Run Thar Agent
256
+ </button>
257
+ </div>
258
+
259
+ <div class="bg-secondary rounded-xl p-6">
260
+ <div class="flex items-center mb-4">
261
+ <div class="status-indicator status-idle" id="thar-agent-status"></div>
262
+ <span id="thar-agent-status-text" class="text-slate-400">Idle</span>
263
+ </div>
264
+ <div id="thar-agent-output" class="bg-slate-800 rounded-lg p-4 min-h-[200px]">
265
+ <p class="text-slate-500 text-center py-12">Results will appear here...</p>
266
+ </div>
267
+ </div>
268
+ </div>
269
+
270
+ <!-- Design View -->
271
+ <div id="design-view" class="hidden animate-fade-in">
272
+ <div class="bg-secondary rounded-xl p-6 mb-6">
273
+ <h2 class="text-2xl font-bold text-white mb-4">System Design</h2>
274
+ <div class="mb-4">
275
+ <label class="block text-slate-400 mb-2">Design Prompt</label>
276
+ <textarea
277
+ id="design-prompt"
278
+ class="w-full bg-slate-800 text-white rounded-lg p-4 focus:outline-none focus:ring-2 focus:ring-primary"
279
+ rows="4"
280
+ placeholder="Describe the system you want to design..."></textarea>
281
+ </div>
282
+ <button id="run-design" class="bg-primary hover:bg-cyan-500 text-white font-bold py-2 px-6 rounded-lg transition duration-300">
283
+ Generate Design
284
+ </button>
285
+ </div>
286
+
287
+ <div class="bg-secondary rounded-xl p-6">
288
+ <h3 class="text-xl font-bold text-white mb-4">Output</h3>
289
+ <div id="design-output" class="bg-slate-800 rounded-lg p-4 min-h-[300px]">
290
+ <p class="text-slate-500 text-center py-12">Design will appear here...</p>
291
+ </div>
292
+ </div>
293
+ </div>
294
+
295
+ <!-- Generate View -->
296
+ <div id="generate-view" class="hidden animate-fade-in">
297
+ <div class="bg-secondary rounded-xl p-6 mb-6">
298
+ <h2 class="text-2xl font-bold text-white mb-4">Code Generation</h2>
299
+ <div class="mb-4">
300
+ <label class="block text-slate-400 mb-2">Prompt</label>
301
+ <textarea
302
+ id="generate-prompt"
303
+ class="w-full bg-slate-800 text-white rounded-lg p-4 focus:outline-none focus:ring-2 focus:ring-primary"
304
+ rows="4"
305
+ placeholder="Describe what you want to generate..."></textarea>
306
+ </div>
307
+ <div class="mb-4">
308
+ <label class="block text-slate-400 mb-2">Language</label>
309
+ <select id="generate-language" class="w-full bg-slate-800 text-white rounded-lg p-2 focus:outline-none focus:ring-2 focus:ring-primary">
310
+ <option>Python</option>
311
+ <option>JavaScript</option>
312
+ <option>Java</option>
313
+ <option>C++</option>
314
+ </select>
315
+ </div>
316
+ <button id="run-generate" class="bg-primary hover:bg-cyan-500 text-white font-bold py-2 px-6 rounded-lg transition duration-300">
317
+ Generate Code
318
+ </button>
319
+ </div>
320
+
321
+ <div class="bg-secondary rounded-xl p-6">
322
+ <h3 class="text-xl font-bold text-white mb-4">Output</h3>
323
+ <div id="generate-output" class="bg-slate-800 rounded-lg p-4 min-h-[300px] code-editor">
324
+ <p class="text-slate-500 text-center py-12">Generated code will appear here...</p>
325
+ </div>
326
+ </div>
327
+ </div>
328
+
329
+ <!-- Review View -->
330
+ <div id="review-view" class="hidden animate-fade-in">
331
+ <div class="bg-secondary rounded-xl p-6 mb-6">
332
+ <h2 class="text-2xl font-bold text-white mb-4">Code Review</h2>
333
+ <div class="mb-4">
334
+ <label class="block text-slate-400 mb-2">Code to Review</label>
335
+ <textarea
336
+ id="review-code"
337
+ class="w-full bg-slate-800 text-white rounded-lg p-4 focus:outline-none focus:ring-2 focus:ring-primary"
338
+ rows="6"
339
+ placeholder="Paste your code here..."></textarea>
340
+ </div>
341
+ <div class="mb-4">
342
+ <label class="block text-slate-400 mb-2">Language</label>
343
+ <select id="review-language" class="w-full bg-slate-800 text-white rounded-lg p-2 focus:outline-none focus:ring-2 focus:ring-primary">
344
+ <option>Python</option>
345
+ <option>JavaScript</option>
346
+ <option>Java</option>
347
+ <option>C++</option>
348
+ </select>
349
+ </div>
350
+ <button id="run-review" class="bg-primary hover:bg-cyan-500 text-white font-bold py-2 px-6 rounded-lg transition duration-300">
351
+ Review Code
352
+ </button>
353
+ </div>
354
+
355
+ <div class="bg-secondary rounded-xl p-6">
356
+ <h3 class="text-xl font-bold text-white mb-4">Review Results</h3>
357
+ <div id="review-output" class="bg-slate-800 rounded-lg p-4 min-h-[300px]">
358
+ <p class="text-slate-500 text-center py-12">Review results will appear here...</p>
359
+ </div>
360
+ </div>
361
+ </div>
362
+
363
+ <!-- Fix View -->
364
+ <div id="fix-view" class="hidden animate-fade-in">
365
+ <div class="bg-secondary rounded-xl p-6 mb-6">
366
+ <h2 class="text-2xl font-bold text-white mb-4">Code Fixer</h2>
367
+ <div class="mb-4">
368
+ <label class="block text-slate-400 mb-2">Code to Fix</label>
369
+ <textarea
370
+ id="fix-code"
371
+ class="w-full bg-slate-800 text-white rounded-lg p-4 focus:outline-none focus:ring-2 focus:ring-primary"
372
+ rows="6"
373
+ placeholder="Paste your code here..."></textarea>
374
+ </div>
375
+ <div class="mb-4">
376
+ <label class="block text-slate-400 mb-2">Language</label>
377
+ <select id="fix-language" class="w-full bg-slate-800 text-white rounded-lg p-2 focus:outline-none focus:ring-2 focus:ring-primary">
378
+ <option>Python</option>
379
+ <option>JavaScript</option>
380
+ <option>Java</option>
381
+ <option>C++</option>
382
+ </select>
383
+ </div>
384
+ <button id="run-fix" class="bg-primary hover:bg-cyan-500 text-white font-bold py-2 px-6 rounded-lg transition duration-300">
385
+ Fix Code
386
+ </button>
387
+ </div>
388
+
389
+ <div class="bg-secondary rounded-xl p-6">
390
+ <h3 class="text-xl font-bold text-white mb-4">Fixed Code</h3>
391
+ <div id="fix-output" class="bg-slate-800 rounded-lg p-4 min-h-[300px] code-editor">
392
+ <p class="text-slate-500 text-center py-12">Fixed code will appear here...</p>
393
+ </div>
394
+ </div>
395
+ </div>
396
+
397
+ <!-- Tests View -->
398
+ <div id="tests-view" class="hidden animate-fade-in">
399
+ <div class="bg-secondary rounded-xl p-6 mb-6">
400
+ <h2 class="text-2xl font-bold text-white mb-4">Test Generator</h2>
401
+ <div class="mb-4">
402
+ <label class="block text-slate-400 mb-2">Code to Test</label>
403
+ <textarea
404
+ id="test-code"
405
+ class="w-full bg-slate-800 text-white rounded-lg p-4 focus:outline-none focus:ring-2 focus:ring-primary"
406
+ rows="6"
407
+ placeholder="Paste your code here..."></textarea>
408
+ </div>
409
+ <div class="mb-4">
410
+ <label class="block text-slate-400 mb-2">Language</label>
411
+ <select id="test-language" class="w-full bg-slate-800 text-white rounded-lg p-2 focus:outline-none focus:ring-2 focus:ring-primary">
412
+ <option>Python</option>
413
+ <option>JavaScript</option>
414
+ <option>Java</option>
415
+ <option>C++</option>
416
+ </select>
417
+ </div>
418
+ <button id="run-tests" class="bg-primary hover:bg-cyan-500 text-white font-bold py-2 px-6 rounded-lg transition duration-300">
419
+ Generate Tests
420
+ </button>
421
+ </div>
422
+
423
+ <div class="bg-secondary rounded-xl p-6">
424
+ <h3 class="text-xl font-bold text-white mb-4">Generated Tests</h3>
425
+ <div id="test-output" class="bg-slate-800 rounded-lg p-4 min-h-[300px] code-editor">
426
+ <p class="text-slate-500 text-center py-12">Tests will appear here...</p>
427
+ </div>
428
+ </div>
429
+ </div>
430
+
431
+ <!-- DevOps View -->
432
+ <div id="devops-view" class="hidden animate-fade-in">
433
+ <div class="bg-secondary rounded-xl p-6 mb-6">
434
+ <h2 class="text-2xl font-bold text-white mb-4">DevOps Configuration</h2>
435
+ <div class="mb-4">
436
+ <label class="block text-slate-400 mb-2">DevOps Prompt</label>
437
+ <textarea
438
+ id="devops-prompt"
439
+ class="w-full bg-slate-800 text-white rounded-lg p-4 focus:outline-none focus:ring-2 focus:ring-primary"
440
+ rows="4"
441
+ placeholder="Describe your DevOps requirements..."></textarea>
442
+ </div>
443
+ <button id="run-devops" class="bg-primary hover:bg-cyan-500 text-white font-bold py-2 px-6 rounded-lg transition duration-300">
444
+ Generate Config
445
+ </button>
446
+ </div>
447
+
448
+ <div class="bg-secondary rounded-xl p-6">
449
+ <h3 class="text-xl font-bold text-white mb-4">Configuration</h3>
450
+ <div id="devops-output" class="bg-slate-800 rounded-lg p-4 min-h-[300px] code-editor">
451
+ <p class="text-slate-500 text-center py-12">DevOps configuration will appear here...</p>
452
+ </div>
453
+ </div>
454
+ </div>
455
+
456
+ <!-- Data View -->
457
+ <div id="data-view" class="hidden animate-fade-in">
458
+ <div class="bg-secondary rounded-xl p-6 mb-6">
459
+ <h2 class="text-2xl font-bold text-white mb-4">Data Science Script</h2>
460
+ <div class="mb-4">
461
+ <label class="block text-slate-400 mb-2">Data Prompt</label>
462
+ <textarea
463
+ id="data-prompt"
464
+ class="w-full bg-slate-800 text-white rounded-lg p-4 focus:outline-none focus:ring-2 focus:ring-primary"
465
+ rows="4"
466
+ placeholder="Describe your data analysis requirements..."></textarea>
467
+ </div>
468
+ <div class="mb-4">
469
+ <label class="block text-slate-400 mb-2">Language</label>
470
+ <select id="data-language" class="w-full bg-slate-800 text-white rounded-lg p-2 focus:outline-none focus:ring-2 focus:ring-primary">
471
+ <option>Python</option>
472
+ <option>R</option>
473
+ <option>SQL</option>
474
+ </select>
475
+ </div>
476
+ <button id="run-data" class="bg-primary hover:bg-cyan-500 text-white font-bold py-2 px-6 rounded-lg transition duration-300">
477
+ Generate Script
478
+ </button>
479
+ </div>
480
+
481
+ <div class="bg-secondary rounded-xl p-6">
482
+ <h3 class="text-xl font-bold text-white mb-4">Generated Script</h3>
483
+ <div id="data-output" class="bg-slate-800 rounded-lg p-4 min-h-[300px] code-editor">
484
+ <p class="text-slate-500 text-center py-12">Data script will appear here...</p>
485
+ </div>
486
+ </div>
487
+ </div>
488
+
489
+ <!-- Research View -->
490
+ <div id="research-view" class="hidden animate-fade-in">
491
+ <div class="bg-secondary rounded-xl p-6 mb-6">
492
+ <h2 class="text-2xl font-bold text-white mb-4">Research Assistant</h2>
493
+ <div class="mb-4">
494
+ <label class="block text-slate-400 mb-2">Research Topic</label>
495
+ <textarea
496
+ id="research-prompt"
497
+ class="w-full bg-slate-800 text-white rounded-lg p-4 focus:outline-none focus:ring-2 focus:ring-primary"
498
+ rows="4"
499
+ placeholder="Describe the topic you want to research..."></textarea>
500
+ </div>
501
+ <button id="run-research" class="bg-primary hover:bg-cyan-500 text-white font-bold py-2 px-6 rounded-lg transition duration-300">
502
+ Research Topic
503
+ </button>
504
+ </div>
505
+
506
+ <div class="bg-secondary rounded-xl p-6">
507
+ <h3 class="text-xl font-bold text-white mb-4">Research Results</h3>
508
+ <div id="research-output" class="bg-slate-800 rounded-lg p-4 min-h-[300px]">
509
+ <p class="text-slate-500 text-center py-12">Research results will appear here...</p>
510
+ </div>
511
+ </div>
512
+ </div>
513
+
514
+ <!-- Security View -->
515
+ <div id="security-view" class="hidden animate-fade-in">
516
+ <div class="bg-secondary rounded-xl p-6 mb-6">
517
+ <h2 class="text-2xl font-bold text-white mb-4">Security Scanner</h2>
518
+ <div class="mb-4">
519
+ <label class="block text-slate-400 mb-2">Code to Scan</label>
520
+ <textarea
521
+ id="security-code"
522
+ class="w-full bg-slate-800 text-white rounded-lg p-4 focus:outline-none focus:ring-2 focus:ring-primary"
523
+ rows="6"
524
+ placeholder="Paste your code here..."></textarea>
525
+ </div>
526
+ <div class="mb-4">
527
+ <label class="block text-slate-400 mb-2">Language</label>
528
+ <select id="security-language" class="w-full bg-slate-800 text-white rounded-lg p-2 focus:outline-none focus:ring-2 focus:ring-primary">
529
+ <option>Python</option>
530
+ <option>JavaScript</option>
531
+ <option>Java</option>
532
+ <option>C++</option>
533
+ </select>
534
+ </div>
535
+ <button id="run-security" class="bg-primary hover:bg-cyan-500 text-white font-bold py-2 px-6 rounded-lg transition duration-300">
536
+ Scan Code
537
+ </button>
538
+ </div>
539
+
540
+ <div class="bg-secondary rounded-xl p-6">
541
+ <h3 class="text-xl font-bold text-white mb-4">Security Report</h3>
542
+ <div id="security-output" class="bg-slate-800 rounded-lg p-4 min-h-[300px]">
543
+ <p class="text-slate-500 text-center py-12">Security report will appear here...</p>
544
+ </div>
545
+ </div>
546
+ </div>
547
+
548
+ <!-- Docs View -->
549
+ <div id="docs-view" class="hidden animate-fade-in">
550
+ <div class="bg-secondary rounded-xl p-6 mb-6">
551
+ <h2 class="text-2xl font-bold text-white mb-4">Documentation Generator</h2>
552
+ <div class="mb-4">
553
+ <label class="block text-slate-400 mb-2">Code to Document</label>
554
+ <textarea
555
+ id="docs-code"
556
+ class="w-full bg-slate-800 text-white rounded-lg p-4 focus:outline-none focus:ring-2 focus:ring-primary"
557
+ rows="6"
558
+ placeholder="Paste your code here..."></textarea>
559
+ </div>
560
+ <div class="mb-4">
561
+ <label class="block text-slate-400 mb-2">Language</label>
562
+ <select id="docs-language" class="w-full bg-slate-800 text-white rounded-lg p-2 focus:outline-none focus:ring-2 focus:ring-primary">
563
+ <option>Python</option>
564
+ <option>JavaScript</option>
565
+ <option>Java</option>
566
+ <option>C++</option>
567
+ </select>
568
+ </div>
569
+ <button id="run-docs" class="bg-primary hover:bg-cyan-500 text-white font-bold py-2 px-6 rounded-lg transition duration-300">
570
+ Generate Docs
571
+ </button>
572
+ </div>
573
+
574
+ <div class="bg-secondary rounded-xl p-6">
575
+ <h3 class="text-xl font-bold text-white mb-4">Documentation</h3>
576
+ <div id="docs-output" class="bg-slate-800 rounded-lg p-4 min-h-[300px]">
577
+ <p class="text-slate-500 text-center py-12">Documentation will appear here...</p>
578
+ </div>
579
+ </div>
580
+ </div>
581
+ </main>
582
+
583
+ <!-- Footer -->
584
+ <footer class="text-center p-6 bg-secondary border-t border-slate-800 mt-8">
585
+ <p class="text-slate-500 text-sm">
586
+ Developed by
587
+ <a href="https://github.com/google/labs-prototyping-platforms" target="_blank" rel="noopener noreferrer" class="font-semibold text-cyan-400 hover:text-cyan-300 transition-colors">
588
+ alkawthar
589
+ </a>.
590
+ Powered by the Gemini API.
591
+ </p>
592
+ </footer>
593
+ </div>
594
+
595
+ <script>
596
+ // DOM Elements
597
+ const modeButtons = document.querySelectorAll('.mode-btn');
598
+ const views = {
599
+ 'home': document.getElementById('home-view'),
600
+ 'thar-agent': document.getElementById('thar-agent-view'),
601
+ 'design': document.getElementById('design-view'),
602
+ 'generate': document.getElementById('generate-view'),
603
+ 'review': document.getElementById('review-view'),
604
+ 'fix': document.getElementById('fix-view'),
605
+ 'tests': document.getElementById('tests-view'),
606
+ 'devops': document.getElementById('devops-view'),
607
+ 'data': document.getElementById('data-view'),
608
+ 'research': document.getElementById('research-view'),
609
+ 'security': document.getElementById('security-view'),
610
+ 'docs': document.getElementById('docs-view')
611
+ };
612
+
613
+ // Set initial active mode
614
+ let currentMode = 'home';
615
+ updateActiveMode();
616
+
617
+ // Mode switching
618
+ modeButtons.forEach(button => {
619
+ button.addEventListener('click', () => {
620
+ const mode = button.getAttribute('data-mode');
621
+ switchMode(mode);
622
+ });
623
+ });
624
+
625
+ // Mode switching function
626
+ function switchMode(mode) {
627
+ if (mode === currentMode) return;
628
+
629
+ // Hide current view
630
+ if (views[currentMode]) {
631
+ views[currentMode].classList.add('hidden');
632
+ }
633
+
634
+ // Show new view
635
+ if (views[mode]) {
636
+ views[mode].classList.remove('hidden');
637
+ views[mode].classList.add('animate-fade-in');
638
+ }
639
+
640
+ currentMode = mode;
641
+ updateActiveMode();
642
+ }
643
+
644
+ // Update active mode button
645
+ function updateActiveMode() {
646
+ modeButtons.forEach(button => {
647
+ const mode = button.getAttribute('data-mode');
648
+ if (mode === currentMode) {
649
+ button.classList.add('active');
650
+ } else {
651
+ button.classList.remove('active');
652
+ }
653
+ });
654
+ }
655
+
656
+ // Simulate API calls with timeouts
657
+ document.getElementById('run-thar-agent').addEventListener('click', function() {
658
+ const status = document.getElementById('thar-agent-status');
659
+ const statusText = document.getElementById('thar-agent-status-text');
660
+ const output = document.getElementById('thar-agent-output');
661
+
662
+ status.className = 'status-indicator status-loading';
663
+ statusText.textContent = 'Processing...';
664
+ output.innerHTML = '<p class="text-slate-400 text-center py-12">Analyzing your request...</p>';
665
+
666
+ setTimeout(() => {
667
+ status.className = 'status-indicator status-success';
668
+ statusText.textContent = 'Completed';
669
+ output.innerHTML = `
670
+ <div class="text-white">
671
+ <h3 class="text-xl font-bold mb-2">System Design for E-commerce Platform</h3>
672
+ <p class="mb-4">Here's a comprehensive design for your e-commerce platform:</p>
673
+ <ul class="list-disc pl-5 mb-4">
674
+ <li>Microservices architecture with separate services for user management, product catalog, order processing, and payment handling</li>
675
+ <li>API Gateway for routing and authentication</li>
676
+ <li>Database design with PostgreSQL for transactional data and Redis for caching</li>
677
+ <li>Frontend built with React and Redux for state management</li>
678
+ <li>Deployment using Docker containers orchestrated with Kubernetes</li>
679
+ </ul>
680
+ <p>Would you like me to elaborate on any specific component?</p>
681
+ </div>
682
+ `;
683
+ }, 2000);
684
+ });
685
+
686
+ // Simulate other API calls
687
+ document.getElementById('run-design').addEventListener('click', function() {
688
+ const output = document.getElementById('design-output');
689
+ output.innerHTML = '<p class="text-slate-400 text-center py-12">Generating design...</p>';
690
+
691
+ setTimeout(() => {
692
+ output.innerHTML = `
693
+ <div class="text-white">
694
+ <h3 class="text-xl font-bold mb-2">System Design for E-commerce Platform</h3>
695
+ <p class="mb-4">Architecture Overview:</p>
696
+ <ul class="list-disc pl-5 mb-4">
697
+ <li>Microservices architecture with separate services for user management, product catalog, order processing, and payment handling</li>
698
+ <li>API Gateway for routing and authentication</li>
699
+ <li>Database design with PostgreSQL for transactional data and Redis for caching</li>
700
+ <li>Frontend built with React and Redux for state management</li>
701
+ <li>Deployment using Docker containers orchestrated with Kubernetes</li>
702
+ </ul>
703
+ </div>
704
+ `;
705
+ }, 1500);
706
+ });
707
+
708
+ document.getElementById('run-generate').addEventListener('click', function() {
709
+ const output = document.getElementById('generate-output');
710
+ output.innerHTML = '<p class="text-slate-400 text-center py-12">Generating code...</p>';
711
+
712
+ setTimeout(() => {
713
+ output.innerHTML = `
714
+ <pre class="text-white">
715
+ def fibonacci(n):
716
+ """Generate Fibonacci sequence up to n terms"""
717
+ if n <= 0:
718
+ return []
719
+ elif n == 1:
720
+ return [0]
721
+ elif n == 2:
722
+ return [0, 1]
723
+
724
+ sequence = [0, 1]
725
+ for i in range(2, n):
726
+ sequence.append(sequence[i-1] + sequence[i-2])
727
+ return sequence
728
+
729
+ # Example usage
730
+ print(fibonacci(10)) # [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
731
+ </pre>
732
+ `;
733
+ }, 1500);
734
+ });
735
+
736
+ document.getElementById('run-review').addEventListener('click', function() {
737
+ const output = document.getElementById('review-output');
738
+ output.innerHTML = '<p class="text-slate-400 text-center py-12">Reviewing code...</p>';
739
+
740
+ setTimeout(() => {
741
+ output.innerHTML = `
742
+ <div class="text-white">
743
+ <h3 class="text-xl font-bold mb-2">Code Review Results</h3>
744
+ <p class="mb-4"><strong>Overall Rating: B+</strong></p>
745
+ <p class="mb-2">This code is generally well-structured and follows good practices. Here are some suggestions:</p>
746
+ <ul class="list-disc pl-5 mb-4">
747
+ <li>Add docstrings to functions for better documentation</li>
748
+ <li>Consider adding type hints for better code clarity</li>
749
+ <li>Add error handling for edge cases (e.g., negative numbers)</li>
750
+ <li>Consider adding unit tests to validate the implementation</li>
751
+ </ul>
752
+ <p>Good job on handling the base cases correctly!</p>
753
+ </div>
754
+ `;
755
+ }, 1500);
756
+ });
757
+
758
+ document.getElementById('run-fix').addEventListener('click', function() {
759
+ const output = document.getElementById('fix-output');
760
+ output.innerHTML = '<p class="text-slate-400 text-center py-12">Fixing code...</p>';
761
+
762
+ setTimeout(() => {
763
+ output.innerHTML = `
764
+ <pre class="text-white">
765
+ def calculate_area(radius):
766
+ """Calculate the area of a circle given its radius"""
767
+ import math
768
+ if radius < 0:
769
+ raise ValueError("Radius cannot be negative")
770
+ return math.pi * radius ** 2
771
+
772
+ # Example usage
773
+ try:
774
+ print(calculate_area(5)) # 78.53981633974483
775
+ print(calculate_area(-3)) # Will raise ValueError
776
+ except ValueError as e:
777
+ print(f"Error: {e}")
778
+ </pre>
779
+ `;
780
+ }, 1500);
781
+ });
782
+
783
+ document.getElementById('run-tests').addEventListener('click', function() {
784
+ const output = document.getElementById('test-output');
785
+ output.innerHTML = '<p class="text-slate-400 text-center py-12">Generating tests...</p>';
786
+
787
+ setTimeout(() => {
788
+ output.innerHTML = `
789
+ <pre class="text-white">
790
+ import unittest
791
+
792
+ def calculate_area(radius):
793
+ import math
794
+ return math.pi * radius ** 2
795
+
796
+ class TestCalculateArea(unittest.TestCase):
797
+ def test_positive_radius(self):
798
+ self.assertAlmostEqual(calculate_area(1), 3.14159, places=5)
799
+ self.assertAlmostEqual(calculate_area(2), 12.56637, places=5)
800
+
801
+ def test_zero_radius(self):
802
+ self.assertEqual(calculate_area(0), 0)
803
+
804
+ def test_negative_radius(self):
805
+ with self.assertRaises(ValueError):
806
+ calculate_area(-1)
807
+
808
+ if __name__ == '__main__':
809
+ unittest.main()
810
+ </pre>
811
+ `;
812
+ }, 1500);
813
+ });
814
+
815
+ document.getElementById('run-devops').addEventListener('click', function() {
816
+ const output = document.getElementById('devops-output');
817
+ output.innerHTML = '<p class="text-slate-400 text-center py-12">Generating DevOps configuration...</p>';
818
+
819
+ setTimeout(() => {
820
+ output.innerHTML = `
821
+ <pre class="text-white">
822
+ # Dockerfile
823
+ FROM python:3.9-slim
824
+ WORKDIR /app
825
+ COPY requirements.txt .
826
+ RUN pip install -r requirements.txt
827
+ COPY . .
828
+ CMD ["python", "app.py"]
829
+
830
+ # docker-compose.yml
831
+ version: '3.8'
832
+ services:
833
+ web:
834
+ build: .
835
+ ports:
836
+ - "8000:8000"
837
+ environment:
838
+ - FLASK_ENV=development
839
+ volumes:
840
+ - .:/app
841
+ depends_on:
842
+ - db
843
+
844
+ db:
845
+ image: postgres:13
846
+ environment:
847
+ POSTGRES_DB: myapp
848
+ POSTGRES_USER: user
849
+ POSTGRES_PASSWORD: password
850
+ volumes:
851
+ - db_data:/var/lib/postgresql/data
852
+
853
+ volumes:
854
+ db_data:
855
+ </pre>
856
+ `;
857
+ }, 1500);
858
+ });
859
+
860
+ document.getElementById('run-data').addEventListener('click', function() {
861
+ const output = document.getElementById('data-output');
862
+ output.innerHTML = '<p class="text-slate-400 text-center py-12">Generating data script...</p>';
863
+
864
+ setTimeout(() => {
865
+ output.innerHTML = `
866
+ <pre class="text-white">
867
+ import pandas as pd
868
+ import matplotlib.pyplot as plt
869
+
870
+ # Load data
871
+ df = pd.read_csv('data.csv')
872
+
873
+ # Basic statistics
874
+ print(df.describe())
875
+
876
+ # Visualization
877
+ plt.figure(figsize=(10, 6))
878
+ plt.plot(df['date'], df['value'])
879
+ plt.title('Value Over Time')
880
+ plt.xlabel('Date')
881
+ plt.ylabel('Value')
882
+ plt.show()
883
+
884
+ # Correlation matrix
885
+ correlation_matrix = df.corr()
886
+ print(correlation_matrix)
887
+ </pre>
888
+ `;
889
+ }, 1500);
890
+ });
891
+
892
+ document.getElementById('run-research').addEventListener('click', function() {
893
+ const output = document.getElementById('research-output');
894
+ output.innerHTML = '<p class="text-slate-400 text-center py-12">Researching topic...</p>';
895
+
896
+ setTimeout(() => {
897
+ output.innerHTML = `
898
+ <div class="text-white">
899
+ <h3 class="text-xl font-bold mb-2">Research: Machine Learning in Healthcare</h3>
900
+ <p class="mb-4"><strong>Summary:</strong></p>
901
+ <p class="mb-4">Machine learning (ML) is revolutionizing healthcare by enabling early disease detection, personalized treatment plans, and improved patient outcomes. Key applications include:</p>
902
+ <ul class="list-disc pl-5 mb-4">
903
+ <li>Medical imaging analysis for cancer detection</li>
904
+ <li>Predictive analytics for patient risk stratification</li>
905
+ <li>Drug discovery and development acceleration</li>
906
+ <li>Personalized treatment recommendations</li>
907
+ </ul>
908
+ <p class="mb-4"><strong>Recent Developments:</strong></p>
909
+ <p>Recent breakthroughs include Google's AI that can detect breast cancer with greater accuracy than radiologists, and IBM Watson's oncology platform that assists doctors in treatment decisions.</p>
910
+ <p class="mt-4">For more information, see the recent papers on arXiv: <a href="#" class="text-cyan-400 hover:text-cyan-300">arXiv:2105.12345</a></p>
911
+ </div>
912
+ `;
913
+ }, 1500);
914
+ });
915
+
916
+ document.getElementById('run-security').addEventListener('click', function() {
917
+ const output = document.getElementById('security-output');
918
+ output.innerHTML = '<p class="text-slate-400 text-center py-12">Scanning code...</p>';
919
+
920
+ setTimeout(() => {
921
+ output.innerHTML = `
922
+ <div class="text-white">
923
+ <h3 class="text-xl font-bold mb-2">Security Scan Report</h3>
924
+ <p class="mb-4"><strong>Scan Results:</strong></p>
925
+ <ul class="list-disc pl-5 mb-4">
926
+ <li class="text-yellow-400">Medium Risk: Hardcoded credentials detected on line 23</li>
927
+ <li class="text-yellow-400">Medium Risk: SQL injection vulnerability in query on line 45</li>
928
+ <li class="text-green-400">Low Risk: Unused import statement on line 5</li>
929
+ <li class="text-green-400">Low Risk: Insecure random number generation on line 32</li>
930
+ </ul>
931
+ <p class="mb-4"><strong>Recommendations:</strong></p>
932
+ <ul class="list-disc pl-5 mb-4">
933
+ <li>Store credentials in environment variables or secure vaults</li>
934
+ <li>Use parameterized queries to prevent SQL injection</li>
935
+ <li>Remove unused imports to reduce attack surface</li>
936
+ <li>Use cryptographically secure random number generators</li>
937
+ </ul>
938
+ </div>
939
+ `;
940
+ }, 1500);
941
+ });
942
+
943
+ document.getElementById('run-docs').addEventListener('click', function() {
944
+ const output = document.getElementById('docs-output');
945
+ output.innerHTML = '<p class="text-slate-400 text-center py-12">Generating documentation...</p>';
946
+
947
+ setTimeout(() => {
948
+ output.innerHTML = `
949
+ <div class="text-white">
950
+ <h3 class="text-xl font-bold mb-2">calculate_area(radius)</h3>
951
+ <p class="mb-4"><strong>Description:</strong> Calculate the area of a circle given its radius.</p>
952
+ <p class="mb-2"><strong>Parameters:</strong></p>
953
+ <ul class="list-disc pl-5 mb-4">
954
+ <li>radius (float): The radius of the circle. Must be a non-negative number.</li>
955
+ </ul>
956
+ <p class="mb-2"><strong>Returns:</strong></p>
957
+ <ul class="list-disc pl-5 mb-4">
958
+ <li>float: The area of the circle calculated using the formula π * radius².</li>
959
+ </ul>
960
+ <p class="mb-2"><strong>Raises:</strong></p>
961
+ <ul class="list-disc pl-5 mb-4">
962
+ <li>ValueError: If the radius is negative.</li>
963
+ </ul>
964
+ <p class="mb-2"><strong>Example:</strong></p>
965
+ <pre class="bg-slate-700 p-4 rounded">
966
+ import math
967
+
968
+ def calculate_area(radius):
969
+ if radius < 0:
970
+ raise ValueError("Radius cannot be negative")
971
+ return math.pi * radius ** 2
972
+ </pre>
973
+ </div>
974
+ `;
975
+ }, 1500);
976
+ });
977
+ </script>
978
+ <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=kausar12/codethar" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
979
+ </html>