Add 2 files
Browse files- index.html +677 -571
- prompts.txt +2 -2
index.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
-
<title>DeepSeek Visual Builder</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>
|
|
@@ -158,6 +158,102 @@
|
|
| 158 |
.resize-handle:hover {
|
| 159 |
@apply bg-primary-dark;
|
| 160 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 161 |
</style>
|
| 162 |
</head>
|
| 163 |
<body class="h-screen flex flex-col overflow-hidden">
|
|
@@ -168,9 +264,13 @@
|
|
| 168 |
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
| 169 |
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" />
|
| 170 |
</svg>
|
| 171 |
-
<h1 class="text-xl font-bold">DeepSeek
|
| 172 |
</div>
|
| 173 |
<div class="flex items-center space-x-3">
|
|
|
|
|
|
|
|
|
|
|
|
|
| 174 |
<button id="saveBtn" class="flex items-center space-x-1 bg-white/10 hover:bg-white/20 px-3 py-1.5 rounded-md text-sm font-medium transition-colors">
|
| 175 |
<i class="fas fa-save"></i>
|
| 176 |
<span>Save</span>
|
|
@@ -188,17 +288,28 @@
|
|
| 188 |
</header>
|
| 189 |
|
| 190 |
<!-- Main Content -->
|
| 191 |
-
<div class="
|
| 192 |
-
<!--
|
| 193 |
-
<div class="w-64 bg-white border-r border-gray-200 flex flex-col">
|
| 194 |
<div class="p-3 border-b border-gray-200">
|
| 195 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 196 |
<div class="mt-2 flex space-x-1">
|
| 197 |
-
<button class="tab-btn active" data-tab="
|
| 198 |
-
<button class="tab-btn" data-tab="
|
| 199 |
</div>
|
| 200 |
</div>
|
| 201 |
-
|
|
|
|
|
|
|
| 202 |
<div class="component bg-white p-3 rounded-lg border border-gray-200 shadow-sm" draggable="true" data-type="header">
|
| 203 |
<div class="flex items-center space-x-3">
|
| 204 |
<div class="bg-primary/10 text-primary p-2 rounded-lg">
|
|
@@ -277,10 +388,34 @@
|
|
| 277 |
</div>
|
| 278 |
</div>
|
| 279 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 280 |
</div>
|
| 281 |
-
|
| 282 |
-
<!--
|
| 283 |
-
<div class="
|
|
|
|
|
|
|
|
|
|
| 284 |
<div id="canvas" class="droppable bg-white mx-auto w-full max-w-4xl min-h-full rounded-lg shadow-sm relative">
|
| 285 |
<div class="absolute inset-0 flex items-center justify-center" id="emptyState">
|
| 286 |
<div class="text-center p-6 max-w-md">
|
|
@@ -288,14 +423,17 @@
|
|
| 288 |
<i class="fas fa-plus text-gray-400 text-2xl"></i>
|
| 289 |
</div>
|
| 290 |
<h3 class="text-lg font-medium text-gray-700 mb-1">Drag components here</h3>
|
| 291 |
-
<p class="text-gray-500 text-sm">Start building your page by dragging components
|
| 292 |
</div>
|
| 293 |
</div>
|
| 294 |
</div>
|
| 295 |
</div>
|
| 296 |
-
|
| 297 |
-
<!--
|
| 298 |
-
<div class="
|
|
|
|
|
|
|
|
|
|
| 299 |
<div class="p-3 border-b border-gray-200">
|
| 300 |
<h2 class="text-lg font-semibold text-gray-800">Properties</h2>
|
| 301 |
</div>
|
|
@@ -358,6 +496,39 @@
|
|
| 358 |
</div>
|
| 359 |
</div>
|
| 360 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 361 |
<script>
|
| 362 |
document.addEventListener('DOMContentLoaded', function() {
|
| 363 |
// Global variables
|
|
@@ -367,6 +538,8 @@
|
|
| 367 |
let componentCounter = 0;
|
| 368 |
let isResizing = false;
|
| 369 |
let startX, startY, startWidth, startHeight;
|
|
|
|
|
|
|
| 370 |
|
| 371 |
// DOM elements
|
| 372 |
const canvas = document.getElementById('canvas');
|
|
@@ -386,11 +559,41 @@
|
|
| 386 |
const downloadBtn = document.getElementById('downloadBtn');
|
| 387 |
const closeExport = document.getElementById('closeExport');
|
| 388 |
const tabBtns = document.querySelectorAll('[data-tab]');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 389 |
|
| 390 |
// Initialize the builder
|
| 391 |
function initBuilder() {
|
| 392 |
initDragAndDrop();
|
| 393 |
initEventListeners();
|
|
|
|
|
|
|
|
|
|
| 394 |
loadFromLocalStorage();
|
| 395 |
}
|
| 396 |
|
|
@@ -429,12 +632,423 @@
|
|
| 429 |
// Tab buttons
|
| 430 |
tabBtns.forEach(btn => {
|
| 431 |
btn.addEventListener('click', () => {
|
|
|
|
| 432 |
tabBtns.forEach(b => b.classList.remove('active'));
|
| 433 |
btn.classList.add('active');
|
| 434 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 435 |
});
|
| 436 |
});
|
| 437 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 438 |
|
| 439 |
// Load from localStorage
|
| 440 |
function loadFromLocalStorage() {
|
|
@@ -907,23 +1521,28 @@
|
|
| 907 |
<div class="color-option bg-gray-800 ${component.props.bgColor === 'gray-800' ? 'selected' : ''}" data-color="gray-800" data-prop="bgColor"></div>
|
| 908 |
</div>
|
| 909 |
</div>
|
| 910 |
-
<div
|
| 911 |
-
<
|
| 912 |
-
|
| 913 |
-
<div class="
|
| 914 |
-
|
| 915 |
-
|
| 916 |
-
|
| 917 |
-
|
| 918 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 919 |
</div>
|
| 920 |
-
|
| 921 |
-
|
| 922 |
-
|
| 923 |
-
|
| 924 |
-
|
| 925 |
-
|
| 926 |
-
</div>
|
| 927 |
</div>
|
| 928 |
</div>
|
| 929 |
</div>
|
|
@@ -943,53 +1562,42 @@
|
|
| 943 |
<div class="flex flex-wrap gap-2">
|
| 944 |
<div class="color-option bg-gray-50 ${component.props.bgColor === 'gray-50' ? 'selected' : ''}" data-color="gray-50" data-prop="bgColor"></div>
|
| 945 |
<div class="color-option bg-white ${component.props.bgColor === 'white' ? 'selected' : ''}" data-color="white" data-prop="bgColor"></div>
|
| 946 |
-
<div class="color-option bg-
|
| 947 |
-
<div class="color-option bg-indigo-50 ${component.props.bgColor === 'indigo-50' ? 'selected' : ''}" data-color="indigo-50" data-prop="bgColor"></div>
|
| 948 |
</div>
|
| 949 |
</div>
|
| 950 |
-
<div>
|
| 951 |
-
<label class="block text-sm font-medium text-gray-700 mb-1">Number of Features</label>
|
| 952 |
-
<select class="w-full p-2 border rounded-md text-sm" data-prop="featureCount">
|
| 953 |
-
<option value="2" ${component.props.features.length === 2 ? 'selected' : ''}>2 Features</option>
|
| 954 |
-
<option value="3" ${component.props.features.length === 3 ? 'selected' : ''}>3 Features</option>
|
| 955 |
-
<option value="4" ${component.props.features.length === 4 ? 'selected' : ''}>4 Features</option>
|
| 956 |
-
</select>
|
| 957 |
-
</div>
|
| 958 |
<div>
|
| 959 |
<label class="block text-sm font-medium text-gray-700 mb-1">Features</label>
|
| 960 |
<div class="features-container space-y-4">
|
| 961 |
${component.props.features.map((feature, index) => `
|
| 962 |
-
<div class="border p-3
|
| 963 |
<div class="flex justify-between items-center mb-2">
|
| 964 |
-
<h4 class="
|
| 965 |
-
<button class="remove-feature-btn text-red-500
|
| 966 |
-
<i class="fas fa-
|
| 967 |
</button>
|
| 968 |
</div>
|
| 969 |
-
<div class="
|
| 970 |
-
<
|
| 971 |
-
|
| 972 |
-
|
| 973 |
-
|
| 974 |
-
<
|
| 975 |
-
|
| 976 |
-
|
| 977 |
-
|
| 978 |
-
<
|
| 979 |
-
|
| 980 |
-
<
|
| 981 |
-
|
| 982 |
-
|
| 983 |
-
|
| 984 |
-
|
| 985 |
-
|
| 986 |
-
</select>
|
| 987 |
-
</div>
|
| 988 |
</div>
|
| 989 |
</div>
|
| 990 |
`).join('')}
|
| 991 |
</div>
|
| 992 |
-
<button class="add-feature-btn mt-
|
| 993 |
<i class="fas fa-plus mr-1"></i> Add Feature
|
| 994 |
</button>
|
| 995 |
</div>
|
|
@@ -1007,7 +1615,7 @@
|
|
| 1007 |
</div>
|
| 1008 |
<div>
|
| 1009 |
<label class="block text-sm font-medium text-gray-700 mb-1">Content</label>
|
| 1010 |
-
<textarea class="w-full p-2 border rounded-md text-sm" rows="
|
| 1011 |
</div>
|
| 1012 |
<div>
|
| 1013 |
<label class="block text-sm font-medium text-gray-700 mb-1">Text Alignment</label>
|
|
@@ -1026,507 +1634,5 @@
|
|
| 1026 |
<div class="space-y-4">
|
| 1027 |
<h3 class="font-medium text-gray-800">Image Settings</h3>
|
| 1028 |
<div>
|
| 1029 |
-
<
|
| 1030 |
-
<input type="text" class="w-full p-2 border rounded-md text-sm" value="${component.props.src}" data-prop="src">
|
| 1031 |
-
</div>
|
| 1032 |
-
<div>
|
| 1033 |
-
<label class="block text-sm font-medium text-gray-700 mb-1">Alt Text</label>
|
| 1034 |
-
<input type="text" class="w-full p-2 border rounded-md text-sm" value="${component.props.alt}" data-prop="alt">
|
| 1035 |
-
</div>
|
| 1036 |
-
<div>
|
| 1037 |
-
<label class="block text-sm font-medium text-gray-700 mb-1">Rounded Corners</label>
|
| 1038 |
-
<select class="w-full p-2 border rounded-md text-sm" data-prop="rounded">
|
| 1039 |
-
<option value="none" ${component.props.rounded === 'none' ? 'selected' : ''}>None</option>
|
| 1040 |
-
<option value="sm" ${component.props.rounded === 'sm' ? 'selected' : ''}>Small</option>
|
| 1041 |
-
<option value="md" ${component.props.rounded === 'md' ? 'selected' : ''}>Medium</option>
|
| 1042 |
-
<option value="lg" ${component.props.rounded === 'lg' ? 'selected' : ''}>Large</option>
|
| 1043 |
-
<option value="full" ${component.props.rounded === 'full' ? 'selected' : ''}>Full (Circle)</option>
|
| 1044 |
-
</select>
|
| 1045 |
-
</div>
|
| 1046 |
-
<div>
|
| 1047 |
-
<label class="block text-sm font-medium text-gray-700 mb-1">Padding</label>
|
| 1048 |
-
<select class="w-full p-2 border rounded-md text-sm" data-prop="padding">
|
| 1049 |
-
<option value="0" ${component.props.padding === '0' ? 'selected' : ''}>None</option>
|
| 1050 |
-
<option value="2" ${component.props.padding === '2' ? 'selected' : ''}>Small</option>
|
| 1051 |
-
<option value="4" ${component.props.padding === '4' ? 'selected' : ''}>Medium</option>
|
| 1052 |
-
<option value="6" ${component.props.padding === '6' ? 'selected' : ''}>Large</option>
|
| 1053 |
-
<option value="8" ${component.props.padding === '8' ? 'selected' : ''}>Extra Large</option>
|
| 1054 |
-
</select>
|
| 1055 |
-
</div>
|
| 1056 |
-
</div>
|
| 1057 |
-
`;
|
| 1058 |
-
break;
|
| 1059 |
-
|
| 1060 |
-
case 'cta':
|
| 1061 |
-
propertiesHtml = `
|
| 1062 |
-
<div class="space-y-4">
|
| 1063 |
-
<h3 class="font-medium text-gray-800">CTA Settings</h3>
|
| 1064 |
-
<div>
|
| 1065 |
-
<label class="block text-sm font-medium text-gray-700 mb-1">Title</label>
|
| 1066 |
-
<input type="text" class="w-full p-2 border rounded-md text-sm" value="${component.props.title}" data-prop="title">
|
| 1067 |
-
</div>
|
| 1068 |
-
<div>
|
| 1069 |
-
<label class="block text-sm font-medium text-gray-700 mb-1">Subtitle</label>
|
| 1070 |
-
<textarea class="w-full p-2 border rounded-md text-sm" rows="2" data-prop="subtitle">${component.props.subtitle}</textarea>
|
| 1071 |
-
</div>
|
| 1072 |
-
<div>
|
| 1073 |
-
<label class="block text-sm font-medium text-gray-700 mb-1">Button Text</label>
|
| 1074 |
-
<input type="text" class="w-full p-2 border rounded-md text-sm" value="${component.props.buttonText}" data-prop="buttonText">
|
| 1075 |
-
</div>
|
| 1076 |
-
<div>
|
| 1077 |
-
<label class="block text-sm font-medium text-gray-700 mb-2">Background Color</label>
|
| 1078 |
-
<div class="flex flex-wrap gap-2">
|
| 1079 |
-
<div class="color-option bg-primary/10 ${component.props.bgColor === 'primary/10' ? 'selected' : ''}" data-color="primary/10" data-prop="bgColor"></div>
|
| 1080 |
-
<div class="color-option bg-blue-50 ${component.props.bgColor === 'blue-50' ? 'selected' : ''}" data-color="blue-50" data-prop="bgColor"></div>
|
| 1081 |
-
<div class="color-option bg-green-50 ${component.props.bgColor === 'green-50' ? 'selected' : ''}" data-color="green-50" data-prop="bgColor"></div>
|
| 1082 |
-
<div class="color-option bg-yellow-50 ${component.props.bgColor === 'yellow-50' ? 'selected' : ''}" data-color="yellow-50" data-prop="bgColor"></div>
|
| 1083 |
-
<div class="color-option bg-gray-100 ${component.props.bgColor === 'gray-100' ? 'selected' : ''}" data-color="gray-100" data-prop="bgColor"></div>
|
| 1084 |
-
</div>
|
| 1085 |
-
</div>
|
| 1086 |
-
<div class="grid grid-cols-2 gap-4">
|
| 1087 |
-
<div>
|
| 1088 |
-
<label class="block text-sm font-medium text-gray-700 mb-2">Button Color</label>
|
| 1089 |
-
<div class="flex flex-wrap gap-2">
|
| 1090 |
-
<div class="color-option bg-primary ${component.props.buttonColor === 'primary' ? 'selected' : ''}" data-color="primary" data-prop="buttonColor"></div>
|
| 1091 |
-
<div class="color-option bg-blue-600 ${component.props.buttonColor === 'blue-600' ? 'selected' : ''}" data-color="blue-600" data-prop="buttonColor"></div>
|
| 1092 |
-
<div class="color-option bg-green-600 ${component.props.buttonColor === 'green-600' ? 'selected' : ''}" data-color="green-600" data-prop="buttonColor"></div>
|
| 1093 |
-
<div class="color-option bg-red-600 ${component.props.buttonColor === 'red-600' ? 'selected' : ''}" data-color="red-600" data-prop="buttonColor"></div>
|
| 1094 |
-
<div class="color-option bg-yellow-500 ${component.props.buttonColor === 'yellow-500' ? 'selected' : ''}" data-color="yellow-500" data-prop="buttonColor"></div>
|
| 1095 |
-
<div class="color-option bg-white border ${component.props.buttonColor === 'white' ? 'selected' : ''}" data-color="white" data-prop="buttonColor"></div>
|
| 1096 |
-
</div>
|
| 1097 |
-
</div>
|
| 1098 |
-
<div>
|
| 1099 |
-
<label class="block text-sm font-medium text-gray-700 mb-2">Button Text Color</label>
|
| 1100 |
-
<div class="flex flex-wrap gap-2">
|
| 1101 |
-
<div class="color-option bg-white border ${component.props.buttonTextColor === 'white' ? 'selected' : ''}" data-color="white" data-prop="buttonTextColor"></div>
|
| 1102 |
-
<div class="color-option bg-gray-800 ${component.props.buttonTextColor === 'gray-800' ? 'selected' : ''}" data-color="gray-800" data-prop="buttonTextColor"></div>
|
| 1103 |
-
<div class="color-option bg-primary ${component.props.buttonTextColor === 'primary' ? 'selected' : ''}" data-color="primary" data-prop="buttonTextColor"></div>
|
| 1104 |
-
</div>
|
| 1105 |
-
</div>
|
| 1106 |
-
</div>
|
| 1107 |
-
</div>
|
| 1108 |
-
`;
|
| 1109 |
-
break;
|
| 1110 |
-
|
| 1111 |
-
case 'footer':
|
| 1112 |
-
propertiesHtml = `
|
| 1113 |
-
<div class="space-y-4">
|
| 1114 |
-
<h3 class="font-medium text-gray-800">Footer Settings</h3>
|
| 1115 |
-
<div>
|
| 1116 |
-
<label class="block text-sm font-medium text-gray-700 mb-2">Background Color</label>
|
| 1117 |
-
<div class="flex flex-wrap gap-2">
|
| 1118 |
-
<div class="color-option bg-gray-800 ${component.props.bgColor === 'gray-800' ? 'selected' : ''}" data-color="gray-800" data-prop="bgColor"></div>
|
| 1119 |
-
<div class="color-option bg-indigo-900 ${component.props.bgColor === 'indigo-900' ? 'selected' : ''}" data-color="indigo-900" data-prop="bgColor"></div>
|
| 1120 |
-
<div class="color-option bg-blue-900 ${component.props.bgColor === 'blue-900' ? 'selected' : ''}" data-color="blue-900" data-prop="bgColor"></div>
|
| 1121 |
-
<div class="color-option bg-black ${component.props.bgColor === 'black' ? 'selected' : ''}" data-color="black" data-prop="bgColor"></div>
|
| 1122 |
-
</div>
|
| 1123 |
-
</div>
|
| 1124 |
-
<div>
|
| 1125 |
-
<label class="block text-sm font-medium text-gray-700 mb-2">Text Color</label>
|
| 1126 |
-
<div class="flex flex-wrap gap-2">
|
| 1127 |
-
<div class="color-option bg-white border ${component.props.textColor === 'white' ? 'selected' : ''}" data-color="white" data-prop="textColor"></div>
|
| 1128 |
-
<div class="color-option bg-gray-300 ${component.props.textColor === 'gray-300' ? 'selected' : ''}" data-color="gray-300" data-prop="textColor"></div>
|
| 1129 |
-
<div class="color-option bg-blue-200 ${component.props.textColor === 'blue-200' ? 'selected' : ''}" data-color="blue-200" data-prop="textColor"></div>
|
| 1130 |
-
</div>
|
| 1131 |
-
</div>
|
| 1132 |
-
<div>
|
| 1133 |
-
<label class="block text-sm font-medium text-gray-700 mb-1">Copyright Text</label>
|
| 1134 |
-
<input type="text" class="w-full p-2 border rounded-md text-sm" value="${component.props.copyright}" data-prop="copyright">
|
| 1135 |
-
</div>
|
| 1136 |
-
<div>
|
| 1137 |
-
<label class="block text-sm font-medium text-gray-700 mb-1">Columns</label>
|
| 1138 |
-
<div class="columns-container space-y-4">
|
| 1139 |
-
${component.props.columns.map((column, index) => `
|
| 1140 |
-
<div class="border p-3 rounded-md">
|
| 1141 |
-
<div class="flex justify-between items-center mb-2">
|
| 1142 |
-
<h4 class="font-medium text-sm">Column ${index + 1}</h4>
|
| 1143 |
-
<button class="remove-column-btn text-red-500" data-column-index="${index}">
|
| 1144 |
-
<i class="fas fa-times"></i>
|
| 1145 |
-
</button>
|
| 1146 |
-
</div>
|
| 1147 |
-
<div class="space-y-2">
|
| 1148 |
-
<div>
|
| 1149 |
-
<label class="block text-xs text-gray-500 mb-1">Title</label>
|
| 1150 |
-
<input type="text" class="w-full p-2 border rounded-md text-sm" value="${column.title}" data-column-index="${index}" data-prop="title">
|
| 1151 |
-
</div>
|
| 1152 |
-
<div>
|
| 1153 |
-
<label class="block text-xs text-gray-500 mb-1">Links</label>
|
| 1154 |
-
<div class="links-container space-y-2">
|
| 1155 |
-
${column.links.map((link, linkIndex) => `
|
| 1156 |
-
<div class="flex items-center space-x-2">
|
| 1157 |
-
<input type="text" class="flex-1 p-2 border rounded-md text-sm" value="${link}" data-column-index="${index}" data-link-index="${linkIndex}">
|
| 1158 |
-
<button class="remove-link-btn p-2 text-red-500" data-column-index="${index}" data-link-index="${linkIndex}">
|
| 1159 |
-
<i class="fas fa-times"></i>
|
| 1160 |
-
</button>
|
| 1161 |
-
</div>
|
| 1162 |
-
`).join('')}
|
| 1163 |
-
</div>
|
| 1164 |
-
<button class="add-column-link-btn mt-2 text-sm text-primary hover:text-primary-dark flex items-center" data-column-index="${index}">
|
| 1165 |
-
<i class="fas fa-plus mr-1"></i> Add Link
|
| 1166 |
-
</button>
|
| 1167 |
-
</div>
|
| 1168 |
-
</div>
|
| 1169 |
-
</div>
|
| 1170 |
-
`).join('')}
|
| 1171 |
-
</div>
|
| 1172 |
-
<button class="add-column-btn mt-2 text-sm text-primary hover:text-primary-dark flex items-center">
|
| 1173 |
-
<i class="fas fa-plus mr-1"></i> Add Column
|
| 1174 |
-
</button>
|
| 1175 |
-
</div>
|
| 1176 |
-
</div>
|
| 1177 |
-
`;
|
| 1178 |
-
break;
|
| 1179 |
-
}
|
| 1180 |
-
|
| 1181 |
-
propertiesPanel.innerHTML = propertiesHtml;
|
| 1182 |
-
|
| 1183 |
-
// Add event listeners to property controls
|
| 1184 |
-
addPropertyEventListeners(component);
|
| 1185 |
-
}
|
| 1186 |
-
|
| 1187 |
-
// Add event listeners to property controls
|
| 1188 |
-
function addPropertyEventListeners(component) {
|
| 1189 |
-
// General input/select change handlers
|
| 1190 |
-
propertiesPanel.querySelectorAll('input, select, textarea').forEach(input => {
|
| 1191 |
-
const propName = input.dataset.prop;
|
| 1192 |
-
if (propName) {
|
| 1193 |
-
input.addEventListener('input', function() {
|
| 1194 |
-
updateComponentProperty(component.id, propName, this.value);
|
| 1195 |
-
});
|
| 1196 |
-
}
|
| 1197 |
-
});
|
| 1198 |
-
|
| 1199 |
-
// Color options
|
| 1200 |
-
propertiesPanel.querySelectorAll('.color-option').forEach(option => {
|
| 1201 |
-
option.addEventListener('click', function() {
|
| 1202 |
-
const propName = this.dataset.prop;
|
| 1203 |
-
const colorValue = this.dataset.color;
|
| 1204 |
-
|
| 1205 |
-
// Remove selected class from siblings
|
| 1206 |
-
this.parentElement.querySelectorAll('.color-option').forEach(opt => {
|
| 1207 |
-
opt.classList.remove('selected');
|
| 1208 |
-
});
|
| 1209 |
-
|
| 1210 |
-
// Add selected class to clicked option
|
| 1211 |
-
this.classList.add('selected');
|
| 1212 |
-
|
| 1213 |
-
updateComponentProperty(component.id, propName, colorValue);
|
| 1214 |
-
});
|
| 1215 |
-
});
|
| 1216 |
-
|
| 1217 |
-
// Component-specific event listeners
|
| 1218 |
-
switch(component.type) {
|
| 1219 |
-
case 'header':
|
| 1220 |
-
// Add link button
|
| 1221 |
-
propertiesPanel.querySelector('.add-link-btn')?.addEventListener('click', function() {
|
| 1222 |
-
addHeaderLink(component.id);
|
| 1223 |
-
});
|
| 1224 |
-
|
| 1225 |
-
// Remove link buttons
|
| 1226 |
-
propertiesPanel.querySelectorAll('.remove-link-btn').forEach(btn => {
|
| 1227 |
-
btn.addEventListener('click', function() {
|
| 1228 |
-
const index = parseInt(this.dataset.linkIndex);
|
| 1229 |
-
removeHeaderLink(component.id, index);
|
| 1230 |
-
});
|
| 1231 |
-
});
|
| 1232 |
-
break;
|
| 1233 |
-
|
| 1234 |
-
case 'features':
|
| 1235 |
-
// Add feature button
|
| 1236 |
-
propertiesPanel.querySelector('.add-feature-btn')?.addEventListener('click', function() {
|
| 1237 |
-
addFeature(component.id);
|
| 1238 |
-
});
|
| 1239 |
-
|
| 1240 |
-
// Remove feature buttons
|
| 1241 |
-
propertiesPanel.querySelectorAll('.remove-feature-btn').forEach(btn => {
|
| 1242 |
-
btn.addEventListener('click', function() {
|
| 1243 |
-
const index = parseInt(this.dataset.featureIndex);
|
| 1244 |
-
removeFeature(component.id, index);
|
| 1245 |
-
});
|
| 1246 |
-
});
|
| 1247 |
-
|
| 1248 |
-
// Feature property inputs
|
| 1249 |
-
propertiesPanel.querySelectorAll('[data-feature-index]').forEach(input => {
|
| 1250 |
-
const propName = input.dataset.prop;
|
| 1251 |
-
const featureIndex = parseInt(input.dataset.featureIndex);
|
| 1252 |
-
|
| 1253 |
-
input.addEventListener('input', function() {
|
| 1254 |
-
updateFeatureProperty(component.id, featureIndex, propName, this.value);
|
| 1255 |
-
});
|
| 1256 |
-
});
|
| 1257 |
-
|
| 1258 |
-
// Feature count selector
|
| 1259 |
-
propertiesPanel.querySelector('[data-prop="featureCount"]')?.addEventListener('change', function() {
|
| 1260 |
-
updateFeatureCount(component.id, parseInt(this.value));
|
| 1261 |
-
});
|
| 1262 |
-
break;
|
| 1263 |
-
|
| 1264 |
-
case 'footer':
|
| 1265 |
-
// Add column button
|
| 1266 |
-
propertiesPanel.querySelector('.add-column-btn')?.addEventListener('click', function() {
|
| 1267 |
-
addFooterColumn(component.id);
|
| 1268 |
-
});
|
| 1269 |
-
|
| 1270 |
-
// Remove column buttons
|
| 1271 |
-
propertiesPanel.querySelectorAll('.remove-column-btn').forEach(btn => {
|
| 1272 |
-
btn.addEventListener('click', function() {
|
| 1273 |
-
const index = parseInt(this.dataset.columnIndex);
|
| 1274 |
-
removeFooterColumn(component.id, index);
|
| 1275 |
-
});
|
| 1276 |
-
});
|
| 1277 |
-
|
| 1278 |
-
// Add column link buttons
|
| 1279 |
-
propertiesPanel.querySelectorAll('.add-column-link-btn').forEach(btn => {
|
| 1280 |
-
btn.addEventListener('click', function() {
|
| 1281 |
-
const columnIndex = parseInt(this.dataset.columnIndex);
|
| 1282 |
-
addFooterColumnLink(component.id, columnIndex);
|
| 1283 |
-
});
|
| 1284 |
-
});
|
| 1285 |
-
|
| 1286 |
-
// Remove column link buttons
|
| 1287 |
-
propertiesPanel.querySelectorAll('.remove-link-btn').forEach(btn => {
|
| 1288 |
-
btn.addEventListener('click', function() {
|
| 1289 |
-
const columnIndex = parseInt(this.dataset.columnIndex);
|
| 1290 |
-
const linkIndex = parseInt(this.dataset.linkIndex);
|
| 1291 |
-
removeFooterColumnLink(component.id, columnIndex, linkIndex);
|
| 1292 |
-
});
|
| 1293 |
-
});
|
| 1294 |
-
|
| 1295 |
-
// Column property inputs
|
| 1296 |
-
propertiesPanel.querySelectorAll('[data-column-index]').forEach(input => {
|
| 1297 |
-
if (!input.dataset.prop) return;
|
| 1298 |
-
|
| 1299 |
-
const propName = input.dataset.prop;
|
| 1300 |
-
const columnIndex = parseInt(input.dataset.columnIndex);
|
| 1301 |
-
|
| 1302 |
-
input.addEventListener('input', function() {
|
| 1303 |
-
updateFooterColumnProperty(component.id, columnIndex, propName, this.value);
|
| 1304 |
-
});
|
| 1305 |
-
});
|
| 1306 |
-
break;
|
| 1307 |
-
}
|
| 1308 |
-
}
|
| 1309 |
-
|
| 1310 |
-
// Update component property
|
| 1311 |
-
function updateComponentProperty(componentId, propName, value) {
|
| 1312 |
-
const component = components.find(c => c.id === componentId);
|
| 1313 |
-
if (!component) return;
|
| 1314 |
-
|
| 1315 |
-
component.props[propName] = value;
|
| 1316 |
-
renderComponent(componentId);
|
| 1317 |
-
}
|
| 1318 |
-
|
| 1319 |
-
// Add header link
|
| 1320 |
-
function addHeaderLink(componentId) {
|
| 1321 |
-
const component = components.find(c => c.id === componentId);
|
| 1322 |
-
if (!component || component.type !== 'header') return;
|
| 1323 |
-
|
| 1324 |
-
component.props.links.push('New Link');
|
| 1325 |
-
renderComponent(componentId);
|
| 1326 |
-
updatePropertiesPanel(component);
|
| 1327 |
-
}
|
| 1328 |
-
|
| 1329 |
-
// Remove header link
|
| 1330 |
-
function removeHeaderLink(componentId, index) {
|
| 1331 |
-
const component = components.find(c => c.id === componentId);
|
| 1332 |
-
if (!component || component.type !== 'header') return;
|
| 1333 |
-
|
| 1334 |
-
component.props.links.splice(index, 1);
|
| 1335 |
-
renderComponent(componentId);
|
| 1336 |
-
updatePropertiesPanel(component);
|
| 1337 |
-
}
|
| 1338 |
-
|
| 1339 |
-
// Add feature
|
| 1340 |
-
function addFeature(componentId) {
|
| 1341 |
-
const component = components.find(c => c.id === componentId);
|
| 1342 |
-
if (!component || component.type !== 'features') return;
|
| 1343 |
-
|
| 1344 |
-
component.props.features.push({
|
| 1345 |
-
title: `Feature ${component.props.features.length + 1}`,
|
| 1346 |
-
description: 'Description goes here',
|
| 1347 |
-
icon: 'fa-rocket'
|
| 1348 |
-
});
|
| 1349 |
-
|
| 1350 |
-
renderComponent(componentId);
|
| 1351 |
-
updatePropertiesPanel(component);
|
| 1352 |
-
}
|
| 1353 |
-
|
| 1354 |
-
// Remove feature
|
| 1355 |
-
function removeFeature(componentId, index) {
|
| 1356 |
-
const component = components.find(c => c.id === componentId);
|
| 1357 |
-
if (!component || component.type !== 'features') return;
|
| 1358 |
-
|
| 1359 |
-
component.props.features.splice(index, 1);
|
| 1360 |
-
renderComponent(componentId);
|
| 1361 |
-
updatePropertiesPanel(component);
|
| 1362 |
-
}
|
| 1363 |
-
|
| 1364 |
-
// Update feature property
|
| 1365 |
-
function updateFeatureProperty(componentId, featureIndex, propName, value) {
|
| 1366 |
-
const component = components.find(c => c.id === componentId);
|
| 1367 |
-
if (!component || component.type !== 'features') return;
|
| 1368 |
-
|
| 1369 |
-
if (component.props.features[featureIndex]) {
|
| 1370 |
-
component.props.features[featureIndex][propName] = value;
|
| 1371 |
-
renderComponent(componentId);
|
| 1372 |
-
}
|
| 1373 |
-
}
|
| 1374 |
-
|
| 1375 |
-
// Update feature count
|
| 1376 |
-
function updateFeatureCount(componentId, count) {
|
| 1377 |
-
const component = components.find(c => c.id === componentId);
|
| 1378 |
-
if (!component || component.type !== 'features') return;
|
| 1379 |
-
|
| 1380 |
-
const currentCount = component.props.features.length;
|
| 1381 |
-
|
| 1382 |
-
if (count > currentCount) {
|
| 1383 |
-
// Add features
|
| 1384 |
-
for (let i = currentCount; i < count; i++) {
|
| 1385 |
-
component.props.features.push({
|
| 1386 |
-
title: `Feature ${i + 1}`,
|
| 1387 |
-
description: 'Description goes here',
|
| 1388 |
-
icon: 'fa-rocket'
|
| 1389 |
-
});
|
| 1390 |
-
}
|
| 1391 |
-
} else if (count < currentCount) {
|
| 1392 |
-
// Remove features
|
| 1393 |
-
component.props.features = component.props.features.slice(0, count);
|
| 1394 |
-
}
|
| 1395 |
-
|
| 1396 |
-
renderComponent(componentId);
|
| 1397 |
-
updatePropertiesPanel(component);
|
| 1398 |
-
}
|
| 1399 |
-
|
| 1400 |
-
// Add footer column
|
| 1401 |
-
function addFooterColumn(componentId) {
|
| 1402 |
-
const component = components.find(c => c.id === componentId);
|
| 1403 |
-
if (!component || component.type !== 'footer') return;
|
| 1404 |
-
|
| 1405 |
-
component.props.columns.push({
|
| 1406 |
-
title: `Column ${component.props.columns.length + 1}`,
|
| 1407 |
-
links: ['Link 1', 'Link 2']
|
| 1408 |
-
});
|
| 1409 |
-
|
| 1410 |
-
renderComponent(componentId);
|
| 1411 |
-
updatePropertiesPanel(component);
|
| 1412 |
-
}
|
| 1413 |
-
|
| 1414 |
-
// Remove footer column
|
| 1415 |
-
function removeFooterColumn(componentId, index) {
|
| 1416 |
-
const component = components.find(c => c.id === componentId);
|
| 1417 |
-
if (!component || component.type !== 'footer') return;
|
| 1418 |
-
|
| 1419 |
-
component.props.columns.splice(index, 1);
|
| 1420 |
-
renderComponent(componentId);
|
| 1421 |
-
updatePropertiesPanel(component);
|
| 1422 |
-
}
|
| 1423 |
-
|
| 1424 |
-
// Add footer column link
|
| 1425 |
-
function addFooterColumnLink(componentId, columnIndex) {
|
| 1426 |
-
const component = components.find(c => c.id === componentId);
|
| 1427 |
-
if (!component || component.type !== 'footer') return;
|
| 1428 |
-
|
| 1429 |
-
if (component.props.columns[columnIndex]) {
|
| 1430 |
-
component.props.columns[columnIndex].links.push(`New Link`);
|
| 1431 |
-
renderComponent(componentId);
|
| 1432 |
-
updatePropertiesPanel(component);
|
| 1433 |
-
}
|
| 1434 |
-
}
|
| 1435 |
-
|
| 1436 |
-
// Remove footer column link
|
| 1437 |
-
function removeFooterColumnLink(componentId, columnIndex, linkIndex) {
|
| 1438 |
-
const component = components.find(c => c.id === componentId);
|
| 1439 |
-
if (!component || component.type !== 'footer') return;
|
| 1440 |
-
|
| 1441 |
-
if (component.props.columns[columnIndex] && component.props.columns[columnIndex].links[linkIndex]) {
|
| 1442 |
-
component.props.columns[columnIndex].links.splice(linkIndex, 1);
|
| 1443 |
-
renderComponent(componentId);
|
| 1444 |
-
updatePropertiesPanel(component);
|
| 1445 |
-
}
|
| 1446 |
-
}
|
| 1447 |
-
|
| 1448 |
-
// Update footer column property
|
| 1449 |
-
function updateFooterColumnProperty(componentId, columnIndex, propName, value) {
|
| 1450 |
-
const component = components.find(c => c.id === componentId);
|
| 1451 |
-
if (!component || component.type !== 'footer') return;
|
| 1452 |
-
|
| 1453 |
-
if (component.props.columns[columnIndex]) {
|
| 1454 |
-
component.props.columns[columnIndex][propName] = value;
|
| 1455 |
-
renderComponent(componentId);
|
| 1456 |
-
}
|
| 1457 |
-
}
|
| 1458 |
-
|
| 1459 |
-
// Render component with updated properties
|
| 1460 |
-
function renderComponent(componentId) {
|
| 1461 |
-
const component = components.find(c => c.id === componentId);
|
| 1462 |
-
if (!component) return;
|
| 1463 |
-
|
| 1464 |
-
const element = document.getElementById(componentId);
|
| 1465 |
-
if (!element) return;
|
| 1466 |
-
|
| 1467 |
-
let componentHtml = '';
|
| 1468 |
-
|
| 1469 |
-
switch(component.type) {
|
| 1470 |
-
case 'header':
|
| 1471 |
-
componentHtml = `
|
| 1472 |
-
<div class="bg-${component.props.bgColor} text-${component.props.textColor} p-4">
|
| 1473 |
-
<div class="container mx-auto flex justify-between items-center">
|
| 1474 |
-
<div class="text-xl font-bold">${component.props.logoText}</div>
|
| 1475 |
-
<nav class="flex space-x-4">
|
| 1476 |
-
${component.props.links.map(link => `<a href="#" class="hover:underline">${link}</a>`).join('')}
|
| 1477 |
-
</nav>
|
| 1478 |
-
</div>
|
| 1479 |
-
</div>
|
| 1480 |
-
`;
|
| 1481 |
-
break;
|
| 1482 |
-
|
| 1483 |
-
case 'hero':
|
| 1484 |
-
componentHtml = `
|
| 1485 |
-
<div class="bg-${component.props.bgColor} text-${component.props.textColor} py-12 px-4 md:px-0 text-center">
|
| 1486 |
-
<div class="container mx-auto">
|
| 1487 |
-
<h1 class="text-4xl font-bold mb-4">${component.props.title}</h1>
|
| 1488 |
-
<p class="text-xl mb-8 max-w-2xl mx-auto">${component.props.subtitle}</p>
|
| 1489 |
-
<button class="bg-${component.props.buttonColor} text-${component.props.buttonTextColor} px-6 py-2 rounded-md font-medium hover:bg-opacity-90">${component.props.buttonText}</button>
|
| 1490 |
-
</div>
|
| 1491 |
-
</div>
|
| 1492 |
-
`;
|
| 1493 |
-
break;
|
| 1494 |
-
|
| 1495 |
-
case 'features':
|
| 1496 |
-
componentHtml = `
|
| 1497 |
-
<div class="py-8 px-4 md:px-0 bg-${component.props.bgColor}">
|
| 1498 |
-
<div class="container mx-auto">
|
| 1499 |
-
<h2 class="text-2xl font-bold text-center mb-8">${component.props.title}</h2>
|
| 1500 |
-
<div class="grid grid-cols-1 md:grid-cols-${component.props.features.length} gap-6">
|
| 1501 |
-
${component.props.features.map(feature => `
|
| 1502 |
-
<div class="bg-white p-6 rounded-lg shadow-sm">
|
| 1503 |
-
<div class="text-primary text-3xl mb-3">
|
| 1504 |
-
<i class="fas ${feature.icon}"></i>
|
| 1505 |
-
</div>
|
| 1506 |
-
<h3 class="font-semibold mb-2">${feature.title}</h3>
|
| 1507 |
-
<p class="text-gray-600">${feature.description}</p>
|
| 1508 |
-
</div>
|
| 1509 |
-
`).join('')}
|
| 1510 |
-
</div>
|
| 1511 |
-
</div>
|
| 1512 |
-
</div>
|
| 1513 |
-
`;
|
| 1514 |
-
break;
|
| 1515 |
-
|
| 1516 |
-
case 'text':
|
| 1517 |
-
componentHtml = `
|
| 1518 |
-
<div class="py-8 px-4 md:px-0">
|
| 1519 |
-
<div class="container mx-auto max-w-4xl text-${component.props.textAlign}">
|
| 1520 |
-
<h2 class="text-2xl font-bold mb-4">${component.props.title}</h2>
|
| 1521 |
-
${component.props.content.split('\n\n').map(para => `<p class="text-gray-700 mb-4">${para}</p>`).join('')}
|
| 1522 |
-
</div>
|
| 1523 |
-
</div>
|
| 1524 |
-
`;
|
| 1525 |
-
break;
|
| 1526 |
-
|
| 1527 |
-
case 'image':
|
| 1528 |
-
componentHtml = `
|
| 1529 |
-
<div class="py-${component.props.padding} px-4 md:px-0">
|
| 1530 |
-
<div class="container mx-auto">
|
| 1531 |
-
<img src="${component.props.src}" alt="${component.props.alt}" class="w-full h
|
| 1532 |
</html>
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>DeepSeek Visual Builder with APWB Integration</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>
|
|
|
|
| 158 |
.resize-handle:hover {
|
| 159 |
@apply bg-primary-dark;
|
| 160 |
}
|
| 161 |
+
|
| 162 |
+
/* AI Prompt Modal Styles */
|
| 163 |
+
.ai-modal {
|
| 164 |
+
@apply fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4;
|
| 165 |
+
}
|
| 166 |
+
|
| 167 |
+
.ai-modal-content {
|
| 168 |
+
@apply bg-white rounded-lg w-full max-w-2xl flex flex-col overflow-hidden shadow-xl;
|
| 169 |
+
}
|
| 170 |
+
|
| 171 |
+
.ai-modal-header {
|
| 172 |
+
@apply p-4 border-b flex justify-between items-center bg-gray-50;
|
| 173 |
+
}
|
| 174 |
+
|
| 175 |
+
.ai-modal-body {
|
| 176 |
+
@apply p-4 flex-1 overflow-auto;
|
| 177 |
+
}
|
| 178 |
+
|
| 179 |
+
.ai-modal-footer {
|
| 180 |
+
@apply p-4 border-t flex justify-end space-x-3;
|
| 181 |
+
}
|
| 182 |
+
|
| 183 |
+
.ai-prompt-textarea {
|
| 184 |
+
@apply w-full p-3 border rounded-md text-sm h-32 focus:ring-2 focus:ring-primary focus:border-transparent;
|
| 185 |
+
}
|
| 186 |
+
|
| 187 |
+
.ai-response {
|
| 188 |
+
@apply mt-4 p-3 bg-gray-50 rounded-md text-sm whitespace-pre-wrap;
|
| 189 |
+
}
|
| 190 |
+
|
| 191 |
+
.ai-loading {
|
| 192 |
+
@apply flex items-center justify-center py-4;
|
| 193 |
+
}
|
| 194 |
+
|
| 195 |
+
.ai-loading-spinner {
|
| 196 |
+
@apply animate-spin h-5 w-5 text-primary;
|
| 197 |
+
}
|
| 198 |
+
|
| 199 |
+
.ai-generated-component {
|
| 200 |
+
@apply border-l-4 border-primary pl-3 my-2;
|
| 201 |
+
}
|
| 202 |
+
|
| 203 |
+
/* APWB Integration Styles */
|
| 204 |
+
.apwb-container {
|
| 205 |
+
@apply border rounded-lg overflow-hidden;
|
| 206 |
+
}
|
| 207 |
+
|
| 208 |
+
.apwb-header {
|
| 209 |
+
@apply bg-gray-100 p-3 border-b flex justify-between items-center;
|
| 210 |
+
}
|
| 211 |
+
|
| 212 |
+
.apwb-body {
|
| 213 |
+
@apply p-4;
|
| 214 |
+
}
|
| 215 |
+
|
| 216 |
+
.apwb-input {
|
| 217 |
+
@apply w-full p-2 border rounded-md text-sm mb-2;
|
| 218 |
+
}
|
| 219 |
+
|
| 220 |
+
.apwb-button {
|
| 221 |
+
@apply bg-blue-500 hover:bg-blue-600 text-white px-3 py-1.5 rounded-md text-sm font-medium;
|
| 222 |
+
}
|
| 223 |
+
|
| 224 |
+
.apwb-response {
|
| 225 |
+
@apply mt-4 p-3 bg-gray-50 rounded-md text-sm whitespace-pre-wrap;
|
| 226 |
+
}
|
| 227 |
+
|
| 228 |
+
.model-selector {
|
| 229 |
+
@apply flex items-center space-x-2 bg-gray-100 rounded-md px-3 py-1.5;
|
| 230 |
+
}
|
| 231 |
+
|
| 232 |
+
.model-selector select {
|
| 233 |
+
@apply bg-transparent border-none focus:ring-0 text-sm;
|
| 234 |
+
}
|
| 235 |
+
|
| 236 |
+
/* Split view layout */
|
| 237 |
+
.split-container {
|
| 238 |
+
@apply flex flex-1 overflow-hidden;
|
| 239 |
+
}
|
| 240 |
+
|
| 241 |
+
.split-panel {
|
| 242 |
+
@apply flex-1 overflow-auto;
|
| 243 |
+
}
|
| 244 |
+
|
| 245 |
+
.split-divider {
|
| 246 |
+
@apply w-1 bg-gray-200 cursor-col-resize;
|
| 247 |
+
}
|
| 248 |
+
|
| 249 |
+
/* Tabs */
|
| 250 |
+
.tab-content {
|
| 251 |
+
@apply hidden;
|
| 252 |
+
}
|
| 253 |
+
|
| 254 |
+
.tab-content.active {
|
| 255 |
+
@apply block;
|
| 256 |
+
}
|
| 257 |
</style>
|
| 258 |
</head>
|
| 259 |
<body class="h-screen flex flex-col overflow-hidden">
|
|
|
|
| 264 |
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
| 265 |
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" />
|
| 266 |
</svg>
|
| 267 |
+
<h1 class="text-xl font-bold">DeepSeek + APWB Builder</h1>
|
| 268 |
</div>
|
| 269 |
<div class="flex items-center space-x-3">
|
| 270 |
+
<button id="aiPromptBtn" class="flex items-center space-x-1 bg-white/10 hover:bg-white/20 px-3 py-1.5 rounded-md text-sm font-medium transition-colors">
|
| 271 |
+
<i class="fas fa-robot"></i>
|
| 272 |
+
<span>AI Builder</span>
|
| 273 |
+
</button>
|
| 274 |
<button id="saveBtn" class="flex items-center space-x-1 bg-white/10 hover:bg-white/20 px-3 py-1.5 rounded-md text-sm font-medium transition-colors">
|
| 275 |
<i class="fas fa-save"></i>
|
| 276 |
<span>Save</span>
|
|
|
|
| 288 |
</header>
|
| 289 |
|
| 290 |
<!-- Main Content -->
|
| 291 |
+
<div class="split-container">
|
| 292 |
+
<!-- Left Panel - Components & APWB Integration -->
|
| 293 |
+
<div class="split-panel w-64 bg-white border-r border-gray-200 flex flex-col">
|
| 294 |
<div class="p-3 border-b border-gray-200">
|
| 295 |
+
<div class="flex items-center justify-between">
|
| 296 |
+
<h2 class="text-lg font-semibold text-gray-800">Tools</h2>
|
| 297 |
+
<div class="model-selector">
|
| 298 |
+
<span>Model:</span>
|
| 299 |
+
<select id="modelSelector">
|
| 300 |
+
<option value="apwb">APWB</option>
|
| 301 |
+
<option value="deepseek">DeepSeek</option>
|
| 302 |
+
</select>
|
| 303 |
+
</div>
|
| 304 |
+
</div>
|
| 305 |
<div class="mt-2 flex space-x-1">
|
| 306 |
+
<button class="tab-btn active" data-tab="components">Components</button>
|
| 307 |
+
<button class="tab-btn" data-tab="apwb">APWB</button>
|
| 308 |
</div>
|
| 309 |
</div>
|
| 310 |
+
|
| 311 |
+
<!-- Components Tab -->
|
| 312 |
+
<div id="componentsTab" class="tab-content active flex-1 overflow-y-auto p-3 space-y-3">
|
| 313 |
<div class="component bg-white p-3 rounded-lg border border-gray-200 shadow-sm" draggable="true" data-type="header">
|
| 314 |
<div class="flex items-center space-x-3">
|
| 315 |
<div class="bg-primary/10 text-primary p-2 rounded-lg">
|
|
|
|
| 388 |
</div>
|
| 389 |
</div>
|
| 390 |
</div>
|
| 391 |
+
|
| 392 |
+
<!-- APWB Tab -->
|
| 393 |
+
<div id="apwbTab" class="tab-content flex-1 overflow-y-auto p-3">
|
| 394 |
+
<div class="apwb-container">
|
| 395 |
+
<div class="apwb-header">
|
| 396 |
+
<h3 class="text-sm font-medium">APWB AI Assistant</h3>
|
| 397 |
+
<i class="fas fa-info-circle text-gray-500"></i>
|
| 398 |
+
</div>
|
| 399 |
+
<div class="apwb-body">
|
| 400 |
+
<textarea id="apwbPrompt" class="apwb-input" placeholder="Describe what you want to create..."></textarea>
|
| 401 |
+
<button id="apwbSubmit" class="apwb-button w-full">
|
| 402 |
+
<i class="fas fa-paper-plane mr-1"></i> Generate
|
| 403 |
+
</button>
|
| 404 |
+
<div id="apwbResponse" class="apwb-response hidden"></div>
|
| 405 |
+
<div id="apwbLoading" class="ai-loading hidden">
|
| 406 |
+
<i class="ai-loading-spinner fas fa-spinner"></i>
|
| 407 |
+
<span class="ml-2">Generating with APWB...</span>
|
| 408 |
+
</div>
|
| 409 |
+
</div>
|
| 410 |
+
</div>
|
| 411 |
+
</div>
|
| 412 |
</div>
|
| 413 |
+
|
| 414 |
+
<!-- Divider -->
|
| 415 |
+
<div class="split-divider"></div>
|
| 416 |
+
|
| 417 |
+
<!-- Center Panel - Canvas -->
|
| 418 |
+
<div class="split-panel bg-gray-100 overflow-auto p-6">
|
| 419 |
<div id="canvas" class="droppable bg-white mx-auto w-full max-w-4xl min-h-full rounded-lg shadow-sm relative">
|
| 420 |
<div class="absolute inset-0 flex items-center justify-center" id="emptyState">
|
| 421 |
<div class="text-center p-6 max-w-md">
|
|
|
|
| 423 |
<i class="fas fa-plus text-gray-400 text-2xl"></i>
|
| 424 |
</div>
|
| 425 |
<h3 class="text-lg font-medium text-gray-700 mb-1">Drag components here</h3>
|
| 426 |
+
<p class="text-gray-500 text-sm">Start building your page by dragging components or using the AI tools</p>
|
| 427 |
</div>
|
| 428 |
</div>
|
| 429 |
</div>
|
| 430 |
</div>
|
| 431 |
+
|
| 432 |
+
<!-- Divider -->
|
| 433 |
+
<div class="split-divider"></div>
|
| 434 |
+
|
| 435 |
+
<!-- Right Panel - Properties -->
|
| 436 |
+
<div class="split-panel w-72 bg-white border-l border-gray-200 flex flex-col">
|
| 437 |
<div class="p-3 border-b border-gray-200">
|
| 438 |
<h2 class="text-lg font-semibold text-gray-800">Properties</h2>
|
| 439 |
</div>
|
|
|
|
| 496 |
</div>
|
| 497 |
</div>
|
| 498 |
|
| 499 |
+
<!-- AI Prompt Modal -->
|
| 500 |
+
<div id="aiModal" class="ai-modal hidden">
|
| 501 |
+
<div class="ai-modal-content">
|
| 502 |
+
<div class="ai-modal-header">
|
| 503 |
+
<h3 class="text-lg font-semibold">AI Builder</h3>
|
| 504 |
+
<button id="closeAIModal" class="text-gray-500 hover:text-gray-700">
|
| 505 |
+
<i class="fas fa-times"></i>
|
| 506 |
+
</button>
|
| 507 |
+
</div>
|
| 508 |
+
<div class="ai-modal-body">
|
| 509 |
+
<p class="text-sm text-gray-600 mb-3">Describe the component or page you want to create. The AI will generate it for you.</p>
|
| 510 |
+
<textarea id="aiPrompt" class="ai-prompt-textarea" placeholder="Example: Create a hero section with a dark background, centered text, a headline, a subheadline, and a primary button that says 'Get Started'"></textarea>
|
| 511 |
+
<div id="aiResponse" class="ai-response hidden"></div>
|
| 512 |
+
<div id="aiLoading" class="ai-loading hidden">
|
| 513 |
+
<i class="ai-loading-spinner fas fa-spinner"></i>
|
| 514 |
+
<span class="ml-2">Generating your component...</span>
|
| 515 |
+
</div>
|
| 516 |
+
<div id="aiGeneratedComponents" class="mt-4 hidden">
|
| 517 |
+
<h4 class="font-medium mb-2">Generated Components:</h4>
|
| 518 |
+
<div id="aiComponentsList"></div>
|
| 519 |
+
</div>
|
| 520 |
+
</div>
|
| 521 |
+
<div class="ai-modal-footer">
|
| 522 |
+
<button id="cancelAIBtn" class="px-4 py-2 text-sm font-medium text-gray-700 bg-gray-200 rounded-md hover:bg-gray-300">
|
| 523 |
+
Cancel
|
| 524 |
+
</button>
|
| 525 |
+
<button id="generateAIBtn" class="px-4 py-2 text-sm font-medium text-white bg-primary rounded-md hover:bg-primary-dark">
|
| 526 |
+
Generate
|
| 527 |
+
</button>
|
| 528 |
+
</div>
|
| 529 |
+
</div>
|
| 530 |
+
</div>
|
| 531 |
+
|
| 532 |
<script>
|
| 533 |
document.addEventListener('DOMContentLoaded', function() {
|
| 534 |
// Global variables
|
|
|
|
| 538 |
let componentCounter = 0;
|
| 539 |
let isResizing = false;
|
| 540 |
let startX, startY, startWidth, startHeight;
|
| 541 |
+
let isDraggingDivider = false;
|
| 542 |
+
let activeModel = 'apwb'; // Default to APWB model
|
| 543 |
|
| 544 |
// DOM elements
|
| 545 |
const canvas = document.getElementById('canvas');
|
|
|
|
| 559 |
const downloadBtn = document.getElementById('downloadBtn');
|
| 560 |
const closeExport = document.getElementById('closeExport');
|
| 561 |
const tabBtns = document.querySelectorAll('[data-tab]');
|
| 562 |
+
const tabsContent = document.querySelectorAll('.tab-content');
|
| 563 |
+
const modelSelector = document.getElementById('modelSelector');
|
| 564 |
+
|
| 565 |
+
// AI Modal elements
|
| 566 |
+
const aiPromptBtn = document.getElementById('aiPromptBtn');
|
| 567 |
+
const aiModal = document.getElementById('aiModal');
|
| 568 |
+
const aiPrompt = document.getElementById('aiPrompt');
|
| 569 |
+
const aiResponse = document.getElementById('aiResponse');
|
| 570 |
+
const aiLoading = document.getElementById('aiLoading');
|
| 571 |
+
const aiGeneratedComponents = document.getElementById('aiGeneratedComponents');
|
| 572 |
+
const aiComponentsList = document.getElementById('aiComponentsList');
|
| 573 |
+
const generateAIBtn = document.getElementById('generateAIBtn');
|
| 574 |
+
const cancelAIBtn = document.getElementById('cancelAIBtn');
|
| 575 |
+
const closeAIModal = document.getElementById('closeAIModal');
|
| 576 |
+
|
| 577 |
+
// APWB elements
|
| 578 |
+
const apwbTab = document.getElementById('apwbTab');
|
| 579 |
+
const apwbPrompt = document.getElementById('apwbPrompt');
|
| 580 |
+
const apwbSubmit = document.getElementById('apwbSubmit');
|
| 581 |
+
const apwbResponse = document.getElementById('apwbResponse');
|
| 582 |
+
const apwbLoading = document.getElementById('apwbLoading');
|
| 583 |
+
|
| 584 |
+
// Split view elements
|
| 585 |
+
const splitContainer = document.querySelector('.split-container');
|
| 586 |
+
const leftPanel = document.querySelector('.split-panel:first-child');
|
| 587 |
+
const rightPanel = document.querySelector('.split-panel:last-child');
|
| 588 |
+
const dividers = document.querySelectorAll('.split-divider');
|
| 589 |
|
| 590 |
// Initialize the builder
|
| 591 |
function initBuilder() {
|
| 592 |
initDragAndDrop();
|
| 593 |
initEventListeners();
|
| 594 |
+
initAIEventListeners();
|
| 595 |
+
initAPWBEventListeners();
|
| 596 |
+
initSplitView();
|
| 597 |
loadFromLocalStorage();
|
| 598 |
}
|
| 599 |
|
|
|
|
| 632 |
// Tab buttons
|
| 633 |
tabBtns.forEach(btn => {
|
| 634 |
btn.addEventListener('click', () => {
|
| 635 |
+
const tabId = btn.dataset.tab;
|
| 636 |
tabBtns.forEach(b => b.classList.remove('active'));
|
| 637 |
btn.classList.add('active');
|
| 638 |
+
|
| 639 |
+
tabsContent.forEach(content => content.classList.remove('active'));
|
| 640 |
+
document.getElementById(`${tabId}Tab`).classList.add('active');
|
| 641 |
+
});
|
| 642 |
+
});
|
| 643 |
+
|
| 644 |
+
// Model selector
|
| 645 |
+
modelSelector.addEventListener('change', (e) => {
|
| 646 |
+
activeModel = e.target.value;
|
| 647 |
+
showToast(`Switched to ${activeModel === 'apwb' ? 'APWB' : 'DeepSeek'} model`);
|
| 648 |
+
});
|
| 649 |
+
}
|
| 650 |
+
|
| 651 |
+
// Initialize AI event listeners
|
| 652 |
+
function initAIEventListeners() {
|
| 653 |
+
// AI Prompt button
|
| 654 |
+
aiPromptBtn.addEventListener('click', showAIModal);
|
| 655 |
+
closeAIModal.addEventListener('click', hideAIModal);
|
| 656 |
+
cancelAIBtn.addEventListener('click', hideAIModal);
|
| 657 |
+
|
| 658 |
+
// Generate AI button
|
| 659 |
+
generateAIBtn.addEventListener('click', generateAIComponents);
|
| 660 |
+
}
|
| 661 |
+
|
| 662 |
+
// Initialize APWB event listeners
|
| 663 |
+
function initAPWBEventListeners() {
|
| 664 |
+
apwbSubmit.addEventListener('click', generateWithAPWB);
|
| 665 |
+
|
| 666 |
+
// Allow pressing Enter in the APWB prompt
|
| 667 |
+
apwbPrompt.addEventListener('keydown', (e) => {
|
| 668 |
+
if (e.key === 'Enter' && !e.shiftKey) {
|
| 669 |
+
e.preventDefault();
|
| 670 |
+
generateWithAPWB();
|
| 671 |
+
}
|
| 672 |
+
});
|
| 673 |
+
}
|
| 674 |
+
|
| 675 |
+
// Initialize split view functionality
|
| 676 |
+
function initSplitView() {
|
| 677 |
+
dividers.forEach(divider => {
|
| 678 |
+
divider.addEventListener('mousedown', (e) => {
|
| 679 |
+
isDraggingDivider = true;
|
| 680 |
+
document.body.style.cursor = 'col-resize';
|
| 681 |
+
document.addEventListener('mousemove', handleDividerDrag);
|
| 682 |
+
document.addEventListener('mouseup', () => {
|
| 683 |
+
isDraggingDivider = false;
|
| 684 |
+
document.body.style.cursor = '';
|
| 685 |
+
document.removeEventListener('mousemove', handleDividerDrag);
|
| 686 |
+
});
|
| 687 |
});
|
| 688 |
});
|
| 689 |
}
|
| 690 |
+
|
| 691 |
+
// Handle divider dragging
|
| 692 |
+
function handleDividerDrag(e) {
|
| 693 |
+
if (!isDraggingDivider) return;
|
| 694 |
+
|
| 695 |
+
const containerRect = splitContainer.getBoundingClientRect();
|
| 696 |
+
const divider = dividers[0]; // First divider for left panel
|
| 697 |
+
const dividerRect = divider.getBoundingClientRect();
|
| 698 |
+
|
| 699 |
+
// Calculate new width for left panel
|
| 700 |
+
const newLeftWidth = e.clientX - containerRect.left;
|
| 701 |
+
|
| 702 |
+
// Apply minimum and maximum widths
|
| 703 |
+
const minWidth = 200;
|
| 704 |
+
const maxWidth = containerRect.width * 0.5;
|
| 705 |
+
|
| 706 |
+
if (newLeftWidth >= minWidth && newLeftWidth <= maxWidth) {
|
| 707 |
+
leftPanel.style.width = `${newLeftWidth}px`;
|
| 708 |
+
}
|
| 709 |
+
}
|
| 710 |
+
|
| 711 |
+
// Show AI Modal
|
| 712 |
+
function showAIModal() {
|
| 713 |
+
aiModal.classList.remove('hidden');
|
| 714 |
+
aiPrompt.focus();
|
| 715 |
+
}
|
| 716 |
+
|
| 717 |
+
// Hide AI Modal
|
| 718 |
+
function hideAIModal() {
|
| 719 |
+
aiModal.classList.add('hidden');
|
| 720 |
+
aiResponse.classList.add('hidden');
|
| 721 |
+
aiLoading.classList.add('hidden');
|
| 722 |
+
aiGeneratedComponents.classList.add('hidden');
|
| 723 |
+
aiResponse.textContent = '';
|
| 724 |
+
aiPrompt.value = '';
|
| 725 |
+
aiComponentsList.innerHTML = '';
|
| 726 |
+
}
|
| 727 |
+
|
| 728 |
+
// Generate with APWB model
|
| 729 |
+
function generateWithAPWB() {
|
| 730 |
+
const prompt = apwbPrompt.value.trim();
|
| 731 |
+
if (!prompt) {
|
| 732 |
+
showToast('Please enter a description for the APWB model');
|
| 733 |
+
return;
|
| 734 |
+
}
|
| 735 |
+
|
| 736 |
+
apwbResponse.classList.add('hidden');
|
| 737 |
+
apwbLoading.classList.remove('hidden');
|
| 738 |
+
|
| 739 |
+
// Simulate API call to APWB model
|
| 740 |
+
setTimeout(() => {
|
| 741 |
+
const response = simulateAPWBResponse(prompt);
|
| 742 |
+
displayAPWBResponse(response);
|
| 743 |
+
}, 1500);
|
| 744 |
+
}
|
| 745 |
+
|
| 746 |
+
// Simulate APWB response (in a real app, this would be an API call)
|
| 747 |
+
function simulateAPWBResponse(prompt) {
|
| 748 |
+
// This is a simulation - in a real app, you would call the APWB API
|
| 749 |
+
const responses = [
|
| 750 |
+
`Here's a hero section based on your description:\n\n` +
|
| 751 |
+
`{\n "type": "hero",\n "props": {\n "bgColor": "primary",\n "textColor": "white",\n "title": "Welcome to Our Platform",\n "subtitle": "Build amazing websites with our tools",\n "buttonText": "Get Started",\n "buttonColor": "white",\n "buttonTextColor": "primary"\n }\n}`,
|
| 752 |
+
|
| 753 |
+
`I've created a feature section for you:\n\n` +
|
| 754 |
+
`{\n "type": "features",\n "props": {\n "bgColor": "gray-50",\n "title": "Key Features",\n "features": [\n {\n "title": "Easy to Use",\n "description": "Intuitive drag and drop interface",\n "icon": "fa-rocket"\n },\n {\n "title": "Responsive",\n "description": "Works on all devices",\n "icon": "fa-mobile"\n },\n {\n "title": "Customizable",\n "description": "Tailor every aspect to your needs",\n "icon": "fa-cog"\n }\n ]\n }\n}`,
|
| 755 |
+
|
| 756 |
+
`Based on your request, here's a call to action section:\n\n` +
|
| 757 |
+
`{\n "type": "cta",\n "props": {\n "bgColor": "primary/10",\n "title": "Ready to get started?",\n "subtitle": "Sign up today and get 30 days free trial",\n "buttonText": "Sign Up Now",\n "buttonColor": "primary",\n "buttonTextColor": "white"\n }\n}`
|
| 758 |
+
];
|
| 759 |
+
|
| 760 |
+
// Return a random response for simulation
|
| 761 |
+
return responses[Math.floor(Math.random() * responses.length)];
|
| 762 |
+
}
|
| 763 |
+
|
| 764 |
+
// Display APWB response
|
| 765 |
+
function displayAPWBResponse(response) {
|
| 766 |
+
apwbLoading.classList.add('hidden');
|
| 767 |
+
apwbResponse.classList.remove('hidden');
|
| 768 |
+
apwbResponse.textContent = response;
|
| 769 |
+
|
| 770 |
+
// Try to parse the JSON part of the response
|
| 771 |
+
try {
|
| 772 |
+
const jsonStart = response.indexOf('{');
|
| 773 |
+
const jsonEnd = response.lastIndexOf('}') + 1;
|
| 774 |
+
const jsonString = response.substring(jsonStart, jsonEnd);
|
| 775 |
+
const componentData = JSON.parse(jsonString);
|
| 776 |
+
|
| 777 |
+
// Add a button to add this component to canvas
|
| 778 |
+
const addButton = document.createElement('button');
|
| 779 |
+
addButton.className = 'mt-3 bg-primary text-white px-3 py-1.5 rounded-md text-sm font-medium';
|
| 780 |
+
addButton.innerHTML = '<i class="fas fa-plus mr-1"></i> Add to Canvas';
|
| 781 |
+
addButton.addEventListener('click', () => {
|
| 782 |
+
addAIComponentToCanvas(componentData);
|
| 783 |
+
apwbResponse.classList.add('hidden');
|
| 784 |
+
});
|
| 785 |
+
|
| 786 |
+
apwbResponse.appendChild(addButton);
|
| 787 |
+
} catch (e) {
|
| 788 |
+
console.error('Could not parse component from APWB response:', e);
|
| 789 |
+
}
|
| 790 |
+
}
|
| 791 |
+
|
| 792 |
+
// Generate AI components based on prompt
|
| 793 |
+
function generateAIComponents() {
|
| 794 |
+
const prompt = aiPrompt.value.trim();
|
| 795 |
+
if (!prompt) {
|
| 796 |
+
showToast('Please enter a description for the AI to generate components');
|
| 797 |
+
return;
|
| 798 |
+
}
|
| 799 |
+
|
| 800 |
+
aiResponse.classList.add('hidden');
|
| 801 |
+
aiLoading.classList.remove('hidden');
|
| 802 |
+
aiGeneratedComponents.classList.add('hidden');
|
| 803 |
+
aiComponentsList.innerHTML = '';
|
| 804 |
+
|
| 805 |
+
// Simulate AI processing (in a real app, this would call an API)
|
| 806 |
+
setTimeout(() => {
|
| 807 |
+
const generatedComponents = processAIPrompt(prompt);
|
| 808 |
+
displayAIResults(generatedComponents);
|
| 809 |
+
}, 1500);
|
| 810 |
+
}
|
| 811 |
+
|
| 812 |
+
// Process AI prompt and generate components
|
| 813 |
+
function processAIPrompt(prompt) {
|
| 814 |
+
// This is a simulation - in a real app, you would call an AI API
|
| 815 |
+
const components = [];
|
| 816 |
+
|
| 817 |
+
// Check for common component types in the prompt
|
| 818 |
+
if (prompt.toLowerCase().includes('hero')) {
|
| 819 |
+
components.push({
|
| 820 |
+
type: 'hero',
|
| 821 |
+
props: {
|
| 822 |
+
bgColor: prompt.toLowerCase().includes('dark') ? 'gray-800' : 'primary',
|
| 823 |
+
textColor: 'white',
|
| 824 |
+
title: 'Your Awesome Headline',
|
| 825 |
+
subtitle: 'A compelling subheadline that explains your value proposition',
|
| 826 |
+
buttonText: 'Get Started',
|
| 827 |
+
buttonColor: 'white',
|
| 828 |
+
buttonTextColor: 'primary'
|
| 829 |
+
}
|
| 830 |
+
});
|
| 831 |
+
}
|
| 832 |
+
|
| 833 |
+
if (prompt.toLowerCase().includes('feature') || prompt.toLowerCase().includes('benefit')) {
|
| 834 |
+
components.push({
|
| 835 |
+
type: 'features',
|
| 836 |
+
props: {
|
| 837 |
+
bgColor: 'gray-50',
|
| 838 |
+
title: 'Our Features',
|
| 839 |
+
features: [
|
| 840 |
+
{ title: 'Feature One', description: 'Description of feature one goes here', icon: 'fa-rocket' },
|
| 841 |
+
{ title: 'Feature Two', description: 'Description of feature two goes here', icon: 'fa-bolt' },
|
| 842 |
+
{ title: 'Feature Three', description: 'Description of feature three goes here', icon: 'fa-cog' }
|
| 843 |
+
]
|
| 844 |
+
}
|
| 845 |
+
});
|
| 846 |
+
}
|
| 847 |
+
|
| 848 |
+
if (prompt.toLowerCase().includes('header') || prompt.toLowerCase().includes('navigation')) {
|
| 849 |
+
components.push({
|
| 850 |
+
type: 'header',
|
| 851 |
+
props: {
|
| 852 |
+
bgColor: 'primary',
|
| 853 |
+
textColor: 'white',
|
| 854 |
+
logoText: 'Your Logo',
|
| 855 |
+
links: ['Home', 'About', 'Contact']
|
| 856 |
+
}
|
| 857 |
+
});
|
| 858 |
+
}
|
| 859 |
+
|
| 860 |
+
if (prompt.toLowerCase().includes('footer')) {
|
| 861 |
+
components.push({
|
| 862 |
+
type: 'footer',
|
| 863 |
+
props: {
|
| 864 |
+
bgColor: 'gray-800',
|
| 865 |
+
textColor: 'white',
|
| 866 |
+
columns: [
|
| 867 |
+
{ title: 'Company', links: ['About Us', 'Careers', 'Contact'] },
|
| 868 |
+
{ title: 'Products', links: ['Features', 'Pricing', 'API'] },
|
| 869 |
+
{ title: 'Resources', links: ['Documentation', 'Guides', 'Blog'] },
|
| 870 |
+
{ title: 'Legal', links: ['Privacy', 'Terms', 'Cookie Policy'] }
|
| 871 |
+
],
|
| 872 |
+
copyright: '© 2023 Your Company. All rights reserved.'
|
| 873 |
+
}
|
| 874 |
+
});
|
| 875 |
+
}
|
| 876 |
+
|
| 877 |
+
if (prompt.toLowerCase().includes('text') || prompt.toLowerCase().includes('paragraph')) {
|
| 878 |
+
components.push({
|
| 879 |
+
type: 'text',
|
| 880 |
+
props: {
|
| 881 |
+
title: 'About Us',
|
| 882 |
+
content: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui mauris. Vivamus hendrerit arcu sed erat molestie vehicula. Sed auctor neque eu tellus rhoncus ut eleifend nibh porttitor.\n\nUt in nulla enim. Phasellus molestie magna non est bibendum non venenatis nisl tempor. Suspendisse dictum feugiat nisl ut dapibus.',
|
| 883 |
+
textAlign: 'left'
|
| 884 |
+
}
|
| 885 |
+
});
|
| 886 |
+
}
|
| 887 |
+
|
| 888 |
+
if (prompt.toLowerCase().includes('image') || prompt.toLowerCase().includes('photo')) {
|
| 889 |
+
components.push({
|
| 890 |
+
type: 'image',
|
| 891 |
+
props: {
|
| 892 |
+
src: 'https://via.placeholder.com/800x400?text=Your+Image',
|
| 893 |
+
alt: 'Placeholder image',
|
| 894 |
+
rounded: 'lg',
|
| 895 |
+
padding: '4'
|
| 896 |
+
}
|
| 897 |
+
});
|
| 898 |
+
}
|
| 899 |
+
|
| 900 |
+
if (prompt.toLowerCase().includes('cta') || prompt.toLowerCase().includes('call to action')) {
|
| 901 |
+
components.push({
|
| 902 |
+
type: 'cta',
|
| 903 |
+
props: {
|
| 904 |
+
bgColor: 'primary/10',
|
| 905 |
+
title: 'Ready to get started?',
|
| 906 |
+
subtitle: 'Sign up today and get 30 days free trial',
|
| 907 |
+
buttonText: 'Sign Up Now',
|
| 908 |
+
buttonColor: 'primary',
|
| 909 |
+
buttonTextColor: 'white'
|
| 910 |
+
}
|
| 911 |
+
});
|
| 912 |
+
}
|
| 913 |
+
|
| 914 |
+
// If no specific components detected, create a default hero section
|
| 915 |
+
if (components.length === 0) {
|
| 916 |
+
components.push({
|
| 917 |
+
type: 'hero',
|
| 918 |
+
props: {
|
| 919 |
+
bgColor: 'primary',
|
| 920 |
+
textColor: 'white',
|
| 921 |
+
title: 'Welcome to Our Site',
|
| 922 |
+
subtitle: 'This is a hero section that grabs attention',
|
| 923 |
+
buttonText: 'Get Started',
|
| 924 |
+
buttonColor: 'white',
|
| 925 |
+
buttonTextColor: 'primary'
|
| 926 |
+
}
|
| 927 |
+
});
|
| 928 |
+
}
|
| 929 |
+
|
| 930 |
+
return components;
|
| 931 |
+
}
|
| 932 |
+
|
| 933 |
+
// Display AI generated results
|
| 934 |
+
function displayAIResults(generatedComponents) {
|
| 935 |
+
aiLoading.classList.add('hidden');
|
| 936 |
+
aiGeneratedComponents.classList.remove('hidden');
|
| 937 |
+
|
| 938 |
+
// Show AI response
|
| 939 |
+
aiResponse.classList.remove('hidden');
|
| 940 |
+
aiResponse.textContent = `I've generated ${generatedComponents.length} components based on your description. You can add them to your canvas below.`;
|
| 941 |
+
|
| 942 |
+
// List generated components
|
| 943 |
+
aiComponentsList.innerHTML = '';
|
| 944 |
+
|
| 945 |
+
generatedComponents.forEach((component, index) => {
|
| 946 |
+
const componentDiv = document.createElement('div');
|
| 947 |
+
componentDiv.className = 'ai-generated-component';
|
| 948 |
+
|
| 949 |
+
const componentTitle = document.createElement('h5');
|
| 950 |
+
componentTitle.className = 'font-medium';
|
| 951 |
+
componentTitle.textContent = `${index + 1}. ${component.type.charAt(0).toUpperCase() + component.type.slice(1)}`;
|
| 952 |
+
|
| 953 |
+
const componentPreview = document.createElement('div');
|
| 954 |
+
componentPreview.className = 'text-xs text-gray-500 mb-2';
|
| 955 |
+
componentPreview.textContent = JSON.stringify(component.props, null, 2);
|
| 956 |
+
|
| 957 |
+
const addButton = document.createElement('button');
|
| 958 |
+
addButton.className = 'text-xs bg-primary text-white px-2 py-1 rounded hover:bg-primary-dark';
|
| 959 |
+
addButton.textContent = 'Add to Canvas';
|
| 960 |
+
addButton.addEventListener('click', () => {
|
| 961 |
+
addAIComponentToCanvas(component);
|
| 962 |
+
hideAIModal();
|
| 963 |
+
});
|
| 964 |
+
|
| 965 |
+
componentDiv.appendChild(componentTitle);
|
| 966 |
+
componentDiv.appendChild(componentPreview);
|
| 967 |
+
componentDiv.appendChild(addButton);
|
| 968 |
+
|
| 969 |
+
aiComponentsList.appendChild(componentDiv);
|
| 970 |
+
});
|
| 971 |
+
}
|
| 972 |
+
|
| 973 |
+
// Add AI generated component to canvas
|
| 974 |
+
function addAIComponentToCanvas(componentData) {
|
| 975 |
+
// Create a unique ID for the component
|
| 976 |
+
const componentId = `component-${componentCounter++}`;
|
| 977 |
+
|
| 978 |
+
// Calculate position (centered on canvas)
|
| 979 |
+
const canvasRect = canvas.getBoundingClientRect();
|
| 980 |
+
const relativeX = canvasRect.width / 2 - 100;
|
| 981 |
+
const relativeY = components.length * 20; // Offset slightly for multiple components
|
| 982 |
+
|
| 983 |
+
// Create component wrapper
|
| 984 |
+
const componentWrapper = document.createElement('div');
|
| 985 |
+
componentWrapper.className = 'canvas-component bg-white';
|
| 986 |
+
componentWrapper.id = componentId;
|
| 987 |
+
componentWrapper.style.position = 'absolute';
|
| 988 |
+
componentWrapper.style.left = `${relativeX}px`;
|
| 989 |
+
componentWrapper.style.top = `${relativeY}px`;
|
| 990 |
+
componentWrapper.style.width = '100%';
|
| 991 |
+
|
| 992 |
+
componentWrapper.innerHTML = `
|
| 993 |
+
<div class="component-toolbar">
|
| 994 |
+
<div class="component-handle" draggable="true">
|
| 995 |
+
<i class="fas fa-grip-vertical mr-1"></i>
|
| 996 |
+
<span class="text-xs">${componentData.type}</span>
|
| 997 |
+
</div>
|
| 998 |
+
<div class="component-actions">
|
| 999 |
+
<button class="component-action-btn edit-btn" title="Edit">
|
| 1000 |
+
<i class="fas fa-pen"></i>
|
| 1001 |
+
</button>
|
| 1002 |
+
<button class="component-action-btn delete-btn" title="Delete">
|
| 1003 |
+
<i class="fas fa-trash"></i>
|
| 1004 |
+
</button>
|
| 1005 |
+
</div>
|
| 1006 |
+
</div>
|
| 1007 |
+
<div class="component-content"></div>
|
| 1008 |
+
<div class="resize-handle"></div>
|
| 1009 |
+
`;
|
| 1010 |
+
|
| 1011 |
+
// Add to canvas
|
| 1012 |
+
canvas.appendChild(componentWrapper);
|
| 1013 |
+
|
| 1014 |
+
// Store component data
|
| 1015 |
+
const component = {
|
| 1016 |
+
id: componentId,
|
| 1017 |
+
type: componentData.type,
|
| 1018 |
+
props: componentData.props,
|
| 1019 |
+
position: { x: relativeX, y: relativeY },
|
| 1020 |
+
size: { width: '100%', height: 'auto' }
|
| 1021 |
+
};
|
| 1022 |
+
|
| 1023 |
+
components.push(component);
|
| 1024 |
+
|
| 1025 |
+
// Render the component content
|
| 1026 |
+
renderComponent(componentId);
|
| 1027 |
+
|
| 1028 |
+
// Make draggable
|
| 1029 |
+
makeDraggable(componentWrapper, componentId);
|
| 1030 |
+
|
| 1031 |
+
// Add event listeners to controls
|
| 1032 |
+
componentWrapper.querySelector('.edit-btn').addEventListener('click', () => {
|
| 1033 |
+
selectComponent(componentId);
|
| 1034 |
+
});
|
| 1035 |
+
|
| 1036 |
+
componentWrapper.querySelector('.delete-btn').addEventListener('click', () => {
|
| 1037 |
+
deleteComponent(componentId);
|
| 1038 |
+
});
|
| 1039 |
+
|
| 1040 |
+
// Add resize handle
|
| 1041 |
+
const resizeHandle = componentWrapper.querySelector('.resize-handle');
|
| 1042 |
+
resizeHandle.addEventListener('mousedown', initResize);
|
| 1043 |
+
|
| 1044 |
+
// Select the new component
|
| 1045 |
+
selectComponent(componentId);
|
| 1046 |
+
|
| 1047 |
+
// Hide empty state if it's visible
|
| 1048 |
+
emptyState.style.display = 'none';
|
| 1049 |
+
|
| 1050 |
+
showToast('Component added to canvas');
|
| 1051 |
+
}
|
| 1052 |
|
| 1053 |
// Load from localStorage
|
| 1054 |
function loadFromLocalStorage() {
|
|
|
|
| 1521 |
<div class="color-option bg-gray-800 ${component.props.bgColor === 'gray-800' ? 'selected' : ''}" data-color="gray-800" data-prop="bgColor"></div>
|
| 1522 |
</div>
|
| 1523 |
</div>
|
| 1524 |
+
<div>
|
| 1525 |
+
<label class="block text-sm font-medium text-gray-700 mb-2">Text Color</label>
|
| 1526 |
+
<div class="flex flex-wrap gap-2">
|
| 1527 |
+
<div class="color-option bg-white border ${component.props.textColor === 'white' ? 'selected' : ''}" data-color="white" data-prop="textColor"></div>
|
| 1528 |
+
<div class="color-option bg-gray-100 ${component.props.textColor === 'gray-100' ? 'selected' : ''}" data-color="gray-100" data-prop="textColor"></div>
|
| 1529 |
+
<div class="color-option bg-gray-200 ${component.props.textColor === 'gray-200' ? 'selected' : ''}" data-color="gray-200" data-prop="textColor"></div>
|
| 1530 |
+
</div>
|
| 1531 |
+
</div>
|
| 1532 |
+
<div>
|
| 1533 |
+
<label class="block text-sm font-medium text-gray-700 mb-2">Button Color</label>
|
| 1534 |
+
<div class="flex flex-wrap gap-2">
|
| 1535 |
+
<div class="color-option bg-white border ${component.props.buttonColor === 'white' ? 'selected' : ''}" data-color="white" data-prop="buttonColor"></div>
|
| 1536 |
+
<div class="color-option bg-primary ${component.props.buttonColor === 'primary' ? 'selected' : ''}" data-color="primary" data-prop="buttonColor"></div>
|
| 1537 |
+
<div class="color-option bg-gray-800 ${component.props.buttonColor === 'gray-800' ? 'selected' : ''}" data-color="gray-800" data-prop="buttonColor"></div>
|
| 1538 |
</div>
|
| 1539 |
+
</div>
|
| 1540 |
+
<div>
|
| 1541 |
+
<label class="block text-sm font-medium text-gray-700 mb-2">Button Text Color</label>
|
| 1542 |
+
<div class="flex flex-wrap gap-2">
|
| 1543 |
+
<div class="color-option bg-primary ${component.props.buttonTextColor === 'primary' ? 'selected' : ''}" data-color="primary" data-prop="buttonTextColor"></div>
|
| 1544 |
+
<div class="color-option bg-white border ${component.props.buttonTextColor === 'white' ? 'selected' : ''}" data-color="white" data-prop="buttonTextColor"></div>
|
| 1545 |
+
<div class="color-option bg-gray-800 ${component.props.buttonTextColor === 'gray-800' ? 'selected' : ''}" data-color="gray-800" data-prop="buttonTextColor"></div>
|
| 1546 |
</div>
|
| 1547 |
</div>
|
| 1548 |
</div>
|
|
|
|
| 1562 |
<div class="flex flex-wrap gap-2">
|
| 1563 |
<div class="color-option bg-gray-50 ${component.props.bgColor === 'gray-50' ? 'selected' : ''}" data-color="gray-50" data-prop="bgColor"></div>
|
| 1564 |
<div class="color-option bg-white ${component.props.bgColor === 'white' ? 'selected' : ''}" data-color="white" data-prop="bgColor"></div>
|
| 1565 |
+
<div class="color-option bg-primary/10 ${component.props.bgColor === 'primary/10' ? 'selected' : ''}" data-color="primary/10" data-prop="bgColor"></div>
|
|
|
|
| 1566 |
</div>
|
| 1567 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1568 |
<div>
|
| 1569 |
<label class="block text-sm font-medium text-gray-700 mb-1">Features</label>
|
| 1570 |
<div class="features-container space-y-4">
|
| 1571 |
${component.props.features.map((feature, index) => `
|
| 1572 |
+
<div class="feature-item border rounded-md p-3" data-feature-index="${index}">
|
| 1573 |
<div class="flex justify-between items-center mb-2">
|
| 1574 |
+
<h4 class="text-sm font-medium">Feature ${index + 1}</h4>
|
| 1575 |
+
<button class="remove-feature-btn text-red-500 text-sm">
|
| 1576 |
+
<i class="fas fa-trash"></i>
|
| 1577 |
</button>
|
| 1578 |
</div>
|
| 1579 |
+
<div class="mb-2">
|
| 1580 |
+
<label class="block text-xs text-gray-500 mb-1">Title</label>
|
| 1581 |
+
<input type="text" class="w-full p-2 border rounded-md text-sm" value="${feature.title}" data-prop="features.${index}.title">
|
| 1582 |
+
</div>
|
| 1583 |
+
<div class="mb-2">
|
| 1584 |
+
<label class="block text-xs text-gray-500 mb-1">Description</label>
|
| 1585 |
+
<textarea class="w-full p-2 border rounded-md text-sm" rows="2" data-prop="features.${index}.description">${feature.description}</textarea>
|
| 1586 |
+
</div>
|
| 1587 |
+
<div>
|
| 1588 |
+
<label class="block text-xs text-gray-500 mb-1">Icon</label>
|
| 1589 |
+
<select class="w-full p-2 border rounded-md text-sm" data-prop="features.${index}.icon">
|
| 1590 |
+
<option value="fa-rocket" ${feature.icon === 'fa-rocket' ? 'selected' : ''}>Rocket</option>
|
| 1591 |
+
<option value="fa-bolt" ${feature.icon === 'fa-bolt' ? 'selected' : ''}>Bolt</option>
|
| 1592 |
+
<option value="fa-cog" ${feature.icon === 'fa-cog' ? 'selected' : ''}>Cog</option>
|
| 1593 |
+
<option value="fa-star" ${feature.icon === 'fa-star' ? 'selected' : ''}>Star</option>
|
| 1594 |
+
<option value="fa-heart" ${feature.icon === 'fa-heart' ? 'selected' : ''}>Heart</option>
|
| 1595 |
+
</select>
|
|
|
|
|
|
|
| 1596 |
</div>
|
| 1597 |
</div>
|
| 1598 |
`).join('')}
|
| 1599 |
</div>
|
| 1600 |
+
<button class="add-feature-btn mt-3 text-sm text-primary hover:text-primary-dark flex items-center">
|
| 1601 |
<i class="fas fa-plus mr-1"></i> Add Feature
|
| 1602 |
</button>
|
| 1603 |
</div>
|
|
|
|
| 1615 |
</div>
|
| 1616 |
<div>
|
| 1617 |
<label class="block text-sm font-medium text-gray-700 mb-1">Content</label>
|
| 1618 |
+
<textarea class="w-full p-2 border rounded-md text-sm" rows="4" data-prop="content">${component.props.content}</textarea>
|
| 1619 |
</div>
|
| 1620 |
<div>
|
| 1621 |
<label class="block text-sm font-medium text-gray-700 mb-1">Text Alignment</label>
|
|
|
|
| 1634 |
<div class="space-y-4">
|
| 1635 |
<h3 class="font-medium text-gray-800">Image Settings</h3>
|
| 1636 |
<div>
|
| 1637 |
+
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1638 |
</html>
|
prompts.txt
CHANGED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
-
|
| 2 |
-
|
|
|
|
| 1 |
+
use this code to operate the AI agent and prompt window add so that deepseek builds the html page and the gui can redisgn the created elements
|
| 2 |
+
add this to this website - huggingface.co/MarcRyan/apwb
|