joung-joung / index.html
joung's picture
Add 2 files
addf17e verified
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>๊ฑด๊ฐ• ์ƒ๋‹ด ์ฑ—๋ด‡ - MediCare AI</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.5; }
}
.typing-indicator span {
animation: pulse 1.5s infinite ease-in-out;
}
.typing-indicator span:nth-child(2) {
animation-delay: 0.2s;
}
.typing-indicator span:nth-child(3) {
animation-delay: 0.4s;
}
.chat-container {
height: calc(100vh - 180px);
}
@media (max-width: 640px) {
.chat-container {
height: calc(100vh - 160px);
}
}
.message-animation {
animation: fadeIn 0.3s ease-out;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
</style>
</head>
<body class="bg-gray-50 font-sans">
<div class="container mx-auto max-w-4xl px-4 py-6">
<!-- Header -->
<header class="flex items-center justify-between mb-6">
<div class="flex items-center space-x-3">
<div class="w-12 h-12 rounded-full bg-blue-100 flex items-center justify-center">
<i class="fas fa-user-md text-blue-600 text-xl"></i>
</div>
<div>
<h1 class="text-2xl font-bold text-gray-800">MediCare AI</h1>
<p class="text-sm text-gray-500">AI ๊ฑด๊ฐ• ์ƒ๋‹ด ์ฑ—๋ด‡</p>
</div>
</div>
<div class="flex space-x-2">
<button class="p-2 rounded-full bg-gray-100 hover:bg-gray-200 text-gray-600">
<i class="fas fa-history"></i>
</button>
<button class="p-2 rounded-full bg-gray-100 hover:bg-gray-200 text-gray-600">
<i class="fas fa-cog"></i>
</button>
</div>
</header>
<!-- Chat Container -->
<div class="bg-white rounded-xl shadow-md overflow-hidden mb-4 chat-container" id="chatContainer">
<!-- Welcome Message -->
<div class="p-4 border-b border-gray-100 bg-blue-50">
<div class="flex space-x-3">
<div class="flex-shrink-0">
<div class="w-8 h-8 rounded-full bg-blue-100 flex items-center justify-center">
<i class="fas fa-user-md text-blue-600 text-sm"></i>
</div>
</div>
<div class="message-animation">
<div class="text-sm font-medium text-gray-700">MediCare AI</div>
<div class="mt-1 text-sm text-gray-600">
์•ˆ๋…•ํ•˜์„ธ์š”! MediCare AI ๊ฑด๊ฐ• ์ƒ๋‹ด ์ฑ—๋ด‡์ž…๋‹ˆ๋‹ค. <br>
์–ด๋–ค ๊ฑด๊ฐ• ๊ด€๋ จ ๋ฌธ์ œ๋กœ ๋„์›€์„ ๋“œ๋ฆด๊นŒ์š”? <br>
์ฆ์ƒ, ๋ณต์šฉ ์ค‘์ธ ์•ฝ๋ฌผ, ๋˜๋Š” ๊ฑด๊ฐ• ๊ด€๋ จ ์งˆ๋ฌธ์„ ์•Œ๋ ค์ฃผ์„ธ์š”.
</div>
<div class="mt-3 flex flex-wrap gap-2">
<button onclick="quickQuestion('๋‘ํ†ต์ด ์‹ฌํ•ด์š”')" class="px-3 py-1 text-xs bg-blue-50 hover:bg-blue-100 text-blue-600 rounded-full border border-blue-100 transition">
๋‘ํ†ต์ด ์‹ฌํ•ด์š”
</button>
<button onclick="quickQuestion('๋ณตํ†ต์ด ์žˆ์–ด์š”')" class="px-3 py-1 text-xs bg-blue-50 hover:bg-blue-100 text-blue-600 rounded-full border border-blue-100 transition">
๋ณตํ†ต์ด ์žˆ์–ด์š”
</button>
<button onclick="quickQuestion('๊ฐ๊ธฐ ์ฆ์ƒ์ด ์žˆ์–ด์š”')" class="px-3 py-1 text-xs bg-blue-50 hover:bg-blue-100 text-blue-600 rounded-full border border-blue-100 transition">
๊ฐ๊ธฐ ์ฆ์ƒ์ด ์žˆ์–ด์š”
</button>
<button onclick="quickQuestion('์ŠคํŠธ๋ ˆ์Šค ๊ด€๋ฆฌ ๋ฐฉ๋ฒ•')" class="px-3 py-1 text-xs bg-blue-50 hover:bg-blue-100 text-blue-600 rounded-full border border-blue-100 transition">
์ŠคํŠธ๋ ˆ์Šค ๊ด€๋ฆฌ ๋ฐฉ๋ฒ•
</button>
</div>
</div>
</div>
</div>
<!-- Chat Messages will be appended here -->
<div id="chatMessages" class="overflow-y-auto h-full p-4 space-y-4"></div>
</div>
<!-- Input Area -->
<div class="bg-white rounded-xl shadow-md p-4">
<div class="flex items-center space-x-2">
<button class="p-2 rounded-full text-gray-500 hover:bg-gray-100">
<i class="fas fa-plus"></i>
</button>
<div class="flex-grow relative">
<input
type="text"
id="userInput"
placeholder="์ฆ์ƒ์ด๋‚˜ ๊ฑด๊ฐ• ๊ด€๋ จ ์งˆ๋ฌธ์„ ์ž…๋ ฅํ•˜์„ธ์š”..."
class="w-full py-3 px-4 border border-gray-200 rounded-full focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
onkeypress="handleKeyPress(event)"
>
<button class="absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-blue-500">
<i class="far fa-smile"></i>
</button>
</div>
<button onclick="sendMessage()" class="p-3 rounded-full bg-blue-600 text-white hover:bg-blue-700 transition">
<i class="fas fa-paper-plane"></i>
</button>
</div>
<div class="mt-3 text-xs text-gray-500 text-center">
์ฐธ๊ณ : ์ด ์ฑ—๋ด‡์€ ์ „๋ฌธ ์˜๋ฃŒ ์ƒ๋‹ด์„ ๋Œ€์ฒดํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์‹ฌ๊ฐํ•œ ์ฆ์ƒ์ด ์žˆ์„ ๊ฒฝ์šฐ ์ฆ‰์‹œ ๋ณ‘์›์„ ๋ฐฉ๋ฌธํ•˜์„ธ์š”.
</div>
</div>
<!-- Quick Action Buttons (Mobile) -->
<div class="sm:hidden mt-4 flex justify-around">
<button onclick="quickQuestion('์‘๊ธ‰ ์ƒํ™ฉ์ด์—์š”')" class="px-4 py-2 bg-red-100 hover:bg-red-200 text-red-600 rounded-full text-sm font-medium">
<i class="fas fa-bell mr-1"></i> ์‘๊ธ‰
</button>
<button onclick="showSymptomsList()" class="px-4 py-2 bg-green-100 hover:bg-green-200 text-green-600 rounded-full text-sm font-medium">
<i class="fas fa-list-ul mr-1"></i> ์ฆ์ƒ ๋ชฉ๋ก
</button>
<button onclick="quickQuestion('๋ณ‘์› ์ฐพ๊ธฐ')" class="px-4 py-2 bg-purple-100 hover:bg-purple-200 text-purple-600 rounded-full text-sm font-medium">
<i class="fas fa-hospital mr-1"></i> ๋ณ‘์› ์ฐพ๊ธฐ
</button>
</div>
</div>
<script>
// Sample responses for demonstration
const botResponses = {
"๋‘ํ†ต์ด ์‹ฌํ•ด์š”": [
"๋‘ํ†ต์ด ์‹ฌํ•˜์‹œ๊ตฐ์š”. ๋ช‡ ๊ฐ€์ง€ ์ถ”๊ฐ€ ์ •๋ณด๋ฅผ ์•Œ๋ ค์ฃผ์‹œ๊ฒ ์–ด์š”?",
"1. ๋‘ํ†ต์ด ์–ผ๋งˆ๋‚˜ ์ง€์†๋˜์—ˆ๋‚˜์š”? (๋ช‡ ์‹œ๊ฐ„/๋ช‡ ์ผ)",
"2. ์–ด๋А ๋ถ€์œ„๊ฐ€ ์•„ํ”„์‹ ๊ฐ€์š”? (์ด๋งˆ, ๋’ท๋ชฉ, ํ•œ์ชฝ ๋“ฑ)",
"3. ์ถ”๊ฐ€ ์ฆ์ƒ์ด ์žˆ๋‚˜์š”? (๊ตฌํ† , ์‹œ์•ผ ์ด์ƒ, ๋ฐœ์—ด ๋“ฑ)",
"์ผ๋ฐ˜์ ์œผ๋กœ ์ŠคํŠธ๋ ˆ์Šค, ์ˆ˜๋ฉด ๋ถ€์กฑ, ํƒˆ์ˆ˜ ๋“ฑ์ด ๋‘ํ†ต์˜ ์›์ธ์ด ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ถฉ๋ถ„ํ•œ ํœด์‹๊ณผ ๋ฌผ ์„ญ์ทจ๋ฅผ ๊ถŒ์žฅ๋“œ๋ฆฝ๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ ์ง€์†๋˜๊ฑฐ๋‚˜ ์‹ฌํ•ด์ง€๋ฉด ๋ณ‘์›์„ ๋ฐฉ๋ฌธํ•˜์‹œ๊ธธ ๋ฐ”๋ž๋‹ˆ๋‹ค."
],
"๋ณตํ†ต์ด ์žˆ์–ด์š”": [
"๋ณตํ†ต์ด ์žˆ์œผ์‹œ๊ตฐ์š”. ๋” ์ž์„ธํžˆ ์„ค๋ช…ํ•ด์ฃผ์‹ค ์ˆ˜ ์žˆ๋‚˜์š”?",
"1. ์–ด๋А ๋ถ€์œ„๊ฐ€ ์•„ํ”„์‹ ๊ฐ€์š”? (์œ„, ๋ฐฐ๊ผฝ ์ฃผ๋ณ€, ์•„๋žซ๋ฐฐ ๋“ฑ)",
"2. ํ†ต์ฆ์˜ ์„ฑ๊ฒฉ์ด ์–ด๋–ป๊ฒŒ ๋˜๋‚˜์š”? (์ฐŒ๋ฅด๋Š” ๋“ฏ, ๋ฌต์งํ•œ, ์ฅ์–ด์งœ๋Š” ๋“ฏ ๋“ฑ)",
"3. ์ถ”๊ฐ€ ์ฆ์ƒ์ด ์žˆ๋‚˜์š”? (์„ค์‚ฌ, ๋ณ€๋น„, ๊ตฌํ† , ๋ฐœ์—ด ๋“ฑ)",
"๊ฐ€๋ฒผ์šด ๋ณตํ†ต์˜ ๊ฒฝ์šฐ ์†Œํ™”๋ถˆ๋Ÿ‰, ๊ฐ€์Šค ์ฐจ์ž„, ์‹์ค‘๋… ๋“ฑ์ด ์›์ธ์ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ ๊ธ‰์„ฑ ๋งน์žฅ์—ผ์ด๋‚˜ ๋‹ค๋ฅธ ์ค‘์ฆ ์งˆํ™˜์˜ ๊ฐ€๋Šฅ์„ฑ๋„ ์žˆ์œผ๋‹ˆ ํ†ต์ฆ์ด ์‹ฌํ•˜๊ฑฐ๋‚˜ ์ง€์†๋˜๋ฉด ๋ฐ˜๋“œ์‹œ ๋ณ‘์›์„ ๋ฐฉ๋ฌธํ•˜์„ธ์š”."
],
"๊ฐ๊ธฐ ์ฆ์ƒ์ด ์žˆ์–ด์š”": [
"๊ฐ๊ธฐ ์ฆ์ƒ์ด ์žˆ์œผ์‹œ๊ตฐ์š”. ์–ด๋–ค ์ฆ์ƒ์ด ์žˆ๋‚˜์š”?",
"1. ๋ฐœ์—ด์ด ์žˆ๋‚˜์š”? ์žˆ๋‹ค๋ฉด ์ฒด์˜จ์€ ์–ด๋–ป๊ฒŒ ๋˜๋‚˜์š”?",
"2. ๊ธฐ์นจ, ์ธํ›„ํ†ต, ์ฝง๋ฌผ ์ค‘ ์–ด๋–ค ์ฆ์ƒ์ด ์žˆ๋‚˜์š”?",
"3. ์ฆ์ƒ์ด ์–ผ๋งˆ๋‚˜ ์ง€์†๋˜์—ˆ๋‚˜์š”?",
"๊ฐ๊ธฐ๋Š” ๋Œ€๊ฐœ 7-10์ผ ์ •๋„ ์ง€์†๋ฉ๋‹ˆ๋‹ค. ์ถฉ๋ถ„ํ•œ ํœด์‹๊ณผ ์ˆ˜๋ถ„ ์„ญ์ทจ, ๋น„ํƒ€๋ฏผ ์„ญ์ทจ๊ฐ€ ๋„์›€์ด ๋ฉ๋‹ˆ๋‹ค. ๊ณ ์—ด(38.5ยฐC ์ด์ƒ)์ด ์ง€์†๋˜๊ฑฐ๋‚˜ ํ˜ธํก๊ณค๋ž€ ๋“ฑ์ด ์žˆ์œผ๋ฉด ๋ณ‘์›์„ ๋ฐฉ๋ฌธํ•˜์„ธ์š”."
],
"์ŠคํŠธ๋ ˆ์Šค ๊ด€๋ฆฌ ๋ฐฉ๋ฒ•": [
"์ŠคํŠธ๋ ˆ์Šค ๊ด€๋ฆฌ๋Š” ๊ฑด๊ฐ• ์œ ์ง€์— ๋งค์šฐ ์ค‘์š”ํ•ฉ๋‹ˆ๋‹ค. ๋ช‡ ๊ฐ€์ง€ ๋ฐฉ๋ฒ•์„ ์•Œ๋ ค๋“œ๋ฆด๊ฒŒ์š”:",
"1. ๊ทœ์น™์ ์ธ ์šด๋™: ํ•˜๋ฃจ 30๋ถ„ ์ •๋„์˜ ์œ ์‚ฐ์†Œ ์šด๋™์ด ๋„์›€์ด ๋ฉ๋‹ˆ๋‹ค.",
"2. ์ถฉ๋ถ„ํ•œ ์ˆ˜๋ฉด: ํ•˜๋ฃจ 7-8์‹œ๊ฐ„์˜ ์งˆ ์ข‹์€ ์ˆ˜๋ฉด์„ ์ทจํ•˜์„ธ์š”.",
"3. ๋ช…์ƒ ๋˜๋Š” ์‹ฌํ˜ธํก: ํ•˜๋ฃจ 5-10๋ถ„์”ฉ ๋ช…์ƒ์ด๋‚˜ ๊นŠ์€ ํ˜ธํก์„ ํ•ด๋ณด์„ธ์š”.",
"4. ์ทจ๋ฏธ ํ™œ๋™: ์ฆ๊ฑฐ์›€์„ ์ฃผ๋Š” ํ™œ๋™์— ์‹œ๊ฐ„์„ ํ• ๋‹นํ•˜์„ธ์š”.",
"5. ์‚ฌํšŒ์  ์ง€์›: ์นœ๊ตฌ๋‚˜ ๊ฐ€์กฑ๊ณผ์˜ ๋Œ€ํ™”๊ฐ€ ํฐ ๋„์›€์ด ๋ฉ๋‹ˆ๋‹ค.",
"์ŠคํŠธ๋ ˆ์Šค๊ฐ€ ์ง€์†๋˜์–ด ์ผ์ƒ ์ƒํ™œ์— ์ง€์žฅ์„ ์ค€๋‹ค๋ฉด ์ „๋ฌธ๊ฐ€์™€ ์ƒ๋‹ดํ•˜๋Š” ๊ฒƒ์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค."
],
"์‘๊ธ‰ ์ƒํ™ฉ์ด์—์š”": [
"<span class='font-bold text-red-600'>์‘๊ธ‰ ์ƒํ™ฉ์ธ ๊ฒฝ์šฐ ์ฆ‰์‹œ 119์— ์—ฐ๋ฝํ•˜๊ฑฐ๋‚˜ ๊ฐ€๊นŒ์šด ์‘๊ธ‰์‹ค์„ ๋ฐฉ๋ฌธํ•˜์„ธ์š”.</span>",
"๋‹ค์Œ๊ณผ ๊ฐ™์€ ์ฆ์ƒ์ด ์žˆ์œผ๋ฉด ์ฆ‰์‹œ ์‘๊ธ‰์ฒ˜์น˜๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค:",
"- ํ˜ธํก๊ณค๋ž€ ๋˜๋Š” ์ˆจ์„ ์‰ด ์ˆ˜ ์—†์Œ",
"- ์‹ฌํ•œ ๊ฐ€์Šด ํ†ต์ฆ ๋˜๋Š” ์••๋ฐ•๊ฐ",
"- ์˜์‹ ์†Œ์‹ค ๋˜๋Š” ํ˜ผ๋ž€ ์ƒํƒœ",
"- ์‹ฌํ•œ ์ถœํ˜ˆ",
"- ์‹ฌํ•œ ๋‘ํ†ต๊ณผ ํ•จ๊ป˜ ๊ตฌํ†  ๋˜๋Š” ์‹œ์•ผ ์ด์ƒ",
"์ด ์ฑ—๋ด‡์€ ์‘๊ธ‰ ์ƒํ™ฉ์— ๋Œ€์ฒ˜ํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ์œ„ํ—˜ ๊ฐ€๋Šฅ์„ฑ์ด ์žˆ๋‹ค๊ณ  ํŒ๋‹จ๋˜๋ฉด ์ฆ‰์‹œ ์ „๋ฌธ ์˜๋ฃŒ๊ธฐ๊ด€์„ ์ฐพ์œผ์„ธ์š”."
],
"๋ณ‘์› ์ฐพ๊ธฐ": [
"๊ฐ€๊นŒ์šด ๋ณ‘์›์„ ์ฐพ๊ณ  ๊ณ„์‹œ๊ตฐ์š”. ํ˜„์žฌ ์œ„์น˜ ๊ธฐ๋ฐ˜์œผ๋กœ ๊ฒ€์ƒ‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.",
"1. <button class='text-blue-600 underline'>๋‚ด ์œ„์น˜์—์„œ ๊ฐ€๊นŒ์šด ๋ณ‘์› ์ฐพ๊ธฐ</button>",
"2. <button class='text-blue-600 underline'>์‘๊ธ‰์‹ค์ด ์žˆ๋Š” ๋ณ‘์› ์ฐพ๊ธฐ</button>",
"3. <button class='text-blue-600 underline'>์•ผ๊ฐ„์ง„๋ฃŒ ๊ฐ€๋Šฅ ๋ณ‘์› ์ฐพ๊ธฐ</button>",
"๋” ์ •ํ™•ํ•œ ์ •๋ณด๋ฅผ ์›ํ•˜์‹œ๋ฉด ๋ณด๊ฑด๋ณต์ง€๋ถ€ ํ™ˆํŽ˜์ด์ง€(www.mohw.go.kr) ๋˜๋Š” ์ง€์—ญ ๋ณด๊ฑด์†Œ์— ๋ฌธ์˜ํ•˜์‹ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค."
],
"default": [
"์ดํ•ดํ•˜์ง€ ๋ชปํ–ˆ์–ด์š”. ๊ฑด๊ฐ• ๊ด€๋ จ ์ฆ์ƒ์ด๋‚˜ ์งˆ๋ฌธ์„ ๋” ์ž์„ธํžˆ ์„ค๋ช…ํ•ด์ฃผ์‹œ๊ฒ ์–ด์š”?",
"์˜ˆ๋ฅผ ๋“ค์–ด ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์งˆ๋ฌธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค:",
"- \"์–ด์ œ๋ถ€ํ„ฐ ์—ด์ด 38๋„ ๋‚˜๊ณ  ๊ธฐ์นจ์ด ๋‚˜์š”\"",
"- \"์™ผ์ชฝ ํŒ”์— ์ €๋ฆผ ํ˜„์ƒ์ด ์žˆ๋Š”๋ฐ ์–ด๋–ค ๊ฒŒ ์›์ธ์ผ๊นŒ์š”?\"",
"- \"ํ˜ˆ์••์„ ๋‚ฎ์ถ”๋Š” ์ž์—ฐ์ ์ธ ๋ฐฉ๋ฒ•์ด ์žˆ์„๊นŒ์š”?\""
]
};
// Function to send message
function sendMessage() {
const userInput = document.getElementById('userInput');
const message = userInput.value.trim();
if (message === '') return;
// Add user message to chat
addMessageToChat(message, 'user');
userInput.value = '';
// Show typing indicator
showTypingIndicator();
// Simulate bot thinking
setTimeout(() => {
// Remove typing indicator
removeTypingIndicator();
// Generate bot response
let response;
for (const key in botResponses) {
if (message.toLowerCase().includes(key.toLowerCase())) {
response = botResponses[key];
break;
}
}
if (!response) {
response = botResponses['default'];
}
// Add bot response to chat
response.forEach((line, index) => {
setTimeout(() => {
addMessageToChat(line, 'bot');
}, index * 500);
});
}, 1000 + Math.random() * 1000);
}
// Function to handle quick questions
function quickQuestion(question) {
document.getElementById('userInput').value = question;
sendMessage();
}
// Function to show symptoms list
function showSymptomsList() {
const symptoms = [
"๋‘ํ†ต", "๋ณตํ†ต", "๋ฐœ์—ด", "๊ธฐ์นจ", "์ธํ›„ํ†ต",
"๋ฉ”์Šค๊บผ์›€", "๊ตฌํ† ", "ํ˜„๊ธฐ์ฆ", "ํ”ผ๋กœ๊ฐ",
"ํ˜ธํก๊ณค๋ž€", "ํ‰ํ†ต", "๊ด€์ ˆํ†ต", "๊ทผ์œกํ†ต",
"์„ค์‚ฌ", "๋ณ€๋น„", "ํ”ผ๋ถ€ ๋ฐœ์ง„", "์‹œ์•ผ ์ด์ƒ"
];
let message = "<div class='font-medium mb-2'>์ฆ์ƒ ๋ชฉ๋ก:</div><div class='flex flex-wrap gap-2'>";
symptoms.forEach(symptom => {
message += `<button onclick="quickQuestion('${symptom}์ด ์žˆ์–ด์š”')" class="px-3 py-1 text-xs bg-gray-100 hover:bg-gray-200 text-gray-700 rounded-full">${symptom}</button>`;
});
message += "</div>";
addMessageToChat(message, 'bot');
}
// Function to add message to chat
function addMessageToChat(message, sender) {
const chatMessages = document.getElementById('chatMessages');
const messageDiv = document.createElement('div');
messageDiv.className = 'message-animation';
if (sender === 'user') {
messageDiv.innerHTML = `
<div class="flex justify-end">
<div class="max-w-xs sm:max-w-md md:max-w-lg bg-blue-600 text-white rounded-xl px-4 py-2">
${message}
</div>
</div>
`;
} else {
messageDiv.innerHTML = `
<div class="flex space-x-3">
<div class="flex-shrink-0">
<div class="w-8 h-8 rounded-full bg-blue-100 flex items-center justify-center">
<i class="fas fa-user-md text-blue-600 text-sm"></i>
</div>
</div>
<div class="max-w-xs sm:max-w-md md:max-w-lg bg-gray-100 text-gray-800 rounded-xl px-4 py-2">
${message}
</div>
</div>
`;
}
chatMessages.appendChild(messageDiv);
chatMessages.scrollTop = chatMessages.scrollHeight;
}
// Function to show typing indicator
function showTypingIndicator() {
const chatMessages = document.getElementById('chatMessages');
const typingDiv = document.createElement('div');
typingDiv.className = 'flex space-x-3';
typingDiv.id = 'typingIndicator';
typingDiv.innerHTML = `
<div class="flex-shrink-0">
<div class="w-8 h-8 rounded-full bg-blue-100 flex items-center justify-center">
<i class="fas fa-user-md text-blue-600 text-sm"></i>
</div>
</div>
<div class="bg-gray-100 text-gray-800 rounded-xl px-4 py-2">
<div class="typing-indicator">
<span>.</span><span>.</span><span>.</span>
</div>
</div>
`;
chatMessages.appendChild(typingDiv);
chatMessages.scrollTop = chatMessages.scrollHeight;
}
// Function to remove typing indicator
function removeTypingIndicator() {
const typingIndicator = document.getElementById('typingIndicator');
if (typingIndicator) {
typingIndicator.remove();
}
}
// Function to handle enter key press
function handleKeyPress(event) {
if (event.key === 'Enter') {
sendMessage();
}
}
</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=joung/joung-joung" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>