Add 3 files
Browse files- README.md +7 -5
- index.html +384 -19
- prompts.txt +3 -0
README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: static
|
7 |
pinned: false
|
|
|
|
|
8 |
---
|
9 |
|
10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
+
title: web-chat
|
3 |
+
emoji: π³
|
4 |
+
colorFrom: yellow
|
5 |
+
colorTo: red
|
6 |
sdk: static
|
7 |
pinned: false
|
8 |
+
tags:
|
9 |
+
- deepsite
|
10 |
---
|
11 |
|
12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
@@ -1,19 +1,384 @@
|
|
1 |
-
<!
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Adiba's AI Assistant</title>
|
7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
9 |
+
<style>
|
10 |
+
@keyframes pulse {
|
11 |
+
0%, 100% { opacity: 1; }
|
12 |
+
50% { opacity: 0.5; }
|
13 |
+
}
|
14 |
+
.typing-indicator::after {
|
15 |
+
content: '...';
|
16 |
+
animation: typing 1.5s infinite;
|
17 |
+
}
|
18 |
+
@keyframes typing {
|
19 |
+
0% { content: '.'; }
|
20 |
+
33% { content: '..'; }
|
21 |
+
66% { content: '...'; }
|
22 |
+
}
|
23 |
+
.message-animation {
|
24 |
+
animation: fadeIn 0.3s ease-out;
|
25 |
+
}
|
26 |
+
@keyframes fadeIn {
|
27 |
+
from { opacity: 0; transform: translateY(10px); }
|
28 |
+
to { opacity: 1; transform: translateY(0); }
|
29 |
+
}
|
30 |
+
.gradient-bg {
|
31 |
+
background: linear-gradient(135deg, #6e8efb, #a777e3);
|
32 |
+
}
|
33 |
+
.language-selector {
|
34 |
+
position: relative;
|
35 |
+
display: inline-block;
|
36 |
+
}
|
37 |
+
.language-dropdown {
|
38 |
+
display: none;
|
39 |
+
position: absolute;
|
40 |
+
right: 0;
|
41 |
+
background-color: white;
|
42 |
+
min-width: 120px;
|
43 |
+
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
|
44 |
+
z-index: 1;
|
45 |
+
border-radius: 8px;
|
46 |
+
overflow: hidden;
|
47 |
+
}
|
48 |
+
.language-selector:hover .language-dropdown {
|
49 |
+
display: block;
|
50 |
+
}
|
51 |
+
.language-option {
|
52 |
+
padding: 8px 16px;
|
53 |
+
display: flex;
|
54 |
+
align-items: center;
|
55 |
+
cursor: pointer;
|
56 |
+
}
|
57 |
+
.language-option:hover {
|
58 |
+
background-color: #f1f1f1;
|
59 |
+
}
|
60 |
+
.language-flag {
|
61 |
+
width: 20px;
|
62 |
+
margin-right: 8px;
|
63 |
+
}
|
64 |
+
</style>
|
65 |
+
</head>
|
66 |
+
<body class="bg-gray-100 font-sans">
|
67 |
+
<div class="flex flex-col h-screen max-w-4xl mx-auto">
|
68 |
+
<!-- Header -->
|
69 |
+
<header class="gradient-bg text-white p-4 shadow-md">
|
70 |
+
<div class="flex items-center justify-between">
|
71 |
+
<div class="flex items-center space-x-3">
|
72 |
+
<div class="w-10 h-10 rounded-full bg-white flex items-center justify-center">
|
73 |
+
<i class="fas fa-robot text-purple-600 text-xl"></i>
|
74 |
+
</div>
|
75 |
+
<div>
|
76 |
+
<h1 class="font-bold text-lg">Adiba's AI Assistant</h1>
|
77 |
+
<p class="text-xs opacity-80" id="subtitle">Always here to help</p>
|
78 |
+
</div>
|
79 |
+
</div>
|
80 |
+
<div class="flex space-x-2 items-center">
|
81 |
+
<div class="language-selector">
|
82 |
+
<button class="p-2 rounded-full hover:bg-white/10 transition flex items-center">
|
83 |
+
<img src="https://flagcdn.com/w20/gb.png" class="language-flag" id="current-flag">
|
84 |
+
<span id="current-language">English</span>
|
85 |
+
</button>
|
86 |
+
<div class="language-dropdown">
|
87 |
+
<div class="language-option" data-lang="en">
|
88 |
+
<img src="https://flagcdn.com/w20/gb.png" class="language-flag">
|
89 |
+
<span>English</span>
|
90 |
+
</div>
|
91 |
+
<div class="language-option" data-lang="de">
|
92 |
+
<img src="https://flagcdn.com/w20/de.png" class="language-flag">
|
93 |
+
<span>Deutsch</span>
|
94 |
+
</div>
|
95 |
+
<div class="language-option" data-lang="uz">
|
96 |
+
<img src="https://flagcdn.com/w20/uz.png" class="language-flag">
|
97 |
+
<span>O'zbekcha</span>
|
98 |
+
</div>
|
99 |
+
</div>
|
100 |
+
</div>
|
101 |
+
<button class="p-2 rounded-full hover:bg-white/10 transition">
|
102 |
+
<i class="fas fa-cog"></i>
|
103 |
+
</button>
|
104 |
+
</div>
|
105 |
+
</div>
|
106 |
+
</header>
|
107 |
+
|
108 |
+
<!-- Chat Container -->
|
109 |
+
<div class="flex-1 overflow-y-auto p-4 space-y-4" id="chat-container">
|
110 |
+
<!-- AI Welcome Message -->
|
111 |
+
<div class="message-animation flex space-x-3">
|
112 |
+
<div class="flex-shrink-0">
|
113 |
+
<div class="w-8 h-8 rounded-full bg-purple-500 flex items-center justify-center">
|
114 |
+
<i class="fas fa-robot text-white text-sm"></i>
|
115 |
+
</div>
|
116 |
+
</div>
|
117 |
+
<div class="bg-white p-3 rounded-lg shadow-sm max-w-[85%]">
|
118 |
+
<p class="text-gray-800" id="welcome-message">Hello Adiba! π I'm your personal AI assistant. I can help with coding, design, research, and much more. What would you like to explore today?</p>
|
119 |
+
<div class="mt-2 flex flex-wrap gap-2">
|
120 |
+
<button class="suggestion-btn px-3 py-1 bg-gray-100 hover:bg-gray-200 rounded-full text-sm transition" data-key="design">Website design tips</button>
|
121 |
+
<button class="suggestion-btn px-3 py-1 bg-gray-100 hover:bg-gray-200 rounded-full text-sm transition" data-key="code">JavaScript help</button>
|
122 |
+
<button class="suggestion-btn px-3 py-1 bg-gray-100 hover:bg-gray-200 rounded-full text-sm transition" data-key="ideas">Creative ideas</button>
|
123 |
+
</div>
|
124 |
+
<p class="text-xs text-gray-500 mt-2" id="prompt-text">Just type your question below β</p>
|
125 |
+
</div>
|
126 |
+
</div>
|
127 |
+
</div>
|
128 |
+
|
129 |
+
<!-- Input Area -->
|
130 |
+
<div class="border-t p-4 bg-white">
|
131 |
+
<form id="message-form" class="flex space-x-2">
|
132 |
+
<div class="flex-1 relative">
|
133 |
+
<input
|
134 |
+
type="text"
|
135 |
+
id="message-input"
|
136 |
+
placeholder="Message Adiba's AI..."
|
137 |
+
class="w-full p-3 pr-10 border rounded-full focus:outline-none focus:ring-2 focus:ring-purple-300"
|
138 |
+
autocomplete="off"
|
139 |
+
>
|
140 |
+
<button type="button" class="absolute right-3 top-3 text-gray-400 hover:text-purple-600">
|
141 |
+
<i class="fas fa-microphone"></i>
|
142 |
+
</button>
|
143 |
+
</div>
|
144 |
+
<button
|
145 |
+
type="submit"
|
146 |
+
class="w-12 h-12 rounded-full gradient-bg text-white flex items-center justify-center hover:opacity-90 transition"
|
147 |
+
>
|
148 |
+
<i class="fas fa-paper-plane"></i>
|
149 |
+
</button>
|
150 |
+
</form>
|
151 |
+
<p class="text-xs text-gray-500 mt-2 text-center" id="disclaimer">AI may produce inaccurate information. Free Research Preview.</p>
|
152 |
+
</div>
|
153 |
+
</div>
|
154 |
+
|
155 |
+
<script>
|
156 |
+
document.addEventListener('DOMContentLoaded', function() {
|
157 |
+
const form = document.getElementById('message-form');
|
158 |
+
const input = document.getElementById('message-input');
|
159 |
+
const chatContainer = document.getElementById('chat-container');
|
160 |
+
const currentLanguage = document.getElementById('current-language');
|
161 |
+
const currentFlag = document.getElementById('current-flag');
|
162 |
+
const welcomeMessage = document.getElementById('welcome-message');
|
163 |
+
const promptText = document.getElementById('prompt-text');
|
164 |
+
const subtitle = document.getElementById('subtitle');
|
165 |
+
const disclaimer = document.getElementById('disclaimer');
|
166 |
+
|
167 |
+
// Language data
|
168 |
+
const languages = {
|
169 |
+
en: {
|
170 |
+
name: "English",
|
171 |
+
flag: "https://flagcdn.com/w20/gb.png",
|
172 |
+
translations: {
|
173 |
+
welcome: "Hello Adiba! π I'm your personal AI assistant. I can help with coding, design, research, and much more. What would you like to explore today?",
|
174 |
+
design: "Website design tips",
|
175 |
+
code: "JavaScript help",
|
176 |
+
ideas: "Creative ideas",
|
177 |
+
prompt: "Just type your question below β",
|
178 |
+
subtitle: "Always here to help",
|
179 |
+
disclaimer: "AI may produce inaccurate information. Free Research Preview.",
|
180 |
+
responses: {
|
181 |
+
"hello": "Hi Adiba! π How can I assist you today?",
|
182 |
+
"website design tips": "For beautiful website design, consider:<br>1. Consistent color palette<br>2. Proper spacing and alignment<br>3. Readable typography<br>4. Mobile responsiveness<br>5. Intuitive navigation<br><br>Would you like me to generate some design mockups for you?",
|
183 |
+
"javascript help": "Of course! Here's a quick JavaScript example:<br><br><code class='bg-gray-100 p-2 rounded block'>// Simple array manipulation<br>const numbers = [1, 2, 3, 4];<br>const doubled = numbers.map(num => num * 2);<br>console.log(doubled); // [2, 4, 6, 8]</code><br><br>What specific JavaScript concept do you need help with?",
|
184 |
+
"creative ideas": "Here are 3 creative project ideas:<br>1. Interactive portfolio with 3D elements<br>2. AI-generated poetry generator<br>3. Personal dashboard that visualizes your daily habits<br><br>Want me to elaborate on any of these?",
|
185 |
+
"default": "I'm an AI assistant here to help with coding, design, research, and creative projects. I can generate code snippets, design mockups, explain concepts, and brainstorm ideas. What specifically would you like me to help with?"
|
186 |
+
}
|
187 |
+
}
|
188 |
+
},
|
189 |
+
de: {
|
190 |
+
name: "Deutsch",
|
191 |
+
flag: "https://flagcdn.com/w20/de.png",
|
192 |
+
translations: {
|
193 |
+
welcome: "Hallo Adiba! π Ich bin dein persΓΆnlicher KI-Assistent. Ich kann dir bei Codierung, Design, Recherche und vielem mehr helfen. Wonach mΓΆchtest du heute suchen?",
|
194 |
+
design: "Website-Design-Tipps",
|
195 |
+
code: "JavaScript-Hilfe",
|
196 |
+
ideas: "Kreative Ideen",
|
197 |
+
prompt: "Tippe einfach deine Frage unten ein β",
|
198 |
+
subtitle: "Immer hier, um zu helfen",
|
199 |
+
disclaimer: "KI kann ungenaue Informationen liefern. Kostenlose Forschungsvorschau.",
|
200 |
+
responses: {
|
201 |
+
"hallo": "Hallo Adiba! π Wie kann ich dir heute helfen?",
|
202 |
+
"website design tipps": "FΓΌr ein schΓΆnes Webdesign sollten Sie Folgendes beachten:<br>1. Konsistente Farbpalette<br>2. Richtiger Abstand und Ausrichtung<br>3. Lesbare Typografie<br>4. Mobile ReaktionsfΓ€higkeit<br>5. Intuitive Navigation<br><br>MΓΆchten Sie, dass ich einige Design-Mockups fΓΌr Sie erstelle?",
|
203 |
+
"javascript hilfe": "NatΓΌrlich! Hier ist ein kurzes JavaScript-Beispiel:<br><br><code class='bg-gray-100 p-2 rounded block'>// Einfache Array-Manipulation<br>const zahlen = [1, 2, 3, 4];<br>const verdoppelt = zahlen.map(num => num * 2);<br>console.log(verdoppelt); // [2, 4, 6, 8]</code><br><br>Mit welchem spezifischen JavaScript-Konzept brauchen Sie Hilfe?",
|
204 |
+
"kreative ideen": "Hier sind 3 kreative Projektideen:<br>1. Interaktives Portfolio mit 3D-Elementen<br>2. KI-generierter Poesie-Generator<br>3. PersΓΆnliches Dashboard, das Ihre tΓ€glichen Gewohnheiten visualisiert<br><br>MΓΆchten Sie, dass ich eines davon nΓ€her erlΓ€utere?",
|
205 |
+
"default": "Ich bin ein KI-Assistent, der bei Codierung, Design, Recherche und kreativen Projekten hilft. Ich kann Code-Snippets generieren, Design-Mockups erstellen, Konzepte erklΓ€ren und Ideen entwickeln. Wobei genau kann ich Ihnen helfen?"
|
206 |
+
}
|
207 |
+
}
|
208 |
+
},
|
209 |
+
uz: {
|
210 |
+
name: "O'zbekcha",
|
211 |
+
flag: "https://flagcdn.com/w20/uz.png",
|
212 |
+
translations: {
|
213 |
+
welcome: "Salom Adiba! π Men sizning shaxsiy AI yordamchingizman. Kod yozish, dizayn, tadqiqot va boshqa ko'p narsalarda yordam bera olaman. Bugun nima bilan shug'ullanishni xohlaysiz?",
|
214 |
+
design: "Vebsayt dizayn maslahatlari",
|
215 |
+
code: "JavaScript yordami",
|
216 |
+
ideas: "Ijodiy g'oyalar",
|
217 |
+
prompt: "Savolingizni quyida yozing β",
|
218 |
+
subtitle: "Doimo yordamga tayyor",
|
219 |
+
disclaimer: "AI noto'g'ri ma'lumotlar berishi mumkin. Bepul tadqiqot ko'rib chiqish.",
|
220 |
+
responses: {
|
221 |
+
"salom": "Salom Adiba! π Bugun sizga qanday yordam bera olaman?",
|
222 |
+
"vebsayt dizayn maslahatlari": "Chiroyli vebsayt dizayni uchun quyidagilarni hisobga oling:<br>1. Izchil rang palitrasi<br>2. To'g'ri joylashuv va tekislash<br>3. O'qish uchun qulay shrift<br>4> Mobil moslashuvchanlik<br>5. Intuitiv navigatsiya<br><br>Siz uchun ba'zi dizayn maketlarini yaratishimni xohlaysizmi?",
|
223 |
+
"javascript yordami": "Albatta! Mana JavaScriptda oddiy misol:<br><br><code class='bg-gray-100 p-2 rounded block'>// Oddiy massiv manipulyatsiyasi<br>const sonlar = [1, 2, 3, 4];<br>const ikkiBarobar = sonlar.map(son => son * 2);<br>console.log(ikkiBarobar); // [2, 4, 6, 8]</code><br><br>Qaysi JavaScript konsepsiyasi haqida yordam kerak?",
|
224 |
+
"ijodiy g'oyalar": "Mana 3 ta ijodiy loyiha g'oyasi:<br>1. 3D elementlar bilan interaktiv portfolio<br>2. AI tomonidan yaratilgan she'r generatori<br>3. Kunlik odatlaringizni vizualizatsiya qiluvchi shaxsiy boshqaruv paneli<br><br>Ulardan birini batafsil tushuntirishimni xohlaysizmi?",
|
225 |
+
"default": "Men kodlash, dizayn, tadqiqot va ijodiy loyihalarda yordam beradigan AI yordamchiman. Kod parchalarini yaratish, dizayn maketlarini ishlab chiqish, tushunchalarni tushuntirish va g'oyalar yaratishda yordam bera olaman. Aniq qanday yordam kerak?"
|
226 |
+
}
|
227 |
+
}
|
228 |
+
}
|
229 |
+
};
|
230 |
+
|
231 |
+
let currentLang = 'en';
|
232 |
+
|
233 |
+
// Set language
|
234 |
+
function setLanguage(lang) {
|
235 |
+
currentLang = lang;
|
236 |
+
const langData = languages[lang];
|
237 |
+
|
238 |
+
currentLanguage.textContent = langData.name;
|
239 |
+
currentFlag.src = langData.flag;
|
240 |
+
welcomeMessage.textContent = langData.translations.welcome;
|
241 |
+
promptText.textContent = langData.translations.prompt;
|
242 |
+
subtitle.textContent = langData.translations.subtitle;
|
243 |
+
disclaimer.textContent = langData.translations.disclaimer;
|
244 |
+
|
245 |
+
// Update suggestion buttons
|
246 |
+
document.querySelectorAll('.suggestion-btn[data-key="design"]').forEach(btn => {
|
247 |
+
btn.textContent = langData.translations.design;
|
248 |
+
});
|
249 |
+
document.querySelectorAll('.suggestion-btn[data-key="code"]').forEach(btn => {
|
250 |
+
btn.textContent = langData.translations.code;
|
251 |
+
});
|
252 |
+
document.querySelectorAll('.suggestion-btn[data-key="ideas"]').forEach(btn => {
|
253 |
+
btn.textContent = langData.translations.ideas;
|
254 |
+
});
|
255 |
+
|
256 |
+
// Update input placeholder
|
257 |
+
input.placeholder = lang === 'en' ? "Message Adiba's AI..." :
|
258 |
+
lang === 'de' ? "Nachricht an Adibas KI..." :
|
259 |
+
"Adiba AI-ga xabar...";
|
260 |
+
}
|
261 |
+
|
262 |
+
// Language selector
|
263 |
+
document.querySelectorAll('.language-option').forEach(option => {
|
264 |
+
option.addEventListener('click', function() {
|
265 |
+
const lang = this.getAttribute('data-lang');
|
266 |
+
setLanguage(lang);
|
267 |
+
});
|
268 |
+
});
|
269 |
+
|
270 |
+
form.addEventListener('submit', function(e) {
|
271 |
+
e.preventDefault();
|
272 |
+
const message = input.value.trim();
|
273 |
+
if (!message) return;
|
274 |
+
|
275 |
+
// Add user message
|
276 |
+
addMessage(message, 'user');
|
277 |
+
input.value = '';
|
278 |
+
|
279 |
+
// Show typing indicator
|
280 |
+
const typingIndicator = document.createElement('div');
|
281 |
+
typingIndicator.className = 'flex space-x-3';
|
282 |
+
typingIndicator.innerHTML = `
|
283 |
+
<div class="flex-shrink-0">
|
284 |
+
<div class="w-8 h-8 rounded-full bg-purple-500 flex items-center justify-center">
|
285 |
+
<i class="fas fa-robot text-white text-sm"></i>
|
286 |
+
</div>
|
287 |
+
</div>
|
288 |
+
<div class="bg-white p-3 rounded-lg shadow-sm max-w-[85%]">
|
289 |
+
<div class="typing-indicator flex space-x-1">
|
290 |
+
<div class="w-2 h-2 rounded-full bg-gray-400 animate-pulse"></div>
|
291 |
+
<div class="w-2 h-2 rounded-full bg-gray-400 animate-pulse" style="animation-delay: 0.2s"></div>
|
292 |
+
<div class="w-2 h-2 rounded-full bg-gray-400 animate-pulse" style="animation-delay: 0.4s"></div>
|
293 |
+
</div>
|
294 |
+
</div>
|
295 |
+
`;
|
296 |
+
chatContainer.appendChild(typingIndicator);
|
297 |
+
chatContainer.scrollTop = chatContainer.scrollHeight;
|
298 |
+
|
299 |
+
// Simulate AI response after delay
|
300 |
+
setTimeout(() => {
|
301 |
+
chatContainer.removeChild(typingIndicator);
|
302 |
+
|
303 |
+
const langData = languages[currentLang].translations;
|
304 |
+
let response = langData.responses.default;
|
305 |
+
const lowerMessage = message.toLowerCase();
|
306 |
+
|
307 |
+
// Check for greetings in all languages
|
308 |
+
if (lowerMessage.includes('hello') || lowerMessage.includes('hi') ||
|
309 |
+
lowerMessage.includes('hallo') || lowerMessage.includes('salom')) {
|
310 |
+
response = langData.responses.hello || langData.responses.default;
|
311 |
+
}
|
312 |
+
// Check for design queries
|
313 |
+
else if (lowerMessage.includes('design') || lowerMessage.includes('dizayn') ||
|
314 |
+
lowerMessage.includes('gestaltung') || lowerMessage.includes('dizayn maslahatlari')) {
|
315 |
+
response = langData.responses["website design tips"] || langData.responses.default;
|
316 |
+
}
|
317 |
+
// Check for code queries
|
318 |
+
else if (lowerMessage.includes('javascript') || lowerMessage.includes('code') ||
|
319 |
+
lowerMessage.includes('kod') || lowerMessage.includes('yordami')) {
|
320 |
+
response = langData.responses["javascript help"] || langData.responses.default;
|
321 |
+
}
|
322 |
+
// Check for idea queries
|
323 |
+
else if (lowerMessage.includes('idea') || lowerMessage.includes('creative') ||
|
324 |
+
lowerMessage.includes('idee') || lowerMessage.includes('g'idea')) {
|
325 |
+
response = langData.responses["creative ideas"] || langData.responses.default;
|
326 |
+
}
|
327 |
+
|
328 |
+
addMessage(response, 'ai');
|
329 |
+
}, 1500 + Math.random() * 2000);
|
330 |
+
});
|
331 |
+
|
332 |
+
// Add click handlers for suggestion buttons
|
333 |
+
document.querySelectorAll('.suggestion-btn').forEach(button => {
|
334 |
+
button.addEventListener('click', function() {
|
335 |
+
const key = this.getAttribute('data-key');
|
336 |
+
const langData = languages[currentLang].translations;
|
337 |
+
|
338 |
+
if (key === 'design') {
|
339 |
+
input.value = langData.design;
|
340 |
+
} else if (key === 'code') {
|
341 |
+
input.value = langData.code;
|
342 |
+
} else if (key === 'ideas') {
|
343 |
+
input.value = langData.ideas;
|
344 |
+
}
|
345 |
+
|
346 |
+
input.focus();
|
347 |
+
});
|
348 |
+
});
|
349 |
+
|
350 |
+
function addMessage(content, sender) {
|
351 |
+
const messageDiv = document.createElement('div');
|
352 |
+
messageDiv.className = 'message-animation flex space-x-3';
|
353 |
+
|
354 |
+
if (sender === 'user') {
|
355 |
+
messageDiv.innerHTML = `
|
356 |
+
<div class="flex-shrink-0 ml-auto">
|
357 |
+
<div class="w-8 h-8 rounded-full bg-gray-300 flex items-center justify-center">
|
358 |
+
<i class="fas fa-user text-gray-600 text-sm"></i>
|
359 |
+
</div>
|
360 |
+
</div>
|
361 |
+
<div class="bg-purple-100 p-3 rounded-lg shadow-sm max-w-[85%]">
|
362 |
+
<p class="text-gray-800">${content}</p>
|
363 |
+
</div>
|
364 |
+
`;
|
365 |
+
} else {
|
366 |
+
messageDiv.innerHTML = `
|
367 |
+
<div class="flex-shrink-0">
|
368 |
+
<div class="w-8 h-8 rounded-full bg-purple-500 flex items-center justify-center">
|
369 |
+
<i class="fas fa-robot text-white text-sm"></i>
|
370 |
+
</div>
|
371 |
+
</div>
|
372 |
+
<div class="bg-white p-3 rounded-lg shadow-sm max-w-[85%]">
|
373 |
+
<p class="text-gray-800">${content}</p>
|
374 |
+
</div>
|
375 |
+
`;
|
376 |
+
}
|
377 |
+
|
378 |
+
chatContainer.appendChild(messageDiv);
|
379 |
+
chatContainer.scrollTop = chatContainer.scrollHeight;
|
380 |
+
}
|
381 |
+
});
|
382 |
+
</script>
|
383 |
+
<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=Meszod/web-chat" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
384 |
+
</html>
|
prompts.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
Make it open on the phone too
|
2 |
+
Create an Artificial Intelligence for me, like ChatGPT, that knows everything, often writes code, and designs a beautiful website for Adiba.
|
3 |
+
The site must know Uzbek and German languages.
|