lab-wizard-hub / index.html
CSNET's picture
ช่วยเพิ่มปุ่มเมนู Advance Lab อัปเดตเว็บแอป HTML5 (มือถือเป็นหลัก) เดิมให้:
000c8fc verified
Raw History Blame
143 kB
<!DOCTYPE html> <html lang="th"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <title>Whoop Thailand - ติดตามสุขภาพ 24 ชั่วโมง</title> <script src="https://cdn.tailwindcss.com"></script> <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script> <script src="https://unpkg.com/feather-icons"></script> <style> @import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700&display=swap'); * { font-family: 'Kanit', sans-serif; } .gradient-bg { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); } .card-shadow { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); } .health-metric-card { transition: all 0.3s ease; } .health-metric-card:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); } .progress-ring { transform: rotate(-90deg); } .tab-active { border-bottom: 3px solid #667eea; color: #667eea; } .scroll-hidden::-webkit-scrollbar { display: none; } .scroll-hidden { -ms-overflow-style: none; scrollbar-width: none; } @keyframes pulse-dot { 0%, 60%, 100% { opacity: 0.3; } 30% { opacity: 1; } } .pulse-dot { animation: pulse-dot 2s infinite; } .metric-trend-up { color: #10b981; } .metric-trend-down { color: #ef4444; } .metric-trend-neutral { color: #6b7280; } </style> </head> <body class="bg-gray-50"> <!-- Mobile Container --> <div class="max-w-md mx-auto bg-white min-h-screen relative"> <!-- Header --> <div class="gradient-bg text-white p-4 pb-6"> <div class="flex justify-between items-center mb-4"> <div class="flex items-center space-x-2"> <div class="w-10 h-10 bg-white rounded-full flex items-center justify-center"> <span class="text-purple-600 font-bold text-xl">W</span> </div> <div> <h1 class="text-lg font-semibold">Whoop</h1> <p class="text-xs opacity-90">สวัสดี, สมชาย 👋</p> </div> </div> <div class="flex items-center space-x-3"> <button onclick="showNotifications()" class="relative"> <i data-feather="bell" class="w-5 h-5"></i> <span class="absolute -top-1 -right-1 w-2 h-2 bg-red-500 rounded-full pulse-dot"></span> </button> <button onclick="showProfile()"> <img src="http://static.photos/people/40x40/45" alt="Profile" class="w-8 h-8 rounded-full border-2 border-white"> </button> </div> </div> <!-- Score Overview --> <div class="bg-white/20 backdrop-blur rounded-2xl p-4"> <div class="grid grid-cols-3 gap-4 text-center"> <div> <p class="text-2xl font-bold">87</p> <p class="text-xs opacity-90">คะแนนสุขภาพ</p> </div> <div> <p class="text-2xl font-bold">72%</p> <p class="text-xs opacity-90">การฟื้นตัว</p> </div> <div> <p class="text-2xl font-bold">8.2</p> <p class="text-xs opacity-90">ชั่วโมงนอน</p> </div> </div> </div> </div> <!-- Navigation Tabs --> <div class="bg-white sticky top-0 z-10 border-b"> <div class="flex justify-around p-2"> <button onclick="switchTab('dashboard')" class="tab-btn px-4 py-2 text-sm font-medium tab-active transition-all" data-tab="dashboard"> แดชบอร์ด </button> <button onclick="switchTab('metrics')" class="tab-btn px-4 py-2 text-sm font-medium text-gray-600 transition-all" data-tab="metrics"> สถิติ 160+ </button> <button onclick="switchTab('insights')" class="tab-btn px-4 py-2 text-sm font-medium text-gray-600 transition-all" data-tab="insights"> ข้อมูลเชิงลึก </button> <button onclick="switchTab('if-training')" class="tab-btn px-4 py-2 text-sm font-medium text-gray-600 transition-all" data-tab="if-training"> ฝึก IF </button> <button onclick="switchTab('impacts')" class="tab-btn px-4 py-2 text-sm font-medium text-gray-600 transition-all" data-tab="impacts"> Impacts </button> <button onclick="switchTab('goals')" class="tab-btn px-4 py-2 text-sm font-medium text-gray-600 transition-all" data-tab="goals"> เป้าหมาย </button> <button onclick="switchTab('lab')" class="tab-btn px-4 py-2 text-sm font-medium text-gray-600 transition-all" data-tab="lab"> Lab 🧪 </button> </div> </div> <!-- Content Area --> <div class="pb-20"> <!-- Dashboard Tab --> <div id="dashboard" class="tab-content p-4"> <!-- Quick Stats --> <div class="grid grid-cols-2 gap-3 mb-4"> <div class="bg-gradient-to-br from-purple-500 to-pink-500 rounded-xl p-4 text-white"> <div class="flex items-center justify-between mb-2"> <i data-feather="heart" class="w-5 h-5"></i> <span class="text-xs bg-white/20 px-2 py-1 rounded-full">ขณะนี้</span> </div> <p class="text-2xl font-bold">68</p> <p class="text-xs opacity-90">ชีพจร BPM</p> </div> <div class="bg-gradient-to-br from-blue-500 to-cyan-500 rounded-xl p-4 text-white"> <div class="flex items-center justify-between mb-2"> <i data-feather="zap" class="w-5 h-5"></i> <span class="text-xs bg-white/20 px-2 py-1 rounded-full metric-trend-up">↑ 12%</span> </div> <p class="text-2xl font-bold">425</p> <p class="text-xs opacity-90">แคลอรีที่เผา</p> </div> </div> <!-- Today's Activities --> <div class="mb-4"> <h3 class="font-semibold mb-3 flex items-center"> <i data-feather="activity" class="w-4 h-4 mr-2 text-purple-600"></i> กิจกรรมวันนี้ </h3> <div class="space-y-2"> <div class="bg-white rounded-lg p-3 card-shadow flex items-center justify-between"> <div class="flex items-center space-x-3"> <div class="w-10 h-10 bg-green-100 rounded-full flex items-center justify-center"> <i data-feather="moon" class="w-5 h-5 text-green-600"></i> </div> <div> <p class="font-medium text-sm">การนอนหลับ</p> <p class="text-xs text-gray-500">คุณภาพดีมาก</p> </div> </div> <div class="text-right"> <p class="text-sm font-semibold">8.2 ชม.</p> <p class="text-xs text-gray-500">คะแนน 92</p> </div> </div> <div class="bg-white rounded-lg p-3 card-shadow flex items-center justify-between"> <div class="flex items-center space-x-3"> <div class="w-10 h-10 bg-blue-100 rounded-full flex items-center justify-center"> <i data-feather="droplet" class="w-5 h-5 text-blue-600"></i> </div> <div> <p class="font-medium text-sm">การดื่มน้ำ</p> <p class="text-xs text-gray-500">เหลืออีก 500 มล.</p> </div> </div> <div class="text-right"> <p class="text-sm font-semibold">1.5 ลิตร</p> <p class="text-xs text-gray-500">75%</p> </div> </div> <div class="bg-white rounded-lg p-3 card-shadow flex items-center justify-between"> <div class="flex items-center space-x-3"> <div class="w-10 h-10 bg-orange-100 rounded-full flex items-center justify-center"> <i data-feather="trending-up" class="w-5 h-5 text-orange-600"></i> </div> <div> <p class="font-medium text-sm">การออกกำลังกาย</p> <p class="text-xs text-gray-500">วิ่ง 5 กม.</p> </div> </div> <div class="text-right"> <p class="text-sm font-semibold">32 นาที</p> <p class="text-xs text-gray-500">คะแนน 88</p> </div> </div> </div> </div> <!-- Weekly Progress --> <div> <h3 class="font-semibold mb-3 flex items-center"> <i data-feather="calendar" class="w-4 h-4 mr-2 text-purple-600"></i> ความคืบหน้ารายสัปดาห์ </h3> <div class="bg-white rounded-xl p-4 card-shadow"> <div class="grid grid-cols-7 gap-2 mb-3"> <div class="text-center"> <p class="text-xs text-gray-500 mb-1">จ</p> <div class="h-16 bg-gray-100 rounded-lg flex items-end justify-center p-1"> <div class="w-full bg-purple-500 rounded" style="height: 60%"></div> </div> </div> <div class="text-center"> <p class="text-xs text-gray-500 mb-1">อ</p> <div class="h-16 bg-gray-100 rounded-lg flex items-end justify-center p-1"> <div class="w-full bg-purple-500 rounded" style="height: 80%"></div> </div> </div> <div class="text-center"> <p class="text-xs text-gray-500 mb-1">พ</p> <div class="h-16 bg-gray-100 rounded-lg flex items-end justify-center p-1"> <div class="w-full bg-purple-500 rounded" style="height: 70%"></div> </div> </div> <div class="text-center"> <p class="text-xs text-gray-500 mb-1">พฤ</p> <div class="h-16 bg-gray-100 rounded-lg flex items-end justify-center p-1"> <div class="w-full bg-purple-500 rounded" style="height: 90%"></div> </div> </div> <div class="text-center"> <p class="text-xs text-gray-500 mb-1">ศ</p> <div class="h-16 bg-gray-100 rounded-lg flex items-end justify-center p-1"> <div class="w-full bg-purple-500 rounded" style="height: 65%"></div> </div> </div> <div class="text-center"> <p class="text-xs text-gray-500 mb-1">ส</p> <div class="h-16 bg-gray-100 rounded-lg flex items-end justify-center p-1"> <div class="w-full bg-purple-300 rounded" style="height: 40%"></div> </div> </div> <div class="text-center"> <p class="text-xs text-gray-500 mb-1">อา</p> <div class="h-16 bg-purple-100 rounded-lg flex items-end justify-center p-1"> <div class="w-full bg-purple-300 rounded animate-pulse" style="height: 30%"></div> </div> </div> </div> <div class="flex justify-between text-sm"> <span class="text-gray-600">ค่าเฉลี่ยคะแนน</span> <span class="font-semibold text-purple-600">73.5 / 100</span> </div> </div> </div> </div> <!-- Metrics Tab (160+ Health Metrics) --> <div id="metrics" class="tab-content hidden p-4"> <!-- Search Bar --> <div class="mb-4"> <div class="relative"> <i data-feather="search" class="absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"></i> <input type="text" placeholder="ค้นหาสถิติทั้งหมด 160+ รายการ..." class="w-full pl-10 pr-4 py-2 border border-gray-200 rounded-lg focus:outline-none focus:border-purple-500"> </div> </div> <!-- Metric Categories --> <div class="mb-4"> <div class="flex space-x-2 overflow-x-auto scroll-hidden pb-2"> <button class="px-4 py-1 bg-purple-600 text-white rounded-full text-sm whitespace-nowrap">ทั้งหมด</button> <button class="px-4 py-1 bg-gray-200 text-gray-700 rounded-full text-sm whitespace-nowrap">หัวใจ</button> <button class="px-4 py-1 bg-gray-200 text-gray-700 rounded-full text-sm whitespace-nowrap">การนอน</button> <button class="px-4 py-1 bg-gray-200 text-gray-700 rounded-full text-sm whitespace-nowrap">การออกกำลังกาย</button> <button class="px-4 py-1 bg-gray-200 text-gray-700 rounded-full text-sm whitespace-nowrap">อาหาร</button> <button class="px-4 py-1 bg-gray-200 text-gray-700 rounded-full text-sm whitespace-nowrap">ความเครียด</button> </div> </div> <!-- Health Metrics Grid --> <div class="space-y-4"> <!-- Heart Metrics --> <div class="bg-white rounded-xl p-4 card-shadow"> <h4 class="font-semibold mb-3 flex items-center text-purple-600"> <i data-feather="heart" class="w-4 h-4 mr-2"></i> หัวใจและไหลเลือด (12 รายการ) </h4> <div class="grid grid-cols-2 gap-3"> <div class="health-metric-card bg-gray-50 rounded-lg p-3"> <p class="text-xs text-gray-600">ชีพจรขณะพัก</p> <p class="text-lg font-bold">58 BPM</p> <span class="text-xs metric-trend-up">↓ 2 จากเมื่อวาน</span> </div> <div class="health-metric-card bg-gray-50 rounded-lg p-3"> <p class="text-xs text-gray-600">ความดันซิสโทล</p> <p class="text-lg font-bold">120 mmHg</p> <span class="text-xs metric-trend-neutral">ปกติ</span> </div> <div class="health-metric-card bg-gray-50 rounded-lg p-3"> <p class="text-xs text-gray-600">ความดันไดแอสโทล</p> <p class="text-lg font-bold">80 mmHg</p> <span class="text-xs metric-trend-neutral">ปกติ</span> </div> <div class="health-metric-card bg-gray-50 rounded-lg p-3"> <p class="text-xs text-gray-600">HRV</p> <p class="text-lg font-bold">42 ms</p> <span class="text-xs metric-trend-up">↑ 5 จากเมื่อวาน</span> </div> <div class="health-metric-card bg-gray-50 rounded-lg p-3"> <p class="text-xs text-gray-600">ออกซิเจนในเลือด</p> <p class="text-lg font-bold">98%</p> <span class="text-xs metric-trend-neutral">ดีมาก</span> </div> <div class="health-metric-card bg-gray-50 rounded-lg p-3"> <p class="text-xs text-gray-600">ชีพจรสูงสุด</p> <p class="text-lg font-bold">165 BPM</p> <span class="text-xs metric-trend-neutral">85% ของสูงสุด</span> </div> </div> </div> <!-- Sleep Metrics --> <div class="bg-white rounded-xl p-4 card-shadow"> <h4 class="font-semibold mb-3 flex items-center text-purple-600"> <i data-feather="moon" class="w-4 h-4 mr-2"></i> การนอนหลับ (18 รายการ) </h4> <div class="grid grid-cols-2 gap-3"> <div class="health-metric-card bg-gray-50 rounded-lg p-3"> <p class="text-xs text-gray-600">ระยะเวลานอน</p> <p class="text-lg font-bold">8.2 ชม.</p> <span class="text-xs metric-trend-up">↑ 0.5 ชม.</span> </div> <div class="health-metric-card bg-gray-50 rounded-lg p-3"> <p class="text-xs text-gray-600">คุณภาพการนอน</p> <p class="text-lg font-bold">85%</p> <span class="text-xs metric-trend-up">ดีมาก</span> </div> <div class="health-metric-card bg-gray-50 rounded-lg p-3"> <p class="text-xs text-gray-600">REM Sleep</p> <p class="text-lg font-bold">1.8 ชม.</p> <span class="text-xs metric-trend-neutral">22% ของทั้งหมด</span> </div> <div class="health-metric-card bg-gray-50 rounded-lg p-3"> <p class="text-xs text-gray-600">Deep Sleep</p> <p class="text-lg font-bold">2.1 ชม.</p> <span class="text-xs metric-trend-neutral">26% ของทั้งหมด</span> </div> <div class="health-metric-card bg-gray-50 rounded-lg p-3"> <p class="text-xs text-gray-600">Light Sleep</p> <p class="text-lg font-bold">4.3 ชม.</p> <span class="text-xs metric-trend-neutral">52% ของทั้งหมด</span> </div> <div class="health-metric-card bg-gray-50 rounded-lg p-3"> <p class="text-xs text-gray-600">ตื่นขึ้นมา</p> <p class="text-lg font-bold">3 ครั้ง</p> <span class="text-xs metric-trend-down">↓ 1 ครั้ง</span> </div> </div> </div> <!-- Exercise Metrics --> <div class="bg-white rounded-xl p-4 card-shadow"> <h4 class="font-semibold mb-3 flex items-center text-purple-600"> <i data-feather="trending-up" class="w-4 h-4 mr-2"></i> การออกกำลังกาย (25 รายการ) </h4> <div class="grid grid-cols-2 gap-3"> <div class="health-metric-card bg-gray-50 rounded-lg p-3"> <p class="text-xs text-gray-600">ก้าวเดินวันนี้</p> <p class="text-lg font-bold">12,847</p> <span class="text-xs metric-trend-up">↑ 23%</span> </div> <div class="health-metric-card bg-gray-50 rounded-lg p-3"> <p class="text-xs text-gray-600">ระยะทาง</p> <p class="text-lg font-bold">8.2 กม.</p> <span class="text-xs metric-trend-up">↑ 1.2 กม.</span> </div> <div class="health-metric-card bg-gray-50 rounded-lg p-3"> <p class="text-xs text-gray-600">แคลอรีที่เผา</p> <p class="text-lg font-bold">425 kcal</p> <span class="text-xs metric-trend-up">↑ 15%</span> </div> <div class="health-metric-card bg-gray-50 rounded-lg p-3"> <p class="text-xs text-gray-600">เวลาออกกำลังกาย</p> <p class="text-lg font-bold">32 นาที</p> <span class="text-xs metric-trend-neutral">ถึงเป้า</span> </div> <div class="health-metric-card bg-gray-50 rounded-lg p-3"> <p class="text-xs text-gray-600">ความเข้มข้น</p> <p class="text-lg font-bold">75%</p> <span class="text-xs metric-trend-neutral">ปานกลาง</span> </div> <div class="health-metric-card bg-gray-50 rounded-lg p-3"> <p class="text-xs text-gray-600">ชั้นขั้น</p> <p class="text-lg font-bold">45 ชั้น</p> <span class="text-xs metric-trend-up">↑ 10 ชั้น</span> </div> </div> </div> <!-- Nutrition Metrics --> <div class="bg-white rounded-xl p-4 card-shadow"> <h4 class="font-semibold mb-3 flex items-center text-purple-600"> <i data-feather="coffee" class="w-4 h-4 mr-2"></i> โภชนาการ (22 รายการ) </h4> <div class="grid grid-cols-2 gap-3"> <div class="health-metric-card bg-gray-50 rounded-lg p-3"> <p class="text-xs text-gray-600">แคลอรีรับประทาน</p> <p class="text-lg font-bold">1,850 kcal</p> <span class="text-xs metric-trend-neutral">92% ของเป้า</span> </div> <div class="health-metric-card bg-gray-50 rounded-lg p-3"> <p class="text-xs text-gray-600">โปรตีน</p> <p class="text-lg font-bold">85 กรัม</p> <span class="text-xs metric-trend-up">เพียงพอ</span> </div> <div class="health-metric-card bg-gray-50 rounded-lg p-3"> <p class="text-xs text-gray-600">คาร์โบไฮเดรต</p> <p class="text-lg font-bold">230 กรัม</p> <span class="text-xs metric-trend-neutral">ปกติ</span> </div> <div class="health-metric-card bg-gray-50 rounded-lg p-3"> <p class="text-xs text-gray-600">ไขมัน</p> <p class="text-lg font-bold">65 กรัม</p> <span class="text-xs metric-trend-neutral">ปกติ</span> </div> <div class="health-metric-card bg-gray-50 rounded-lg p-3"> <p class="text-xs text-gray-600">น้ำตาล</p> <p class="text-lg font-bold">42 กรัม</p> <span class="text-xs metric-trend-down">↓ 5 กรัม</span> </div> <div class="health-metric-card bg-gray-50 rounded-lg p-3"> <p class="text-xs text-gray-600">ไฟเบอร์</p> <p class="text-lg font-bold">28 กรัม</p> <span class="text-xs metric-trend-up">↑ 2 กรัม</span> </div> </div> </div> <!-- Stress Metrics --> <div class="bg-white rounded-xl p-4 card-shadow"> <h4 class="font-semibold mb-3 flex items-center text-purple-600"> <i data-feather="alert-circle" class="w-4 h-4 mr-2"></i> ความเครียดและจิตใจ (15 รายการ) </h4> <div class="grid grid-cols-2 gap-3"> <div class="health-metric-card bg-gray-50 rounded-lg p-3"> <p class="text-xs text-gray-600">ระดับความเครียด</p> <p class="text-lg font-bold">28%</p> <span class="text-xs metric-trend-down">ต่ำ</span> </div> <div class="health-metric-card bg-gray-50 rounded-lg p-3"> <p class="text-xs text-gray-600">คอร์ติซอล</p> <p class="text-lg font-bold">12 nmol/L</p> <span class="text-xs metric-trend-down">↓ 2</span> </div> <div class="health-metric-card bg-gray-50 rounded-lg p-3"> <p class="text-xs text-gray-600">ความผ่อนคลาย</p> <p class="text-lg font-bold">85%</p> <span class="text-xs metric-trend-up">ดีมาก</span> </div> <div class="health-metric-card bg-gray-50 rounded-lg p-3"> <p class="text-xs text-gray-600">โฟกัส</p> <p class="text-lg font-bold">78%</p> <span class="text-xs metric-trend-neutral">ดี</span> </div> </div> </div> <!-- Load More --> <div class="text-center py-4"> <button class="text-purple-600 font-medium text-sm">แสดงเพิ่มเติม 93 รายการ ↓</button> </div> </div> </div> <!-- Insights Tab --> <div id="insights" class="tab-content hidden p-4"> <!-- AI Insights --> <div class="bg-gradient-to-br from-purple-500 to-pink-500 rounded-xl p-4 text-white mb-4"> <div class="flex items-center mb-2"> <i data-feather="cpu" class="w-5 h-5 mr-2"></i> <h3 class="font-semibold">ข้อมูลเชิงลึกจาก AI</h3> </div> <p class="text-sm leading-relaxed"> จากการวิเคราะห์ข้อมูล 7 วันที่ผ่านมา พบว่าคุณมีการฟื้นตัวดีขึ้น 15% เนื่องจากการนอนหลับที่เพิ่มขึ้นและการจัดการความเครียดที่ดีขึ้น แนะนำให้รักษากำหนดการนอนต่อเนื่อง </p> </div> <!-- Trends --> <div class="bg-white rounded-xl p-4 card-shadow mb-4"> <h3 class="font-semibold mb-3">แนวโน้มสำคัญ</h3> <div class="space-y-3"> <div class="flex items-center justify-between p-3 bg-green-50 rounded-lg"> <div class="flex items-center"> <i data-feather="trending-up" class="w-4 h-4 text-green-600 mr-3"></i> <div> <p class="font-medium text-sm">คุณภาพการนอนดีขึ้น</p> <p class="text-xs text-gray-600">เพิ่มขึ้น 12% ใน 7 วัน</p> </div> </div> <span class="text-green-600 font-bold text-sm">+12%</span> </div> <div class="flex items-center justify-between p-3 bg-blue-50 rounded-lg"> <div class="flex items-center"> <i data-feather="activity" class="w-4 h-4 text-blue-600 mr-3"></i> <div> <p class="font-medium text-sm">HRV ดีขึ้น</p> <p class="text-xs text-gray-600">ระบบภูมิคุ้มกันแข็งแกร่ง</p> </div> </div> <span class="text-blue-600 font-bold text-sm">+8ms</span> </div> <div class="flex items-center justify-between p-3 bg-orange-50 rounded-lg"> <div class="flex items-center"> <i data-feather="alert-triangle" class="w-4 h-4 text-orange-600 mr-3"></i> <div> <p class="font-medium text-sm">ความเครียดสูงขึ้น</p> <p class="text-xs text-gray-600">หลังเที่ยงวันทุกวัน</p> </div> </div> <span class="text-orange-600 font-bold text-sm">+5%</span> </div> </div> </div> <!-- Recommendations --> <div class="bg-white rounded-xl p-4 card-shadow mb-4"> <h3 class="font-semibold mb-3">คำแนะนำส่วนตัว</h3> <div class="space-y-3"> <div class="flex items-start space-x-3"> <div class="w-8 h-8 bg-purple-100 rounded-full flex items-center justify-center flex-shrink-0 mt-1"> <span class="text-purple-600 font-bold text-sm">1</span> </div> <div> <p class="font-medium text-sm">เพิ่มการพักผ่อนหลังเที่ยง</p> <p class="text-xs text-gray-600">5-10 นาที จะช่วยลดความเครียดได้</p> </div> </div> <div class="flex items-start space-x-3"> <div class="w-8 h-8 bg-purple-100 rounded-full flex items-center justify-center flex-shrink-0 mt-1"> <span class="text-purple-600 font-bold text-sm">2</span> </div> <div> <p class="font-medium text-sm">ดื่มน้ำมากขึ้น</p> <p class="text-xs text-gray-600">เพิ่ม 200 มล. ในช่วงเช้า</p> </div> </div> <div class="flex items-start space-x-3"> <div class="w-8 h-8 bg-purple-100 rounded-full flex items-center justify-center flex-shrink-0 mt-1"> <span class="text-purple-600 font-bold text-sm">3</span> </div> <div> <p class="font-medium text-sm">ออกกำลังกายแบบ HIIT</p> <p class="text-xs text-gray-600">2 ครั้งต่อสัปดาห์ เพื่อเพิ่มสมรรถภาพ</p> </div> </div> </div> </div> </div> <!-- IF Training Tab --> <div id="if-training" class="tab-content hidden p-4"> <!-- IF Status Card --> <div class="bg-gradient-to-br from-orange-500 to-red-500 rounded-xl p-4 text-white mb-4"> <div class="flex justify-between items-start mb-3"> <div> <h3 class="font-semibold text-lg">Intermittent Fasting</h3> <p class="text-sm opacity-90">วันที่ 15 ของเดือนนี้</p> </div> <div class="bg-white/20 backdrop-blur rounded-full px-3 py-1"> <span class="text-sm font-medium">16:8</span> </div> </div> <!-- Current Fast Timer --> <div class="bg-white/10 backdrop-blur rounded-lg p-3 mb-3"> <div class="flex justify-between items-center mb-2"> <span class="text-sm">ระยะเวลาที่ทำไปแล้ว</span> <span class="text-xs bg-green-400 text-green-900 px-2 py-1 rounded-full">กำลังทำอยู่</span> </div> <div class="text-3xl font-bold mb-1">14:32:45</div> <div class="w-full bg-white/20 rounded-full h-2"> <div class="bg-white h-2 rounded-full transition-all duration-1000" style="width: 91%"></div> </div> <div class="flex justify-between text-xs mt-2 opacity-90"> <span>เริ่ม 20:00</span> <span>สิ้นสุด 12:00</span> </div> </div> <!-- Quick Stats --> <div class="grid grid-cols-3 gap-3 text-center"> <div> <p class="text-xl font-bold">15</p> <p class="text-xs opacity-90">วันทำต่อเนื่อง</p> </div> <div> <p class="text-xl font-bold">68</p> <p class="text-xs opacity-90">ชั่วโมงรวม</p> </div> <div> <p class="text-xl font-bold">2.1</p> <p class="text-xs opacity-90">กก. ลดน้ำหนัก</p> </div> </div> </div> <!-- IF Plans --> <div class="mb-4"> <h3 class="font-semibold mb-3 flex items-center"> <i data-feather="clock" class="w-4 h-4 mr-2 text-purple-600"></i> แผนการทำ IF </h3> <div class="grid grid-cols-2 gap-3"> <button onclick="selectIFPlan('16:8')" class="bg-white rounded-xl p-3 card-shadow border-2 border-purple-500"> <div class="text-center"> <p class="font-bold text-purple-600">16:8</p> <p class="text-xs text-gray-600 mt-1">16 ชม. อด 8 ชม. กิน</p> <p class="text-xs text-green-600 mt-2">✓ กำลังใช้งาน</p> </div> </button> <button onclick="selectIFPlan('18:6')" class="bg-white rounded-xl p-3 card-shadow"> <div class="text-center"> <p class="font-bold">18:6</p> <p class="text-xs text-gray-600 mt-1">18 ชม. อด 6 ชม. กิน</p> <p class="text-xs text-gray-500 mt-2">ขั้นสูง</p> </div> </button> <button onclick="selectIFPlan('20:4')" class="bg-white rounded-xl p-3 card-shadow"> <div class="text-center"> <p class="font-bold">20:4</p> <p class="text-xs text-gray-600 mt-1">20 ชม. อด 4 ชม. กิน</p> <p class="text-xs text-gray-500 mt-2">ผู้เชี่ยวชาญ</p> </div> </button> <button onclick="selectIFPlan('OMAD')" class="bg-white rounded-xl p-3 card-shadow"> <div class="text-center"> <p class="font-bold">OMAD</p> <p class="text-xs text-gray-600 mt-1">มื้อเดียวต่อวัน</p> <p class="text-xs text-gray-500 mt-2">สุดขั้ว</p> </div> </button> </div> </div> <!-- Weekly Schedule --> <div class="bg-white rounded-xl p-4 card-shadow mb-4"> <h3 class="font-semibold mb-3 flex items-center"> <i data-feather="calendar" class="w-4 h-4 mr-2 text-purple-600"></i> ตารางทำ IF รายสัปดาห์ </h3> <div class="space-y-2"> <div class="flex items-center justify-between p-2 bg-green-50 rounded-lg"> <div class="flex items-center"> <div class="w-8 h-8 bg-green-500 rounded-full flex items-center justify-center text-white text-xs font-bold">จ</div> <span class="ml-3 text-sm font-medium">จันทร์</span> </div> <div class="text-right"> <p class="text-sm font-semibold">สำเร็จ</p> <p class="text-xs text-gray-600">16:08 ชม.</p> </div> </div> <div class="flex items-center justify-between p-2 bg-green-50 rounded-lg"> <div class="flex items-center"> <div class="w-8 h-8 bg-green-500 rounded-full flex items-center justify-center text-white text-xs font-bold">อ</div> <span class="ml-3 text-sm font-medium">อังคาร</span> </div> <div class="text-right"> <p class="text-sm font-semibold">สำเร็จ</p> <p class="text-xs text-gray-600">16:12 ชม.</p> </div> </div> <div class="flex items-center justify-between p-2 bg-green-50 rounded-lg"> <div class="flex items-center"> <div class="w-8 h-8 bg-green-500 rounded-full flex items-center justify-center text-white text-xs font-bold">พ</div> <span class="ml-3 text-sm font-medium">พุธ</span> </div> <div class="text-right"> <p class="text-sm font-semibold">สำเร็จ</p> <p class="text-xs text-gray-600">16:05 ชม.</p> </div> </div> <div class="flex items-center justify-between p-2 bg-orange-50 rounded-lg"> <div class="flex items-center"> <div class="w-8 h-8 bg-orange-500 rounded-full flex items-center justify-center text-white text-xs font-bold">พฤ</div> <span class="ml-3 text-sm font-medium">พฤหัส</span> </div> <div class="text-right"> <p class="text-sm font-semibold text-orange-600">กำลังทำ</p> <p class="text-xs text-gray-600">14:32 ชม.</p> </div> </div> <div class="flex items-center justify-between p-2 bg-gray-50 rounded-lg"> <div class="flex items-center"> <div class="w-8 h-8 bg-gray-300 rounded-full flex items-center justify-center text-white text-xs font-bold">ศ</div> <span class="ml-3 text-sm font-medium">ศุกร์</span> </div> <div class="text-right"> <p class="text-sm font-semibold">รอดำเนินการ</p> <p class="text-xs text-gray-600">20:00 - 12:00</p> </div> </div> <div class="flex items-center justify-between p-2 bg-gray-50 rounded-lg"> <div class="flex items-center"> <div class="w-8 h-8 bg-gray-300 rounded-full flex items-center justify-center text-white text-xs font-bold">ส</div> <span class="ml-3 text-sm font-medium">เสาร์</span> </div> <div class="text-right"> <p class="text-sm font-semibold">วันหยุดพัก</p> <p class="text-xs text-gray-600">กินตามปกติ</p> </div> </div> <div class="flex items-center justify-between p-2 bg-gray-50 rounded-lg"> <div class="flex items-center"> <div class="w-8 h-8 bg-gray-300 rounded-full flex items-center justify-center text-white text-xs font-bold">อา</div> <span class="ml-3 text-sm font-medium">อาทิตย์</span> </div> <div class="text-right"> <p class="text-sm font-semibold">วันหยุดพัก</p> <p class="text-xs text-gray-600">กินตามปกติ</p> </div> </div> </div> </div> <!-- IF Tips --> <div class="bg-white rounded-xl p-4 card-shadow mb-4"> <h3 class="font-semibold mb-3 flex items-center"> <i data-feather="info" class="w-4 h-4 mr-2 text-purple-600"></i> เคล็ดลับการทำ IF </h3> <div class="space-y-3"> <div class="flex items-start space-x-3"> <div class="w-6 h-6 bg-blue-100 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5"> <i data-feather="droplet" class="w-3 h-3 text-blue-600"></i> </div> <div> <p class="font-medium text-sm">ดื่มน้ำมากๆ</p> <p class="text-xs text-gray-600">ช่วยลดความหิวและรักษาสมดุลร่างกาย</p> </div> </div> <div class="flex items-start space-x-3"> <div class="w-6 h-6 bg-green-100 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5"> <i data-feather="coffee" class="w-3 h-3 text-green-600"></i> </div> <div> <p class="font-medium text-sm">ดื่มกาแฟ/ชาได้</p> <p class="text-xs text-gray-600">ไม่ใส่นมและน้ำตาล ช่วยไม่ให้หิวง่าย</p> </div> </div> <div class="flex items-start space-x-3"> <div class="w-6 h-6 bg-purple-100 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5"> <i data-feather="moon" class="w-3 h-3 text-purple-600"></i> </div> <div> <p class="font-medium text-sm">นอนหลับให้เพียงพอ</p> <p class="text-xs text-gray-600">ช่วยควบคุมฮอร์โมนความหิว</p> </div> </div> <div class="flex items-start space-x-3"> <div class="w-6 h-6 bg-orange-100 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5"> <i data-feather="activity" class="w-3 h-3 text-orange-600"></i> </div> <div> <p class="font-medium text-sm">ออกกำลังกายเบาๆ</p> <p class="text-xs text-gray-600">การเดินหรือยิมเบาๆ ช่วยเผาผลาญได้ดี</p> </div> </div> </div> </div> <!-- Start/End Fast Button --> <button onclick="toggleFast()" id="fastToggleBtn" class="w-full bg-red-500 text-white rounded-xl p-4 font-semibold hover:bg-red-600 transition-colors"> <i data-feather="square" class="w-5 h-5 inline mr-2"></i> หยุดการทำ IF วันนี้ </button> </div> <!-- Impacts Tab --> <div id="impacts" class="tab-content hidden p-4"> <!-- Impact Overview Card --> <div class="bg-gradient-to-br from-indigo-500 to-purple-600 rounded-xl p-4 text-white mb-4"> <div class="flex items-center mb-3"> <i data-feather="trending-up" class="w-6 h-6 mr-3"></i> <div> <h3 class="font-semibold text-lg">Impacts Analysis</h3> <p class="text-sm opacity-90">การวิเคราะห์ผลกระทบของพฤติกรรมต่อการฟื้นตัว</p> </div> </div> <div class="grid grid-cols-2 gap-3"> <div class="bg-white/20 backdrop-blur rounded-lg p-3"> <p class="text-2xl font-bold">+23%</p> <p class="text-xs opacity-90">การเพิ่มขึ้นของ Recovery Score</p> </div> <div class="bg-white/20 backdrop-blur rounded-lg p-3"> <p class="text-2xl font-bold">8.5</p> <p class="text-xs opacity-90">คะแนนความสัมพันธ์โดยรวม</p> </div> </div> </div> <!-- Top Positive Impacts --> <div class="mb-4"> <h3 class="font-semibold mb-3 flex items-center"> <i data-feather="arrow-up-circle" class="w-4 h-4 mr-2 text-green-600"></i> พฤติกรรมที่ส่งผลดีต่อการฟื้นตัว </h3> <div class="space-y-3"> <div class="bg-white rounded-xl p-4 card-shadow"> <div class="flex justify-between items-start mb-2"> <div class="flex items-center"> <div class="w-10 h-10 bg-green-100 rounded-full flex items-center justify-center mr-3"> <i data-feather="moon" class="w-5 h-5 text-green-600"></i> </div> <div> <p class="font-medium text-sm">ไม่ใช้หน้าจอก่อนนอน</p> <p class="text-xs text-gray-600">พบใน 12 จาก 14 คืนที่ฟื้นตัวดี</p> </div> </div> <div class="text-right"> <span class="text-green-600 font-bold text-lg">+32%</span> <p class="text-xs text-gray-500">Recovery Score</p> </div> </div> <div class="bg-gray-50 rounded-lg p-2 mt-3"> <div class="flex justify-between text-xs mb-1"> <span>ความสัมพันธ์</span> <span class="font-semibold">0.89 (สูงมาก)</span> </div> <div class="w-full bg-gray-200 rounded-full h-2"> <div class="bg-green-500 h-2 rounded-full" style="width: 89%"></div> </div> </div> </div> <div class="bg-white rounded-xl p-4 card-shadow"> <div class="flex justify-between items-start mb-2"> <div class="flex items-center"> <div class="w-10 h-10 bg-green-100 rounded-full flex items-center justify-center mr-3"> <i data-feather="droplet" class="w-5 h-5 text-green-600"></i> </div> <div> <p class="font-medium text-sm">อาบน้ำเย็น</p> <p class="text-xs text-gray-600">ลดการอักเสบและเร่งการฟื้นตัว</p> </div> </div> <div class="text-right"> <span class="text-green-600 font-bold text-lg">+28%</span> <p class="text-xs text-gray-500">Sleep Quality</p> </div> </div> <div class="bg-gray-50 rounded-lg p-2 mt-3"> <div class="flex justify-between text-xs mb-1"> <span>ความสัมพันธ์</span> <span class="font-semibold">0.76 (สูง)</span> </div> <div class="w-full bg-gray-200 rounded-full h-2"> <div class="bg-green-500 h-2 rounded-full" style="width: 76%"></div> </div> </div> </div> <div class="bg-white rounded-xl p-4 card-shadow"> <div class="flex justify-between items-start mb-2"> <div class="flex items-center"> <div class="w-10 h-10 bg-green-100 rounded-full flex items-center justify-center mr-3"> <i data-feather="book-open" class="w-5 h-5 text-green-600"></i> </div> <div> <p class="font-medium text-sm">อ่านหนังสือบนเตียง</p> <p class="text-xs text-gray-600">ช่วยผ่อนคลายก่อนนอน</p> </div> </div> <div class="text-right"> <span class="text-green-600 font-bold text-lg">+21%</span> <p class="text-xs text-gray-500">HRV</p> </div> </div> <div class="bg-gray-50 rounded-lg p-2 mt-3"> <div class="flex justify-between text-xs mb-1"> <span>ความสัมพันธ์</span> <span class="font-semibold">0.72 (สูง)</span> </div> <div class="w-full bg-gray-200 rounded-full h-2"> <div class="bg-green-500 h-2 rounded-full" style="width: 72%"></div> </div> </div> </div> </div> </div> <!-- Negative Impacts --> <div class="mb-4"> <h3 class="font-semibold mb-3 flex items-center"> <i data-feather="arrow-down-circle" class="w-4 h-4 mr-2 text-red-600"></i> พฤติกรรมที่ส่งผลเสียต่อการฟื้นตัว </h3> <div class="space-y-3"> <div class="bg-white rounded-xl p-4 card-shadow"> <div class="flex justify-between items-start mb-2"> <div class="flex items-center"> <div class="w-10 h-10 bg-red-100 rounded-full flex items-center justify-center mr-3"> <i data-feather="smartphone" class="w-5 h-5 text-red-600"></i> </div> <div> <p class="font-medium text-sm">รับประทานอาหารดึก</p> <p class="text-xs text-gray-600">หลัง 21:00 น.</p> </div> </div> <div class="text-right"> <span class="text-red-600 font-bold text-lg">-35%</span> <p class="text-xs text-gray-500">Recovery Score</p> </div> </div> <div class="bg-gray-50 rounded-lg p-2 mt-3"> <div class="flex justify-between text-xs mb-1"> <span>ความสัมพันธ์</span> <span class="font-semibold">-0.82 (สูงมาก)</span> </div> <div class="w-full bg-gray-200 rounded-full h-2"> <div class="bg-red-500 h-2 rounded-full" style="width: 82%"></div> </div> </div> </div> <div class="bg-white rounded-xl p-4 card-shadow"> <div class="flex justify-between items-start mb-2"> <div class="flex items-center"> <div class="w-10 h-10 bg-red-100 rounded-full flex items-center justify-center mr-3"> <i data-feather="coffee" class="w-5 h-5 text-red-600"></i> </div> <div> <p class="font-medium text-sm">คาเฟอีนหลัง 14:00 น.</p> <p class="text-xs text-gray-600">กระตุ้นระบบประสาท</p> </div> </div> <div class="text-right"> <span class="text-red-600 font-bold text-lg">-28%</span> <p class="text-xs text-gray-500">Sleep Quality</p> </div> </div> <div class="bg-gray-50 rounded-lg p-2 mt-3"> <div class="flex justify-between text-xs mb-1"> <span>ความสัมพันธ์</span> <span class="font-semibold">-0.74 (สูง)</span> </div> <div class="w-full bg-gray-200 rounded-full h-2"> <div class="bg-red-500 h-2 rounded-full" style="width: 74%"></div> </div> </div> </div> </div> </div> <!-- Impact Categories --> <div class="mb-4"> <h3 class="font-semibold mb-3">ผลกระทบตามหมวดหมู่</h3> <div class="grid grid-cols-2 gap-3"> <div class="bg-white rounded-xl p-3 card-shadow"> <div class="flex items-center mb-2"> <i data-feather="moon" class="w-4 h-4 text-blue-600 mr-2"></i> <span class="font-medium text-sm">การนอน</span> </div> <p class="text-lg font-bold text-blue-600">+18%</p> <p class="text-xs text-gray-600">จากพฤติกรรมที่ดี</p> </div> <div class="bg-white rounded-xl p-3 card-shadow"> <div class="flex items-center mb-2"> <i data-feather="activity" class="w-4 h-4 text-green-600 mr-2"></i> <span class="font-medium text-sm">การออกกำลังกาย</span> </div> <p class="text-lg font-bold text-green-600">+12%</p> <p class="text-xs text-gray-600">เมื่อทำเวลาเหมาะสม</p> </div> <div class="bg-white rounded-xl p-3 card-shadow"> <div class="flex items-center mb-2"> <i data-feather="coffee" class="w-4 h-4 text-orange-600 mr-2"></i> <span class="font-medium text-sm">โภชนาการ</span> </div> <p class="text-lg font-bold text-red-600">-15%</p> <p class="text-xs text-gray-600">จากพฤติกรรมที่ผิด</p> </div> <div class="bg-white rounded-xl p-3 card-shadow"> <div class="flex items-center mb-2"> <i data-feather="brain" class="w-4 h-4 text-purple-600 mr-2"></i> <span class="font-medium text-sm">จิตใจ</span> </div> <p class="text-lg font-bold text-purple-600">+8%</p> <p class="text-xs text-gray-600">จากการ meditate</p> </div> </div> </div> <!-- Recommendations Based on Impacts --> <div class="bg-white rounded-xl p-4 card-shadow mb-4"> <h3 class="font-semibold mb-3 flex items-center"> <i data-feather="lightbulb" class="w-4 h-4 mr-2 text-yellow-500"></i> คำแนะนำจากการวิเคราะห์ Impacts </h3> <div class="space-y-3"> <div class="flex items-start space-x-3 p-3 bg-blue-50 rounded-lg"> <div class="w-8 h-8 bg-blue-500 rounded-full flex items-center justify-center text-white text-sm font-bold flex-shrink-0">!</div> <div> <p class="font-medium text-sm text-blue-900">ระมัดระวังอาหารดึก</p> <p class="text-xs text-blue-700 mt-1">ข้อมูลแสดงว่าการทานอาหารหลัง 21:00 น. ลดคะแนนการฟื้นตัวถึง 35%</p> </div> </div> <div class="flex items-start space-x-3 p-3 bg-green-50 rounded-lg"> <div class="w-8 h-8 bg-green-500 rounded-full flex items-center justify-center text-white text-sm font-bold flex-shrink-0">✓</div> <div> <p class="font-medium text-sm text-green-900">ทำต่อไปเลย: ไม่ใช้หน้าจอก่อนนอน</p> <p class="text-xs text-green-700 mt-1">พฤติกรรมนี้เพิ่มคะแนนการฟื้นตัว 32% - ทำได้ดีมาก!</p> </div> </div> <div class="flex items-start space-x-3 p-3 bg-yellow-50 rounded-lg"> <div class="w-8 h-8 bg-yellow-500 rounded-full flex items-center justify-center text-white text-sm font-bold flex-shrink-0">→</div> <div> <p class="font-medium text-sm text-yellow-900">ลองเพิ่ม: อาบน้ำเย็น</p> <p class="text-xs text-yellow-700 mt-1">จากข้อมูลผู้ใช้รายอื่น พบว่าช่วยเพิ่มคุณภาพการนอน 28%</p> </div> </div> </div> </div> <!-- View Detailed Insights Button --> <button onclick="showDetailedImpacts()" class="w-full bg-purple-100 text-purple-600 rounded-xl p-4 font-medium text-sm hover:bg-purple-200 transition-colors"> <i data-feather="bar-chart-2" class="w-4 h-4 inline mr-2"></i> ดูการวิเคราะห์แบบละเอียด </button> </div> <!-- Advance Lab Tab --> <div id="lab" class="tab-content hidden p-4"> <!-- Lab Header --> <div class="bg-gradient-to-r from-indigo-500 to-purple-600 rounded-xl p-4 text-white mb-4"> <div class="flex justify-between items-start mb-2"> <div> <h3 class="font-semibold text-lg">Advance Lab</h3> <p class="text-sm opacity-90">วันที่เจาะเลือดล่าสุด: 15 ธ.ค. 2024</p> </div> <div class="bg-white/20 backdrop-blur rounded-lg px-3 py-1"> <span class="text-sm">⚠️ 3 รายการผิดปกติ</span> </div> </div> <div class="flex space-x-4 text-sm"> <div class="flex items-center"> <div class="w-3 h-3 bg-green-400 rounded-full mr-1"></div> <span>ปกติ 45</span> </div> <div class="flex items-center"> <div class="w-3 h-3 bg-yellow-400 rounded-full mr-1"></div> <span>เสี่ยง 8</span> </div> <div class="flex items-center"> <div class="w-3 h-3 bg-red-400 rounded-full mr-1"></div> <span>สูง 3</span> </div> </div> </div> <!-- Lab Sub-Navigation --> <div class="flex space-x-2 overflow-x-auto mb-4 scroll-hidden"> <button onclick="switchLabView('overview')" class="lab-nav-btn px-4 py-2 bg-purple-600 text-white rounded-lg text-sm whitespace-nowrap">Overview</button> <button onclick="switchLabView('panels')" class="lab-nav-btn px-4 py-2 bg-gray-200 text-gray-700 rounded-lg text-sm whitespace-nowrap">Panels</button> <button onclick="switchLabView('derived')" class="lab-nav-btn px-4 py-2 bg-gray-200 text-gray-700 rounded-lg text-sm whitespace-nowrap">Derived & Ratios</button> <button onclick="switchLabView('trends')" class="lab-nav-btn px-4 py-2 bg-gray-200 text-gray-700 rounded-lg text-sm whitespace-nowrap">Trends & Heatmap</button> <button onclick="switchLabView('correlations')" class="lab-nav-btn px-4 py-2 bg-gray-200 text-gray-700 rounded-lg text-sm whitespace-nowrap">Correlations</button> <button onclick="switchLabView('import')" class="lab-nav-btn px-4 py-2 bg-gray-200 text-gray-700 rounded-lg text-sm whitespace-nowrap">Import/Export</button> <button onclick="switchLabView('settings')" class="lab-nav-btn px-4 py-2 bg-gray-200 text-gray-700 rounded-lg text-sm whitespace-nowrap">Lab Settings</button> </div> <!-- Overview View --> <div id="lab-overview" class="lab-view"> <!-- Lab Wellness Index --> <div class="bg-white rounded-xl p-4 card-shadow mb-4"> <h4 class="font-semibold mb-3">Lab Wellness Index</h4> <div class="flex items-center justify-center"> <div class="relative"> <svg width="120" height="120"> <circle cx="60" cy="60" r="50" stroke="#e5e7eb" stroke-width="10" fill="none"/> <circle cx="60" cy="60" r="50" stroke="#8b5cf6" stroke-width="10" fill="none" stroke-dasharray="314" stroke-dashoffset="78" stroke-linecap="round" transform="rotate(-90 60 60)"/> </svg> <div class="absolute inset-0 flex items-center justify-center"> <span class="text-2xl font-bold">75</span> </div> </div> </div> <p class="text-center text-sm text-gray-600 mt-2">สถานะ: ดี (เสี่ยงต่ำ)</p> </div> <!-- Panel Radar Chart --> <div class="bg-white rounded-xl p-4 card-shadow mb-4"> <h4 class="font-semibold mb-3">Panel Performance</h4> <canvas id="radarChart" width="300" height="300"></canvas> </div> <!-- Top 5 Abnormal --> <div class="bg-white rounded-xl p-4 card-shadow"> <h4 class="font-semibold mb-3">Top 5 รายการที่ผิดปกติ</h4> <div class="space-y-2"> <div class="flex items-center justify-between p-2 bg-red-50 rounded-lg"> <div> <p class="font-medium text-sm">HOMA-IR</p> <p class="text-xs text-gray-600">Insulin resistance</p> </div> <span class="text-red-600 font-bold">3.2</span> </div> <div class="flex items-center justify-between p-2 bg-yellow-50 rounded-lg"> <div> <p class="font-medium text-sm">Triglycerides</p> <p class="text-xs text-gray-600">ไขมันในเลือดสูง</p> </div> <span class="text-yellow-600 font-bold">185 mg/dL</span> </div> <div class="flex items-center justify-between p-2 bg-yellow-50 rounded-lg"> <div> <p class="font-medium text-sm">hs-CRP</p> <p class="text-xs text-gray-600">การอักเสบ</p> </div> <span class="text-yellow-600 font-bold">3.8 mg/L</span> </div> </div> </div> </div> <!-- Panels View --> <div id="lab-panels" class="lab-view hidden"> <!-- Metabolic Panel --> <div class="bg-white rounded-xl p-4 card-shadow mb-4"> <div class="flex justify-between items-center mb-3"> <h4 class="font-semibold">Metabolic Panel</h4> <button onclick="togglePanelExpand('metabolic')" class="text-purple-600"> <i data-feather="chevron-down" class="w-4 h-4"></i> </button> </div> <div id="metabolic-panel" class="space-y-3"> <div class="flex justify-between items-center"> <div> <p class="text-sm font-medium">Glucose (Fasting)</p> <p class="text-xs text-gray-600">70-99 mg/dL</p> </div> <div class="text-right"> <span class="font-bold text-green-600">92 mg/dL</span> <p class="text-xs text-gray-500">Normal</p> </div> </div> <div class="flex justify-between items-center"> <div> <p class="text-sm font-medium">Insulin</p> <p class="text-xs text-gray-600">2.6-24.9 μIU/mL</p> </div> <div class="text-right"> <span class="font-bold text-yellow-600">14 μIU/mL</span> <p class="text-xs text-gray-500">Borderline</p> </div> </div> <div class="flex justify-between items-center"> <div> <p class="text-sm font-medium">HbA1c</p> <p class="text-xs text-gray-600">4.0-5.6 %</p> </div> <div class="text-right"> <span class="font-bold text-green-600">5.4 %</span> <p class="text-xs text-gray-500">Normal</p> </div> </div> </div> </div> <!-- Lipids Panel --> <div class="bg-white rounded-xl p-4 card-shadow mb-4"> <div class="flex justify-between items-center mb-3"> <h4 class="font-semibold">Lipids Panel</h4> <button onclick="togglePanelExpand('lipids')" class="text-purple-600"> <i data-feather="chevron-down" class="w-4 h-4"></i> </button> </div> <div id="lipids-panel" class="space-y-3"> <div class="flex justify-between items-center"> <div> <p class="text-sm font-medium">Total Cholesterol</p> <p class="text-xs text-gray-600">0-200 mg/dL</p> </div> <div class="text-right"> <span class="font-bold text-green-600">195 mg/dL</span> <p class="text-xs text-gray-500">Normal</p> </div> </div> <div class="flex justify-between items-center"> <div> <p class="text-sm font-medium">LDL Cholesterol</p> <p class="text-xs text-gray-600">0-129 mg/dL</p> </div> <div class="text-right"> <span class="font-bold text-yellow-600">135 mg/dL</span> <p class="text-xs text-gray-500">Borderline</p> </div> </div> <div class="flex justify-between items-center"> <div> <p class="text-sm font-medium">HDL Cholesterol</p> <p class="text-xs text-gray-600">40-60 mg/dL</p> </div> <div class="text-right"> <span class="font-bold text-green-600">48 mg/dL</span> <p class="text-xs text-gray-500">Normal</p> </div> </div> <div class="flex justify-between items-center"> <div> <p class="text-sm font-medium">Triglycerides</p> <p class="text-xs text-gray-600">0-149 mg/dL</p> </div> <div class="text-right"> <span class="font-bold text-yellow-600">185 mg/dL</span> <p class="text-xs text-gray-500">High</p> </div> </div> </div> </div> </div> <!-- Derived & Ratios View --> <div id="lab-derived" class="lab-view hidden"> <div class="bg-white rounded-xl p-4 card-shadow mb-4"> <h4 class="font-semibold mb-3">Derived Calculations</h4> <div class="space-y-3"> <div class="flex justify-between items-center p-3 bg-gray-50 rounded-lg"> <div> <p class="font-medium text-sm">HOMA-IR</p> <p class="text-xs text-gray-600">Insulin Resistance</p> <p class="text-xs text-purple-600">คำนวณ: (Glucose × Insulin) / 405</p> </div> <div class="text-right"> <span class="font-bold text-red-600">3.2</span> <p class="text-xs text-red-500">High Risk</p> </div> </div> <div class="flex justify-between items-center p-3 bg-gray-50 rounded-lg"> <div> <p class="font-medium text-sm">Atherogenic Index (AIP)</p> <p class="text-xs text-gray-600">log₁₀(TG/HDL-C)</p> <p class="text-xs text-purple-600">ความเสี่ยงโรคหัวใจ</p> </div> <div class="text-right"> <span class="font-bold text-yellow-600">0.58</span> <p class="text-xs text-yellow-500">Intermediate</p> </div> </div> <div class="flex justify-between items-center p-3 bg-gray-50 rounded-lg"> <div> <p class="font-medium text-sm">Non-HDL Cholesterol</p> <p class="text-xs text-gray-600">TC - HDL-C</p> </div> <div class="text-right"> <span class="font-bold text-green-600">147 mg/dL</span> <p class="text-xs text-gray-500">Normal</p> </div> </div> <div class="flex justify-between items-center p-3 bg-gray-50 rounded-lg"> <div> <p class="font-medium text-sm">eGFR</p> <p class="text-xs text-gray-600">CKD-EPI Equation</p> <p class="text-xs text-purple-600">ฟังก์ชันไต</p> </div> <div class="text-right"> <span class="font-bold text-green-600">92 mL/min/1.73m²</span> <p class="text-xs text-gray-500">Normal</p> </div> </div> </div> </div> </div> <!-- Trends & Heatmap View --> <div id="lab-trends" class="lab-view hidden"> <div class="bg-white rounded-xl p-4 card-shadow mb-4"> <h4 class="font-semibold mb-3">12-Month Heatmap</h4> <canvas id="heatmapChart" width="300" height="200"></canvas> </div> <div class="bg-white rounded-xl p-4 card-shadow"> <h4 class="font-semibold mb-3">Trend Comparison</h4> <canvas id="trendChart" width="300" height="200"></canvas> </div> </div> <!-- Correlations View --> <div id="lab-correlations" class="lab-view hidden"> <div class="bg-white rounded-xl p-4 card-shadow mb-4"> <h4 class="font-semibold mb-3">Correlation Matrix</h4> <canvas id="correlationChart" width="300" height="300"></canvas> </div> <div class="bg-white rounded-xl p-4 card-shadow"> <h4 class="font-semibold mb-3">Selected Correlation</h4> <canvas id="scatterChart" width="300" height="200"></canvas> </div> </div> <!-- Import/Export View --> <div id="lab-import" class="lab-view hidden"> <div class="bg-white rounded-xl p-4 card-shadow mb-4"> <h4 class="font-semibold mb-3">Import Lab Data</h4> <div class="border-2 border-dashed border-gray-300 rounded-lg p-8 text-center"> <i data-feather="upload-cloud" class="w-12 h-12 mx-auto text-gray-400 mb-3"></i> <p class="text-sm text-gray-600 mb-3">ลากไฟล์ CSV หรือคลิกเพื่อเลือก</p> <input type="file" accept=".csv" class="hidden" id="fileInput"> <button onclick="document.getElementById('fileInput').click()" class="bg-purple-600 text-white px-4 py-2 rounded-lg text-sm"> เลือกไฟล์ </button> </div> <button onclick="downloadTemplate()" class="mt-3 text-purple-600 text-sm underline"> ดาวน์โหลดเทมเพลต CSV </button> </div> <div class="bg-white rounded-xl p-4 card-shadow"> <h4 class="font-semibold mb-3">Export Data</h4> <button onclick="exportLabData()" class="w-full bg-purple-600 text-white rounded-lg p-3 font-medium"> <i data-feather="download" class="w-4 h-4 inline mr-2"></i> Export as JSON </button> </div> </div> <!-- Lab Settings View --> <div id="lab-settings" class="lab-view hidden"> <div class="bg-white rounded-xl p-4 card-shadow mb-4"> <h4 class="font-semibold mb-3">Personal Information</h4> <div class="space-y-3"> <div> <label class="text-sm font-medium">เพศ</label> <select class="w-full mt-1 p-2 border rounded-lg"> <option>ชาย</option> <option>หญิง</option> </select> </div> <div> <label class="text-sm font-medium">อายุ</label> <input type="number" value="28" class="w-full mt-1 p-2 border rounded-lg"> </div> <div> <label class="text-sm font-medium">หน่วย</label> <select class="w-full mt-1 p-2 border rounded-lg"> <option>US (mg/dL)</option> <option>SI (mmol/L)</option> </select> </div> </div> </div> <div class="bg-white rounded-xl p-4 card-shadow mb-4"> <h4 class="font-semibold mb-3">Risk Thresholds</h4> <div class="space-y-3"> <div class="flex justify-between items-center"> <span class="text-sm">Normal</span> <div class="flex space-x-2"> <div class="w-6 h-6 bg-green-400 rounded"></div> </div> </div> <div class="flex justify-between items-center"> <span class="text-sm">Borderline</span> <div class="flex space-x-2"> <div class="w-6 h-6 bg-yellow-400 rounded"></div> </div> </div> <div class="flex justify-between items-center"> <span class="text-sm">High Risk</span> <div class="flex space-x-2"> <div class="w-6 h-6 bg-red-400 rounded"></div> </div> </div> </div> </div> <div class="bg-yellow-50 rounded-xl p-4 mb-4"> <p class="text-xs text-yellow-800"> <strong>คำเตือน:</strong> ข้อมูลนี้เพื่อการศึกษาเท่านั้น ไม่ใช่คำวินิจฉัยทางการแพทย์ </p> </div> <button onclick="resetLabData()" class="w-full bg-red-100 text-red-600 rounded-lg p-3 font-medium"> <i data-feather="trash-2" class="w-4 h-4 inline mr-2"></i> Reset Lab Data </button> </div> </div> <!-- Goals Tab --> <div id="goals" class="tab-content hidden p-4"> <!-- Active Goals --> <div class="mb-4"> <h3 class="font-semibold mb-3">เป้าหมายประจำเดือน</h3> <div class="space-y-3"> <div class="bg-white rounded-xl p-4 card-shadow"> <div class="flex justify-between items-center mb-2"> <div class="flex items-center"> <i data-feather="target" class="w-5 h-5 text-purple-600 mr-2"></i> <span class="font-medium">ลดน้ำหนัก 3 กก.</span> </div> <span class="text-sm font-bold text-purple-600">60%</span> </div> <div class="w-full bg-gray-200 rounded-full h-2 mb-2"> <div class="bg-gradient-to-r from-purple-500 to-pink-500 h-2 rounded-full" style="width: 60%"></div> </div> <p class="text-xs text-gray-600">ลดไปแล้ว 1.8 กก. เหลืออีก 1.2 กก. • 12 วันที่เหลือ</p> </div> <div class="bg-white rounded-xl p-4 card-shadow"> <div class="flex justify-between items-center mb-2"> <div class="flex items-center"> <i data-feather="moon" class="w-5 h-5 text-blue-600 mr-2"></i> <span class="font-medium">นอน 8 ชั่วโมงต่อวัน</span> </div> <span class="text-sm font-bold text-blue-600">75%</span> </div> <div class="w-full bg-gray-200 rounded-full h-2 mb-2"> <div class="bg-gradient-to-r from-blue-500 to-cyan-500 h-2 rounded-full" style="width: 75%"></div> </div> <p class="text-xs text-gray-600">ทำได้ 22 จาก 30 วัน • 8 วันที่เหลือ</p> </div> <div class="bg-white rounded-xl p-4 card-shadow"> <div class="flex justify-between items-center mb-2"> <div class="flex items-center"> <i data-feather="trending-up" class="w-5 h-5 text-green-600 mr-2"></i> <span class="font-medium">วิ่ง 100 กม. ต่อเดือน</span> </div> <span class="text-sm font-bold text-green-600">82%</span> </div> <div class="w-full bg-gray-200 rounded-full h-2 mb-2"> <div class="bg-gradient-to-r from-green-500 to-emerald-500 h-2 rounded-full" style="width: 82%"></div> </div> <p class="text-xs text-gray-600">วิ่งไปแล้ว 82 กม. • เหลือ 18 กม. • 8 วันที่เหลือ</p> </div> </div> </div> <!-- Daily Journal --> <div class="mb-4"> <h3 class="font-semibold mb-3">บันทึกประจำวัน</h3> <div class="bg-white rounded-xl p-4 card-shadow"> <div class="mb-3"> <label class="text-sm font-medium text-gray-700 mb-2 block">พฤติกรรมวันนี้</label> <div class="space-y-2 max-h-40 overflow-y-auto"> <!-- Behaviors will be populated here --> </div> </div> <button onclick="showBehaviorSelector()" class="w-full bg-purple-100 text-purple-600 rounded-lg p-3 font-medium text-sm hover:bg-purple-200 transition-colors"> <i data-feather="plus-circle" class="w-4 h-4 inline mr-2"></i> เพิ่มพฤติกรรม </button> </div> </div> <!-- Add New Goal --> <button class="w-full bg-purple-100 text-purple-600 rounded-xl p-4 font-medium text-sm hover:bg-purple-200 transition-colors"> <i data-feather="plus-circle" class="w-4 h-4 inline mr-2"></i> เพิ่มเป้าหมายใหม่ </button> </div> </div> <!-- Bottom Navigation --> <div class="fixed bottom-0 left-0 right-0 bg-white border-t max-w-md mx-auto"> <div class="grid grid-cols-5 py-2"> <button class="flex flex-col items-center py-2 text-purple-600"> <i data-feather="home" class="w-5 h-5"></i> <span class="text-xs mt-1">หน้าแรก</span> </button> <button class="flex flex-col items-center py-2 text-gray-500"> <i data-feather="bar-chart-2" class="w-5 h-5"></i> <span class="text-xs mt-1">กราฟ</span> </button> <button class="flex flex-col items-center py-2 text-gray-500"> <div class="w-12 h-12 bg-purple-600 rounded-full flex items-center justify-center -mt-2"> <i data-feather="plus" class="w-6 h-6 text-white"></i> </div> </button> <button class="flex flex-col items-center py-2 text-gray-500"> <i data-feather="award" class="w-5 h-5"></i> <span class="text-xs mt-1">ความสำเร็จ</span> </button> <button class="flex flex-col items-center py-2 text-gray-500"> <i data-feather="settings" class="w-5 h-5"></i> <span class="text-xs mt-1">ตั้งค่า</span> </button> </div> </div> </div> <!-- Behavior Selector Modal --> <div id="behaviorModal" class="fixed inset-0 bg-black bg-opacity-50 z-50 hidden"> <div class="flex items-center justify-center min-h-screen p-4"> <div class="bg-white rounded-2xl max-w-md w-full max-h-[80vh] overflow-hidden"> <div class="p-4 border-b sticky top-0 bg-white"> <div class="flex justify-between items-center"> <h3 class="font-semibold text-lg">เลือกพฤติกรรม</h3> <button onclick="closeBehaviorSelector()" class="p-1"> <i data-feather="x" class="w-5 h-5"></i> </button> </div> </div> <div class="p-4 overflow-y-auto max-h-[60vh]"> <div id="behaviorCategories" class="space-y-4"> <!-- Categories will be populated here --> </div> </div> </div> </div> </div> <script> // Initialize Feather Icons feather.replace(); // Tab Switching function switchTab(tabName) { // Hide all tab contents document.querySelectorAll('.tab-content').forEach(tab => { tab.classList.add('hidden'); }); // Remove active class from all tab buttons document.querySelectorAll('.tab-btn').forEach(btn => { btn.classList.remove('tab-active'); btn.classList.add('text-gray-600'); }); // Show selected tab document.getElementById(tabName).classList.remove('hidden'); // Add active class to selected tab button const activeBtn = document.querySelector(`[data-tab="${tabName}"]`); activeBtn.classList.add('tab-active'); activeBtn.classList.remove('text-gray-600'); } // Mock data updates function updateMetrics() { // Simulate real-time heart rate update const heartRate = 55 + Math.floor(Math.random() * 20); const heartRateElement = document.querySelector('.health-metric-card p.text-lg'); if (heartRateElement && heartRateElement.textContent.includes('BPM')) { heartRateElement.textContent = heartRate + ' BPM'; } // Update calories const calories = 400 + Math.floor(Math.random() * 50); const caloriesElements = document.querySelectorAll('.health-metric-card p.text-lg'); caloriesElements.forEach(el => { if (el.textContent.includes('kcal')) { el.textContent = calories + ' kcal'; } }); } // Show notifications function showNotifications() { alert('🔔 มีการแจ้งเตือนใหม่\n\n• ถึงเวลาดื่มน้ำแล้ว\n• คุณออกกำลังกายไปแล้ว 75% ของเป้าหมายวันนี้\n• คุณภาพการนอนเมื่อคืนดีขึ้น 10%'); } // Show profile function showProfile() { alert('👤 โปรไฟล์\n\nชื่อ: สมชาย ใจดี\nอายุ: 28 ปี\nเป้าหมาย: สุขภาพแข็งแรง\nสมาชิกตั้งแต่: มกราคม 2024'); } // Simulate real-time updates setInterval(updateMetrics, 5000); // Add swipe gestures for mobile let touchStartX = 0; let touchEndX = 0; document.addEventListener('touchstart', (e) => { touchStartX = e.changedTouches[0].screenX; }); document.addEventListener('touchend', (e) => { touchEndX = e.changedTouches[0].screenX; handleSwipe(); }); function handleSwipe() { const tabs = ['dashboard', 'metrics', 'insights', 'if-training', 'impacts', 'goals']; const currentTab = document.querySelector('.tab-content:not(.hidden)').id; const currentIndex = tabs.indexOf(currentTab); if (touchEndX < touchStartX - 50 && currentIndex < tabs.length - 1) { // Swipe left - next tab switchTab(tabs[currentIndex + 1]); } if (touchEndX > touchStartX + 50 && currentIndex > 0) { // Swipe right - previous tab switchTab(tabs[currentIndex - 1]); } } function showDetailedImpacts() { alert('📊 การวิเคราะห์ Impacts แบบละเอียด\n\n• วิเคราะห์ข้อมูล 30 วันล่าสุด\n• ความสัมพันธ์ระหว่างพฤติกรรมกับ HRV\n• กราฟแสดงแนวโน้มการฟื้นตัว\n• เปรียบเทียบกับข้อมูลผู้ใช้รายอื่น\n• คำแนะนำส่วนตัวแบบ AI\n\n🔍 Premium Feature - อัปเกรดเพื่อดูข้อมูลเพิ่มเติม'); } // Add haptic feedback (vibration) on button clicks for mobile document.querySelectorAll('button').forEach(button => { button.addEventListener('click', () => { if ('vibrate' in navigator) { navigator.vibrate(10); } }); }); // Behavior Database const behaviorDatabase = { "การนอนและสุขภาพรอบวัน": [ "แว่นกันแสงสีฟ้า", "เครื่องเสียง", "อ่านหนังสือบนเตียง", "นอนร่วมกับผู้อื่น", "แมวอยู่ในห้องนอน", "สุนัขอยู่ในห้องนอน", "หน้ากากปิดตา", "นอนในห้องมืด", "แสงแดดตอนเช้า", "รับประทานอาหารดึก", "เครื่อง CPAP", "เทปปิดปาก", "แผ่นแปะจมูก", "ผ้าห่มมีน้ำหนัก", "แสงประดิษฐ์", "นอนกลางวัน", "เวลานอนสม่ำเสมอ", "เวลาตื่นสม่ำเสมอ", "อุปกรณ์ติดตามการนอน", "เสียงคลื่นความถี่ขาว", "เครื่องเพิ่มความชื้น", "ไม่ใช้หน้าจอก่อนนอน", "กายกรรมตอนเย็น", "ชาสมุนไพรก่อนนอน", "อาบน้ำอุ่นก่อนนอน" ], "การฟื้นตัว": [ "นวดบำบัด", "อาบน้ำเย็น", "การยืดกล้ามเนื้อ", "ซาวน่า", "ห้องไอน้ำ", "ฝังเข็ม", "ถ้วยฝาครอบ", "อัดอากาศ", "การ meditate", "การฝึกหายใจ", "อาบน้ำอุ่น", "อาบน้ำเย็น", "โฟมรอลลิ่ง", "อาบน้ำสลับ", "การฟื้นตัวแบบ active", "วันพัก", "CBD ภายนอก", "อาบน้ำเกลือ Epsom", "บำบัดแสงแดง", "ถังลอย", "การปรับสันหลัง", "กายภาพบำบัด", "ซาวน่าอินฟราเรด", "ครีโอเทอราพี", "เสื้อผ้าบีบอัด" ], "โภชนาการ": [ "การลดน้ำหนักแบบ Intermittent Fasting", "อาหาร Paleo", "อาหารพืช", "อาหาร Keto", "อาหาร Mediterranean", "คาเฟอีน", "การดื่มแอลกอฮอล์", "ไม่ดื่มแอลกอฮอล์", "การติดตามการบริโภคน้ำ", "การเตรียมอาหารล่วงหน้า", "อาหารออร์แกนิก", "ปราศจากกลูเตน", "ปราศจากแล็กโทส", "น้ำตาลต่ำ", "โปรตีนสูง", "มื้ออาหารก่อนออกกำลังกาย", "มื้ออาหารหลังออกกำลังกาย", "การจัดเวลามื้ออาหาร", "การติดตามแคลอรี่", "การติดตามแมโคร", "การจำกัดพลังงานแบบ Intermittent", "การรับประทานแบบจำกัดเวลา", "การจัดเวลาธาตุอาหาร", "เครื่องดื่มกีฬา", "อาหารเสริมอิเล็กโทรไลต์" ], "ยาและอาหารเสริม": [ "อาหารเสริมแมกนีเซียม", "เมลาโทนิน", "วิตามินรวม", "วิตามิน B-12", "วิตามิน C", "วิตามิน D", "สังกะสี", "โปรไบโอติกส์", "CBD", "กัญชา", "ยาแก้ปวดตามใบสั่งแพทย์", "ยาต้านการอักเสบ NSAIDs", "ยาลดน้ำหนัก", "ยา AD(H)D", "ครีเอทีน", "ผงโปรตีน", "BCAA", "อาหารเสริมก่อนออกกำลังกาย", "บีตาอะลานีน", "อาชวากันดา", "โรดิโอล่า", "น้ำมันปลา", "อาหารเสริมเหล็ก", "อาหารเสริมแคลเซียม", "การสนับสนุนข้อต่อ" ], "ไลฟ์สไตล์และสุขภาพจิต": [ "ความวิตกกังวล", "ความเครียด", "ทำงานที่บ้าน", "เวลาหน้าจอ", "เดินทางโดยเครื่องบิน", "เพศสัมพันธ์", "เลี้ยงดูเด็กทารก", "กอดเด็ก", "การบำบัด", "การเขียนบันทึก", "เวลาทางสังคม", "เดินเที่ยวในธรรมชาติ", "การ detox จากดิจิทัล", "การฝึกความขอบคุณ", "การสัมผัสความเย็น", "การสัมผัสความร้อน", "การออกกำลังกายการหายใจ", "การตั้งสติ", "โยคะ", "ไท่จี", "บำบัดการลอยตัว", "บำบัดศิลปะ", "บำบัดดนตรี", "บำบัดสัตว์เลี้ยง", "บริการชุมชน" ], "สุขภาพการสืบพันธุ์": [ "ประจำเดือน", "การตั้งครรภ์", "หลังคลอด", "ให้นมบุตร", "การคุมกำเนิด", "ฮอร์โมนบำบัด", "การรักษาภาวะมีบุตรยาก", "วัยทอง", "การติดตามการตกไข่", "อาการ PMS", "ภาวะถุงน้ำในรังไข่", "เยื่อบุโพรงมดลูกเจริญผิดที่", "การเปลี่ยนแปลงฮอร์โมน", "พยายามมีบุตร" ], "สิ่งแวดล้อม": [ "เครื่องตรวจสอบคุณภาพอากาศ", "ตัวกรองน้ำ", "การป้องกัน EMF", "อากาศบริสุทธิ์", "แสงธรรมชาติ", "พื้นที่สีเขียว", "ไม้ในร่ม", "ที่นอนออร์แกนิก", "การทำความสะอาดปราศจากสารพิษ", "การบำบัดน้ำ", "การควบคุมความชื้น", "การควบคุมอุณหภูมิ", "การลดเสียงรบกวน", "การจัดการสิ่งอำนวยความสะดวก" ], "ประสิทธิภาพ": [ "การฝึกกำลัง", "การออกกำลังกายแบบคาร์ดิโอ", "การออกกำลังกาย HIIT", "การฝึกความอดทน", "การฝึกความยืดหยุ่น", "การฝึกกีฬา", "การแข่งขัน", "ภาระการฝึก", "การติดตามประสิทธิภาพ", "การตั้งเป้าหมาย", "การสร้างภาพในใจ", "การฝึกทักษะ", "การฝึกข้าม", "ฟิตเนสเชิงฟังก์ชัน" ] }; // Daily Journal Behaviors let selectedBehaviors = []; function showBehaviorSelector() { const modal = document.getElementById('behaviorModal'); const categoriesContainer = document.getElementById('behaviorCategories'); categoriesContainer.innerHTML = ''; Object.entries(behaviorDatabase).forEach(([category, behaviors]) => { const categoryDiv = document.createElement('div'); categoryDiv.className = 'bg-gray-50 rounded-lg p-3'; const categoryTitle = document.createElement('h4'); categoryTitle.className = 'font-semibold text-sm mb-2 text-purple-600'; categoryTitle.textContent = category; categoryDiv.appendChild(categoryTitle); const behaviorsGrid = document.createElement('div'); behaviorsGrid.className = 'grid grid-cols-2 gap-2'; behaviors.forEach(behavior => { const behaviorLabel = document.createElement('label'); behaviorLabel.className = 'flex items-center space-x-2 cursor-pointer'; const checkbox = document.createElement('input'); checkbox.type = 'checkbox'; checkbox.className = 'rounded text-purple-600'; checkbox.value = behavior; checkbox.checked = selectedBehaviors.includes(behavior); const label = document.createElement('span'); label.className = 'text-xs'; label.textContent = behavior; behaviorLabel.appendChild(checkbox); behaviorLabel.appendChild(label); behaviorsGrid.appendChild(behaviorLabel); }); categoryDiv.appendChild(behaviorsGrid); categoriesContainer.appendChild(categoryDiv); }); modal.classList.remove('hidden'); feather.replace(); } function closeBehaviorSelector() { const modal = document.getElementById('behaviorModal'); // Save selected behaviors const checkboxes = modal.querySelectorAll('input[type="checkbox"]:checked'); selectedBehaviors = Array.from(checkboxes).map(cb => cb.value); // Update journal display updateJournalDisplay(); modal.classList.add('hidden'); } function updateJournalDisplay() { const journalContainer = document.querySelector('#goals .bg-white .space-y-2'); if (selectedBehaviors.length > 0) { journalContainer.innerHTML = selectedBehaviors.map(behavior => ` <div class="flex items-center justify-between bg-purple-50 rounded-lg p-2"> <span class="text-sm">${behavior}</span> <button onclick="removeBehavior('${behavior}')" class="text-red-500"> <i data-feather="x" class="w-4 h-4"></i> </button> </div> `).join(''); } else { journalContainer.innerHTML = '<p class="text-xs text-gray-500 text-center py-4">ยังไม่ได้เพิ่มพฤติกรรมวันนี้</p>'; } feather.replace(); } function removeBehavior(behavior) { selectedBehaviors = selectedBehaviors.filter(b => b !== behavior); updateJournalDisplay(); } // Initialize journal display updateJournalDisplay(); // Store lab data in localStorage if not exists if (!localStorage.getItem('labData')) { const initialLabData = { lastUpdate: new Date().toISOString(), biomarkers: { glucose: { value: 92, unit: 'mg/dL', date: '2024-12-15' }, insulin: { value: 14, unit: 'μIU/mL', date: '2024-12-15' }, hdl: { value: 48, unit: 'mg/dL', date: '2024-12-15' }, ldl: { value: 135, unit: 'mg/dL', date: '2024-12-15' }, triglycerides: { value: 185, unit: 'mg/dL', date: '2024-12-15' }, hba1c: { value: 5.4, unit: '%', date: '2024-12-15' }, ast: { value: 28, unit: 'U/L', date: '2024-12-15' }, alt: { value: 32, unit: 'U/L', date: '2024-12-15' }, creatinine: { value: 0.9, unit: 'mg/dL', date: '2024-12-15' }, egfr: { value: 92, unit: 'mL/min/1.73m²', date: '2024-12-15' }, uric_acid: { value: 6.2, unit: 'mg/dL', date: '2024-12-15' }, calcium: { value: 9.4, unit: 'mg/dL', date: '2024-12-15' }, tsh: { value: 2.1, unit: 'mIU/L', date: '2024-12-15' }, free_t4: { value: 1.2, unit: 'ng/dL', date: '2024-12-15' }, free_t3: { value: 3.2, unit: 'pg/mL', date: '2024-12-15' }, hscrp: { value: 3.8, unit: 'mg/L', date: '2024-12-15' }, wbc: { value: 6.5, unit: 'K/μL', date: '2024-12-15' }, rbc: { value: 4.8, unit: 'M/μL', date: '2024-12-15' }, hemoglobin: { value: 14.5, unit: 'g/dL', date: '2024-12-15' }, hematocrit: { value: 43, unit: '%', date: '2024-12-15' }, vitamin_d: { value: 32, unit: 'ng/mL', date: '2024-12-15' }, vitamin_b12: { value: 520, unit: 'pg/mL', date: '2024-12-15' }, ferritin: { value: 85, unit: 'ng/mL', date: '2024-12-15' }, testosterone: { value: 650, unit: 'ng/dL', date: '2024-12-15' }, shbg: { value: 35, unit: 'nmol/L', date: '2024-12-15' }, cortisol_am: { value: 15.2, unit: 'μg/dL', date: '2024-12-15' }, cortisol_pm: { value: 4.8, unit: 'μg/dL', date: '2024-12-15' } }, derived: { homa_ir: labDerived.homaIR(92, 14, 'US'), non_hdl: labDerived.nonHDL(195, 48), ldl_calc: labDerived.ldlFriedewald(195, 48, 185), aip: labDerived.aip(185, 48), tg_hdl_ratio: 185 / 48, ag_ratio: 4.2 / 3.1 }, settings: { gender: 'male', age: 28, units: 'US', referenceSet: 'general' }, history: generateMockHistory() }; localStorage.setItem('labData', JSON.stringify(initialLabData)); } } // Generate Mock Historical Data function generateMockHistory() { const history = {}; const biomarkerIds = ['glucose', 'insulin', 'hdl', 'ldl', 'triglycerides', 'hscrp', 'testosterone']; const months = ['2024-01', '2024-02', '2024-03', '2024-04', '2024-05', '2024-06', '2024-07', '2024-08', '2024-09', '2024-10', '2024-11', '2024-12']; biomarkerIds.forEach(id => { history[id] = []; months.forEach(month => { const baseValue = getBaseValue(id); const variation = (Math.random() - 0.5) * 20; const trend = getMonthTrend(month); history[id].push({ date: month, value: Math.max(0, baseValue + variation + trend) }); }); }); return history; } function getBaseValue(id) { const bases = { glucose: 90, insulin: 12, hdl: 45, ldl: 130, triglycerides: 150, hscrp: 2.5, testosterone: 600 }; return bases[id] || 50; } function getMonthTrend(month) { // Simulate gradual improvement trend const monthNum = parseInt(month.split('-')[1]); return (monthNum - 1) * 0.5; } // IF Training Functions let currentIFPlan = '16:8'; let fastStartTime = null; let fastInterval = null; let isCurrentlyFasting = true; function selectIFPlan(plan) { currentIFPlan = plan; // Update UI to show selected plan document.querySelectorAll('#if-training .grid button').forEach(btn => { btn.classList.remove('border-2', 'border-purple-500'); }); event.target.closest('button').classList.add('border-2', 'border-purple-500'); // Show confirmation showNotification(`เปลี่ยนแผนเป็น ${plan} แล้ว ✅`); } function toggleFast() { const btn = document.getElementById('fastToggleBtn'); if (isCurrentlyFasting) { // End fast isCurrentlyFasting = false; clearInterval(fastInterval); btn.innerHTML = '<i data-feather="play" class="w-5 h-5 inline mr-2"></i>เริ่มทำ IF ใหม่'; btn.classList.remove('bg-red-500', 'hover:bg-red-600'); btn.classList.add('bg-green-500', 'hover:bg-green-600'); // Update status document.querySelector('#if-training .bg-white\\/10 .bg-green-400').textContent = 'สิ้นสุดแล้ว'; document.querySelector('#if-training .bg-white\\/10 .bg-green-400').classList.remove('bg-green-400', 'text-green-900'); document.querySelector('#if-training .bg-white\\/10 .bg-green-400').classList.add('bg-gray-400', 'text-gray-900'); showNotification('สิ้นสุดการทำ IF วันนี้แล้ว! 🎉'); } else { // Start fast isCurrentlyFasting = true; startFastTimer(); btn.innerHTML = '<i data-feather="square" class="w-5 h-5 inline mr-2"></i>หยุดการทำ IF วันนี้'; btn.classList.remove('bg-green-500', 'hover:bg-green-600'); btn.classList.add('bg-red-500', 'hover:bg-red-600'); showNotification('เริ่มทำ IF แล้ว! 💪'); } feather.replace(); } function startFastTimer() { fastStartTime = new Date(); fastInterval = setInterval(() => { if (!isCurrentlyFasting) return; const now = new Date(); const elapsed = now - fastStartTime; // Calculate target time (16 hours from start for 16:8) const targetHours = 16; const targetMs = targetHours * 60 * 60 * 1000; const hours = Math.floor(elapsed / (1000 * 60 * 60)); const minutes = Math.floor((elapsed % (1000 * 60 * 60)) / (1000 * 60)); const seconds = Math.floor((elapsed % (1000 * 60)) / 1000); const timeString = `${String(hours).padStart(2, '0')}:${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`; // Update timer display const timerElement = document.querySelector('#if-training .text-3xl'); if (timerElement) { timerElement.textContent = timeString; } // Update progress bar const progress = Math.min((elapsed / targetMs) * 100, 100); const progressBar = document.querySelector('#if-training .bg-white\\/10 .bg-white'); if (progressBar) { progressBar.style.width = `${progress}%`; } // Update status const statusElement = document.querySelector('#if-training .bg-white\\/10 span'); if (statusElement && progress < 100) { statusElement.textContent = 'กำลังทำอยู่'; statusElement.classList.remove('bg-gray-400', 'text-gray-900', 'bg-green-400', 'text-green-900'); statusElement.classList.add('bg-green-400', 'text-green-900'); } else if (statusElement && progress >= 100) { statusElement.textContent = 'เกินเป้าแล้ว!'; statusElement.classList.remove('bg-green-400', 'text-green-900'); statusElement.classList.add('bg-yellow-400', 'text-yellow-900'); // Show completion notification if (!window.completionShown) { showNotification('🎊 ทำ IF ครบ 16 ชั่วโมงแล้ว! สามารถเริ่มทานอาหารได้'); window.completionShown = true; } } }, 1000); } function showNotification(message) { // Create a simple toast notification const toast = document.createElement('div'); toast.className = 'fixed top-4 right-4 bg-purple-600 text-white px-4 py-3 rounded-lg shadow-lg z-50 max-w-xs'; toast.innerHTML = ` <div class="flex items-center"> <i data-feather="check-circle" class="w-5 h-5 mr-2"></i> <span class="text-sm">${message}</span> </div> `; document.body.appendChild(toast); feather.replace(); // Auto remove after 3 seconds setTimeout(() => { toast.style.transition = 'opacity 0.3s'; toast.style.opacity = '0'; setTimeout(() => toast.remove(), 300); }, 3000); } // Initialize IF timer on page load document.addEventListener('DOMContentLoaded', () => { if (isCurrentlyFasting) { // Simulate that fast started at 20:00 const now = new Date(); fastStartTime = new Date(); fastStartTime.setHours(20, 0, 0, 0); // If it's after 20:00, start the timer if (now.getHours() >= 20 || now.getHours() < 12) { startFastTimer(); } } // Initialize Lab Charts initializeLabCharts(); }); // Lab View Switching function switchLabView(viewName) { // Hide all lab views document.querySelectorAll('.lab-view').forEach(view => { view.classList.add('hidden'); }); // Remove active class from all nav buttons document.querySelectorAll('.lab-nav-btn').forEach(btn => { btn.classList.remove('bg-purple-600', 'text-white'); btn.classList.add('bg-gray-200', 'text-gray-700'); }); // Show selected view document.getElementById(`lab-${viewName}`).classList.remove('hidden'); // Add active class to selected button const activeBtn = document.querySelector(`[onclick="switchLabView('${viewName}')"]`); activeBtn.classList.remove('bg-gray-200', 'text-gray-700'); activeBtn.classList.add('bg-purple-600', 'text-white'); feather.replace(); } // Toggle Panel Expand function togglePanelExpand(panelName) { const panel = document.getElementById(`${panelName}-panel`); const icon = event.currentTarget.querySelector('i'); if (panel.style.display === 'none') { panel.style.display = 'block'; icon.classList.remove('chevron-right'); icon.classList.add('chevron-down'); } else { panel.style.display = 'none'; icon.classList.remove('chevron-down'); icon.classList.add('chevron-right'); } feather.replace(); } // Initialize Lab Charts function initializeLabCharts() { // Radar Chart const radarCanvas = document.getElementById('radarChart'); if (radarCanvas) { const ctx = radarCanvas.getContext('2d'); // Simple radar chart implementation ctx.strokeStyle = '#8b5cf6'; ctx.lineWidth = 2; ctx.beginPath(); ctx.moveTo(60, 20); ctx.lineTo(100, 60); ctx.lineTo(80, 110); ctx.lineTo(40, 110); ctx.lineTo(20, 60); ctx.closePath(); ctx.stroke(); ctx.fillStyle = 'rgba(139, 92, 246, 0.1)'; ctx.fill(); } // Heatmap Chart const heatmapCanvas = document.getElementById('heatmapChart'); if (heatmapCanvas) { const ctx = heatmapCanvas.getContext('2d'); const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; const biomarkers = ['HOMA-IR', 'AIP', 'hs-CRP', 'HDL', 'LDL']; // Draw months ctx.font = '10px Arial'; ctx.fillStyle = '#666'; months.forEach((month, i) => { ctx.fillText(month, 20 + i * 22, 15); }); // Draw biomarkers biomarkers.forEach((marker, i) => { ctx.fillText(marker.substring(0, 8), 5, 35 + i * 30); }); // Draw heatmap cells for (let i = 0; i < biomarkers.length; i++) { for (let j = 0; j < months.length; j++) { const value = Math.random(); const hue = value > 0.5 ? 0 : (value > 0.25 ? 60 : 120); ctx.fillStyle = `hsla(${hue}, 70%, 50%, 0.7)`; ctx.fillRect(20 + j * 22, 20 + i * 30, 20, 20); } } } // Trend Chart const trendCanvas = document.getElementById('trendChart'); if (trendCanvas) { const ctx = trendCanvas.getContext('2d'); ctx.strokeStyle = '#8b5cf6'; ctx.lineWidth = 2; ctx.beginPath(); ctx.moveTo(10, 150); for (let i = 0; i < 10; i++) { ctx.lineTo(10 + i * 28, 150 - Math.random() * 100); } ctx.stroke(); } // Correlation Matrix const correlationCanvas = document.getElementById('correlationChart'); if (correlationCanvas) { const ctx = correlationCanvas.getContext('2d'); // Draw correlation heatmap for (let i = 0; i < 5; i++) { for (let j = 0; j < 5; j++) { const correlation = i === j ? 1 : (Math.random() - 0.5) * 2; const intensity = Math.abs(correlation); ctx.fillStyle = correlation > 0 ? `rgba(139, 92, 246, ${intensity})` : `rgba(239, 68, 68, ${intensity})`; ctx.fillRect(50 + j * 45, 50 + i * 45, 40, 40); } } } // Scatter Plot const scatterCanvas = document.getElementById('scatterChart'); if (scatterCanvas) { const ctx = scatterCanvas.getContext('2d'); ctx.fillStyle = '#8b5cf6'; for (let i = 0; i < 20; i++) { const x = Math.random() * 280 + 10; const y = Math.random() * 180 + 10; ctx.beginPath(); ctx.arc(x, y, 3, 0, Math.PI * 2); ctx.fill(); } } } // Download CSV Template function downloadTemplate() { const csv = 'date,biomarker_id,value,unit\n2024-12-15,glucose,92,mg/dL\n2024-12-15,insulin,14,μIU/mL\n2024-12-15,hdl,48,mg/dL\n2024-12-15,ldl,135,mg/dL\n2024-12-15,triglycerides,185,mg/dL'; const blob = new Blob([csv], { type: 'text/csv' }); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = 'lab_template.csv'; a.click(); } // Export Lab Data function exportLabData() { const labData = { version: '1.0', exportDate: new Date().toISOString(), settings: { gender: 'male', age: 28, units: 'US' }, biomarkers: { glucose: { values: [92, 89, 95, 90, 88, 91], unit: 'mg/dL' }, insulin: { values: [14, 12, 15, 13, 11, 14], unit: 'μIU/mL' }, hdl: { values: [48, 45, 50, 47, 46, 48], unit: 'mg/dL' } }, derived: { homa_ir: { values: [3.2, 2.9, 3.5, 3.1, 2.8, 3.2], unit: '' } } }; const blob = new Blob([JSON.stringify(labData, null, 2)], { type: 'application/json' }); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = 'lab_data.json'; a.click(); } // Reset Lab Data function resetLabData() { if (confirm('คุณต้องการรีเซ็ตข้อมูลทั้งหมดใช่หรือไม่? การกระทำนี้ไม่สามารถย้อนกลับได้')) { if (confirm('ยืนยันอีกครั้งว่าต้องการลบข้อมูลทั้งหมด')) { localStorage.removeItem('labData'); showNotification('รีเซ็ตข้อมูลเรียบร้อยแล้ว'); setTimeout(() => { switchLabView('overview'); }, 1000); } } } // File Import Handler document.getElementById('fileInput')?.addEventListener('change', function(e) { const file = e.target.files[0]; if (file && file.type === 'text/csv') { const reader = new FileReader(); reader.onload = function(e) { const csv = e.target.result; parseLabCSV(csv); }; reader.readAsText(file); } }); // Parse CSV Data function parseLabCSV(csv) { const lines = csv.split('\n'); const headers = lines[0].split(','); const data = []; for (let i = 1; i < lines.length; i++) { if (lines[i].trim()) { const values = lines[i].split(','); const row = {}; headers.forEach((header, index) => { row[header.trim()] = values[index]?.trim(); }); data.push(row); } } // Save to localStorage localStorage.setItem('importedLabData', JSON.stringify(data)); showNotification('นำเข้าข้อมูลเรียบร้อยแล้ว!'); setTimeout(() => { switchLabView('overview'); }, 1000); } // Lab Catalog (mock data structure) const labCatalog = { glucose: { id: 'glucose', label_th: 'กลูโคส', panel: 'metabolic', unit_SI: 'mmol/L', unit_US: 'mg/dL', toSI: (value) => value / 18, toUS: (value) => value * 18, ref_range: { male: { min: 3.9, max: 5.6 }, female: { min: 3.9, max: 5.6 } }, direction: 'high_worse', weight: 1.0 }, insulin: { id: 'insulin', label_th: 'อินซูลิน', panel: 'metabolic', unit_SI: 'pmol/L', unit_US: 'μIU/mL', toSI: (value) => value * 6, toUS: (value) => value / 6, ref_range: { male: { min: 2.6, max: 24.9 }, female: { min: 2.6, max: 24.9 } }, direction: 'high_worse', weight: 1.2 }, hdl: { id: 'hdl', label_th: 'HDL คอเลสเตอรอล', panel: 'lipids', unit_SI: 'mmol/L', unit_US: 'mg/dL', toSI: (value) => value / 38.67, toUS: (value) => value * 38.67, ref_range: { male: { min: 40, max: 60 }, female: { min: 50, max: 80 } }, direction: 'low_worse', weight: 1.0 } }; // Derived Calculations const labDerived = { homaIR: (glucose, insulin, units = 'US') => { const g = units === 'US' ? glucose : glucose * 18; return (g * insulin) / 405; }, nonHDL: (tc, hdl) => { return tc - hdl; }, ldlFriedewald: (tc, hdl, tg) => { if (tg >= 400) return null; return tc - hdl - (tg / 5); }, aip: (tg, hdl) => { return Math.log10(tg / hdl); }, eGFR: (scr, age, gender) => { const kappa = gender === 'female' ? 0.7 : 0.9; const alpha = gender === 'female' ? -0.241 : -0.302; let egfr = 142 * Math.min(scr / kappa, 1) ** alpha; egfr *= Math.max(scr / kappa, 1) ** -1.200; egfr *= 0.9938 ** age; if (gender === 'female') egfr *= 1.012; return Math.round(egfr); } }; // Z-Score Calculation function calculateZScore(value, mean, stdDev) { return Math.max(-3.5, Math.min(3.5, (value - mean) / stdDev)); } // Z-Score to Percentile function zScoreToPercentile(z) { // Simple approximation if (z >= 3) return 99.9; if (z <= -3) return 0.1; const table = [ {z: -3, p: 0.1}, {z: -2.5, p: 0.6}, {z: -2, p: 2.3}, {z: -1.5, p: 6.7}, {z: -1, p: 15.9}, {z: -0.5, p: 30.9}, {z: 0, p: 50}, {z: 0.5, p: 69.1}, {z: 1, p: 84.1}, {z: 1.5, p: 93.3}, {z: 2, p: 97.7}, {z: 2.5, p: 99.4}, {z: 3, p: 99.9} ]; for (let i = 1; i < table.length; i++) { if (z <= table[i].z) { const ratio = (z - table[i-1].z) / (table[i].z - table[i-1].z); return table[i-1].p + ratio * (table[i].p - table[i-1].p); } } return 50; } // Lab Wellness Index Calculation function calculateLabWellnessIndex(biomarkers, settings) { let totalScore = 0; let totalWeight = 0; Object.entries(biomarkers).forEach(([id, data]) => { const catalog = labCatalog[id]; if (catalog && data.value !== null) { const ref = catalog.ref_range[settings.gender]; const range = ref.max - ref.min; const deviation = catalog.direction === 'high_worse' ? Math.max(0, data.value - ref.max) : Math.max(0, ref.min - data.value); const normalizedScore = Math.max(0, 1 - (deviation / range)); totalScore += normalizedScore * catalog.weight; totalWeight += catalog.weight; } }); return totalWeight > 0 ? Math.round((totalScore / totalWeight) * 100) : 0; } </script> <script src="https://huggingface.co/deepsite/deepsite-badge.js"></script> </body> </html>
<!DOCTYPE html>
<html lang="th">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Whoop Thailand - ติดตามสุขภาพ 24 ชั่วโมง</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<script src="https://unpkg.com/feather-icons"></script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700&display=swap');
* {
font-family: 'Kanit', sans-serif;
}
.gradient-bg {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.card-shadow {
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
.health-metric-card {
transition: all 0.3s ease;
}
.health-metric-card:hover {
transform: translateY(-2px);
box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
.progress-ring {
transform: rotate(-90deg);
}
.tab-active {
border-bottom: 3px solid #667eea;
color: #667eea;
}
.scroll-hidden::-webkit-scrollbar {
display: none;
}
.scroll-hidden {
-ms-overflow-style: none;
scrollbar-width: none;
}
@keyframes pulse-dot {
0%, 60%, 100% {
opacity: 0.3;
}
30% {
opacity: 1;
}
}
.pulse-dot {
animation: pulse-dot 2s infinite;
}
.metric-trend-up {
color: #10b981;
}
.metric-trend-down {
color: #ef4444;
}
.metric-trend-neutral {
color: #6b7280;
}
</style>
</head>
<body class="bg-gray-50">
<!-- Mobile Container -->
<div class="max-w-md mx-auto bg-white min-h-screen relative">
<!-- Header -->
<div class="gradient-bg text-white p-4 pb-6">
<div class="flex justify-between items-center mb-4">
<div class="flex items-center space-x-2">
<div class="w-10 h-10 bg-white rounded-full flex items-center justify-center">
<span class="text-purple-600 font-bold text-xl">W</span>
</div>
<div>
<h1 class="text-lg font-semibold">Whoop</h1>
<p class="text-xs opacity-90">สวัสดี, สมชาย 👋</p>
</div>
</div>
<div class="flex items-center space-x-3">
<button onclick="showNotifications()" class="relative">
<i data-feather="bell" class="w-5 h-5"></i>
<span class="absolute -top-1 -right-1 w-2 h-2 bg-red-500 rounded-full pulse-dot"></span>
</button>
<button onclick="showProfile()">