kritsanan commited on
Commit
d783d5c
·
verified ·
1 Parent(s): a9f466e

Add 3 files

Browse files
Files changed (3) hide show
  1. README.md +7 -5
  2. index.html +732 -19
  3. prompts.txt +0 -0
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Chatbot 6
3
- emoji: 🌍
4
- colorFrom: green
5
- colorTo: yellow
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: chatbot-6
3
+ emoji: 🐳
4
+ colorFrom: gray
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,732 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="th">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>ThaiGov AI Assistant</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link href="https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@400;500;700&display=swap" rel="stylesheet">
9
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
10
+ <style>
11
+ :root {
12
+ --primary-color: #2c7be5;
13
+ --secondary-color: #00d97e;
14
+ --danger-color: #e63757;
15
+ --warning-color: #f6c343;
16
+ --dark-color: #12263f;
17
+ --light-color: #f9fafd;
18
+ }
19
+
20
+ body {
21
+ font-family: 'Noto Sans Thai', sans-serif;
22
+ background-color: #f5f7fa;
23
+ }
24
+
25
+ .chat-bubble {
26
+ border-radius: 18px;
27
+ max-width: 80%;
28
+ }
29
+
30
+ .user-bubble {
31
+ border-bottom-right-radius: 4px;
32
+ background-color: var(--primary-color);
33
+ color: white;
34
+ }
35
+
36
+ .bot-bubble {
37
+ border-bottom-left-radius: 4px;
38
+ background-color: white;
39
+ color: var(--dark-color);
40
+ box-shadow: 0 1px 3px rgba(0,0,0,0.1);
41
+ }
42
+
43
+ .quick-reply {
44
+ transition: all 0.2s ease;
45
+ }
46
+
47
+ .quick-reply:hover {
48
+ transform: translateY(-2px);
49
+ box-shadow: 0 4px 6px rgba(0,0,0,0.1);
50
+ }
51
+
52
+ .high-contrast {
53
+ background-color: black !important;
54
+ color: white !important;
55
+ }
56
+
57
+ .high-contrast .bot-bubble {
58
+ background-color: black !important;
59
+ color: yellow !important;
60
+ border: 2px solid yellow !important;
61
+ }
62
+
63
+ .high-contrast .user-bubble {
64
+ background-color: yellow !important;
65
+ color: black !important;
66
+ }
67
+
68
+ .text-xxs {
69
+ font-size: 0.65rem;
70
+ }
71
+
72
+ /* Animation for typing indicator */
73
+ @keyframes typing {
74
+ 0% { opacity: 0.5; }
75
+ 50% { opacity: 1; }
76
+ 100% { opacity: 0.5; }
77
+ }
78
+
79
+ .typing-indicator span {
80
+ animation: typing 1.5s infinite;
81
+ }
82
+
83
+ .typing-indicator span:nth-child(2) {
84
+ animation-delay: 0.2s;
85
+ }
86
+
87
+ .typing-indicator span:nth-child(3) {
88
+ animation-delay: 0.4s;
89
+ }
90
+
91
+ /* LINE style elements */
92
+ .line-button {
93
+ background-color: #06c755;
94
+ color: white;
95
+ }
96
+
97
+ /* Accessibility focus styles */
98
+ button:focus, input:focus {
99
+ outline: 2px solid var(--primary-color);
100
+ outline-offset: 2px;
101
+ }
102
+
103
+ /* Document status indicators */
104
+ .status-pending {
105
+ background-color: #fff4e5;
106
+ color: #f79009;
107
+ }
108
+
109
+ .status-approved {
110
+ background-color: #ecfdf3;
111
+ color: #12b76a;
112
+ }
113
+
114
+ .status-rejected {
115
+ background-color: #fef3f2;
116
+ color: #f04438;
117
+ }
118
+ </style>
119
+ </head>
120
+ <body class="relative h-screen overflow-hidden bg-gray-50" style="max-width: 360px; margin: 0 auto;">
121
+ <!-- App Header with LINE integration -->
122
+ <header class="bg-blue-600 text-white p-4 shadow-md">
123
+ <div class="flex items-center justify-between">
124
+ <button id="backBtn" class="text-white" aria-label="Back">
125
+ <i class="fas fa-chevron-left"></i>
126
+ </button>
127
+ <div class="flex items-center space-x-2">
128
+ <img src="https://img5.pic.in.th/file/secure-sv1/307460108_387435583599238_6386334495691428178_n-removebg-preview.png" alt="ThaiGov Logo" class="h-8">
129
+ <h1 class="font-bold text-lg">ThaiGov AI</h1>
130
+ </div>
131
+ <div class="flex items-center space-x-3">
132
+ <button id="languageToggle" class="text-white text-sm" aria-label="Toggle language">EN</button>
133
+ <button id="settingsBtn" class="text-white" aria-label="Settings">
134
+ <i class="fas fa-cog"></i>
135
+ </button>
136
+ </div>
137
+ </div>
138
+ </header>
139
+
140
+ <!-- Chat Container -->
141
+ <main class="h-[calc(100vh-120px)] overflow-y-auto pb-4 px-3 pt-2" id="chatContainer">
142
+ <!-- Welcome Message with LINE login option -->
143
+ <div class="flex mb-4">
144
+ <div class="w-8 h-8 rounded-full bg-blue-100 flex items-center justify-center mr-2">
145
+ <i class="fas fa-robot text-blue-600"></i>
146
+ </div>
147
+ <div class="bot-bubble chat-bubble px-4 py-3">
148
+ <p class="font-medium">สวัสดีค่ะ! ยินดีต้อนรับสู่ ThaiGov AI Assistant</p>
149
+ <p class="text-sm mt-1">เพื่อความสะดวกในการใช้งาน คุณสามารถเข้าสู่ระบบผ่าน LINE</p>
150
+
151
+ <button class="line-button w-full mt-3 rounded-lg px-4 py-2 text-sm font-medium flex items-center justify-center">
152
+ <i class="fab fa-line mr-2 text-xl"></i> เข้าสู่ระบบด้วย LINE
153
+ </button>
154
+
155
+ <div class="mt-3 grid grid-cols-2 gap-2">
156
+ <button class="quick-reply bg-blue-50 text-blue-600 rounded-full px-3 py-1 text-xs font-medium">
157
+ <i class="fas fa-file-alt mr-1"></i> ยื่นเอกสาร
158
+ </button>
159
+ <button class="quick-reply bg-blue-50 text-blue-600 rounded-full px-3 py-1 text-xs font-medium">
160
+ <i class="fas fa-calendar-alt mr-1"></i> นัดหมาย
161
+ </button>
162
+ <button class="quick-reply bg-blue-50 text-blue-600 rounded-full px-3 py-1 text-xs font-medium">
163
+ <i class="fas fa-money-bill-wave mr-1"></i> ชำระเงิน
164
+ </button>
165
+ <button class="quick-reply bg-blue-50 text-blue-600 rounded-full px-3 py-1 text-xs font-medium">
166
+ <i class="fas fa-question-circle mr-1"></i> คำถามทั่วไป
167
+ </button>
168
+ </div>
169
+ </div>
170
+ </div>
171
+
172
+ <!-- Emergency Shortcut -->
173
+ <div class="flex justify-center mb-4">
174
+ <button id="emergencyBtn" class="bg-red-100 text-red-600 rounded-full px-4 py-2 text-sm font-medium flex items-center">
175
+ <i class="fas fa-phone-alt mr-2"></i> เบอร์ฉุกเฉิน
176
+ </button>
177
+ </div>
178
+
179
+ <!-- Sample Document Status Update -->
180
+ <div class="flex mb-4">
181
+ <div class="w-8 h-8 rounded-full bg-blue-100 flex items-center justify-center mr-2">
182
+ <i class="fas fa-robot text-blue-600"></i>
183
+ </div>
184
+ <div class="bot-bubble chat-bubble px-4 py-3">
185
+ <div class="flex items-start">
186
+ <div class="bg-green-100 p-2 rounded-full mr-3">
187
+ <i class="fas fa-check-circle text-green-600"></i>
188
+ </div>
189
+ <div>
190
+ <p class="font-medium">สถานะเอกสารของคุณ</p>
191
+ <p class="text-sm mt-1">ใบคำร้องขออนุญาตก่อสร้าง</p>
192
+ <div class="mt-2 status-approved px-3 py-1 rounded-full text-xs inline-flex items-center">
193
+ <i class="fas fa-check-circle mr-1"></i> อนุมัติแล้ว
194
+ </div>
195
+ <p class="text-xs text-gray-500 mt-2">อัปเดตล่าสุด: 15/06/2566 14:30</p>
196
+ </div>
197
+ </div>
198
+ <button class="w-full mt-3 bg-blue-50 text-blue-600 rounded-lg px-3 py-2 text-sm font-medium">
199
+ <i class="fas fa-download mr-2"></i> ดาวน์โหลดเอกสารอนุมัติ
200
+ </button>
201
+ </div>
202
+ </div>
203
+
204
+ <!-- Appointment Reminder -->
205
+ <div class="flex mb-4">
206
+ <div class="w-8 h-8 rounded-full bg-blue-100 flex items-center justify-center mr-2">
207
+ <i class="fas fa-robot text-blue-600"></i>
208
+ </div>
209
+ <div class="bot-bubble chat-bubble px-4 py-3">
210
+ <div class="flex items-start">
211
+ <div class="bg-yellow-100 p-2 rounded-full mr-3">
212
+ <i class="fas fa-bell text-yellow-600"></i>
213
+ </div>
214
+ <div>
215
+ <p class="font-medium">การแจ้งเตือนนัดหมาย</p>
216
+ <p class="text-sm mt-1">คุณมีนัดหมายกับสำนักงานเขตในวันพรุ่งนี้</p>
217
+ <p class="text-sm font-medium mt-1">16/06/2566 เวลา 09:30 น.</p>
218
+ <p class="text-xs text-gray-500 mt-1">สถานที่: สำนักงานเขตบางนา ชั้น 3</p>
219
+ </div>
220
+ </div>
221
+ <div class="grid grid-cols-2 gap-2 mt-3">
222
+ <button class="quick-reply bg-blue-50 text-blue-600 rounded-lg px-3 py-2 text-sm font-medium">
223
+ <i class="fas fa-calendar-check mr-1"></i> ยืนยัน
224
+ </button>
225
+ <button class="quick-reply bg-gray-100 text-gray-600 rounded-lg px-3 py-2 text-sm font-medium">
226
+ <i class="fas fa-calendar-times mr-1"></i> ยกเลิก
227
+ </button>
228
+ </div>
229
+ </div>
230
+ </div>
231
+
232
+ <!-- Payment Notification -->
233
+ <div class="flex mb-4">
234
+ <div class="w-8 h-8 rounded-full bg-blue-100 flex items-center justify-center mr-2">
235
+ <i class="fas fa-robot text-blue-600"></i>
236
+ </div>
237
+ <div class="bot-bubble chat-bubble px-4 py-3">
238
+ <div class="flex items-start">
239
+ <div class="bg-purple-100 p-2 rounded-full mr-3">
240
+ <i class="fas fa-money-bill-wave text-purple-600"></i>
241
+ </div>
242
+ <div>
243
+ <p class="font-medium">แจ้งเตือนการชำระเงิน</p>
244
+ <p class="text-sm mt-1">ค่าธรรมเนียมใบอนุญาตขับขี่</p>
245
+ <p class="text-sm font-medium mt-1">จำนวน 300 บาท</p>
246
+ <p class="text-xs text-gray-500 mt-1">ครบกำหนดชำระ: 20/06/2566</p>
247
+ </div>
248
+ </div>
249
+ <button class="w-full mt-3 bg-green-600 text-white rounded-lg px-3 py-2 text-sm font-medium">
250
+ <i class="fas fa-credit-card mr-2"></i> ชำระเงินตอนนี้
251
+ </button>
252
+ </div>
253
+ </div>
254
+
255
+ <!-- Typing Indicator -->
256
+ <div class="flex mb-4 typing-indicator" id="typingIndicator" style="display: none;">
257
+ <div class="w-8 h-8 rounded-full bg-blue-100 flex items-center justify-center mr-2">
258
+ <i class="fas fa-robot text-blue-600"></i>
259
+ </div>
260
+ <div class="bg-gray-100 rounded-full px-4 py-3 flex space-x-1">
261
+ <span>•</span>
262
+ <span>•</span>
263
+ <span>•</span>
264
+ </div>
265
+ </div>
266
+ </main>
267
+
268
+ <!-- Input Area with voice and attachment options -->
269
+ <footer class="absolute bottom-0 w-full bg-white border-t border-gray-200 p-3">
270
+ <div class="flex items-center space-x-2">
271
+ <button id="attachBtn" class="text-blue-600 p-2 rounded-full hover:bg-blue-50" aria-label="Attach file">
272
+ <i class="fas fa-paperclip"></i>
273
+ </button>
274
+ <button id="voiceBtn" class="text-blue-600 p-2 rounded-full hover:bg-blue-50" aria-label="Voice input">
275
+ <i class="fas fa-microphone"></i>
276
+ </button>
277
+ <div class="flex-1 relative">
278
+ <input type="text" placeholder="พิมพ์ข้อความ..." class="w-full bg-gray-100 rounded-full px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500" id="messageInput">
279
+ <button id="sendBtn" class="absolute right-2 top-1/2 transform -translate-y-1/2 text-blue-600" aria-label="Send message">
280
+ <i class="fas fa-paper-plane"></i>
281
+ </button>
282
+ </div>
283
+ </div>
284
+
285
+ <!-- Quick Action Buttons -->
286
+ <div class="mt-2 flex justify-between text-xs text-center">
287
+ <button class="text-gray-600 px-2 py-1 rounded hover:bg-gray-100">
288
+ <i class="fas fa-home block mx-auto mb-1"></i>
289
+ หน้าหลัก
290
+ </button>
291
+ <button class="text-gray-600 px-2 py-1 rounded hover:bg-gray-100">
292
+ <i class="fas fa-file-alt block mx-auto mb-1"></i>
293
+ เอกสาร
294
+ </button>
295
+ <button class="text-gray-600 px-2 py-1 rounded hover:bg-gray-100">
296
+ <i class="fas fa-calendar block mx-auto mb-1"></i>
297
+ นัดหมาย
298
+ </button>
299
+ <button class="text-gray-600 px-2 py-1 rounded hover:bg-gray-100">
300
+ <i class="fas fa-wallet block mx-auto mb-1"></i>
301
+ ชำระเงิน
302
+ </button>
303
+ <button class="text-gray-600 px-2 py-1 rounded hover:bg-gray-100">
304
+ <i class="fas fa-user block mx-auto mb-1"></i>
305
+ บัญชี
306
+ </button>
307
+ </div>
308
+ </footer>
309
+
310
+ <!-- Settings Modal with accessibility options -->
311
+ <div id="settingsModal" class="fixed inset-0 bg-black bg-opacity-50 z-50 hidden flex items-center justify-center">
312
+ <div class="bg-white rounded-lg w-full max-w-xs mx-4">
313
+ <div class="p-4 border-b border-gray-200 flex justify-between items-center">
314
+ <h3 class="font-bold text-lg">การตั้งค่า</h3>
315
+ <button id="closeSettings" class="text-gray-500" aria-label="Close settings">
316
+ <i class="fas fa-times"></i>
317
+ </button>
318
+ </div>
319
+
320
+ <div class="p-4 space-y-4">
321
+ <div>
322
+ <label class="block text-sm font-medium mb-1">ภาษา</label>
323
+ <div class="flex space-x-2">
324
+ <button class="bg-blue-600 text-white px-3 py-1 rounded-full text-sm">ไทย</button>
325
+ <button class="bg-gray-200 text-gray-700 px-3 py-1 rounded-full text-sm">English</button>
326
+ </div>
327
+ </div>
328
+
329
+ <div>
330
+ <label class="block text-sm font-medium mb-1">ขนาดตัวอักษร</label>
331
+ <div class="flex items-center space-x-2">
332
+ <button class="text-gray-500" id="decreaseFont">
333
+ <i class="fas fa-minus"></i>
334
+ </button>
335
+ <div class="flex-1 bg-gray-100 rounded-full h-2">
336
+ <div class="bg-blue-600 h-2 rounded-full w-3/4" id="fontSizeBar"></div>
337
+ </div>
338
+ <button class="text-gray-500" id="increaseFont">
339
+ <i class="fas fa-plus"></i>
340
+ </button>
341
+ </div>
342
+ </div>
343
+
344
+ <div class="flex items-center justify-between">
345
+ <label class="text-sm font-medium">โหมดความคมชัดสูง</label>
346
+ <label class="relative inline-flex items-center cursor-pointer">
347
+ <input type="checkbox" class="sr-only peer" id="highContrastToggle">
348
+ <div class="w-11 h-6 bg-gray-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-blue-600"></div>
349
+ </label>
350
+ </div>
351
+
352
+ <div class="flex items-center justify-between">
353
+ <label class="text-sm font-medium">การตอบสนองสัมผัส</label>
354
+ <label class="relative inline-flex items-center cursor-pointer">
355
+ <input type="checkbox" class="sr-only peer" checked id="hapticToggle">
356
+ <div class="w-11 h-6 bg-gray-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-blue-600"></div>
357
+ </label>
358
+ </div>
359
+
360
+ <div class="flex items-center justify-between">
361
+ <label class="text-sm font-medium">ป้อนข้อมูลด้วยเสียง</label>
362
+ <label class="relative inline-flex items-center cursor-pointer">
363
+ <input type="checkbox" class="sr-only peer" checked id="voiceInputToggle">
364
+ <div class="w-11 h-6 bg-gray-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-blue-600"></div>
365
+ </label>
366
+ </div>
367
+
368
+ <div class="pt-4 border-t border-gray-200">
369
+ <button class="w-full bg-blue-600 text-white py-2 rounded-lg text-sm font-medium" id="saveSettings">
370
+ บันทึกการตั้งค่า
371
+ </button>
372
+ </div>
373
+ </div>
374
+ </div>
375
+ </div>
376
+
377
+ <!-- Emergency Contacts Modal -->
378
+ <div id="emergencyModal" class="fixed inset-0 bg-black bg-opacity-50 z-50 hidden flex items-center justify-center">
379
+ <div class="bg-white rounded-lg w-full max-w-xs mx-4">
380
+ <div class="p-4 border-b border-gray-200 flex justify-between items-center">
381
+ <h3 class="font-bold text-lg">เบอร์ฉุกเฉิน</h3>
382
+ <button id="closeEmergency" class="text-gray-500" aria-label="Close emergency contacts">
383
+ <i class="fas fa-times"></i>
384
+ </button>
385
+ </div>
386
+
387
+ <div class="p-4 space-y-3">
388
+ <div class="flex items-center p-3 bg-red-50 rounded-lg">
389
+ <div class="bg-red-100 p-2 rounded-full mr-3">
390
+ <i class="fas fa-ambulance text-red-600"></i>
391
+ </div>
392
+ <div>
393
+ <p class="font-medium">รถพยาบาล</p>
394
+ <p class="text-sm text-gray-600">1669</p>
395
+ </div>
396
+ </div>
397
+
398
+ <div class="flex items-center p-3 bg-blue-50 rounded-lg">
399
+ <div class="bg-blue-100 p-2 rounded-full mr-3">
400
+ <i class="fas fa-shield-alt text-blue-600"></i>
401
+ </div>
402
+ <div>
403
+ <p class="font-medium">ตำรวจ</p>
404
+ <p class="text-sm text-gray-600">191</p>
405
+ </div>
406
+ </div>
407
+
408
+ <div class="flex items-center p-3 bg-orange-50 rounded-lg">
409
+ <div class="bg-orange-100 p-2 rounded-full mr-3">
410
+ <i class="fas fa-fire-extinguisher text-orange-600"></i>
411
+ </div>
412
+ <div>
413
+ <p class="font-medium">ดับเพลิง</p>
414
+ <p class="text-sm text-gray-600">199</p>
415
+ </div>
416
+ </div>
417
+
418
+ <div class="flex items-center p-3 bg-purple-50 rounded-lg">
419
+ <div class="bg-purple-100 p-2 rounded-full mr-3">
420
+ <i class="fas fa-life-ring text-purple-600"></i>
421
+ </div>
422
+ <div>
423
+ <p class="font-medium">ภัยพิบัติ</p>
424
+ <p class="text-sm text-gray-600">1784</p>
425
+ </div>
426
+ </div>
427
+
428
+ <div class="pt-4">
429
+ <button class="w-full border border-blue-600 text-blue-600 py-2 rounded-lg text-sm font-medium">
430
+ โทรออก
431
+ </button>
432
+ </div>
433
+ </div>
434
+ </div>
435
+ </div>
436
+
437
+ <!-- Attachment Options Modal -->
438
+ <div id="attachmentModal" class="fixed inset-0 bg-black bg-opacity-50 z-50 hidden flex items-center justify-center">
439
+ <div class="bg-white rounded-lg w-full max-w-xs mx-4">
440
+ <div class="p-4 border-b border-gray-200 flex justify-between items-center">
441
+ <h3 class="font-bold text-lg">แนบไฟล์</h3>
442
+ <button id="closeAttachment" class="text-gray-500" aria-label="Close attachment options">
443
+ <i class="fas fa-times"></i>
444
+ </button>
445
+ </div>
446
+
447
+ <div class="p-4 grid grid-cols-2 gap-3">
448
+ <button class="flex flex-col items-center p-3 border border-gray-200 rounded-lg hover:bg-gray-50">
449
+ <i class="fas fa-camera text-blue-600 text-xl mb-2"></i>
450
+ <span class="text-sm">กล้อง</span>
451
+ </button>
452
+ <button class="flex flex-col items-center p-3 border border-gray-200 rounded-lg hover:bg-gray-50">
453
+ <i class="fas fa-images text-green-600 text-xl mb-2"></i>
454
+ <span class="text-sm">แกลเลอรี่</span>
455
+ </button>
456
+ <button class="flex flex-col items-center p-3 border border-gray-200 rounded-lg hover:bg-gray-50">
457
+ <i class="fas fa-file-pdf text-red-600 text-xl mb-2"></i>
458
+ <span class="text-sm">เอกสาร</span>
459
+ </button>
460
+ <button class="flex flex-col items-center p-3 border border-gray-200 rounded-lg hover:bg-gray-50">
461
+ <i class="fas fa-map-marker-alt text-yellow-600 text-xl mb-2"></i>
462
+ <span class="text-sm">ตำแหน่ง</span>
463
+ </button>
464
+ </div>
465
+
466
+ <div class="p-4 border-t border-gray-200 text-xs text-gray-500">
467
+ <i class="fas fa-lock"></i> ไฟล์ทั้งหมดจะถูกเก็บเป็นความลับตาม พ.ร.บ. คุ้มครองข้อมูลส่วนบุคคล
468
+ </div>
469
+ </div>
470
+ </div>
471
+
472
+ <!-- Voice Input Modal -->
473
+ <div id="voiceModal" class="fixed inset-0 bg-black bg-opacity-50 z-50 hidden flex items-center justify-center">
474
+ <div class="bg-white rounded-lg w-full max-w-xs mx-4">
475
+ <div class="p-6 flex flex-col items-center">
476
+ <div class="relative mb-4">
477
+ <div class="w-24 h-24 bg-blue-100 rounded-full flex items-center justify-center">
478
+ <i class="fas fa-microphone text-blue-600 text-3xl" id="voiceIcon"></i>
479
+ </div>
480
+ <div class="absolute -bottom-2 -right-2 bg-red-500 rounded-full w-8 h-8 flex items-center justify-center">
481
+ <i class="fas fa-stop text-white"></i>
482
+ </div>
483
+ </div>
484
+ <h3 class="font-bold text-lg mb-1">กำลังฟัง...</h3>
485
+ <p class="text-sm text-gray-600 mb-4">พูดตอนนี้</p>
486
+ <div class="w-full bg-gray-100 rounded-full h-2 mb-4">
487
+ <div class="bg-blue-600 h-2 rounded-full w-1/2" id="voiceLevel"></div>
488
+ </div>
489
+ <p class="text-sm text-gray-500">ระบบจะประมวลผลหลังจากคุณหยุดพูด</p>
490
+ </div>
491
+ </div>
492
+ </div>
493
+
494
+ <script>
495
+ // DOM Elements
496
+ const settingsBtn = document.getElementById('settingsBtn');
497
+ const closeSettings = document.getElementById('closeSettings');
498
+ const settingsModal = document.getElementById('settingsModal');
499
+ const emergencyModal = document.getElementById('emergencyModal');
500
+ const closeEmergency = document.getElementById('closeEmergency');
501
+ const emergencyBtn = document.getElementById('emergencyBtn');
502
+ const languageToggle = document.getElementById('languageToggle');
503
+ const highContrastToggle = document.getElementById('highContrastToggle');
504
+ const hapticToggle = document.getElementById('hapticToggle');
505
+ const voiceInputToggle = document.getElementById('voiceInputToggle');
506
+ const chatContainer = document.getElementById('chatContainer');
507
+ const messageInput = document.getElementById('messageInput');
508
+ const sendBtn = document.getElementById('sendBtn');
509
+ const attachBtn = document.getElementById('attachBtn');
510
+ const voiceBtn = document.getElementById('voiceBtn');
511
+ const attachmentModal = document.getElementById('attachmentModal');
512
+ const closeAttachment = document.getElementById('closeAttachment');
513
+ const voiceModal = document.getElementById('voiceModal');
514
+ const typingIndicator = document.getElementById('typingIndicator');
515
+ const increaseFont = document.getElementById('increaseFont');
516
+ const decreaseFont = document.getElementById('decreaseFont');
517
+ const fontSizeBar = document.getElementById('fontSizeBar');
518
+ const saveSettings = document.getElementById('saveSettings');
519
+
520
+ // Current settings state
521
+ let currentSettings = {
522
+ language: 'th',
523
+ fontSize: 3, // 1-5 scale
524
+ highContrast: false,
525
+ hapticFeedback: true,
526
+ voiceInput: true
527
+ };
528
+
529
+ // Event Listeners
530
+ settingsBtn.addEventListener('click', () => {
531
+ settingsModal.classList.remove('hidden');
532
+ triggerHapticFeedback();
533
+ });
534
+
535
+ closeSettings.addEventListener('click', () => {
536
+ settingsModal.classList.add('hidden');
537
+ triggerHapticFeedback();
538
+ });
539
+
540
+ emergencyBtn.addEventListener('click', () => {
541
+ emergencyModal.classList.remove('hidden');
542
+ triggerHapticFeedback();
543
+ });
544
+
545
+ closeEmergency.addEventListener('click', () => {
546
+ emergencyModal.classList.add('hidden');
547
+ triggerHapticFeedback();
548
+ });
549
+
550
+ attachBtn.addEventListener('click', () => {
551
+ attachmentModal.classList.remove('hidden');
552
+ triggerHapticFeedback();
553
+ });
554
+
555
+ closeAttachment.addEventListener('click', () => {
556
+ attachmentModal.classList.add('hidden');
557
+ triggerHapticFeedback();
558
+ });
559
+
560
+ voiceBtn.addEventListener('click', () => {
561
+ if (currentSettings.voiceInput) {
562
+ voiceModal.classList.remove('hidden');
563
+ triggerHapticFeedback();
564
+
565
+ // Simulate voice input animation
566
+ const voiceLevel = document.getElementById('voiceLevel');
567
+ let width = 10;
568
+ const interval = setInterval(() => {
569
+ width = 10 + Math.random() * 90;
570
+ voiceLevel.style.width = `${width}%`;
571
+ }, 100);
572
+
573
+ // Stop after 3 seconds
574
+ setTimeout(() => {
575
+ clearInterval(interval);
576
+ voiceModal.classList.add('hidden');
577
+
578
+ // Show typing indicator
579
+ typingIndicator.style.display = 'flex';
580
+
581
+ // Simulate bot response after delay
582
+ setTimeout(() => {
583
+ typingIndicator.style.display = 'none';
584
+ addBotMessage("ฉันได้ยินคุณพูดว่า 'ฉันต้องการยื่นเอกสารสำหรับการแจ้งเกิด' ถูกต้องหรือไม่?");
585
+ }, 2000);
586
+ }, 3000);
587
+ }
588
+ });
589
+
590
+ languageToggle.addEventListener('click', () => {
591
+ const currentLang = languageToggle.textContent;
592
+ languageToggle.textContent = currentLang === 'EN' ? 'TH' : 'EN';
593
+ currentSettings.language = currentLang === 'EN' ? 'th' : 'en';
594
+ triggerHapticFeedback();
595
+ });
596
+
597
+ highContrastToggle.addEventListener('change', (e) => {
598
+ currentSettings.highContrast = e.target.checked;
599
+ updateHighContrastMode();
600
+ });
601
+
602
+ hapticToggle.addEventListener('change', (e) => {
603
+ currentSettings.hapticFeedback = e.target.checked;
604
+ });
605
+
606
+ voiceInputToggle.addEventListener('change', (e) => {
607
+ currentSettings.voiceInput = e.target.checked;
608
+ });
609
+
610
+ increaseFont.addEventListener('click', () => {
611
+ if (currentSettings.fontSize < 5) {
612
+ currentSettings.fontSize++;
613
+ updateFontSize();
614
+ triggerHapticFeedback();
615
+ }
616
+ });
617
+
618
+ decreaseFont.addEventListener('click', () => {
619
+ if (currentSettings.fontSize > 1) {
620
+ currentSettings.fontSize--;
621
+ updateFontSize();
622
+ triggerHapticFeedback();
623
+ }
624
+ });
625
+
626
+ saveSettings.addEventListener('click', () => {
627
+ settingsModal.classList.add('hidden');
628
+ triggerHapticFeedback();
629
+ // In a real app, you would save these settings to localStorage or backend
630
+ });
631
+
632
+ // Message sending functionality
633
+ sendBtn.addEventListener('click', sendMessage);
634
+ messageInput.addEventListener('keypress', (e) => {
635
+ if (e.key === 'Enter') {
636
+ sendMessage();
637
+ }
638
+ });
639
+
640
+ // Functions
641
+ function sendMessage() {
642
+ const message = messageInput.value.trim();
643
+ if (message) {
644
+ addUserMessage(message);
645
+ messageInput.value = '';
646
+
647
+ // Show typing indicator
648
+ typingIndicator.style.display = 'flex';
649
+
650
+ // Simulate bot response after delay
651
+ setTimeout(() => {
652
+ typingIndicator.style.display = 'none';
653
+
654
+ // Simple chatbot responses
655
+ if (message.includes('สวัสดี') || message.includes('hello')) {
656
+ addBotMessage("สวัสดีค่ะ! มีอะไรให้ช่วยเหลือหรือไม่?");
657
+ } else if (message.includes('ขอบคุณ') || message.includes('thank')) {
658
+ addBotMessage("ยินดีให้บริการค่ะ 😊");
659
+ } else if (message.includes('เอกสาร') || message.includes('document')) {
660
+ addBotMessage("คุณต้องการดำเนินการเกี่ยวกับเอกสารประเภทใดคะ?");
661
+ } else {
662
+ addBotMessage("ฉันเข้าใจคำถามของคุณแล้ว กำลังค้นหาข้อมูลให้ค่ะ...");
663
+ }
664
+ }, 1500);
665
+
666
+ triggerHapticFeedback();
667
+ }
668
+ }
669
+
670
+ function addUserMessage(text) {
671
+ const messageDiv = document.createElement('div');
672
+ messageDiv.className = 'flex mb-4 justify-end';
673
+ messageDiv.innerHTML = `
674
+ <div class="user-bubble chat-bubble px-4 py-2">
675
+ <p>${text}</p>
676
+ </div>
677
+ `;
678
+ chatContainer.appendChild(messageDiv);
679
+ scrollToBottom();
680
+ }
681
+
682
+ function addBotMessage(text) {
683
+ const messageDiv = document.createElement('div');
684
+ messageDiv.className = 'flex mb-4';
685
+ messageDiv.innerHTML = `
686
+ <div class="w-8 h-8 rounded-full bg-blue-100 flex items-center justify-center mr-2">
687
+ <i class="fas fa-robot text-blue-600"></i>
688
+ </div>
689
+ <div class="bot-bubble chat-bubble px-4 py-3">
690
+ <p>${text}</p>
691
+ </div>
692
+ `;
693
+ chatContainer.appendChild(messageDiv);
694
+ scrollToBottom();
695
+ }
696
+
697
+ function updateHighContrastMode() {
698
+ if (currentSettings.highContrast) {
699
+ document.body.classList.add('high-contrast');
700
+ } else {
701
+ document.body.classList.remove('high-contrast');
702
+ }
703
+ }
704
+
705
+ function updateFontSize() {
706
+ const sizes = ['text-xs', 'text-sm', 'text-base', 'text-lg', 'text-xl'];
707
+ const percentage = [20, 40, 60, 80, 100];
708
+
709
+ // Update all text elements (simplified for demo)
710
+ document.body.className = document.body.className.replace(/\btext-(xs|sm|base|lg|xl)\b/g, '');
711
+ document.body.classList.add(sizes[currentSettings.fontSize - 1]);
712
+
713
+ // Update font size bar
714
+ fontSizeBar.style.width = `${percentage[currentSettings.fontSize - 1]}%`;
715
+ }
716
+
717
+ function scrollToBottom() {
718
+ chatContainer.scrollTop = chatContainer.scrollHeight;
719
+ }
720
+
721
+ function triggerHapticFeedback() {
722
+ if (currentSettings.hapticFeedback) {
723
+ // In a real app, we would use navigator.vibrate()
724
+ console.log("Haptic feedback triggered");
725
+ }
726
+ }
727
+
728
+ // Initialize
729
+ scrollToBottom();
730
+ </script>
731
+ <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=kritsanan/chatbot-6" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
732
+ </html>
prompts.txt ADDED
File without changes