Spaces:
Running
Running
loading state
Browse files- components/editor/ask-ai/index.tsx +63 -2
- lib/prompts.ts +2 -1
components/editor/ask-ai/index.tsx
CHANGED
@@ -284,9 +284,70 @@ export function AskAI({
|
|
284 |
{(isAiWorking || isUploading) && (
|
285 |
<div className="absolute bg-neutral-800 top-0 left-4 w-[calc(100%-30px)] h-full z-1 flex items-start pt-3.5 justify-between max-lg:text-sm">
|
286 |
<div className="flex items-center justify-start gap-2">
|
287 |
-
<Loading overlay={false} className="!size-4" />
|
288 |
<p className="text-neutral-400 text-sm">
|
289 |
-
{isUploading ?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
290 |
</p>
|
291 |
</div>
|
292 |
{isAiWorking && (
|
|
|
284 |
{(isAiWorking || isUploading) && (
|
285 |
<div className="absolute bg-neutral-800 top-0 left-4 w-[calc(100%-30px)] h-full z-1 flex items-start pt-3.5 justify-between max-lg:text-sm">
|
286 |
<div className="flex items-center justify-start gap-2">
|
287 |
+
<Loading overlay={false} className="!size-4 opacity-50" />
|
288 |
<p className="text-neutral-400 text-sm">
|
289 |
+
{isUploading ? (
|
290 |
+
"Uploading images..."
|
291 |
+
) : isAiWorking && !isSameHtml ? (
|
292 |
+
"AI is working..."
|
293 |
+
) : (
|
294 |
+
<span className="inline-flex">
|
295 |
+
{[
|
296 |
+
"D",
|
297 |
+
"e",
|
298 |
+
"e",
|
299 |
+
"p",
|
300 |
+
"S",
|
301 |
+
"i",
|
302 |
+
"t",
|
303 |
+
"e",
|
304 |
+
" ",
|
305 |
+
"i",
|
306 |
+
"s",
|
307 |
+
" ",
|
308 |
+
"T",
|
309 |
+
"h",
|
310 |
+
"i",
|
311 |
+
"n",
|
312 |
+
"k",
|
313 |
+
"i",
|
314 |
+
"n",
|
315 |
+
"g",
|
316 |
+
".",
|
317 |
+
".",
|
318 |
+
".",
|
319 |
+
" ",
|
320 |
+
"W",
|
321 |
+
"a",
|
322 |
+
"i",
|
323 |
+
"t",
|
324 |
+
" ",
|
325 |
+
"a",
|
326 |
+
" ",
|
327 |
+
"m",
|
328 |
+
"o",
|
329 |
+
"m",
|
330 |
+
"e",
|
331 |
+
"n",
|
332 |
+
"t",
|
333 |
+
".",
|
334 |
+
".",
|
335 |
+
".",
|
336 |
+
].map((char, index) => (
|
337 |
+
<span
|
338 |
+
key={index}
|
339 |
+
className="bg-gradient-to-r from-neutral-100 to-neutral-300 bg-clip-text text-transparent animate-pulse"
|
340 |
+
style={{
|
341 |
+
animationDelay: `${index * 0.1}s`,
|
342 |
+
animationDuration: "1.3s",
|
343 |
+
animationIterationCount: "infinite",
|
344 |
+
}}
|
345 |
+
>
|
346 |
+
{char === " " ? "\u00A0" : char}
|
347 |
+
</span>
|
348 |
+
))}
|
349 |
+
</span>
|
350 |
+
)}
|
351 |
</p>
|
352 |
</div>
|
353 |
{isAiWorking && (
|
lib/prompts.ts
CHANGED
@@ -20,7 +20,8 @@ You create website in a way a designer would, using ONLY HTML, CSS and Javascrip
|
|
20 |
Try to create the best UI possible. Important: Make the website responsive by using TailwindCSS. Use it as much as you can, if you can't use it, use custom css (make sure to import tailwind with <script src="https://cdn.tailwindcss.com"></script> in the head).
|
21 |
Also try to elaborate as much as you can, to create something unique, with a great design.
|
22 |
If you want to use ICONS import Feather Icons (Make sure to add <script src="https://unpkg.com/feather-icons"></script> and <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script> in the head., and <script>feather.replace();</script> in the body. Ex : <i data-feather="user"></i>).
|
23 |
-
|
|
|
24 |
You can create multiple pages website at once (following the format rules below) or a Single Page Application. If the user doesn't ask for a specific version, you have to determine the best version for the user, depending on the request. (Try to avoid the Single Page Application if the user asks for multiple pages.)
|
25 |
${PROMPT_FOR_IMAGE_GENERATION}
|
26 |
No need to explain what you did. Just return the expected result. AVOID Chinese characters in the code if not asked by the user.
|
|
|
20 |
Try to create the best UI possible. Important: Make the website responsive by using TailwindCSS. Use it as much as you can, if you can't use it, use custom css (make sure to import tailwind with <script src="https://cdn.tailwindcss.com"></script> in the head).
|
21 |
Also try to elaborate as much as you can, to create something unique, with a great design.
|
22 |
If you want to use ICONS import Feather Icons (Make sure to add <script src="https://unpkg.com/feather-icons"></script> and <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script> in the head., and <script>feather.replace();</script> in the body. Ex : <i data-feather="user"></i>).
|
23 |
+
For scroll animations you can use: AOS.com (Make sure to add <link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet"> and <script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script> and <script>AOS.init();</script>).
|
24 |
+
For interactive animations you can use: Vanta.js (Make sure to add <script src="https://cdn.jsdelivr.net/npm/vanta@latest/dist/vanta.globe.min.js"></script> and <script>VANTA.GLOBE({...</script> in the body.).
|
25 |
You can create multiple pages website at once (following the format rules below) or a Single Page Application. If the user doesn't ask for a specific version, you have to determine the best version for the user, depending on the request. (Try to avoid the Single Page Application if the user asks for multiple pages.)
|
26 |
${PROMPT_FOR_IMAGE_GENERATION}
|
27 |
No need to explain what you did. Just return the expected result. AVOID Chinese characters in the code if not asked by the user.
|