pulse-coach / index.html
CSNET's picture
Project Name: ชีพจร (Pulse) - The Context-Aware Thai Health & Recovery Coach
9d40d50 verified
Raw History Blame Contribute Delete
26.3 kB
<!DOCTYPE html>
<html lang="th" class="scroll-smooth">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ชีพจร - ผู้ช่วยสุขภาาพไทยอัจฉริยะ</title>
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
<link rel="stylesheet" href="style.css">
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/feather-icons"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<script>
tailwind.config = {
theme: {
extend: {
fontFamily: {
'thai': ['Sarabun', 'sans-serif'],
},
colors: {
'thai': {
50: '#fef7ee',
100: '#feefd7',
200: '#fcdbae',
300: '#f9c27c',
400: '#f59e44',
500: '#f17f0b',
600: '#e36b07',
700: '#bc5308',
800: '#95420e',
900: '#78370f',
},
'sage': {
50: '#f5f7f6',
100: '#e3e9e6',
200: '#c8d3cd',
300: '#a3b5ac',
400: '#7a9485',
500: '#5d7968',
600: '#486152',
700: '#3d4f45',
800: '#334039',
900: '#2c3531',
}
}
}
}
}
</script>
</head>
<body class="bg-slate-50 font-thai" style="font-family: 'Sarabun', sans-serif;">
<!-- Navigation -->
<nav class="fixed top-0 w-full bg-white/90 backdrop-blur-md border-b border-slate-200 z-50">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between items-center h-16">
<div class="flex items-center">
<div class="flex-shrink-0">
<h1 class="text-xl font-bold text-thai-600">ชีพจร</h1>
</div>
<div class="hidden md:block">
<div class="ml-10 flex items-baseline space-x-4">
<a href="#dashboard" class="nav-link text-slate-700 hover:text-thai-600 px-3 py-2 text-sm font-medium">หน้าาหลัก</a>
<a href="#sleep" class="nav-link text-slate-700 hover:text-thai-600 px-3 py-2 text-sm font-medium">การนอน</a>
<a href="#activity" class="nav-link text-slate-700 hover:text-thai-600 px-3 py-2 text-sm font-medium">กิจกรรม</a>
<a href="#nutrition" class="nav-link text-slate-700 hover:text-thai-600 px-3 py-2 text-sm font-medium">โภชนาการ</a>
</div>
</div>
</div>
<div class="flex items-center space-x-4">
<button class="p-2 rounded-full text-slate-600 hover:bg-slate-100">
<i data-feather="bell" class="w-5 h-5"></i>
</button>
<img class="w-8 h-8 rounded-full" src="http://static.photos/people/200x200/1" alt="Profile">
</div>
</div>
</div>
</nav>
<!-- Main Content -->
<main class="pt-20 pb-20">
<!-- Hero Section -->
<section class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
<div class="text-center mb-12">
<h1 class="text-4xl md:text-5xl font-bold text-slate-900 mb-4">
ผู้ช่วยสุขภาาพที่เข้าใจคุณ
</h1>
<p class="text-xl text-slate-600 max-w-2xl mx-auto">
วิเเคราาะห์สุขภาาพของคุณด้วย AI ที่เข้าใจวิถีชีวิตไทย ตั้งแต่กะเเพราไข่ดาวจนนถึงการจราาจรในกรุงเเทพ
</p>
</div>
<!-- Dashboard Overview -->
<div id="dashboard" class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-12">
<!-- Recovery Card -->
<div class="bg-white rounded-2xl shadow-sm border border-slate-200 p-6">
<div class="flex items-center justify-between mb-4">
<h3 class="text-lg font-semibold text-slate-900">การฟื้นนตัว</h3>
<div class="w-12 h-12 rounded-full bg-green-100 flex items-center justify-center">
<i data-feather="heart" class="w-6 h-6 text-green-600"></i>
</div>
</div>
<div class="text-3xl font-bold text-green-600 mb-2">78%</div>
<p class="text-sm text-slate-600">พร้อมสำหรับวันนี้</p>
<div class="mt-4 p-3 bg-green-50 rounded-lg">
<p class="text-xs text-green-700">
<i data-feather="check-circle" class="w-4 h-4 inline mr-1"></i>
HRV อยู่ในเกณฑ์ดี
</p>
</div>
</div>
<!-- Strain Card -->
<div class="bg-white rounded-2xl shadow-sm border border-slate-200 p-6">
<div class="flex items-center justify-between mb-4">
<h3 class="text-lg font-semibold text-slate-900">ภาระร่างกาย</h3>
<div class="w-12 h-12 rounded-full bg-orange-100 flex items-center justify-center">
<i data-feather="zap" class="w-6 h-6 text-orange-600"></i>
</div>
</div>
<div class="text-3xl font-bold text-orange-600 mb-2">12.4</div>
<p class="text-sm text-slate-600">ระดับปานกลาง</p>
<div class="mt-4 p-3 bg-orange-50 rounded-lg">
<p class="text-xs text-orange-700">
<i data-feather="trending-up" class="w-4 h-4 inline mr-1"></i>
เ เพิ่มขึ้นนจากเมื่อวาน
</p>
</div>
</div>
<!-- Sleep Card -->
<div class="bg-white rounded-2xl shadow-sm border border-slate-200 p-6">
<div class="flex items-center justify-between mb-4">
<h3 class="text-lg font-semibold text-slate-900">การนอน</h3>
<div class="w-12 h-12 rounded-full bg-purple-100 flex items-center justify-center">
<i data-feather="moon" class="w-6 h-6 text-purple-600"></i>
</div>
</div>
<div class="text-3xl font-bold text-purple-600 mb-2">92%</div>
<p class="text-sm text-slate-600">คุณภาาพดีมาก</p>
<div class="mt-4 p-3 bg-purple-50 rounded-lg">
<p class="text-xs text-purple-700">
<i data-feather="clock" class="w-4 h-4 inline mr-1"></i>
7 ชั่วโมง 24 นาาที
</p>
</div>
</div>
</div>
<!-- Contextual Vitals -->
<div class="bg-white rounded-2xl shadow-sm border border-slate-200 p-6 mb-8">
<h3 class="text-lg font-semibold text-slate-900 mb-4">สภาาพแวดล้อมวันนี้</h3>
<div class="grid grid-cols-1 md:grid-cols-4 gap-4">
<div class="bg-slate-50 rounded-lg p-4">
<div class="flex items-center mb-2">
<i data-feather="wind" class="w-5 h-5 text-slate-600 mr-2"></i>
<span class="text-sm font-medium text-slate-700">AQI</span>
</div>
<p class="text-lg font-semibold text-yellow-600">ปานกลาง (65)</p>
<p class="text-xs text-slate-500">PM2.5: 35 μg/m³</p>
</div>
<div class="bg-slate-50 rounded-lg p-4">
<div class="flex items-center mb-2">
<i data-feather="sun" class="w-5 h-5 text-slate-600 mr-2"></i>
<span class="text-sm font-medium text-slate-700">อากาาศ</span>
</div>
<p class="text-lg font-semibold text-red-600">ร้อนมาก (39°C)</p>
<p class="text-xs text-slate-500">ความชื้น 68%</p>
</div>
<div class="bg-slate-50 rounded-lg p-4">
<div class="flex items-center mb-2">
<i data-feather="map-pin" class="w-5 h-5 text-slate-600 mr-2"></i>
<span class="text-sm font-medium text-slate-700">การจราาจร</span>
</div>
<p class="text-lg font-semibold text-red-600">ติดขัด</p>
<p class="text-xs text-slate-500">เเพิ่มขึ้น 45%</p>
</div>
<div class="bg-slate-50 rounded-lg p-4">
<div class="flex items-center mb-2">
<i data-feather="droplets" class="w-5 h-5 text-slate-600 mr-2"></i>
<span class="text-sm font-medium text-slate-700">ความเเครียด</span>
</div>
<p class="text-lg font-semibold text-yellow-600">ระดับกลาง</p>
<p class="text-xs text-slate-500">จากการจราาจร</p>
</div>
</div>
</div>
<!-- AI Coach Insight -->
<div class="bg-gradient-to-r from-thai-50 to-sage-50 rounded-2xl border border-thai-200 p-6 mb-8">
<div class="flex items-start">
<div class="flex-shrink-0">
<div class="w-12 h-12 rounded-full bg-thai-100 flex items-center justify-center">
<i data-feather="brain" class="w-6 h-6 text-thai-600"></i>
</div>
</div>
<div class="ml-4">
<h3 class="text-lg font-semibold text-slate-900 mb-2">คำแนนะนนำจากผู้ช่วย AI</h3>
<p class="text-slate-700">
วันนี้ฝุ่น PM2.5 อยู่ในระดับปานกลาง และอากาาศร้อนมาก จากข้อมูลพบว่า HRV ของคุณลดลง 15% ในในคืนนที่มีฝุ่นนสูง
แนนะนนำให้ลดการออกกำลังกายกลางแจ้ง และเลือกทำกิจกรรมในร่มแทน เ เช่น ฝึกมวยไทยในโรงยิมหรือนั่งสมาาธิ
</p>
<button class="mt-4 bg-thai-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-thai-700 transition">
ดูคำแนนะนนำเเพิ่มเเติม
</button>
</div>
</div>
</div>
<!-- Quick Actions -->
<div class="grid grid-cols-2 md:grid-cols-4 gap-4">
<button class="bg-white rounded-xl p-4 shadow-sm border border-slate-200 hover:shadow-md transition text-center">
<i data-feather="camera" class="w-8 h-8 text-thai-600 mx-auto mb-2"></i>
<span class="text-sm font-medium text-slate-700">ถ่ายอาาหาร</span>
</button>
<button class="bg-white rounded-xl p-4 shadow-sm border border-slate-200 hover:shadow-md transition text-center">
<i data-feather="play" class="w-8 h-8 text-green-600 mx-auto mb-2"></i>
<span class="text-sm font-medium text-slate-700">เริ่มออกกำลัง</span>
</button>
<button class="bg-white rounded-xl p-4 shadow-sm border border-slate-200 hover:shadow-md transition text-center">
<i data-feather="coffee" class="w-8 h-8 text-orange-600 mx-auto mb-2"></i>
<span class="text-sm font-medium text-slate-700">เริ่ม IF</span>
</button>
<button class="bg-white rounded-xl p-4 shadow-sm border border-slate-200 hover:shadow-md transition text-center">
<i data-feather="smile" class="w-8 h-8 text-purple-600 mx-auto mb-2"></i>
<span class="text-sm font-medium text-slate-700">บันันทึกอารมณ์</span>
</button>
</div>
</section>
<!-- Sleep Section -->
<section id="sleep" class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
<h2 class="text-2xl font-bold text-slate-900 mb-6">การนอนนหลับ</h2>
<div class="bg-white rounded-2xl shadow-sm border border-slate-200 p-6">
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<h3 class="text-lg font-semibold mb-4">เเวลานอนเมื่อคืน</h3>
<div class="space-y-4">
<div class="flex justify-between items-center">
<span class="text-slate-600">เข้านอน</span>
<span class="font-semibold text-slate-900">22:45 น.</span>
</div>
<div class="flex justify-between items-center">
<span class="text-slate-600">ตื่นนอน</span>
<span class="font-semibold text-slate-900">06:09 น.</span>
</div>
<div class="flex justify-between items-center">
<span class="text-slate-600">เเวลานอนนทั้งหมด</span>
<span class="font-semibold text-slate-900">7 ชม. 24 นาาที</span>
</div>
</div>
</div>
<div>
<h3 class="text-lg font-semibold mb-4">ระยะการนอน</h3>
<div class="space-y-2">
<div class="flex items-center justify-between">
<span class="text-sm text-slate-600">Deep</span>
<div class="flex-1 mx-3 bg-slate-200 rounded-full h-2">
<div class="bg-blue-600 h-2 rounded-full" style="width: 25%"></div>
</div>
<span class="text-sm font-semibold">1h 51m</span>
</div>
<div class="flex items-center justify-between">
<span class="text-sm text-slate-600">REM</span>
<div class="flex-1 mx-3 bg-slate-200 rounded-full h-2">
<div class="bg-purple-600 h-2 rounded-full" style="width: 20%"></div>
</div>
<span class="text-sm font-semibold">1h 28m</span>
</div>
<div class="flex items-center justify-between">
<span class="text-sm text-slate-600">Light</span>
<div class="flex-1 mx-3 bg-slate-200 rounded-full h-2">
<div class="bg-green-600 h-2 rounded-full" style="width: 55%"></div>
</div>
<span class="text-sm font-semibold">4h 5m</span>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Activity Section -->
<section id="activity" class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
<h2 class="text-2xl font-bold text-slate-900 mb-6">กิจกรรมและการออกกำลังกาย</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div class="bg-white rounded-2xl shadow-sm border border-slate-200 p-6">
<h3 class="text-lg font-semibold mb-4">ก้าววันนี้</h3>
<div class="text-center">
<div class="text-4xl font-bold text-thai-600 mb-2">8,432</div>
<p class="text-slate-600 mb-4">จากเป้า 10,000 ก้าว</p>
<div class="w-full bg-slate-200 rounded-full h-3">
<div class="bg-thai-600 h-3 rounded-full" style="width: 84%"></div>
</div>
</div>
</div>
<div class="bg-white rounded-2xl shadow-sm border border-slate-200 p-6">
<h3 class="text-lg font-semibold mb-4">แคลอรี่ที่เผาผลาญ</h3>
<div class="text-center">
<div class="text-4xl font-bold text-orange-600 mb-2">1,245</div>
<p class="text-slate-600">แคลอรี่</p>
</div>
</div>
</div>
</section>
<!-- Nutrition Section -->
<section id="nutrition" class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
<h2 class="text-2xl font-bold text-slate-900 mb-6">โภชนาการ</h2>
<div class="bg-white rounded-2xl shadow-sm border border-slate-200 p-6">
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
<div class="text-center">
<div class="text-2xl font-bold text-green-600 mb-1">1,850</div>
<p class="text-sm text-slate-600">แคลอรี่ที่รับประทาน</p>
</div>
<div class="text-center">
<div class="text-2xl font-bold text-blue-600 mb-1">75g</div>
<p class="text-sm text-slate-600">โปรตีน</p>
</div>
<div class="text-center">
<div class="text-2xl font-bold text-orange-600 mb-1">45g</div>
<p class="text-sm text-slate-600">ไขมัน</p>
</div>
</div>
<div class="mt-6">
<h4 class="font-semibold text-slate-900 mb-3">มื้อล่าสุด</h4>
<div class="space-y-3">
<div class="flex items-center justify-between p-3 bg-slate-50 rounded-lg">
<div>
<p class="font-medium text-slate-900">กะเพราไข่ดาว</p>
<p class="text-sm text-slate-600">มื้อเที่ยง • 650 แคลอรี่</p>
</div>
<img src="http://static.photos/food/120x120/1" alt="กะเพราไข่ดาว" class="w-16 h-16 rounded-lg object-cover">
</div>
</div>
</div>
</div>
</section>
</main>
<!-- Bottom Navigation -->
<nav class="fixed bottom-0 w-full bg-white border-t border-slate-200">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-around items-center h-16">
<a href="#dashboard" class="flex flex-col items-center py-2 text-thai-600">
<i data-feather="home" class="w-6 h-6 mb-1"></i>
<span class="text-xs">หน้าแรก</span>
</a>
<a href="sleep.html" class="flex flex-col items-center py-2 text-slate-600">
<i data-feather="moon" class="w-6 h-6 mb-1"></i>
<span class="text-xs">การนอน</span>
</a>
<a href="activity.html" class="flex flex-col items-center py-2 text-slate-600">
<i data-feather="activity" class="w-6 h-6 mb-1"></i>
<span class="text-xs">กิจกรรม</span>
</a>
<a href="nutrition.html" class="flex flex-col items-center py-2 text-slate-600">
<i data-feather="coffee" class="w-6 h-6 mb-1"></i>
<span class="text-xs">โภชนาการ</span>
</a>
</div>
</div>
</nav>
<!-- Address Management Modal -->
<div id="address-modal" class="fixed inset-0 bg-black bg-opacity-50 hidden z-50 flex items-center justify-center">
<div class="bg-white rounded-2xl p-6 max-w-md w-full mx-4">
<h3 class="text-lg font-semibold mb-4">จัดการที่อยู่</h3>
<div class="space-y-4">
<div>
<label class="block text-sm font-medium text-slate-700 mb-1">ที่อยู่บ้าน</label>
<input type="text" id="home-address" class="w-full px-3 py-2 border border-slate-300 rounded-lg" placeholder="ใส่ที่อยู่บ้าน">
</div>
<div>
<label class="block text-sm font-medium text-slate-700 mb-1">ที่อยู่ที่ทำงาน</label>
<input type="text" id="work-address" class="w-full px-3 py-2 border border-slate-300 rounded-lg" placeholder="ใส่ที่อยู่ที่ทำงาน">
</div>
<div class="flex gap-3">
<button onclick="saveAddress()" class="flex-1 bg-thai-600 text-white py-2 rounded-lg hover:bg-thai-700">บันันทึก</button>
<button onclick="closeAddressModal()" class="flex-1 bg-slate-200 text-slate-700 py-2 rounded-lg hover:bg-slate-300">ยกเลิก</button>
</div>
</div>
</div>
</div>
<!-- Food Camera Modal -->
<div id="food-modal" class="fixed inset-0 bg-black bg-opacity-50 hidden z-50 flex items-center justify-center">
<div class="bg-white rounded-2xl p-6 max-w-sm w-full mx-4">
<h3 class="text-lg font-semibold mb-4">ถ่ายอาาหาร</h3>
<input type="file" id="food-photo" accept="image/*" class="w-full mb-4">
<div class="flex gap-3">
<button onclick="analyzeFood()" class="flex-1 bg-thai-600 text-white py-2 rounded-lg hover:bg-thai-700">วิเเคราาะห์</button>
<button onclick="closeFoodModal()" class="flex-1 bg-slate-200 text-slate-700 py-2 rounded-lg hover:bg-slate-300">ยกเลิก</button>
</div>
</div>
</div>
<script src="script.js"></script>
<script>
feather.replace();
// Modal functions
function openAddressModal() {
document.getElementById('address-modal').classList.remove('hidden');
}
function closeAddressModal() {
document.getElementById('address-modal').classList.add('hidden');
}
function openFoodModal() {
document.getElementById('food-modal').classList.remove('hidden');
}
function closeFoodModal() {
document.getElementById('food-modal').classList.add('hidden');
}
function saveAddress() {
const home = document.getElementById('home-address').value;
const work = document.getElementById('work-address').value;
localStorage.setItem('homeAddress', home);
localStorage.setItem('workAddress', work);
closeAddressModal();
}
function analyzeFood() {
alert('กำลังวิเเคราาะห์อาาหาร... พบว่าเป็น "กะเเพราไข่ดาว" 650 แคลอรี่');
closeFoodModal();
}
// Load saved addresses
const homeAddress = localStorage.getItem('homeAddress') || '';
const workAddress = localStorage.getItem('workAddress') || '';
document.getElementById('home-address').value = homeAddress;
document.getElementById('work-address').value = workAddress;
</script>
</body>
</html>