Spaces:
Running
Running
File size: 18,233 Bytes
addf17e |
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 |
<!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> |