File size: 20,364 Bytes
21db7b3 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 |
<!DOCTYPE html>
<html lang="th">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ThaiGov AI Assistant</title>
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@400;500;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
:root {
--primary-color: #2c7be5;
--secondary-color: #00d97e;
--danger-color: #e63757;
--warning-color: #f6c343;
--dark-color: #12263f;
--light-color: #f9fafd;
}
body {
font-family: 'Noto Sans Thai', sans-serif;
background-color: #f5f7fa;
}
.chat-bubble {
border-radius: 18px;
max-width: 80%;
}
.user-bubble {
border-bottom-right-radius: 4px;
background-color: var(--primary-color);
color: white;
}
.bot-bubble {
border-bottom-left-radius: 4px;
background-color: white;
color: var(--dark-color);
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.quick-reply {
transition: all 0.2s ease;
}
.quick-reply:hover {
transform: translateY(-2px);
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.high-contrast {
background-color: black !important;
color: white !important;
}
.high-contrast .bot-bubble {
background-color: black !important;
color: yellow !important;
border: 2px solid yellow !important;
}
.high-contrast .user-bubble {
background-color: yellow !important;
color: black !important;
}
.text-xxs {
font-size: 0.65rem;
}
</style>
</head>
<body class="relative h-screen overflow-hidden bg-gray-50" style="max-width: 360px; margin: 0 auto;">
<!-- App Header -->
<header class="bg-blue-600 text-white p-4 shadow-md">
<div class="flex items-center justify-between">
<button id="backBtn" class="text-white">
<i class="fas fa-chevron-left"></i>
</button>
<div class="flex items-center space-x-2">
<img src="https://img5.pic.in.th/file/secure-sv1/307460108_387435583599238_6386334495691428178_n-removebg-preview.png" alt="ThaiGov Logo" class="h-8">
<h1 class="font-bold text-lg">ThaiGov AI</h1>
</div>
<div class="flex items-center space-x-3">
<button id="languageToggle" class="text-white text-sm">EN</button>
<button id="settingsBtn" class="text-white">
<i class="fas fa-cog"></i>
</button>
</div>
</div>
</header>
<!-- Chat Container -->
<main class="h-[calc(100vh-120px)] overflow-y-auto pb-4 px-3 pt-2" id="chatContainer">
<!-- Welcome Message -->
<div class="flex mb-4">
<div class="w-8 h-8 rounded-full bg-blue-100 flex items-center justify-center mr-2">
<i class="fas fa-robot text-blue-600"></i>
</div>
<div class="bot-bubble chat-bubble px-4 py-3">
<p class="font-medium">สวัสดีค่ะ! ยินดีต้อนรับสู่ ThaiGov AI Assistant</p>
<p class="text-sm mt-1">ฉันสามารถช่วยเหลือคุณในเรื่องบริการของรัฐบาลท้องถิ่นได้ทุกเวลา</p>
<div class="mt-3 grid grid-cols-2 gap-2">
<button class="quick-reply bg-blue-50 text-blue-600 rounded-full px-3 py-1 text-xs font-medium">
<i class="fas fa-file-alt mr-1"></i> ยื่นเอกสาร
</button>
<button class="quick-reply bg-blue-50 text-blue-600 rounded-full px-3 py-1 text-xs font-medium">
<i class="fas fa-calendar-alt mr-1"></i> นัดหมาย
</button>
<button class="quick-reply bg-blue-50 text-blue-600 rounded-full px-3 py-1 text-xs font-medium">
<i class="fas fa-money-bill-wave mr-1"></i> ชำระเงิน
</button>
<button class="quick-reply bg-blue-50 text-blue-600 rounded-full px-3 py-1 text-xs font-medium">
<i class="fas fa-question-circle mr-1"></i> คำถามทั่วไป
</button>
</div>
</div>
</div>
<!-- Emergency Shortcut -->
<div class="flex justify-center mb-4">
<button class="bg-red-100 text-red-600 rounded-full px-4 py-2 text-sm font-medium flex items-center">
<i class="fas fa-phone-alt mr-2"></i> เบอร์ฉุกเฉิน
</button>
</div>
<!-- Sample Chat -->
<div class="flex mb-4 justify-end">
<div class="user-bubble chat-bubble px-4 py-2">
<p>ฉันต้องการยื่นเอกสารสำหรับการแจ้งเกิด</p>
</div>
</div>
<div class="flex mb-4">
<div class="w-8 h-8 rounded-full bg-blue-100 flex items-center justify-center mr-2">
<i class="fas fa-robot text-blue-600"></i>
</div>
<div class="bot-bubble chat-bubble px-4 py-3">
<p>สำหรับการแจ้งเกิด คุณสามารถ:</p>
<div class="mt-2 space-y-2">
<button class="quick-reply w-full text-left bg-blue-50 text-blue-600 rounded-lg px-3 py-2 text-sm font-medium flex items-center">
<i class="fas fa-file-pdf mr-2 text-red-500"></i> ดาวน์โหลดแบบฟอร์ม
</button>
<button class="quick-reply w-full text-left bg-blue-50 text-blue-600 rounded-lg px-3 py-2 text-sm font-medium flex items-center">
<i class="fas fa-upload mr-2 text-green-500"></i> อัปโหลดเอกสาร
</button>
<button class="quick-reply w-full text-left bg-blue-50 text-blue-600 rounded-lg px-3 py-2 text-sm font-medium flex items-center">
<i class="fas fa-map-marker-alt mr-2 text-orange-500"></i> สถานที่ยื่นเอกสาร
</button>
</div>
</div>
</div>
<!-- Document Upload Example -->
<div class="flex mb-4 justify-end">
<div class="user-bubble chat-bubble px-4 py-2">
<p>ฉันต้องการอัปโหลดเอกสาร</p>
</div>
</div>
<div class="flex mb-4">
<div class="w-8 h-8 rounded-full bg-blue-100 flex items-center justify-center mr-2">
<i class="fas fa-robot text-blue-600"></i>
</div>
<div class="bot-bubble chat-bubble px-4 py-3">
<p class="font-medium">ระบบอัปโหลดเอกสาร</p>
<p class="text-sm mt-1">กรุณาเลือกไฟล์ที่ต้องการอัปโหลด (PDF, JPG ไม่เกิน 5MB)</p>
<div class="mt-3 border-2 border-dashed border-blue-200 rounded-lg p-4 text-center">
<i class="fas fa-cloud-upload-alt text-blue-400 text-3xl mb-2"></i>
<p class="text-sm text-gray-500">ลากไฟล์มาวางที่นี่หรือคลิกเพื่อเลือกไฟล์</p>
<button class="mt-2 bg-blue-600 text-white rounded-full px-4 py-1 text-sm">
เลือกไฟล์
</button>
</div>
<div class="mt-3 text-xs text-gray-500">
<i class="fas fa-lock"></i> ข้อมูลของคุณจะถูกเก็บเป็นความลับตาม พ.ร.บ. คุ้มครองข้อมูลส่วนบุคคล
</div>
</div>
</div>
</main>
<!-- Input Area -->
<footer class="absolute bottom-0 w-full bg-white border-t border-gray-200 p-3">
<div class="flex items-center space-x-2">
<button class="text-blue-600 p-2 rounded-full hover:bg-blue-50">
<i class="fas fa-paperclip"></i>
</button>
<button class="text-blue-600 p-2 rounded-full hover:bg-blue-50">
<i class="fas fa-microphone"></i>
</button>
<div class="flex-1 relative">
<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">
<button class="absolute right-2 top-1/2 transform -translate-y-1/2 text-blue-600">
<i class="fas fa-paper-plane"></i>
</button>
</div>
</div>
<!-- Quick Action Buttons -->
<div class="mt-2 flex justify-between text-xs text-center">
<button class="text-gray-600 px-2 py-1 rounded hover:bg-gray-100">
<i class="fas fa-home block mx-auto mb-1"></i>
หน้าหลัก
</button>
<button class="text-gray-600 px-2 py-1 rounded hover:bg-gray-100">
<i class="fas fa-file-alt block mx-auto mb-1"></i>
เอกสาร
</button>
<button class="text-gray-600 px-2 py-1 rounded hover:bg-gray-100">
<i class="fas fa-calendar block mx-auto mb-1"></i>
นัดหมาย
</button>
<button class="text-gray-600 px-2 py-1 rounded hover:bg-gray-100">
<i class="fas fa-wallet block mx-auto mb-1"></i>
ชำระเงิน
</button>
<button class="text-gray-600 px-2 py-1 rounded hover:bg-gray-100">
<i class="fas fa-user block mx-auto mb-1"></i>
บัญชี
</button>
</div>
</footer>
<!-- Settings Modal -->
<div id="settingsModal" class="fixed inset-0 bg-black bg-opacity-50 z-50 hidden flex items-center justify-center">
<div class="bg-white rounded-lg w-full max-w-xs mx-4">
<div class="p-4 border-b border-gray-200 flex justify-between items-center">
<h3 class="font-bold text-lg">การตั้งค่า</h3>
<button id="closeSettings" class="text-gray-500">
<i class="fas fa-times"></i>
</button>
</div>
<div class="p-4 space-y-4">
<div>
<label class="block text-sm font-medium mb-1">ภาษา</label>
<div class="flex space-x-2">
<button class="bg-blue-600 text-white px-3 py-1 rounded-full text-sm">ไทย</button>
<button class="bg-gray-200 text-gray-700 px-3 py-1 rounded-full text-sm">English</button>
</div>
</div>
<div>
<label class="block text-sm font-medium mb-1">ขนาดตัวอักษร</label>
<div class="flex items-center space-x-2">
<button class="text-gray-500">
<i class="fas fa-minus"></i>
</button>
<div class="flex-1 bg-gray-100 rounded-full h-2">
<div class="bg-blue-600 h-2 rounded-full w-3/4"></div>
</div>
<button class="text-gray-500">
<i class="fas fa-plus"></i>
</button>
</div>
</div>
<div class="flex items-center justify-between">
<label class="text-sm font-medium">โหมดความคมชัดสูง</label>
<label class="relative inline-flex items-center cursor-pointer">
<input type="checkbox" class="sr-only peer">
<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>
</label>
</div>
<div class="flex items-center justify-between">
<label class="text-sm font-medium">การตอบสนองสัมผัส</label>
<label class="relative inline-flex items-center cursor-pointer">
<input type="checkbox" class="sr-only peer" checked>
<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>
</label>
</div>
<div class="pt-4 border-t border-gray-200">
<button class="w-full bg-blue-600 text-white py-2 rounded-lg text-sm font-medium">
บันทึกการตั้งค่า
</button>
</div>
</div>
</div>
</div>
<!-- Emergency Contacts Modal -->
<div id="emergencyModal" class="fixed inset-0 bg-black bg-opacity-50 z-50 hidden flex items-center justify-center">
<div class="bg-white rounded-lg w-full max-w-xs mx-4">
<div class="p-4 border-b border-gray-200 flex justify-between items-center">
<h3 class="font-bold text-lg">เบอร์ฉุกเฉิน</h3>
<button id="closeEmergency" class="text-gray-500">
<i class="fas fa-times"></i>
</button>
</div>
<div class="p-4 space-y-3">
<div class="flex items-center p-3 bg-red-50 rounded-lg">
<div class="bg-red-100 p-2 rounded-full mr-3">
<i class="fas fa-ambulance text-red-600"></i>
</div>
<div>
<p class="font-medium">รถพยาบาล</p>
<p class="text-sm text-gray-600">1669</p>
</div>
</div>
<div class="flex items-center p-3 bg-blue-50 rounded-lg">
<div class="bg-blue-100 p-2 rounded-full mr-3">
<i class="fas fa-shield-alt text-blue-600"></i>
</div>
<div>
<p class="font-medium">ตำรวจ</p>
<p class="text-sm text-gray-600">191</p>
</div>
</div>
<div class="flex items-center p-3 bg-orange-50 rounded-lg">
<div class="bg-orange-100 p-2 rounded-full mr-3">
<i class="fas fa-fire-extinguisher text-orange-600"></i>
</div>
<div>
<p class="font-medium">ดับเพลิง</p>
<p class="text-sm text-gray-600">199</p>
</div>
</div>
<div class="flex items-center p-3 bg-purple-50 rounded-lg">
<div class="bg-purple-100 p-2 rounded-full mr-3">
<i class="fas fa-life-ring text-purple-600"></i>
</div>
<div>
<p class="font-medium">ภัยพิบัติ</p>
<p class="text-sm text-gray-600">1784</p>
</div>
</div>
<div class="pt-4">
<button class="w-full border border-blue-600 text-blue-600 py-2 rounded-lg text-sm font-medium">
โทรออก
</button>
</div>
</div>
</div>
</div>
<script>
// DOM Elements
const settingsBtn = document.getElementById('settingsBtn');
const closeSettings = document.getElementById('closeSettings');
const settingsModal = document.getElementById('settingsModal');
const emergencyModal = document.getElementById('emergencyModal');
const closeEmergency = document.getElementById('closeEmergency');
const emergencyBtn = document.querySelector('.bg-red-100');
const languageToggle = document.getElementById('languageToggle');
const highContrastToggle = document.querySelector('input[type="checkbox"]');
const chatContainer = document.getElementById('chatContainer');
// Event Listeners
settingsBtn.addEventListener('click', () => {
settingsModal.classList.remove('hidden');
});
closeSettings.addEventListener('click', () => {
settingsModal.classList.add('hidden');
});
emergencyBtn.addEventListener('click', () => {
emergencyModal.classList.remove('hidden');
});
closeEmergency.addEventListener('click', () => {
emergencyModal.classList.add('hidden');
});
languageToggle.addEventListener('click', () => {
const currentLang = languageToggle.textContent;
languageToggle.textContent = currentLang === 'EN' ? 'TH' : 'EN';
// Here you would add language switching logic
});
highContrastToggle.addEventListener('change', (e) => {
if(e.target.checked) {
document.body.classList.add('high-contrast');
} else {
document.body.classList.remove('high-contrast');
}
});
// Simulate haptic feedback
document.querySelectorAll('button').forEach(btn => {
btn.addEventListener('click', () => {
// In a real app, we would use navigator.vibrate()
console.log("Haptic feedback triggered");
});
});
// Auto-scroll to bottom of chat
function scrollToBottom() {
chatContainer.scrollTop = chatContainer.scrollHeight;
}
scrollToBottom();
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=kritsanan/chatbot2" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |