File size: 33,931 Bytes
d83b491
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>NoCode AI Agent Builder</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>
        .gradient-bg {
            background: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%);
        }
        .agent-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .draggable-item {
            cursor: grab;
            transition: all 0.2s ease;
        }
        .draggable-item:active {
            cursor: grabbing;
        }
        .drop-zone {
            min-height: 200px;
            transition: all 0.3s ease;
        }
        .drop-zone.active {
            border-color: #6e8efb;
            background-color: rgba(110, 142, 251, 0.1);
        }
        .animate-pulse {
            animation: pulse 2s infinite;
        }
        @keyframes pulse {
            0% { opacity: 0.6; }
            50% { opacity: 1; }
            100% { opacity: 0.6; }
        }
    </style>
</head>
<body class="bg-gray-50 font-sans">
    <!-- Header -->
    <header class="gradient-bg text-white shadow-lg">
        <div class="container mx-auto px-4 py-6">
            <div class="flex justify-between items-center">
                <div class="flex items-center space-x-2">
                    <i class="fas fa-robot text-3xl"></i>
                    <h1 class="text-2xl font-bold">NoCode AI Agent Builder</h1>
                </div>
                <nav class="hidden md:flex space-x-6">
                    <a href="#" class="hover:text-gray-200 transition">Templates</a>
                    <a href="#" class="hover:text-gray-200 transition">Documentation</a>
                    <a href="#" class="hover:text-gray-200 transition">Community</a>
                    <a href="#" class="hover:text-gray-200 transition">Pricing</a>
                </nav>
                <div class="flex items-center space-x-4">
                    <button class="bg-white text-purple-600 px-4 py-2 rounded-lg font-medium hover:bg-gray-100 transition">
                        Sign In
                    </button>
                    <button class="hidden md:block bg-purple-800 text-white px-4 py-2 rounded-lg font-medium hover:bg-purple-900 transition">
                        Get Started
                    </button>
                    <button class="md:hidden text-2xl">
                        <i class="fas fa-bars"></i>
                    </button>
                </div>
            </div>
        </div>
    </header>

    <!-- Main Content -->
    <main class="container mx-auto px-4 py-8">
        <!-- Hero Section -->
        <section class="mb-16">
            <div class="text-center max-w-3xl mx-auto">
                <h1 class="text-4xl md:text-5xl font-bold text-gray-800 mb-6">Build AI Agents Without Writing Code</h1>
                <p class="text-xl text-gray-600 mb-8">Create powerful AI assistants, chatbots, and automation workflows with our intuitive drag-and-drop interface. No coding required!</p>
                <div class="flex flex-col sm:flex-row justify-center gap-4">
                    <button class="gradient-bg text-white px-6 py-3 rounded-lg font-medium hover:opacity-90 transition shadow-lg">
                        Start Building - It's Free
                    </button>
                    <button class="bg-white border border-gray-300 text-gray-700 px-6 py-3 rounded-lg font-medium hover:bg-gray-50 transition shadow">
                        Watch Demo <i class="fas fa-play-circle ml-2"></i>
                    </button>
                </div>
            </div>
        </section>

        <!-- Features Section -->
        <section class="mb-16">
            <div class="grid grid-cols-1 md:grid-cols-3 gap-8">
                <div class="bg-white p-6 rounded-xl shadow-md hover:shadow-lg transition">
                    <div class="text-purple-600 text-4xl mb-4">
                        <i class="fas fa-magic"></i>
                    </div>
                    <h3 class="text-xl font-semibold mb-2">Drag & Drop Interface</h3>
                    <p class="text-gray-600">Easily build AI agents by dragging and dropping components. No technical skills needed.</p>
                </div>
                <div class="bg-white p-6 rounded-xl shadow-md hover:shadow-lg transition">
                    <div class="text-purple-600 text-4xl mb-4">
                        <i class="fas fa-brain"></i>
                    </div>
                    <h3 class="text-xl font-semibold mb-2">Pre-trained AI Models</h3>
                    <p class="text-gray-600">Access state-of-the-art AI models for text, vision, and voice processing.</p>
                </div>
                <div class="bg-white p-6 rounded-xl shadow-md hover:shadow-lg transition">
                    <div class="text-purple-600 text-4xl mb-4">
                        <i class="fas fa-share-alt"></i>
                    </div>
                    <h3 class="text-xl font-semibold mb-2">Multi-platform Deployment</h3>
                    <p class="text-gray-600">Deploy your AI agent to websites, mobile apps, and messaging platforms with one click.</p>
                </div>
            </div>
        </section>

        <!-- Builder Section -->
        <section class="mb-16">
            <h2 class="text-3xl font-bold text-center text-gray-800 mb-8">AI Agent Builder</h2>
            
            <div class="bg-white rounded-xl shadow-lg overflow-hidden">
                <!-- Toolbar -->
                <div class="bg-gray-100 p-4 border-b flex justify-between items-center">
                    <div class="flex items-center space-x-4">
                        <button class="bg-white px-4 py-2 rounded-lg border hover:bg-gray-50">
                            <i class="fas fa-plus mr-2"></i> New Agent
                        </button>
                        <button class="bg-white px-4 py-2 rounded-lg border hover:bg-gray-50">
                            <i class="fas fa-save mr-2"></i> Save
                        </button>
                    </div>
                    <div class="flex items-center space-x-2">
                        <button id="preview-btn" class="bg-purple-600 text-white px-4 py-2 rounded-lg hover:bg-purple-700">
                            <i class="fas fa-eye mr-2"></i> Preview
                        </button>
                        <button class="gradient-bg text-white px-4 py-2 rounded-lg hover:opacity-90">
                            <i class="fas fa-rocket mr-2"></i> Deploy
                        </button>
                    </div>
                </div>
                
                <!-- Builder Area -->
                <div class="flex flex-col md:flex-row h-full">
                    <!-- Components Panel -->
                    <div class="w-full md:w-1/4 bg-gray-50 p-4 border-r">
                        <h3 class="font-semibold text-lg mb-4 flex items-center">
                            <i class="fas fa-cubes mr-2"></i> Components
                        </h3>
                        <div class="space-y-2">
                            <div class="draggable-item bg-white p-3 rounded-lg border cursor-move shadow-sm hover:shadow-md" draggable="true" data-type="input">
                                <i class="fas fa-keyboard text-blue-500 mr-2"></i> Text Input
                            </div>
                            <div class="draggable-item bg-white p-3 rounded-lg border cursor-move shadow-sm hover:shadow-md" draggable="true" data-type="llm">
                                <i class="fas fa-brain text-purple-500 mr-2"></i> AI Model
                            </div>
                            <div class="draggable-item bg-white p-3 rounded-lg border cursor-move shadow-sm hover:shadow-md" draggable="true" data-type="database">
                                <i class="fas fa-database text-green-500 mr-2"></i> Database
                            </div>
                            <div class="draggable-item bg-white p-3 rounded-lg border cursor-move shadow-sm hover:shadow-md" draggable="true" data-type="api">
                                <i class="fas fa-plug text-yellow-500 mr-2"></i> API Connector
                            </div>
                            <div class="draggable-item bg-white p-3 rounded-lg border cursor-move shadow-sm hover:shadow-md" draggable="true" data-type="output">
                                <i class="fas fa-terminal text-red-500 mr-2"></i> Output
                            </div>
                            <div class="draggable-item bg-white p-3 rounded-lg border cursor-move shadow-sm hover:shadow-md" draggable="true" data-type="condition">
                                <i class="fas fa-code-branch text-indigo-500 mr-2"></i> Condition
                            </div>
                        </div>
                    </div>
                    
                    <!-- Canvas -->
                    <div class="w-full md:w-2/4 p-6">
                        <div id="canvas" class="drop-zone bg-gray-50 rounded-xl border-2 border-dashed border-gray-300 p-6 min-h-64">
                            <p class="text-gray-500 text-center py-8">Drag components here to build your AI agent</p>
                            
                            <!-- Sample agent flow (visible after components are added) -->
                            <div id="agent-flow" class="hidden space-y-6">
                                <!-- This will be populated by JavaScript -->
                            </div>
                        </div>
                    </div>
                    
                    <!-- Properties Panel -->
                    <div class="w-full md:w-1/4 bg-gray-50 p-4 border-l">
                        <h3 class="font-semibold text-lg mb-4 flex items-center">
                            <i class="fas fa-sliders-h mr-2"></i> Properties
                        </h3>
                        <div id="properties-panel" class="bg-white p-4 rounded-lg border">
                            <p class="text-gray-500 text-center py-8">Select a component to edit its properties</p>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Templates Section -->
        <section class="mb-16">
            <div class="flex justify-between items-center mb-8">
                <h2 class="text-3xl font-bold text-gray-800">Starter Templates</h2>
                <a href="#" class="text-purple-600 hover:text-purple-800 font-medium">View all templates →</a>
            </div>
            
            <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
                <div class="agent-card bg-white rounded-xl overflow-hidden shadow-md hover:shadow-xl transition duration-300">
                    <div class="gradient-bg p-4 text-white">
                        <h3 class="font-bold text-xl">Customer Support Bot</h3>
                        <p class="text-purple-100">24/7 automated support</p>
                    </div>
                    <div class="p-4">
                        <p class="text-gray-600 mb-4">Handle common customer queries with AI-powered responses.</p>
                        <button class="w-full bg-gray-100 hover:bg-gray-200 text-gray-800 py-2 rounded-lg transition">
                            Use Template
                        </button>
                    </div>
                </div>
                
                <div class="agent-card bg-white rounded-xl overflow-hidden shadow-md hover:shadow-xl transition duration-300">
                    <div class="gradient-bg p-4 text-white">
                        <h3 class="font-bold text-xl">Content Generator</h3>
                        <p class="text-purple-100">Create engaging content</p>
                    </div>
                    <div class="p-4">
                        <p class="text-gray-600 mb-4">Generate blog posts, social media content, and product descriptions.</p>
                        <button class="w-full bg-gray-100 hover:bg-gray-200 text-gray-800 py-2 rounded-lg transition">
                            Use Template
                        </button>
                    </div>
                </div>
                
                <div class="agent-card bg-white rounded-xl overflow-hidden shadow-md hover:shadow-xl transition duration-300">
                    <div class="gradient-bg p-4 text-white">
                        <h3 class="font-bold text-xl">Data Analyzer</h3>
                        <p class="text-purple-100">Extract insights from data</p>
                    </div>
                    <div class="p-4">
                        <p class="text-gray-600 mb-4">Process and visualize data with natural language queries.</p>
                        <button class="w-full bg-gray-100 hover:bg-gray-200 text-gray-800 py-2 rounded-lg transition">
                            Use Template
                        </button>
                    </div>
                </div>
            </div>
        </section>

        <!-- Testimonials -->
        <section class="mb-16 gradient-bg text-white rounded-xl p-8 md:p-12">
            <h2 class="text-3xl font-bold text-center mb-12">Trusted by Thousands of Creators</h2>
            <div class="grid grid-cols-1 md:grid-cols-3 gap-8">
                <div class="bg-white bg-opacity-10 p-6 rounded-xl backdrop-blur-sm">
                    <div class="flex items-center mb-4">
                        <div class="w-12 h-12 rounded-full bg-white flex items-center justify-center text-purple-600 font-bold mr-4">JD</div>
                        <div>
                            <h4 class="font-semibold">Jane Doe</h4>
                            <p class="text-purple-200 text-sm">E-commerce Owner</p>
                        </div>
                    </div>
                    <p>"Built a customer support bot in 30 minutes that handles 80% of our queries. Game changer!"</p>
                </div>
                <div class="bg-white bg-opacity-10 p-6 rounded-xl backdrop-blur-sm">
                    <div class="flex items-center mb-4">
                        <div class="w-12 h-12 rounded-full bg-white flex items-center justify-center text-purple-600 font-bold mr-4">MS</div>
                        <div>
                            <h4 class="font-semibold">Mike Smith</h4>
                            <p class="text-purple-200 text-sm">Content Creator</p>
                        </div>
                    </div>
                    <p>"The content generator template saved me hours each week. The quality is surprisingly good!"</p>
                </div>
                <div class="bg-white bg-opacity-10 p-6 rounded-xl backdrop-blur-sm">
                    <div class="flex items-center mb-4">
                        <div class="w-12 h-12 rounded-full bg-white flex items-center justify-center text-purple-600 font-bold mr-4">AR</div>
                        <div>
                            <h4 class="font-semibold">Alex Rivera</h4>
                            <p class="text-purple-200 text-sm">Startup Founder</p>
                        </div>
                    </div>
                    <p>"As a non-technical founder, this tool let me build our MVP's AI features myself."</p>
                </div>
            </div>
        </section>

        <!-- CTA Section -->
        <section class="text-center mb-16">
            <h2 class="text-3xl md:text-4xl font-bold text-gray-800 mb-6">Ready to Build Your AI Agent?</h2>
            <p class="text-xl text-gray-600 max-w-2xl mx-auto mb-8">Join thousands of creators building powerful AI solutions without writing a single line of code.</p>
            <button class="gradient-bg text-white px-8 py-4 rounded-lg font-bold text-lg hover:opacity-90 transition shadow-xl">
                Start Building for Free <i class="fas fa-arrow-right ml-2"></i>
            </button>
        </section>
    </main>

    <!-- Footer -->
    <footer class="bg-gray-900 text-gray-400 py-12">
        <div class="container mx-auto px-4">
            <div class="grid grid-cols-1 md:grid-cols-4 gap-8 mb-8">
                <div>
                    <h3 class="text-white text-lg font-semibold mb-4">NoCode AI Builder</h3>
                    <p class="mb-4">Empowering everyone to create AI solutions without coding.</p>
                    <div class="flex space-x-4">
                        <a href="#" class="text-gray-400 hover:text-white"><i class="fab fa-twitter"></i></a>
                        <a href="#" class="text-gray-400 hover:text-white"><i class="fab fa-linkedin"></i></a>
                        <a href="#" class="text-gray-400 hover:text-white"><i class="fab fa-github"></i></a>
                        <a href="#" class="text-gray-400 hover:text-white"><i class="fab fa-discord"></i></a>
                    </div>
                </div>
                <div>
                    <h3 class="text-white text-lg font-semibold mb-4">Product</h3>
                    <ul class="space-y-2">
                        <li><a href="#" class="hover:text-white transition">Features</a></li>
                        <li><a href="#" class="hover:text-white transition">Templates</a></li>
                        <li><a href="#" class="hover:text-white transition">Pricing</a></li>
                        <li><a href="#" class="hover:text-white transition">Integrations</a></li>
                    </ul>
                </div>
                <div>
                    <h3 class="text-white text-lg font-semibold mb-4">Resources</h3>
                    <ul class="space-y-2">
                        <li><a href="#" class="hover:text-white transition">Documentation</a></li>
                        <li><a href="#" class="hover:text-white transition">Tutorials</a></li>
                        <li><a href="#" class="hover:text-white transition">Blog</a></li>
                        <li><a href="#" class="hover:text-white transition">Community</a></li>
                    </ul>
                </div>
                <div>
                    <h3 class="text-white text-lg font-semibold mb-4">Company</h3>
                    <ul class="space-y-2">
                        <li><a href="#" class="hover:text-white transition">About</a></li>
                        <li><a href="#" class="hover:text-white transition">Careers</a></li>
                        <li><a href="#" class="hover:text-white transition">Contact</a></li>
                        <li><a href="#" class="hover:text-white transition">Legal</a></li>
                    </ul>
                </div>
            </div>
            <div class="pt-8 border-t border-gray-800 text-center">
                <p>© 2023 NoCode AI Builder. All rights reserved.</p>
            </div>
        </div>
    </footer>

    <!-- Preview Modal -->
    <div id="preview-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
        <div class="bg-white rounded-xl w-full max-w-4xl max-h-[90vh] overflow-hidden">
            <div class="flex justify-between items-center bg-gray-100 p-4 border-b">
                <h3 class="font-semibold text-lg">AI Agent Preview</h3>
                <button id="close-preview" class="text-gray-500 hover:text-gray-700">
                    <i class="fas fa-times"></i>
                </button>
            </div>
            <div class="p-6 overflow-y-auto" style="max-height: 80vh;">
                <div class="bg-gray-50 rounded-lg p-6 mb-4">
                    <div class="flex mb-4">
                        <div class="w-10 h-10 rounded-full bg-purple-100 flex items-center justify-center text-purple-600 mr-3">
                            <i class="fas fa-robot"></i>
                        </div>
                        <div class="bg-white p-3 rounded-lg shadow-sm max-w-xs">
                            <p>Hello! I'm your AI assistant. How can I help you today?</p>
                        </div>
                    </div>
                    
                    <div class="flex justify-end mb-4">
                        <div class="bg-purple-600 text-white p-3 rounded-lg shadow-sm max-w-xs">
                            <p>What can you do?</p>
                        </div>
                    </div>
                    
                    <div class="flex">
                        <div class="w-10 h-10 rounded-full bg-purple-100 flex items-center justify-center text-purple-600 mr-3">
                            <i class="fas fa-robot"></i>
                        </div>
                        <div class="bg-white p-3 rounded-lg shadow-sm max-w-xs">
                            <p>I can answer questions, analyze data, generate content, and more! Try asking me something.</p>
                        </div>
                    </div>
                </div>
                
                <div class="flex items-center">
                    <input type="text" placeholder="Type your message..." class="flex-1 border border-gray-300 rounded-l-lg p-3 focus:outline-none focus:ring-2 focus:ring-purple-500">
                    <button class="gradient-bg text-white px-6 py-3 rounded-r-lg hover:opacity-90">
                        <i class="fas fa-paper-plane"></i>
                    </button>
                </div>
            </div>
        </div>
    </div>

    <script>
        // Drag and drop functionality
        document.addEventListener('DOMContentLoaded', function() {
            const canvas = document.getElementById('canvas');
            const agentFlow = document.getElementById('agent-flow');
            const propertiesPanel = document.getElementById('properties-panel');
            const previewBtn = document.getElementById('preview-btn');
            const previewModal = document.getElementById('preview-modal');
            const closePreview = document.getElementById('close-preview');
            
            let draggedItem = null;
            
            // Make components draggable
            document.querySelectorAll('.draggable-item').forEach(item => {
                item.addEventListener('dragstart', function() {
                    draggedItem = this;
                    setTimeout(() => {
                        this.style.opacity = '0.4';
                    }, 0);
                });
                
                item.addEventListener('dragend', function() {
                    this.style.opacity = '1';
                });
            });
            
            // Canvas drop zone
            canvas.addEventListener('dragover', function(e) {
                e.preventDefault();
                this.classList.add('active');
            });
            
            canvas.addEventListener('dragleave', function() {
                this.classList.remove('active');
            });
            
            canvas.addEventListener('drop', function(e) {
                e.preventDefault();
                this.classList.remove('active');
                
                if (draggedItem) {
                    // Hide the placeholder text
                    if (canvas.querySelector('p')) {
                        canvas.querySelector('p').style.display = 'none';
                    }
                    
                    // Show the agent flow container
                    agentFlow.classList.remove('hidden');
                    
                    // Create a new component on the canvas
                    const componentType = draggedItem.getAttribute('data-type');
                    const newComponent = createComponent(componentType);
                    agentFlow.appendChild(newComponent);
                    
                    // Add click event to show properties
                    newComponent.addEventListener('click', function() {
                        showProperties(componentType);
                    });
                }
            });
            
            // Preview button
            previewBtn.addEventListener('click', function() {
                previewModal.classList.remove('hidden');
            });
            
            // Close preview
            closePreview.addEventListener('click', function() {
                previewModal.classList.add('hidden');
            });
            
            // Close modal when clicking outside
            previewModal.addEventListener('click', function(e) {
                if (e.target === previewModal) {
                    previewModal.classList.add('hidden');
                }
            });
            
            // Helper function to create components
            function createComponent(type) {
                const component = document.createElement('div');
                component.className = 'bg-white p-4 rounded-lg border shadow-sm hover:shadow-md transition cursor-pointer';
                
                let icon, title, description;
                
                switch(type) {
                    case 'input':
                        icon = 'keyboard';
                        title = 'Text Input';
                        description = 'Collect user input text';
                        break;
                    case 'llm':
                        icon = 'brain';
                        title = 'AI Model';
                        description = 'Process input with AI';
                        break;
                    case 'database':
                        icon = 'database';
                        title = 'Database';
                        description = 'Store and retrieve data';
                        break;
                    case 'api':
                        icon = 'plug';
                        title = 'API Connector';
                        description = 'Connect to external services';
                        break;
                    case 'output':
                        icon = 'terminal';
                        title = 'Output';
                        description = 'Display results to user';
                        break;
                    case 'condition':
                        icon = 'code-branch';
                        title = 'Condition';
                        description = 'Create decision branches';
                        break;
                }
                
                component.innerHTML = `
                    <div class="flex items-start">
                        <div class="bg-purple-100 text-purple-600 p-2 rounded-lg mr-3">
                            <i class="fas fa-${icon}"></i>
                        </div>
                        <div>
                            <h4 class="font-medium">${title}</h4>
                            <p class="text-sm text-gray-500">${description}</p>
                        </div>
                    </div>
                `;
                
                return component;
            }
            
            // Show properties for selected component
            function showProperties(type) {
                let propertiesHTML = '';
                
                switch(type) {
                    case 'input':
                        propertiesHTML = `
                            <h4 class="font-medium text-lg mb-4">Text Input Properties</h4>
                            <div class="space-y-4">
                                <div>
                                    <label class="block text-sm font-medium text-gray-700 mb-1">Prompt Text</label>
                                    <input type="text" class="w-full border border-gray-300 rounded-lg p-2" value="Enter your question...">
                                </div>
                                <div>
                                    <label class="block text-sm font-medium text-gray-700 mb-1">Input Type</label>
                                    <select class="w-full border border-gray-300 rounded-lg p-2">
                                        <option>Single line text</option>
                                        <option>Multi-line text</option>
                                        <option>Number</option>
                                        <option>Email</option>
                                    </select>
                                </div>
                                <div class="flex items-center">
                                    <input type="checkbox" id="required" class="mr-2">
                                    <label for="required" class="text-sm text-gray-700">Required field</label>
                                </div>
                            </div>
                        `;
                        break;
                    case 'llm':
                        propertiesHTML = `
                            <h4 class="font-medium text-lg mb-4">AI Model Properties</h4>
                            <div class="space-y-4">
                                <div>
                                    <label class="block text-sm font-medium text-gray-700 mb-1">Model</label>
                                    <select class="w-full border border-gray-300 rounded-lg p-2">
                                        <option>GPT-4</option>
                                        <option>GPT-3.5</option>
                                        <option>Claude 2</option>
                                        <option>Llama 2</option>
                                    </select>
                                </div>
                                <div>
                                    <label class="block text-sm font-medium text-gray-700 mb-1">System Prompt</label>
                                    <textarea class="w-full border border-gray-300 rounded-lg p-2 h-24">You are a helpful AI assistant...</textarea>
                                </div>
                                <div>
                                    <label class="block text-sm font-medium text-gray-700 mb-1">Temperature</label>
                                    <input type="range" min="0" max="1" step="0.1" value="0.7" class="w-full">
                                    <div class="text-xs text-gray-500 flex justify-between">
                                        <span>Precise</span>
                                        <span>Creative</span>
                                    </div>
                                </div>
                            </div>
                        `;
                        break;
                    case 'database':
                        propertiesHTML = `
                            <h4 class="font-medium text-lg mb-4">Database Properties</h4>
                            <div class="space-y-4">
                                <div>
                                    <label class="block text-sm font-medium text-gray-700 mb-1">Connection</label>
                                    <select class="w-full border border-gray-300 rounded-lg p-2">
                                        <option>Create new connection</option>
                                        <option>PostgreSQL</option>
                                        <option>MySQL</option>
                                        <option>MongoDB</option>
                                        <option>Firebase</option>
                                    </select>
                                </div>
                                <div>
                                    <label class="block text-sm font-medium text-gray-700 mb-1">Operation</label>
                                    <select class="w-full border border-gray-300 rounded-lg p-2">
                                        <option>Read</option>
                                        <option>Create</option>
                                        <option>Update</option>
                                        <option>Delete</option>
                                    </select>
                                </div>
                                <div>
                                    <label class="block text-sm font-medium text-gray-700 mb-1">Query</label>
                                    <textarea class="w-full border border-gray-300 rounded-lg p-2 h-20">SELECT * FROM users WHERE id = ?</textarea>
                                </div>
                            </div>
                        `;
                        break;
                    default:
                        propertiesHTML = `
                            <h4 class="font-medium text-lg mb-4">${type.charAt(0).toUpperCase() + type.slice(1)} Properties</h4>
                            <p class="text-gray-500">Configure your ${type} component here.</p>
                        `;
                }
                
                propertiesPanel.innerHTML = propertiesHTML;
            }
        });
    </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=LuckyEnforceAgent/flex-ai" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>