CSNET commited on
Commit
df62a7a
·
verified ·
1 Parent(s): 177ed88

ทำแอพ HTML5 ภาษาไทย โดยมี module ดังนี้

Browse files

Module 2: Dashboard (หน้าหลัก "วันนี้") - (The "WOW" Factor)
(เชื่อมโยง UI id="dashboard")

นี่คือหน้าจอที่สำคัญที่สุดที่ต้อง "ชนะใจ" ผู้ใช้ภายใน 5 วินาที ต้องแสดงให้เห็นทันทีว่าแอปนี้ "ฉลาด" และ "เข้าใจชีวิตคนไทย"

Function 2.1: Main Vitals (Real Data):

Detail: ไม่ใช่แค่แสดงตัวเลข 3 วง (Recovery, Strain, Sleep) แต่ต้องแสดง "ความสมดุล" ของร่างกาย วงกลมทั้ง 3 ต้องเชื่อมโยงกัน เช่น หาก Recovery ต่ำ (สีแดง) วง Strain ควรมี "เป้าหมายที่แนะนำ" (Target Strain) ที่ต่ำลงโดยอัตโนมัติ และ AI Coach (2.3) ต้องอธิบายว่าทำไม

Data Source: ดึงข้อมูลดิบ (HRV, RHR, Sleep Stages) จาก HealthKit/Connect และส่งให้ Module 8 (AI Coach) คำนวณเป็นคะแนนที่ "เข้าใจง่าย" แล้วส่งกลับมาแสดงผล

Function 2.2: Contextual Vitals (Live API) - (The "Context" Killer)

Detail: นี่คือสิ่งที่ WHOOP ไม่มี! ต้องทำให้ผู้ใช้ "ตระหนักรู้" ว่าสิ่งแวดล้อมกำลังส่งผลต่อร่างกายเขายังไง

"คุณภาพอากาศ (PM2.5)": แสดงค่า AQI ตาม Location จริงของผู้ใช้ พร้อม "คำเตือน" (เช่น "ฝุ่นสูง! ลดการออกกำลังกายกลางแจ้ง")

"ดัชนีความร้อน": ไม่ใช่แค่อุณหภูมิ แต่ต้องเป็น "Heat Index" (อุณหภูมิที่รู้สึกจริง) พร้อมคำเตือน (เช่น "ร้อนจัด! เสี่ยงฮีทสโตรก ดื่มน้ำเพิ่ม")

"การจราจร": (ดึงจาก "บ้าน" ไป "ที่ทำงาน") แสดงเวลาเดินทาง พร้อม "คำเตือนด้านความเครียด" (เช่น "วันนี้รถติดหนัก เผื่อเวลาเดินทาง และระวังความเครียดสะสม")

(ใหม่) "น้ำท่วม/ฝนตกหนัก": (ดึง API GISTDA/กรมอุตุฯ) แจ้งเตือนหากมีฝนตกหนักหรือน้ำท่วมฉับพลันในพื้นที่

Function 2.3: AI Coach Summary (Dynamic) - (The "So What?")

Detail: นี่คือ "บทสรุปผู้บริหาร" สำหรับสุขภาพวันนี้ ต้องไม่ใช่ Text นิ่งๆ แต่เป็น "ข้อความที่ Generate สดใหม่ทุกเช้า" โดย Module 8

Example (Win vs WHOOP):

WHOOP: "Your Recovery is 45%."

ชีพจร (Pulse): "วันนี้คุณฟื้นตัว 45% (สีเหลือง) เพราะ เมื่อคืนค่า PM2.5 สูง ทำให้การหายใจติดขัด (Respiratory Rate สูง) และการจราจรที่ติดหนักเมื่อวาน ทำให้คุณเครียดสะสม (HRV ต่ำ) ดังนั้น วันนี้ AI แนะนำให้งดเวทหนัก เปลี่ยนเป็นโยคะในบ้าน และดื่มน้ำให้มากขึ้นครับ"

Function 2.4: Quick Actions (Functional):

Detail: ปุ่มลัดต้อง "ฉลาด" เช่น ถ้าผู้ใช้กำลังทำ IF (จาก Module 6) ปุ่ม "บันทึกอาหาร" อาจจะเปลี่ยนเป็น "บันทึกการดื่มน้ำ" แทน หรือหากระบบตรวจพบว่าเพิ่งออกกำลังกายเสร็จ ปุ่มอาจจะ Pop-up ถามว่า "บันทึกกิจกรรมเมื่อสักครู่?"

Module 3: Sleep Tracking (การนอนหลับ) - (The Foundation)
(เชื่อมโยง UI id="sleep")

WHOOP เก่งเรื่องนี้มาก เราต้องทำได้ "เทียบเท่า" และ "อธิบายได้ดีกว่า"

Function 3.1: Automatic Detection:

Detail: สร้างระบบที่ "เรียนรู้" แพทเทิร์นการนอนของผู้ใช้ (Calibration Phase) เพื่อให้การตรวจจับการ "เริ่มนอน" และ "ตื่นนอน" แม่นยำ 100% โดยไม่ต้องกดปุ่มใดๆ (ใช้ข้อมูล HR, Movement, และ Respiratory Rate)

Function 3.2: Data Processing:

Detail: ไม่ใช่แค่แสดงกราฟ Sleep Stages แต่ต้องประมวลผล "ตัวชี้วัดคุณภาพ" ที่สำคัญ เช่น:

Sleep Performance: (% เทียบกับ "หนี้การนอน" หรือ Sleep Debt)

Sleep Consistency: (ความสม่ำเสมอของเวลานอน/ตื่น)

Time to Fall Asleep: (ใช้เวลาล้มตัวลงนอนนานแค่ไหน)

Disturbances: (จำนวนครั้งที่ตื่นกลางดึก)

ข้อมูลทั้งหมดนี้จะถูกส่งไปเป็น "วัตถุดิบ" ให้ Module 5 และ 8

Function 3.3: Smart Alarm:

Detail: สร้างฟีเจอร์นาฬิกาปลุกอัจฉริยะ ที่ปลุกผู้ใช้ในช่วง "Light Sleep" ภายใน 30 นาทีก่อนเวลาที่ตั้งไว้ เพื่อให้เป็นการตื่นนอนที่ "สดใสที่สุด" (Most refreshing wake-up) โดยไม่กระทบต่อ Deep/REM Sleep

Module 4: Strain & Activity (การออกกำลังกาย) - (The Thai Flavour)
(เชื่อมโยง UI id="activity" และ id="strain")

Function 4.1: Activity Logging (Hyper-Localization):

Detail: สร้างฐานข้อมูล Activity ที่ออกแบบมาเพื่อคนไทยโดยเฉพาะ

"มวยไทย", "แบดมินตัน", "โยคะ", "เวทเทรนนิ่ง", "วิ่งในสวน"

"นั่งสมาธิ", "สวดมนต์", "เดินจงกรม": นี่คือ Killer Feature ด้าน Mental Health โดยระบบจะวัด HR และ HRV ระหว่างทำกิจกรรม เพื่อแสดงให้เห็นว่า "จิตใจที่สงบ" ส่งผลต่อ "ร่างกาย" (HRV สูงขึ้น) อย่างไร

Function 4.2: Strain Calculation:

Detail: สร้างระบบคำนวณคะแนน Cardiovascular Load (0-21) ที่แม่นยำ โดยอิงจากการใช้เวลาใน Heart Rate Zone ต่างๆ ตลอดทั้งวัน (ทั้งจากการใช้ชีวิตและการออกกำลังกาย)

Function 4.3: Strain Coach (Smarter than WHOOP):

Detail: AI จะแนะนำ "กรอบ Strain ที่เหมาะสม" (เช่น 10.5-12.0) โดยอิงจาก 3 ปัจจัย (ไม่ใช่แค่ Recovery):

Recovery Score (จาก Module 5)

เป้าหมายของผู้ใช้ (เช่น สร้างกล้าม, ลดไขมัน, รักษาสภาพ)

(!!จุดชนะ!!) ปัจจัยบริบท (จาก Module 2.2): เช่น "วันนี้อากาศร้อนจัดและ PM2.5 สูง AI จะปรับลด Strain เป้าหมายของคุณลง 20% อัตโนมัติ เพื่อป้องกัน Over-train และการอักเสบ"

Module 5: Recovery (การฟื้นตัว) - (The "Why")
(เชื่อมโยง UI id="recovery")

Function 5.1: Recovery Calculation:

Detail: คำนวณคะแนน Recovery (%) ตอนตื่นนอน โดยใช้ Key Metrics ที่สำคัญที่สุด: HRV (ตัวแปรหลัก), RHR (อัตราการเต้นหัวใจขณะพัก), คุณภาพการนอน (จาก Module 3), และ Respiratory Rate

Function 5.2: Factor Analysis (The Automated Journal):

Detail: นี่คือ Killer Feature ที่ชนะ WHOOP (ที่ยังให้ผู้ใช้กรอก Journal เอง) ระบบของเราจะ "วิเคราะห์ปัจจัยบวก/ลบ อัตโนมัติ" ที่ส่งผลต่อ Recovery ของเมื่อคืน

Example UI:

การนอนหลับ (Deep Sleep เยอะ): +20%

การออกกำลังกาย (เหมาะสม): +10%

PM2.5 (จาก API): -15% (ระบบตรวจพบว่าฝุ่นสูง)

ความเครียด (จาก API):

Files changed (7) hide show
  1. README.md +8 -5
  2. components/bottomNav.js +170 -0
  3. components/navbar.js +122 -0
  4. components/vitalCircle.js +258 -0
  5. index.html +762 -19
  6. script.js +447 -0
  7. style.css +377 -18
README.md CHANGED
@@ -1,10 +1,13 @@
1
  ---
2
- title: Pulse Tracker
3
- emoji: 🚀
4
- colorFrom: purple
5
- colorTo: green
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
1
  ---
2
+ title: ชีพจร Pulse Tracker
3
+ colorFrom: gray
4
+ colorTo: blue
5
+ emoji: 🐳
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite-v3
10
  ---
11
 
12
+ # Welcome to your new DeepSite project!
13
+ This project was created with [DeepSite](https://huggingface.co/deepsite).
components/bottomNav.js ADDED
@@ -0,0 +1,170 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class BottomNav extends HTMLElement {
2
+ connectedCallback() {
3
+ this.attachShadow({ mode: 'open' });
4
+ this.shadowRoot.innerHTML = `
5
+ <style>
6
+ .bottom-nav {
7
+ position: fixed;
8
+ bottom: 0;
9
+ left: 0;
10
+ right: 0;
11
+ background: white;
12
+ border-top: 1px solid #e5e7eb;
13
+ box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
14
+ z-index: 50;
15
+ }
16
+ .nav-container {
17
+ max-width: 480px;
18
+ margin: 0 auto;
19
+ display: flex;
20
+ justify-content: space-around;
21
+ padding: 8px 0;
22
+ }
23
+ .nav-item {
24
+ flex: 1;
25
+ display: flex;
26
+ flex-direction: column;
27
+ align-items: center;
28
+ padding: 8px 4px;
29
+ text-decoration: none;
30
+ color: #6b7280;
31
+ transition: all 0.3s ease;
32
+ cursor: pointer;
33
+ position: relative;
34
+ }
35
+ .nav-item.active {
36
+ color: #6366f1;
37
+ }
38
+ .nav-item:hover {
39
+ color: #6366f1;
40
+ }
41
+ .nav-item i {
42
+ width: 24px;
43
+ height: 24px;
44
+ margin-bottom: 4px;
45
+ }
46
+ .nav-label {
47
+ font-size: 11px;
48
+ font-weight: 500;
49
+ }
50
+ .pulse-dot {
51
+ position: absolute;
52
+ top: 8px;
53
+ right: calc(50% - 20px);
54
+ width: 8px;
55
+ height: 8px;
56
+ background: #ef4444;
57
+ border-radius: 50%;
58
+ animation: pulse 2s infinite;
59
+ }
60
+ @keyframes pulse {
61
+ 0% {
62
+ transform: scale(0.95);
63
+ box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
64
+ }
65
+ 70% {
66
+ transform: scale(1);
67
+ box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
68
+ }
69
+ 100% {
70
+ transform: scale(0.95);
71
+ box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
72
+ }
73
+ }
74
+ </style>
75
+ <div class="bottom-nav">
76
+ <div class="nav-container">
77
+ <a href="#dashboard" class="nav-item active" data-page="dashboard">
78
+ <i data-feather="home"></i>
79
+ <span class="nav-label">วันนี้</span>
80
+ </a>
81
+ <a href="#sleep" class="nav-item" data-page="sleep">
82
+ <i data-feather="moon"></i>
83
+ <span class="nav-label">นอน</span>
84
+ </a>
85
+ <a href="#activity" class="nav-item" data-page="activity">
86
+ <i data-feather="activity"></i>
87
+ <span class="nav-label">กิจกรรม</span>
88
+ </a>
89
+ <a href="#nutrition" class="nav-item" data-page="nutrition">
90
+ <i data-feather="coffee"></i>
91
+ <span class="nav-label">โภชนาการ</span>
92
+ </a>
93
+ <a href="#mental" class="nav-item" data-page="mental">
94
+ <i data-feather="heart"></i>
95
+ <span class="nav-label">จิตใจ</span>
96
+ <div class="pulse-dot"></div>
97
+ </a>
98
+ </div>
99
+ </div>
100
+ `;
101
+
102
+ // Add click event listeners
103
+ this.shadowRoot.querySelectorAll('.nav-item').forEach(item => {
104
+ item.addEventListener('click', (e) => {
105
+ e.preventDefault();
106
+ const targetId = item.getAttribute('href').substring(1);
107
+
108
+ // Update active state
109
+ this.shadowRoot.querySelectorAll('.nav-item').forEach(navItem => {
110
+ navItem.classList.remove('active');
111
+ });
112
+ item.classList.add('active');
113
+
114
+ // Navigate to page
115
+ navigateToPage(targetId);
116
+ });
117
+ });
118
+ }
119
+ }
120
+
121
+ customElements.define('bottom-nav', BottomNav);
122
+
123
+ function navigateToPage(pageId) {
124
+ // Hide all pages
125
+ document.querySelectorAll('.page-content').forEach(page => {
126
+ page.classList.remove('active');
127
+ });
128
+
129
+ // Show target page
130
+ const targetPage = document.getElementById(pageId);
131
+ if (targetPage) {
132
+ targetPage.classList.add('active');
133
+ }
134
+
135
+ // Update URL hash
136
+ window.location.hash = pageId;
137
+
138
+ // Scroll to top
139
+ window.scrollTo(0, 0);
140
+ }
141
+
142
+ // Handle browser back/forward buttons
143
+ window.addEventListener('popstate', function() {
144
+ const hash = window.location.hash.substring(1);
145
+ if (hash) {
146
+ navigateToPage(hash);
147
+
148
+ // Update bottom nav active state
149
+ document.querySelectorAll('bottom-nav .nav-item').forEach(item => {
150
+ item.classList.remove('active');
151
+ if (item.getAttribute('href') === '#' + hash) {
152
+ item.classList.add('active');
153
+ }
154
+ });
155
+ }
156
+ });
157
+
158
+ // Set initial page based on URL hash
159
+ window.addEventListener('load', function() {
160
+ const hash = window.location.hash.substring(1) || 'dashboard';
161
+ navigateToPage(hash);
162
+
163
+ // Update bottom nav active state
164
+ document.querySelectorAll('bottom-nav .nav-item').forEach(item => {
165
+ item.classList.remove('active');
166
+ if (item.getAttribute('href') === '#' + hash) {
167
+ item.classList.add('active');
168
+ }
169
+ });
170
+ });
components/navbar.js ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class NavbarCustom extends HTMLElement {
2
+ connectedCallback() {
3
+ this.attachShadow({ mode: 'open' });
4
+ this.shadowRoot.innerHTML = `
5
+ <style>
6
+ .navbar {
7
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
8
+ padding: 16px 20px;
9
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
10
+ }
11
+ .navbar-container {
12
+ max-width: 480px;
13
+ margin: 0 auto;
14
+ display: flex;
15
+ align-items: center;
16
+ justify-content: space-between;
17
+ }
18
+ .logo {
19
+ color: white;
20
+ font-size: 24px;
21
+ font-weight: bold;
22
+ text-decoration: none;
23
+ display: flex;
24
+ align-items: center;
25
+ }
26
+ .logo-icon {
27
+ width: 32px;
28
+ height: 32px;
29
+ margin-right: 8px;
30
+ background: white;
31
+ border-radius: 50%;
32
+ display: flex;
33
+ align-items: center;
34
+ justify-content: center;
35
+ }
36
+ .notification-btn {
37
+ background: rgba(255, 255, 255, 0.2);
38
+ border: none;
39
+ border-radius: 50%;
40
+ width: 40px;
41
+ height: 40px;
42
+ display: flex;
43
+ align-items: center;
44
+ justify-content: center;
45
+ cursor: pointer;
46
+ transition: all 0.3s ease;
47
+ }
48
+ .notification-btn:hover {
49
+ background: rgba(255, 255, 255, 0.3);
50
+ transform: scale(1.05);
51
+ }
52
+ .notification-badge {
53
+ position: absolute;
54
+ top: -4px;
55
+ right: -4px;
56
+ background: #ef4444;
57
+ color: white;
58
+ border-radius: 50%;
59
+ width: 16px;
60
+ height: 16px;
61
+ display: flex;
62
+ align-items: center;
63
+ justify-content: center;
64
+ font-size: 10px;
65
+ font-weight: bold;
66
+ }
67
+ </style>
68
+ <nav class="navbar">
69
+ <div class="navbar-container">
70
+ <a href="#dashboard" class="logo">
71
+ <div class="logo-icon">
72
+ <span style="color: #667eea;">💗</span>
73
+ </div>
74
+ <span>ชีพจร</span>
75
+ </a>
76
+ <button class="notification-btn" onclick="showNotifications()">
77
+ <i data-feather="bell" style="width: 20px; height: 20px; color: white;"></i>
78
+ <span class="notification-badge">3</span>
79
+ </button>
80
+ </div>
81
+ </nav>
82
+ `;
83
+ }
84
+ }
85
+
86
+ customElements.define('nav-custom', NavbarCustom);
87
+
88
+ function showNotifications() {
89
+ // Create notification modal
90
+ const modal = document.createElement('div');
91
+ modal.className = 'modal';
92
+ modal.innerHTML = `
93
+ <div class="modal-content">
94
+ <h2 class="text-xl font-bold mb-4">การแจ้งเตือน</h2>
95
+ <div class="space-y-3">
96
+ <div class="p-3 bg-red-50 rounded-lg border-l-4 border-red-500">
97
+ <div class="font-semibold text-red-800">คำเตือน PM2.5</div>
98
+ <div class="text-sm text-red-600">ค่า PM2.5 สูงกว่ามาตรฐาน ควรหลีกเลี่ยงการออกกำลังกายกลางแจ้ง</div>
99
+ </div>
100
+ <div class="p-3 bg-orange-50 rounded-lg border-l-4 border-orange-500">
101
+ <div class="font-semibold text-orange-800">แจ้งเตือนออฟฟิศ</div>
102
+ <div class="text-sm text-orange-600">นั่งนิ่งมา 60 นาทีแล้ว ควรลุกขึ้นเดิน</div>
103
+ </div>
104
+ <div class="p-3 bg-blue-50 rounded-lg border-l-4 border-blue-500">
105
+ <div class="font-semibold text-blue-800">เวลาทานยา</div>
106
+ <div class="text-sm text-blue-600">ถึงเวลาทานวิตามินประจำวันแล้ว</div>
107
+ </div>
108
+ </div>
109
+ <button class="w-full mt-4 bg-indigo-600 text-white rounded-lg py-2 font-semibold hover:bg-indigo-700 transition" onclick="this.closest('.modal').remove()">
110
+ ปิด
111
+ </button>
112
+ </div>
113
+ `;
114
+ document.body.appendChild(modal);
115
+
116
+ // Close modal when clicking outside
117
+ modal.addEventListener('click', function(e) {
118
+ if (e.target === modal) {
119
+ modal.remove();
120
+ }
121
+ });
122
+ }
components/vitalCircle.js ADDED
@@ -0,0 +1,258 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class VitalCircle extends HTMLElement {
2
+ constructor() {
3
+ super();
4
+ this.value = this.getAttribute('value') || 0;
5
+ this.max = this.getAttribute('max') || 100;
6
+ this.label = this.getAttribute('label') || '';
7
+ this.sublabel = this.getAttribute('sublabel') || '';
8
+ this.color = this.getAttribute('color') || 'blue';
9
+ }
10
+
11
+ connectedCallback() {
12
+ this.attachShadow({ mode: 'open' });
13
+ this.render();
14
+ }
15
+
16
+ static get observedAttributes() {
17
+ return ['value', 'max', 'label', 'sublabel', 'color'];
18
+ }
19
+
20
+ attributeChangedCallback(name, oldValue, newValue) {
21
+ if (oldValue !== newValue) {
22
+ this[name] = newValue;
23
+ this.render();
24
+ }
25
+ }
26
+
27
+ getColorClasses() {
28
+ const colors = {
29
+ green: {
30
+ stroke: '#10b981',
31
+ fill: '#10b98120',
32
+ text: 'text-green-600',
33
+ bg: 'bg-green-50'
34
+ },
35
+ yellow: {
36
+ stroke: '#f59e0b',
37
+ fill: '#f59e0b20',
38
+ text: 'text-yellow-600',
39
+ bg: 'bg-yellow-50'
40
+ },
41
+ red: {
42
+ stroke: '#ef4444',
43
+ fill: '#ef444420',
44
+ text: 'text-red-600',
45
+ bg: 'bg-red-50'
46
+ },
47
+ blue: {
48
+ stroke: '#3b82f6',
49
+ fill: '#3b82f620',
50
+ text: 'text-blue-600',
51
+ bg: 'bg-blue-50'
52
+ },
53
+ purple: {
54
+ stroke: '#8b5cf6',
55
+ fill: '#8b5cf620',
56
+ text: 'text-purple-600',
57
+ bg: 'bg-purple-50'
58
+ }
59
+ };
60
+
61
+ return colors[this.color] || colors.blue;
62
+ }
63
+
64
+ render() {
65
+ const colors = this.getColorClasses();
66
+ const percentage = (this.value / this.max) * 100;
67
+ const circumference = 2 * Math.PI * 45;
68
+ const strokeDashoffset = circumference - (percentage / 100) * circumference;
69
+
70
+ this.shadowRoot.innerHTML = `
71
+ <style>
72
+ .vital-container {
73
+ text-align: center;
74
+ background: white;
75
+ border-radius: 16px;
76
+ padding: 16px;
77
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
78
+ transition: all 0.3s ease;
79
+ cursor: pointer;
80
+ }
81
+ .vital-container:hover {
82
+ transform: translateY(-2px);
83
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
84
+ }
85
+ .circle-svg {
86
+ width: 120px;
87
+ height: 120px;
88
+ transform: rotate(-90deg);
89
+ margin: 0 auto 8px;
90
+ }
91
+ .circle-background {
92
+ fill: none;
93
+ stroke: #e5e7eb;
94
+ stroke-width: 8;
95
+ }
96
+ .circle-progress {
97
+ fill: none;
98
+ stroke: ${colors.stroke};
99
+ stroke-width: 8;
100
+ stroke-linecap: round;
101
+ transition: stroke-dashoffset 0.5s ease;
102
+ }
103
+ .vital-value {
104
+ font-size: 24px;
105
+ font-weight: bold;
106
+ margin: -60px 0 8px 0;
107
+ color: #1f2937;
108
+ }
109
+ .vital-label {
110
+ font-size: 14px;
111
+ font-weight: 600;
112
+ color: #4b5563;
113
+ margin-bottom: 2px;
114
+ }
115
+ .vital-sublabel {
116
+ font-size: 12px;
117
+ color: ${colors.stroke};
118
+ }
119
+ .pulse {
120
+ animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
121
+ }
122
+ @keyframes pulse {
123
+ 0%, 100% {
124
+ opacity: 1;
125
+ }
126
+ 50% {
127
+ opacity: 0.7;
128
+ }
129
+ }
130
+ </style>
131
+
132
+ <div class="vital-container">
133
+ <svg class="circle-svg">
134
+ <circle cx="60" cy="60" r="45" class="circle-background"></circle>
135
+ <circle
136
+ cx="60" cy="60" r="45"
137
+ class="circle-progress pulse"
138
+ style="stroke-dasharray: ${circumference}; stroke-dashoffset: ${strokeDashoffset};"
139
+ ></circle>
140
+ </svg>
141
+ <div class="vital-value">${this.value}</div>
142
+ <div class="vital-label">${this.label}</div>
143
+ <div class="vital-sublabel">${this.sublabel}</div>
144
+ </div>
145
+ `;
146
+
147
+ // Add click event
148
+ this.shadowRoot.querySelector('.vital-container').addEventListener('click', () => {
149
+ this.showDetails();
150
+ });
151
+ }
152
+
153
+ showDetails() {
154
+ // Create detail modal
155
+ const modal = document.createElement('div');
156
+ modal.className = 'modal';
157
+ modal.style.display = 'flex';
158
+
159
+ const colors = this.getColorClasses();
160
+ const percentage = Math.round((this.value / this.max) * 100);
161
+
162
+ modal.innerHTML = `
163
+ <div class="modal-content">
164
+ <div class="text-center mb-4">
165
+ <div class="text-4xl font-bold ${colors.text} mb-2">${this.value}</div>
166
+ <div class="text-lg font-semibold mb-1">${this.label}</div>
167
+ <div class="text-sm text-gray-500">${this.sublabel}</div>
168
+ </div>
169
+
170
+ <div class="mb-4">
171
+ <div class="flex justify-between text-sm mb-2">
172
+ <span>ความคืบหน้า</span>
173
+ <span>${percentage}%</span>
174
+ </div>
175
+ <div class="w-full bg-gray-200 rounded-full h-3">
176
+ <div class="${colors.text.replace('text', 'bg')} h-3 rounded-full transition-all" style="width: ${percentage}%"></div>
177
+ </div>
178
+ </div>
179
+
180
+ <div class="mb-4">
181
+ <div class="flex justify-between text-sm mb-1">
182
+ <span>ปัจจุบัน</span>
183
+ <span class="font-semibold">${this.value}</span>
184
+ </div>
185
+ <div class="flex justify-between text-sm">
186
+ <span>เป้าหมาย</span>
187
+ <span class="font-semibold">${this.max}</span>
188
+ </div>
189
+ </div>
190
+
191
+ <div class="bg-gray-50 rounded-lg p-3 mb-4">
192
+ <div class="text-sm text-gray-600 mb-2">ข้อมูลเพิ่มเติม:</div>
193
+ <div class="text-sm">
194
+ ${this.getDetailedInfo()}
195
+ </div>
196
+ </div>
197
+
198
+ <button class="w-full bg-indigo-600 text-white rounded-lg py-2 font-semibold hover:bg-indigo-700 transition" onclick="this.closest('.modal').remove()">
199
+ ปิด
200
+ </button>
201
+ </div>
202
+ `;
203
+
204
+ document.body.appendChild(modal);
205
+
206
+ // Close modal when clicking outside
207
+ modal.addEventListener('click', function(e) {
208
+ if (e.target === modal) {
209
+ modal.remove();
210
+ }
211
+ });
212
+ }
213
+
214
+ getDetailedInfo() {
215
+ const info = {
216
+ Recovery: {
217
+ text: 'Recovery Score คือการวัดความพร้อมของร่างกาย คำนวณจาก HRV, RHR, และคุณภาพการนอน',
218
+ tips: [
219
+ '70%+ = พร้อมฝึกหนัก',
220
+ '40-69% = ฝึกปานกลาง',
221
+ 'ต่ำกว่า 40% = พักผ่อน'
222
+ ]
223
+ },
224
+ Strain: {
225
+ text: 'Strain คือปริมาณของการใช้พลังงานรวมทั้งวัน (0-21)',
226
+ tips: [
227
+ '0-9 = การฟื้นตัว',
228
+ '10-13 = ฝึกปานกลาง',
229
+ '14-17 = ฝึกหนัก',
230
+ '18+ = ฝึกหนักมาก'
231
+ ]
232
+ },
233
+ Sleep: {
234
+ text: 'ชั่วโมงการนอนที่แนะนำสำหรับผู้ใหญ่คือ 7-9 ชั่วโมง',
235
+ tips: [
236
+ 'คุณภาพสำคัญกว่าปริมาณ',
237
+ 'Deep Sleep ควรเป็น 15-20%',
238
+ 'REM Sleep ควรเป็น 20-25%'
239
+ ]
240
+ }
241
+ };
242
+
243
+ const details = info[this.label] || { text: '', tips: [] };
244
+ let html = `<p>${details.text}</p>`;
245
+
246
+ if (details.tips.length > 0) {
247
+ html += '<ul class="mt-2 space-y-1">';
248
+ details.tips.forEach(tip => {
249
+ html += `<li class="flex items-start"><span class="mr-2">•</span><span>${tip}</span></li>`;
250
+ });
251
+ html += '</ul>';
252
+ }
253
+
254
+ return html;
255
+ }
256
+ }
257
+
258
+ customElements.define('vital-circle', VitalCircle);
index.html CHANGED
@@ -1,19 +1,762 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="th">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>ชีพจร - Pulse Tracker</title>
7
+ <link rel="stylesheet" href="style.css">
8
+ <script src="https://cdn.tailwindcss.com"></script>
9
+ <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
10
+ <script src="https://unpkg.com/feather-icons"></script>
11
+ <style>
12
+ .gradient-health {
13
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
14
+ }
15
+ .text-gradient {
16
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
17
+ -webkit-background-clip: text;
18
+ -webkit-text-fill-color: transparent;
19
+ }
20
+ .card-shadow {
21
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
22
+ }
23
+ .pulse-animation {
24
+ animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
25
+ }
26
+ @keyframes pulse {
27
+ 0%, 100% { opacity: 1; }
28
+ 50% { opacity: .5; }
29
+ }
30
+ .circular-progress {
31
+ transform: rotate(-90deg);
32
+ transform-origin: 50% 50%;
33
+ }
34
+ .page-content {
35
+ display: none;
36
+ }
37
+ .page-content.active {
38
+ display: block;
39
+ }
40
+ </style>
41
+ </head>
42
+ <body class="bg-gray-50">
43
+ <!-- Navigation Bar -->
44
+ <nav-custom></nav-custom>
45
+
46
+ <!-- Main Content -->
47
+ <main class="container mx-auto px-4 pb-20">
48
+ <!-- Dashboard Page -->
49
+ <div id="dashboard" class="page-content active">
50
+ <div class="py-6">
51
+ <div class="mb-6">
52
+ <h1 class="text-3xl font-bold text-gray-900 mb-2">วันนี้</h1>
53
+ <p class="text-gray-600" id="todayDate">วันจันทร์ที่ 11 ธันวาคม 2566</p>
54
+ </div>
55
+
56
+ <!-- Main Vitals -->
57
+ <div class="grid grid-cols-3 gap-4 mb-6">
58
+ <vital-circle value="72" max="100" color="green" label="Recovery" sublabel="ฟื้นตัวดี"></vital-circle>
59
+ <vital-circle value="8.5" max="21" color="blue" label="Strain" sublabel="กำลังดี"></vital-circle>
60
+ <vital-circle value="7.8" max="12" color="purple" label="Sleep" sublabel="คืนนี้"></vital-circle>
61
+ </div>
62
+
63
+ <!-- AI Coach Summary -->
64
+ <div class="bg-white rounded-2xl p-6 card-shadow mb-6">
65
+ <div class="flex items-center mb-4">
66
+ <div class="w-12 h-12 bg-gradient-to-r from-purple-500 to-indigo-500 rounded-full flex items-center justify-center mr-4">
67
+ <i data-feather="zap" class="w-6 h-6 text-white"></i>
68
+ </div>
69
+ <h2 class="text-xl font-bold text-gray-900">AI Coach แนะนำ</h2>
70
+ </div>
71
+ <div class="text-gray-700 leading-relaxed">
72
+ <p class="mb-2">วันนี้คุณฟื้นตัว 72% (สีเขียว) เพราะ เมื่อคืนค่า PM2.5 สูง ทำให้การหายใจติดขัด (Respiratory Rate สูง) และการจราจรที่ติดหนักเมื่อวาน ทำให้คุณเครียดสะสม (HRV ต่ำ)</p>
73
+ <p class="text-indigo-600 font-semibold">ดังนั้น วันนี้ AI แนะนำให้งดเวทหนัก เปลี่ยนเป็นโยคะในบ้าน และดื่มน้ำให้มากขึ้นครับ</p>
74
+ </div>
75
+ </div>
76
+
77
+ <!-- Contextual Vitals -->
78
+ <div class="grid grid-cols-2 gap-4 mb-6">
79
+ <div class="bg-gradient-to-br from-orange-400 to-red-500 rounded-2xl p-4 text-white">
80
+ <div class="flex items-center justify-between mb-2">
81
+ <span class="text-sm opacity-90">คุณภาพอากาศ</span>
82
+ <i data-feather="alert-triangle" class="w-5 h-5"></i>
83
+ </div>
84
+ <div class="text-2xl font-bold">PM2.5: 85</div>
85
+ <div class="text-sm mt-1">ฝุ่นสูง! ลดการออกกำลังกายกลางแจ้ง</div>
86
+ </div>
87
+ <div class="bg-gradient-to-br from-yellow-400 to-orange-500 rounded-2xl p-4 text-white">
88
+ <div class="flex items-center justify-between mb-2">
89
+ <span class="text-sm opacity-90">ดัชนีความร้อน</span>
90
+ <i data-feather="sun" class="w-5 h-5"></i>
91
+ </div>
92
+ <div class="text-2xl font-bold">38°C</div>
93
+ <div class="text-sm mt-1">ร้อนจัด! เสี่ยงฮีทสโตรก ดื่มน้ำเพิ่ม</div>
94
+ </div>
95
+ </div>
96
+
97
+ <!-- Traffic Alert -->
98
+ <div class="bg-gradient-to-r from-blue-500 to-purple-600 rounded-2xl p-4 text-white mb-6">
99
+ <div class="flex items-center justify-between">
100
+ <div>
101
+ <div class="flex items-center mb-1">
102
+ <i data-feather="navigation" class="w-5 h-5 mr-2"></i>
103
+ <span class="text-sm">การจราจร</span>
104
+ </div>
105
+ <div class="text-lg font-bold">เดินทางไปทำงาน: 45 นาที</div>
106
+ <div class="text-sm opacity-90">รถติดหนัก เผื่อเวลาเดินทาง และระวังความเครียดสะสม</div>
107
+ </div>
108
+ </div>
109
+ </div>
110
+
111
+ <!-- Quick Actions -->
112
+ <div class="grid grid-cols-2 gap-4">
113
+ <button class="bg-white rounded-2xl p-4 card-shadow flex items-center justify-between hover:shadow-lg transition-shadow">
114
+ <div class="flex items-center">
115
+ <div class="w-10 h-10 bg-indigo-100 rounded-full flex items-center justify-center mr-3">
116
+ <i data-feather="camera" class="w-5 h-5 text-indigo-600"></i>
117
+ </div>
118
+ <div class="text-left">
119
+ <div class="font-semibold text-gray-900">บันทึกอาหาร</div>
120
+ <div class="text-sm text-gray-500">ถ่ายรูปแทน</div>
121
+ </div>
122
+ </div>
123
+ <i data-feather="chevron-right" class="w-5 h-5 text-gray-400"></i>
124
+ </button>
125
+ <button class="bg-white rounded-2xl p-4 card-shadow flex items-center justify-between hover:shadow-lg transition-shadow">
126
+ <div class="flex items-center">
127
+ <div class="w-10 h-10 bg-green-100 rounded-full flex items-center justify-center mr-3">
128
+ <i data-feather="activity" class="w-5 h-5 text-green-600"></i>
129
+ </div>
130
+ <div class="text-left">
131
+ <div class="font-semibold text-gray-900">บันทึกกิจกรรม</div>
132
+ <div class="text-sm text-gray-500">เพิ่งออกกำลังกาย?</div>
133
+ </div>
134
+ </div>
135
+ <i data-feather="chevron-right" class="w-5 h-5 text-gray-400"></i>
136
+ </button>
137
+ </div>
138
+ </div>
139
+ </div>
140
+
141
+ <!-- Sleep Page -->
142
+ <div id="sleep" class="page-content">
143
+ <div class="py-6">
144
+ <h1 class="text-3xl font-bold text-gray-900 mb-6">การนอนหลับ</h1>
145
+
146
+ <!-- Sleep Score -->
147
+ <div class="bg-gradient-to-br from-indigo-500 to-purple-600 rounded-2xl p-6 text-white mb-6">
148
+ <div class="text-center">
149
+ <div class="text-5xl font-bold mb-2">85%</div>
150
+ <div class="text-lg opacity-90">Sleep Performance</div>
151
+ <div class="text-sm mt-2 opacity-80">คุณภาพการนอนดีเยี่ยม</div>
152
+ </div>
153
+ </div>
154
+
155
+ <!-- Sleep Details -->
156
+ <div class="bg-white rounded-2xl p-6 card-shadow mb-6">
157
+ <h2 class="text-lg font-bold text-gray-900 mb-4">รายละเอียดการนอน</h2>
158
+ <div class="space-y-4">
159
+ <div class="flex justify-between items-center">
160
+ <span class="text-gray-600">เวลาเข้าน��น</span>
161
+ <span class="font-semibold">22:30</span>
162
+ </div>
163
+ <div class="flex justify-between items-center">
164
+ <span class="text-gray-600">เวลาตื่นนอน</span>
165
+ <span class="font-semibold">06:15</span>
166
+ </div>
167
+ <div class="flex justify-between items-center">
168
+ <span class="text-gray-600">รวมทั้งหมด</span>
169
+ <span class="font-semibold">7 ชั่วโมง 45 นาที</span>
170
+ </div>
171
+ <div class="flex justify-between items-center">
172
+ <span class="text-gray-600">ความสม่ำเสมอ</span>
173
+ <span class="font-semibold text-green-600">92%</span>
174
+ </div>
175
+ </div>
176
+ </div>
177
+
178
+ <!-- Sleep Stages -->
179
+ <div class="bg-white rounded-2xl p-6 card-shadow mb-6">
180
+ <h2 class="text-lg font-bold text-gray-900 mb-4">ช่วงการนอน</h2>
181
+ <div class="space-y-3">
182
+ <div>
183
+ <div class="flex justify-between items-center mb-1">
184
+ <span class="text-sm text-gray-600">Deep Sleep</span>
185
+ <span class="text-sm font-semibold">1h 45m (23%)</span>
186
+ </div>
187
+ <div class="w-full bg-gray-200 rounded-full h-2">
188
+ <div class="bg-purple-600 h-2 rounded-full" style="width: 23%"></div>
189
+ </div>
190
+ </div>
191
+ <div>
192
+ <div class="flex justify-between items-center mb-1">
193
+ <span class="text-sm text-gray-600">REM Sleep</span>
194
+ <span class="text-sm font-semibold">1h 30m (19%)</span>
195
+ </div>
196
+ <div class="w-full bg-gray-200 rounded-full h-2">
197
+ <div class="bg-indigo-600 h-2 rounded-full" style="width: 19%"></div>
198
+ </div>
199
+ </div>
200
+ <div>
201
+ <div class="flex justify-between items-center mb-1">
202
+ <span class="text-sm text-gray-600">Light Sleep</span>
203
+ <span class="text-sm font-semibold">4h 15m (55%)</span>
204
+ </div>
205
+ <div class="w-full bg-gray-200 rounded-full h-2">
206
+ <div class="bg-blue-400 h-2 rounded-full" style="width: 55%"></div>
207
+ </div>
208
+ </div>
209
+ <div>
210
+ <div class="flex justify-between items-center mb-1">
211
+ <span class="text-sm text-gray-600">Awake</span>
212
+ <span class="text-sm font-semibold">15m (3%)</span>
213
+ </div>
214
+ <div class="w-full bg-gray-200 rounded-full h-2">
215
+ <div class="bg-red-400 h-2 rounded-full" style="width: 3%"></div>
216
+ </div>
217
+ </div>
218
+ </div>
219
+ </div>
220
+
221
+ <!-- Smart Alarm -->
222
+ <div class="bg-gradient-to-r from-green-500 to-teal-600 rounded-2xl p-6 text-white">
223
+ <div class="flex items-center mb-4">
224
+ <i data-feather="clock" class="w-6 h-6 mr-3"></i>
225
+ <h3 class="text-lg font-bold">Smart Alarm</h3>
226
+ </div>
227
+ <p class="text-sm mb-4">ตั้งเวลาปลุกอัจฉริยะ ปลุกในช่วง Light Sleep เพื่อการตื่นนอนที่สดใส</p>
228
+ <button class="bg-white text-green-600 px-4 py-2 rounded-lg font-semibold hover:bg-gray-100 transition">
229
+ ตั้งเวลาปลุก
230
+ </button>
231
+ </div>
232
+ </div>
233
+ </div>
234
+
235
+ <!-- Activity Page -->
236
+ <div id="activity" class="page-content">
237
+ <div class="py-6">
238
+ <h1 class="text-3xl font-bold text-gray-900 mb-6">กิจกรรม</h1>
239
+
240
+ <!-- Today's Activities -->
241
+ <div class="bg-white rounded-2xl p-6 card-shadow mb-6">
242
+ <h2 class="text-lg font-bold text-gray-900 mb-4">กิจกรรมวันนี้</h2>
243
+ <div class="space-y-3">
244
+ <div class="flex items-center justify-between p-3 bg-gray-50 rounded-lg">
245
+ <div class="flex items-center">
246
+ <div class="w-10 h-10 bg-blue-100 rounded-full flex items-center justify-center mr-3">
247
+ <i data-feather="target" class="w-5 h-5 text-blue-600"></i>
248
+ </div>
249
+ <div>
250
+ <div class="font-semibold">วิ่งในสวน</div>
251
+ <div class="text-sm text-gray-500">07:30 - 08:00</div>
252
+ </div>
253
+ </div>
254
+ <div class="text-right">
255
+ <div class="font-bold text-blue-600">10.2</div>
256
+ <div class="text-sm text-gray-500">Strain</div>
257
+ </div>
258
+ </div>
259
+ <div class="flex items-center justify-between p-3 bg-gray-50 rounded-lg">
260
+ <div class="flex items-center">
261
+ <div class="w-10 h-10 bg-green-100 rounded-full flex items-center justify-center mr-3">
262
+ <i data-feather="heart" class="w-5 h-5 text-green-600"></i>
263
+ </div>
264
+ <div>
265
+ <div class="font-semibold">โยคะ</div>
266
+ <div class="text-sm text-gray-500">18:00 - 18:30</div>
267
+ </div>
268
+ </div>
269
+ <div class="text-right">
270
+ <div class="font-bold text-green-600">4.5</div>
271
+ <div class="text-sm text-gray-500">Strain</div>
272
+ </div>
273
+ </div>
274
+ </div>
275
+ </div>
276
+
277
+ <!-- Quick Log -->
278
+ <div class="grid grid-cols-2 gap-4 mb-6">
279
+ <button class="bg-gradient-to-r from-blue-500 to-blue-600 text-white rounded-2xl p-4 flex items-center justify-center hover:shadow-lg transition">
280
+ <i data-feather="plus-circle" class="w-5 h-5 mr-2"></i>
281
+ <span class="font-semibold">เพิ่มกิจกรรม</span>
282
+ </button>
283
+ <button class="bg-gradient-to-r from-purple-500 to-purple-600 text-white rounded-2xl p-4 flex items-center justify-center hover:shadow-lg transition">
284
+ <i data-feather="camera" class="w-5 h-5 mr-2"></i>
285
+ <span class="font-semibold">ถ่ายรูป</span>
286
+ </button>
287
+ </div>
288
+
289
+ <!-- Thai Activities -->
290
+ <div class="bg-white rounded-2xl p-6 card-shadow">
291
+ <h2 class="text-lg font-bold text-gray-900 mb-4">กิจกรรมไทยยอดนิยม</h2>
292
+ <div class="grid grid-cols-3 gap-3">
293
+ <button class="p-3 bg-gray-50 rounded-lg hover:bg-gray-100 transition">
294
+ <div class="text-2xl mb-1">🥊</div>
295
+ <div class="text-xs">มวยไทย</div>
296
+ </button>
297
+ <button class="p-3 bg-gray-50 rounded-lg hover:bg-gray-100 transition">
298
+ <div class="text-2xl mb-1">🏸</div>
299
+ <div class="text-xs">แบดมินตัน</div>
300
+ </button>
301
+ <button class="p-3 bg-gray-50 rounded-lg hover:bg-gray-100 transition">
302
+ <div class="text-2xl mb-1">🧘</div>
303
+ <div class="text-xs">โยคะ</div>
304
+ </button>
305
+ <button class="p-3 bg-gray-50 rounded-lg hover:bg-gray-100 transition">
306
+ <div class="text-2xl mb-1">🏋️</div>
307
+ <div class="text-xs">เวทเทรน</div>
308
+ </button>
309
+ <button class="p-3 bg-gray-50 rounded-lg hover:bg-gray-100 transition">
310
+ <div class="text-2xl mb-1">🏃</div>
311
+ <div class="text-xs">วิ่ง</div>
312
+ </button>
313
+ <button class="p-3 bg-gray-50 rounded-lg hover:bg-gray-100 transition">
314
+ <div class="text-2xl mb-1">🙏</div>
315
+ <div class="text-xs">นั่งสมาธิ</div>
316
+ </button>
317
+ </div>
318
+ </div>
319
+ </div>
320
+ </div>
321
+
322
+ <!-- Strain Page -->
323
+ <div id="strain" class="page-content">
324
+ <div class="py-6">
325
+ <h1 class="text-3xl font-bold text-gray-900 mb-6">Strain</h1>
326
+
327
+ <!-- Current Strain -->
328
+ <div class="bg-gradient-to-br from-blue-500 to-indigo-600 rounded-2xl p-8 text-white mb-6">
329
+ <div class="text-center">
330
+ <div class="text-6xl font-bold mb-2">8.5</div>
331
+ <div class="text-xl opacity-90">Strain วันนี้</div>
332
+ <div class="text-sm mt-2 opacity-80">ปานกลาง - กำลังดี</div>
333
+ </div>
334
+ <div class="mt-6">
335
+ <div class="flex justify-between text-sm mb-2">
336
+ <span>เป้าหมาย: 10.0-12.0</span>
337
+ <span>สูงสุด: 21.0</span>
338
+ </div>
339
+ <div class="w-full bg-white bg-opacity-30 rounded-full h-3">
340
+ <div class="bg-white h-3 rounded-full" style="width: 40%"></div>
341
+ </div>
342
+ </div>
343
+ </div>
344
+
345
+ <!-- Strain Coach -->
346
+ <div class="bg-white rounded-2xl p-6 card-shadow mb-6">
347
+ <div class="flex items-center mb-4">
348
+ <i data-feather="trending-up" class="w-6 h-6 text-indigo-600 mr-3"></i>
349
+ <h2 class="text-lg font-bold text-gray-900">Strain Coach</h2>
350
+ </div>
351
+ <div class="bg-indigo-50 rounded-lg p-4">
352
+ <p class="text-sm text-indigo-900 mb-3">AI แนะนำวันนี้:</p>
353
+ <ul class="space-y-2 text-sm text-gray-700">
354
+ <li class="flex items-start">
355
+ <i data-feather="check-circle" class="w-4 h-4 text-green-500 mr-2 mt-0.5"></i>
356
+ <span>เป้าหมาย Strain 10.5-12.0 เหมาะกับการฟื้นตัว 72%</span>
357
+ </li>
358
+ <li class="flex items-start">
359
+ <i data-feather="check-circle" class="w-4 h-4 text-green-500 mr-2 mt-0.5"></i>
360
+ <span>อากาศร้อนและ PM2.5 สูง ลด Strain 20% อัตโนมัติ</span>
361
+ </li>
362
+ <li class="flex items-start">
363
+ <i data-feather="check-circle" class="w-4 h-4 text-green-500 mr-2 mt-0.5"></i>
364
+ <span>แนะนำ: ออกกำลังกายในร่ม เช่น ว่ายน้ำ หรือโยคะ</span>
365
+ </li>
366
+ </ul>
367
+ </div>
368
+ </div>
369
+
370
+ <!-- Strain History -->
371
+ <div class="bg-white rounded-2xl p-6 card-shadow">
372
+ <h2 class="text-lg font-bold text-gray-900 mb-4">ประวัติ 7 วันล่าสุด</h2>
373
+ <div class="space-y-3">
374
+ <div class="flex items-center justify-between">
375
+ <span class="text-gray-600">จันทร์</span>
376
+ <div class="flex-1 mx-4">
377
+ <div class="w-full bg-gray-200 rounded-full h-2">
378
+ <div class="bg-blue-600 h-2 rounded-full" style="width: 40%"></div>
379
+ </div>
380
+ </div>
381
+ <span class="font-semibold">8.5</span>
382
+ </div>
383
+ <div class="flex items-center justify-between">
384
+ <span class="text-gray-600">อาทิตย์</span>
385
+ <div class="flex-1 mx-4">
386
+ <div class="w-full bg-gray-200 rounded-full h-2">
387
+ <div class="bg-blue-600 h-2 rounded-full" style="width: 30%"></div>
388
+ </div>
389
+ </div>
390
+ <span class="font-semibold">6.3</span>
391
+ </div>
392
+ <div class="flex items-center justify-between">
393
+ <span class="text-gray-600">เสาร์</span>
394
+ <div class="flex-1 mx-4">
395
+ <div class="w-full bg-gray-200 rounded-full h-2">
396
+ <div class="bg-blue-600 h-2 rounded-full" style="width: 75%"></div>
397
+ </div>
398
+ </div>
399
+ <span class="font-semibold">15.8</span>
400
+ </div>
401
+ </div>
402
+ </div>
403
+ </div>
404
+ </div>
405
+
406
+ <!-- Recovery Page -->
407
+ <div id="recovery" class="page-content">
408
+ <div class="py-6">
409
+ <h1 class="text-3xl font-bold text-gray-900 mb-6">การฟื้นตัว</h1>
410
+
411
+ <!-- Recovery Score -->
412
+ <div class="bg-gradient-to-br from-green-500 to-teal-600 rounded-2xl p-8 text-white mb-6">
413
+ <div class="text-center">
414
+ <div class="text-6xl font-bold mb-2">72%</div>
415
+ <div class="text-xl opacity-90">Recovery Score</div>
416
+ <div class="text-sm mt-2 opacity-80">ฟื้นตัวดี</div>
417
+ </div>
418
+ </div>
419
+
420
+ <!-- Key Metrics -->
421
+ <div class="bg-white rounded-2xl p-6 card-shadow mb-6">
422
+ <h2 class="text-lg font-bold text-gray-900 mb-4">ตัวชี้วัดหลัก</h2>
423
+ <div class="grid grid-cols-2 gap-4">
424
+ <div class="text-center p-4 bg-gray-50 rounded-lg">
425
+ <div class="text-2xl font-bold text-indigo-600">52</div>
426
+ <div class="text-sm text-gray-600">HRV (ms)</div>
427
+ </div>
428
+ <div class="text-center p-4 bg-gray-50 rounded-lg">
429
+ <div class="text-2xl font-bold text-blue-600">58</div>
430
+ <div class="text-sm text-gray-600">RHR (bpm)</div>
431
+ </div>
432
+ </div>
433
+ </div>
434
+
435
+ <!-- Factor Analysis -->
436
+ <div class="bg-white rounded-2xl p-6 card-shadow">
437
+ <h2 class="text-lg font-bold text-gray-900 mb-4">ปัจจัยที่ส่งผล</h2>
438
+ <div class="space-y-3">
439
+ <div class="flex items-center justify-between p-3 bg-green-50 rounded-lg">
440
+ <div class="flex items-center">
441
+ <i data-feather="trending-up" class="w-5 h-5 text-green-600 mr-3"></i>
442
+ <span class="text-sm">การนอนหลับ (Deep Sleep เยอะ)</span>
443
+ </div>
444
+ <span class="font-bold text-green-600">+20%</span>
445
+ </div>
446
+ <div class="flex items-center justify-between p-3 bg-green-50 rounded-lg">
447
+ <div class="flex items-center">
448
+ <i data-feather="trending-up" class="w-5 h-5 text-green-600 mr-3"></i>
449
+ <span class="text-sm">การออกกำลังกาย (เหมาะสม)</span>
450
+ </div>
451
+ <span class="font-bold text-green-600">+10%</span>
452
+ </div>
453
+ <div class="flex items-center justify-between p-3 bg-red-50 rounded-lg">
454
+ <div class="flex items-center">
455
+ <i data-feather="trending-down" class="w-5 h-5 text-red-600 mr-3"></i>
456
+ <span class="text-sm">PM2.5 (จาก API)</span>
457
+ </div>
458
+ <span class="font-bold text-red-600">-15%</span>
459
+ </div>
460
+ <div class="flex items-center justify-between p-3 bg-red-50 rounded-lg">
461
+ <div class="flex items-center">
462
+ <i data-feather="trending-down" class="w-5 h-5 text-red-600 mr-3"></i>
463
+ <span class="text-sm">ความเครียด (จากจราจร)</span>
464
+ </div>
465
+ <span class="font-bold text-red-600">-5%</span>
466
+ </div>
467
+ </div>
468
+ </div>
469
+ </div>
470
+ </div>
471
+
472
+ <!-- Nutrition Page -->
473
+ <div id="nutrition" class="page-content">
474
+ <div class="py-6">
475
+ <h1 class="text-3xl font-bold text-gray-900 mb-6">โภชนาการ</h1>
476
+
477
+ <!-- Today's Summary -->
478
+ <div class="bg-gradient-to-br from-orange-500 to-red-600 rounded-2xl p-6 text-white mb-6">
479
+ <div class="text-center">
480
+ <div class="text-3xl font-bold mb-2">1,250 / 2,000</div>
481
+ <div class="text-lg opacity-90">แคลอรี่วันนี้</div>
482
+ </div>
483
+ <div class="grid grid-cols-3 gap-4 mt-6">
484
+ <div class="text-center">
485
+ <div class="text-xl font-bold">45g</div>
486
+ <div class="text-xs opacity-80">โปรตีน</div>
487
+ </div>
488
+ <div class="text-center">
489
+ <div class="text-xl font-bold">180g</div>
490
+ <div class="text-xs opacity-80">ค��ร์บ</div>
491
+ </div>
492
+ <div class="text-center">
493
+ <div class="text-xl font-bold">55g</div>
494
+ <div class="text-xs opacity-80">ไขมัน</div>
495
+ </div>
496
+ </div>
497
+ </div>
498
+
499
+ <!-- Quick Actions -->
500
+ <div class="grid grid-cols-2 gap-4 mb-6">
501
+ <button class="bg-white rounded-2xl p-4 card-shadow flex items-center justify-between hover:shadow-lg transition">
502
+ <div class="flex items-center">
503
+ <i data-feather="camera" class="w-6 h-6 text-orange-600 mr-3"></i>
504
+ <span class="font-semibold">ถ่ายรูปอาหาร</span>
505
+ </div>
506
+ </button>
507
+ <button class="bg-white rounded-2xl p-4 card-shadow flex items-center justify-between hover:shadow-lg transition">
508
+ <div class="flex items-center">
509
+ <i data-feather="grid" class="w-6 h-6 text-orange-600 mr-3"></i>
510
+ <span class="font-semibold">สแกนบาร์โค้ด</span>
511
+ </div>
512
+ </button>
513
+ </div>
514
+
515
+ <!-- Today's Meals -->
516
+ <div class="bg-white rounded-2xl p-6 card-shadow">
517
+ <h2 class="text-lg font-bold text-gray-900 mb-4">มื้ออาหารวันนี้</h2>
518
+ <div class="space-y-3">
519
+ <div class="flex items-center justify-between p-3 bg-gray-50 rounded-lg">
520
+ <div>
521
+ <div class="font-semibold">ข้าวมันไก่</div>
522
+ <div class="text-sm text-gray-500">08:30 • 450 แคล</div>
523
+ </div>
524
+ <img src="http://static.photos/food/60x60/1" alt="อาหาร" class="w-12 h-12 rounded-lg object-cover">
525
+ </div>
526
+ <div class="flex items-center justify-between p-3 bg-gray-50 rounded-lg">
527
+ <div>
528
+ <div class="font-semibold">กะเพราหมูกรอบ</div>
529
+ <div class="text-sm text-gray-500">12:00 • 550 แคล</div>
530
+ </div>
531
+ <img src="http://static.photos/food/60x60/2" alt="อาหาร" class="w-12 h-12 rounded-lg object-cover">
532
+ </div>
533
+ </div>
534
+ </div>
535
+
536
+ <!-- IF Tracker -->
537
+ <div class="bg-gradient-to-r from-purple-500 to-indigo-600 rounded-2xl p-6 text-white mt-6">
538
+ <div class="flex items-center justify-between mb-4">
539
+ <h3 class="text-lg font-bold">Intermittent Fasting</h3>
540
+ <span class="bg-white bg-opacity-20 px-3 py-1 rounded-full text-sm">16:8</span>
541
+ </div>
542
+ <div class="text-center">
543
+ <div class="text-3xl font-bold mb-2">06:45:30</div>
544
+ <div class="text-sm opacity-90">เวลาที่เหลือ</div>
545
+ </div>
546
+ </div>
547
+ </div>
548
+ </div>
549
+
550
+ <!-- Mental Page -->
551
+ <div id="mental" class="page-content">
552
+ <div class="py-6">
553
+ <h1 class="text-3xl font-bold text-gray-900 mb-6">สุขภาพจิต</h1>
554
+
555
+ <!-- Current Mood -->
556
+ <div class="bg-gradient-to-br from-purple-500 to-pink-600 rounded-2xl p-6 text-white mb-6">
557
+ <h2 class="text-lg font-bold mb-4">อารมณ์วันนี้</h2>
558
+ <div class="flex justify-around">
559
+ <button class="text-4xl hover:scale-110 transition">😊</button>
560
+ <button class="text-4xl hover:scale-110 transition">😐</button>
561
+ <button class="text-4xl hover:scale-110 transition">😔</button>
562
+ <button class="text-4xl hover:scale-110 transition">😰</button>
563
+ <button class="text-4xl hover:scale-110 transition">😡</button>
564
+ </div>
565
+ </div>
566
+
567
+ <!-- Stress Level -->
568
+ <div class="bg-white rounded-2xl p-6 card-shadow mb-6">
569
+ <h2 class="text-lg font-bold text-gray-900 mb-4">ระดับความเครียด</h2>
570
+ <div class="text-center mb-4">
571
+ <div class="text-4xl font-bold text-orange-500">45%</div>
572
+ <div class="text-gray-600">ปานกลาง</div>
573
+ </div>
574
+ <div class="space-y-2">
575
+ <div class="flex items-center">
576
+ <i data-feather="navigation" class="w-4 h-4 text-red-500 mr-2"></i>
577
+ <span class="text-sm">การจราจรติดขัด</span>
578
+ </div>
579
+ <div class="flex items-center">
580
+ <i data-feather="alert-triangle" class="w-4 h-4 text-orange-500 mr-2"></i>
581
+ <span class="text-sm">PM2.5 สูง</span>
582
+ </div>
583
+ </div>
584
+ </div>
585
+
586
+ <!-- Guided Meditation -->
587
+ <div class="bg-white rounded-2xl p-6 card-shadow mb-6">
588
+ <h2 class="text-lg font-bold text-gray-900 mb-4">นำสมาธิ</h2>
589
+ <div class="space-y-3">
590
+ <button class="w-full flex items-center justify-between p-3 bg-indigo-50 rounded-lg hover:bg-indigo-100 transition">
591
+ <div class="flex items-center">
592
+ <i data-feather="play-circle" class="w-6 h-6 text-indigo-600 mr-3"></i>
593
+ <div class="text-left">
594
+ <div class="font-semibold">นั่งสมาธิ 5 นาที</div>
595
+ <div class="text-sm text-gray-500">สำหรับผู้เริ่มต้น</div>
596
+ </div>
597
+ </div>
598
+ <span class="text-sm text-gray-500">5:00</span>
599
+ </button>
600
+ <button class="w-full flex items-center justify-between p-3 bg-indigo-50 rounded-lg hover:bg-indigo-100 transition">
601
+ <div class="flex items-center">
602
+ <i data-feather="play-circle" class="w-6 h-6 text-indigo-600 mr-3"></i>
603
+ <div class="text-left">
604
+ <div class="font-semibold">สวดมนต์ ชินบัญชร</div>
605
+ <div class="text-sm text-gray-500">เพื่อความสงบ</div>
606
+ </div>
607
+ </div>
608
+ <span class="text-sm text-gray-500">10:00</span>
609
+ </button>
610
+ </div>
611
+ </div>
612
+
613
+ <!-- Office Syndrome Alert -->
614
+ <div class="bg-gradient-to-r from-yellow-400 to-orange-500 rounded-2xl p-4 text-white">
615
+ <div class="flex items-center justify-between">
616
+ <div>
617
+ <div class="font-bold mb-1">อย่าลืมเคลื่อนไหว!</div>
618
+ <div class="text-sm">นั่งนิ่งมา 45 นาทีแล้ว ลุกขึ้นยืนเดินเลย</div>
619
+ </div>
620
+ <button class="bg-white text-orange-500 px-4 py-2 rounded-lg font-semibold text-sm hover:bg-gray-100 transition">
621
+ ท่ากายบริหาร
622
+ </button>
623
+ </div>
624
+ </div>
625
+ </div>
626
+ </div>
627
+
628
+ <!-- Community Page -->
629
+ <div id="community" class="page-content">
630
+ <div class="py-6">
631
+ <h1 class="text-3xl font-bold text-gray-900 mb-6">ชุมชน</h1>
632
+
633
+ <!-- My Teams -->
634
+ <div class="bg-white rounded-2xl p-6 card-shadow mb-6">
635
+ <h2 class="text-lg font-bold text-gray-900 mb-4">ทีมของฉัน</h2>
636
+ <div class="space-y-3">
637
+ <div class="flex items-center justify-between p-3 bg-indigo-50 rounded-lg">
638
+ <div class="flex items-center">
639
+ <div class="w-10 h-10 bg-indigo-600 rounded-full flex items-center justify-center text-white font-bold mr-3">
640
+ บ
641
+ </div>
642
+ <div>
643
+ <div class="font-semibold">บริษัท Pulse Tech</div>
644
+ <div class="text-sm text-gray-500">12 สมาชิก</div>
645
+ </div>
646
+ </div>
647
+ <i data-feather="chevron-right" class="w-5 h-5 text-gray-400"></i>
648
+ </div>
649
+ <div class="flex items-center justify-between p-3 bg-green-50 rounded-lg">
650
+ <div class="flex items-center">
651
+ <div class="w-10 h-10 bg-green-600 rounded-full flex items-center justify-center text-white font-bold mr-3">
652
+ ว
653
+ </div>
654
+ <div>
655
+ <div class="font-semibold">วิ่งสวนลุม</div>
656
+ <div class="text-sm text-gray-500">28 สมาชิก</div>
657
+ </div>
658
+ </div>
659
+ <i data-feather="chevron-right" class="w-5 h-5 text-gray-400"></i>
660
+ </div>
661
+ </div>
662
+ </div>
663
+
664
+ <!-- Active Challenges -->
665
+ <div class="bg-white rounded-2xl p-6 card-shadow">
666
+ <h2 class="text-lg font-bold text-gray-900 mb-4">Challenge ที่กำลังทำ</h2>
667
+ <div class="space-y-4">
668
+ <div class="border rounded-lg p-4">
669
+ <div class="flex items-center justify-between mb-2">
670
+ <h3 class="font-bold">นอน 7 ชั่วโมง 30 วัน</h3>
671
+ <span class="bg-green-100 text-green-800 px-2 py-1 rounded text-sm">กำลังทำ</span>
672
+ </div>
673
+ <div class="text-sm text-gray-600 mb-2">วันที่ 15/30</div>
674
+ <div class="w-full bg-gray-200 rounded-full h-2">
675
+ <div class="bg-green-500 h-2 rounded-full" style="width: 50%"></div>
676
+ </div>
677
+ </div>
678
+ <div class="border rounded-lg p-4">
679
+ <div class="flex items-center justify-between mb-2">
680
+ <h3 class="font-bold">ลดพุงหลังสงกรานต์</h3>
681
+ <span class="bg-blue-100 text-blue-800 px-2 py-1 rounded text-sm">เริ่มใหม่</span>
682
+ </div>
683
+ <div class="text-sm text-gray-600 mb-2">เหลืออีก 15 วัน</div>
684
+ <div class="w-full bg-gray-200 rounded-full h-2">
685
+ <div class="bg-blue-500 h-2 rounded-full" style="width: 10%"></div>
686
+ </div>
687
+ </div>
688
+ </div>
689
+ </div>
690
+ </div>
691
+ </div>
692
+
693
+ <!-- Settings Page -->
694
+ <div id="settings" class="page-content">
695
+ <div class="py-6">
696
+ <h1 class="text-3xl font-bold text-gray-900 mb-6">การตั้งค่า</h1>
697
+
698
+ <!-- Profile -->
699
+ <div class="bg-white rounded-2xl p-6 card-shadow mb-6">
700
+ <div class="flex items-center mb-4">
701
+ <div class="w-20 h-20 bg-gradient-to-r from-purple-500 to-indigo-500 rounded-full flex items-center justify-center text-white text-2xl font-bold mr-4">
702
+ จ
703
+ </div>
704
+ <div>
705
+ <div class="text-xl font-bold">จอห์น โด</div>
706
+ <div class="text-gray-500">john.doe@email.com</div>
707
+ </div>
708
+ </div>
709
+ <button class="w-full bg-indigo-600 text-white rounded-lg py-2 font-semibold hover:bg-indigo-700 transition">
710
+ แก้ไขโปรไฟล์
711
+ </button>
712
+ </div>
713
+
714
+ <!-- Addresses -->
715
+ <div class="bg-white rounded-2xl p-6 card-shadow mb-6">
716
+ <h2 class="text-lg font-bold text-gray-900 mb-4">ที่อยู่</h2>
717
+ <div class="space-y-3">
718
+ <div class="p-3 bg-gray-50 rounded-lg">
719
+ <div class="font-semibold mb-1">บ้าน</div>
720
+ <div class="text-sm text-gray-600">123 ถนนสุขุมวิท แขวงคลองเตย เขตคลองเตย กรุงเทพฯ</div>
721
+ </div>
722
+ <div class="p-3 bg-gray-50 rounded-lg">
723
+ <div class="font-semibold mb-1">ที่ทำงาน</div>
724
+ <div class="text-sm text-gray-600">456 ถนนพระราม 4 แขวงคลองเตย เขตคลองเตย กรุงเทพฯ</div>
725
+ </div>
726
+ </div>
727
+ </div>
728
+
729
+ <!-- Privacy Settings -->
730
+ <div class="bg-white rounded-2xl p-6 card-shadow">
731
+ <h2 class="text-lg font-bold text-gray-900 mb-4">ความเป็นส่วนตัว (PDPA)</h2>
732
+ <div class="space-y-3">
733
+ <label class="flex items-center justify-between p-3">
734
+ <span class="text-sm">แชร์ตำแหน่งที่ตั้ง</span>
735
+ <input type="checkbox" checked class="w-5 h-5 text-indigo-600 rounded">
736
+ </label>
737
+ <label class="flex items-center justify-between p-3">
738
+ <span class="text-sm">ดึงข้อมูลจราจร</span>
739
+ <input type="checkbox" checked class="w-5 h-5 text-indigo-600 rounded">
740
+ </label>
741
+ <label class="flex items-center justify-between p-3">
742
+ <span class="text-sm">แชร์ข้อมูลสุขภาพ</span>
743
+ <input type="checkbox" class="w-5 h-5 text-indigo-600 rounded">
744
+ </label>
745
+ </div>
746
+ </div>
747
+ </div>
748
+ </div>
749
+ </main>
750
+
751
+ <!-- Bottom Navigation -->
752
+ <bottom-nav></bottom-nav>
753
+
754
+ <!-- Scripts -->
755
+ <script src="components/navbar.js"></script>
756
+ <script src="components/bottomNav.js"></script>
757
+ <script src="components/vitalCircle.js"></script>
758
+ <script src="script.js"></script>
759
+ <script>feather.replace();</script>
760
+ <script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
761
+ </body>
762
+ </html>
script.js ADDED
@@ -0,0 +1,447 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Main App JavaScript
2
+ document.addEventListener('DOMContentLoaded', function() {
3
+ // Initialize app
4
+ initializeApp();
5
+
6
+ // Set up event listeners
7
+ setupEventListeners();
8
+
9
+ // Load initial data
10
+ loadInitialData();
11
+ });
12
+
13
+ function initializeApp() {
14
+ // Set today's date in Thai
15
+ const today = new Date();
16
+ const options = {
17
+ weekday: 'long',
18
+ year: 'numeric',
19
+ month: 'long',
20
+ day: 'numeric'
21
+ };
22
+ const thaiDate = today.toLocaleDateString('th-TH', options);
23
+ const dateElement = document.getElementById('todayDate');
24
+ if (dateElement) {
25
+ dateElement.textContent = thaiDate;
26
+ }
27
+
28
+ // Initialize charts and animations
29
+ initializeCharts();
30
+ initializeAnimations();
31
+ }
32
+
33
+ function setupEventListeners() {
34
+ // Page navigation
35
+ document.querySelectorAll('nav a, .bottom-nav a').forEach(link => {
36
+ link.addEventListener('click', handleNavigation);
37
+ });
38
+
39
+ // Quick action buttons
40
+ document.querySelectorAll('.quick-action').forEach(button => {
41
+ button.addEventListener('click', handleQuickAction);
42
+ });
43
+
44
+ // Tab switching
45
+ document.querySelectorAll('.tab-button').forEach(button => {
46
+ button.addEventListener('click', handleTabSwitch);
47
+ });
48
+
49
+ // Modal triggers
50
+ document.querySelectorAll('[data-modal]').forEach(trigger => {
51
+ trigger.addEventListener('click', handleModalOpen);
52
+ });
53
+
54
+ // Form submissions
55
+ document.querySelectorAll('form').forEach(form => {
56
+ form.addEventListener('submit', handleFormSubmit);
57
+ });
58
+ }
59
+
60
+ function handleNavigation(e) {
61
+ e.preventDefault();
62
+ const targetId = e.target.getAttribute('href').substring(1);
63
+
64
+ // Hide all pages
65
+ document.querySelectorAll('.page-content').forEach(page => {
66
+ page.classList.remove('active');
67
+ });
68
+
69
+ // Show target page
70
+ const targetPage = document.getElementById(targetId);
71
+ if (targetPage) {
72
+ targetPage.classList.add('active');
73
+ }
74
+
75
+ // Update navigation active states
76
+ document.querySelectorAll('nav a, .bottom-nav a').forEach(link => {
77
+ link.classList.remove('active', 'text-indigo-600');
78
+ });
79
+ e.target.classList.add('active', 'text-indigo-600');
80
+ }
81
+
82
+ function handleQuickAction(e) {
83
+ const action = e.currentTarget.dataset.action;
84
+
85
+ switch(action) {
86
+ case 'camera':
87
+ openCamera();
88
+ break;
89
+ case 'add-activity':
90
+ showActivityModal();
91
+ break;
92
+ case 'add-food':
93
+ showFoodModal();
94
+ break;
95
+ case 'start-meditation':
96
+ startMeditation();
97
+ break;
98
+ default:
99
+ console.log('Unknown action:', action);
100
+ }
101
+ }
102
+
103
+ function handleTabSwitch(e) {
104
+ const tabContainer = e.target.closest('.tab-container');
105
+ const tabButtons = tabContainer.querySelectorAll('.tab-button');
106
+
107
+ // Remove active class from all tabs
108
+ tabButtons.forEach(button => {
109
+ button.classList.remove('active');
110
+ });
111
+
112
+ // Add active class to clicked tab
113
+ e.target.classList.add('active');
114
+
115
+ // Switch content based on tab
116
+ const tabName = e.target.dataset.tab;
117
+ switchTabContent(tabName);
118
+ }
119
+
120
+ function switchTabContent(tabName) {
121
+ // Implementation for switching tab content
122
+ console.log('Switching to tab:', tabName);
123
+ }
124
+
125
+ function handleModalOpen(e) {
126
+ const modalId = e.target.dataset.modal;
127
+ const modal = document.getElementById(modalId);
128
+ if (modal) {
129
+ modal.style.display = 'flex';
130
+ }
131
+ }
132
+
133
+ function handleFormSubmit(e) {
134
+ e.preventDefault();
135
+ const formData = new FormData(e.target);
136
+ const data = Object.fromEntries(formData.entries());
137
+
138
+ // Process form data
139
+ console.log('Form submitted:', data);
140
+
141
+ // Show success message
142
+ showToast('บันทึกสำเร็จ!');
143
+
144
+ // Close modal if exists
145
+ const modal = e.target.closest('.modal');
146
+ if (modal) {
147
+ modal.style.display = 'none';
148
+ }
149
+ }
150
+
151
+ function loadInitialData() {
152
+ // Simulate loading data from APIs
153
+ loadHealthData();
154
+ loadWeatherData();
155
+ loadTrafficData();
156
+ loadNutritionData();
157
+ }
158
+
159
+ async function loadHealthData() {
160
+ // Simulate API call for health data
161
+ try {
162
+ // const response = await fetch('/api/health');
163
+ // const data = await response.json();
164
+
165
+ // Simulated data
166
+ const healthData = {
167
+ recovery: 72,
168
+ strain: 8.5,
169
+ sleep: 7.8,
170
+ hrv: 52,
171
+ rhr: 58,
172
+ sleepStages: {
173
+ deep: 23,
174
+ rem: 19,
175
+ light: 55,
176
+ awake: 3
177
+ }
178
+ };
179
+
180
+ updateHealthUI(healthData);
181
+ } catch (error) {
182
+ console.error('Error loading health data:', error);
183
+ showToast('ไม่สามารถโหลดข้อ��ูลสุขภาพได้', 'error');
184
+ }
185
+ }
186
+
187
+ function updateHealthUI(data) {
188
+ // Update vitals circles
189
+ updateVitalCircles(data);
190
+
191
+ // Update sleep stages chart
192
+ updateSleepStages(data.sleepStages);
193
+
194
+ // Update recovery factors
195
+ updateRecoveryFactors(data);
196
+ }
197
+
198
+ function updateVitalCircles(data) {
199
+ // Update vital circle components
200
+ document.querySelectorAll('vital-circle').forEach(circle => {
201
+ const label = circle.dataset.label;
202
+ let value, max, color;
203
+
204
+ switch(label) {
205
+ case 'Recovery':
206
+ value = data.recovery;
207
+ max = 100;
208
+ color = data.recovery >= 70 ? 'green' : data.recovery >= 50 ? 'yellow' : 'red';
209
+ break;
210
+ case 'Strain':
211
+ value = data.strain;
212
+ max = 21;
213
+ color = data.strain <= 10 ? 'green' : data.strain <= 14 ? 'yellow' : 'red';
214
+ break;
215
+ case 'Sleep':
216
+ value = data.sleep;
217
+ max = 12;
218
+ color = data.sleep >= 7 ? 'green' : data.sleep >= 6 ? 'yellow' : 'red';
219
+ break;
220
+ }
221
+
222
+ circle.setAttribute('value', value);
223
+ circle.setAttribute('max', max);
224
+ circle.setAttribute('color', color);
225
+ });
226
+ }
227
+
228
+ function updateSleepStages(stages) {
229
+ // Update sleep stages progress bars
230
+ Object.keys(stages).forEach(stage => {
231
+ const progressBar = document.querySelector(`[data-sleep-stage="${stage}"]`);
232
+ if (progressBar) {
233
+ progressBar.style.width = `${stages[stage]}%`;
234
+ }
235
+ });
236
+ }
237
+
238
+ function updateRecoveryFactors(data) {
239
+ // Update recovery factor analysis
240
+ // This would be implemented based on the actual recovery calculation
241
+ }
242
+
243
+ async function loadWeatherData() {
244
+ try {
245
+ // Simulate API call for weather data
246
+ const weatherData = {
247
+ temperature: 38,
248
+ humidity: 75,
249
+ pm25: 85,
250
+ aqi: 152
251
+ };
252
+
253
+ updateWeatherUI(weatherData);
254
+ } catch (error) {
255
+ console.error('Error loading weather data:', error);
256
+ }
257
+ }
258
+
259
+ function updateWeatherUI(data) {
260
+ // Update weather cards
261
+ const pm25Element = document.querySelector('[data-weather="pm25"]');
262
+ if (pm25Element) {
263
+ pm25Element.textContent = `PM2.5: ${data.pm25}`;
264
+ }
265
+
266
+ const tempElement = document.querySelector('[data-weather="temperature"]');
267
+ if (tempElement) {
268
+ tempElement.textContent = `${data.temperature}°C`;
269
+ }
270
+ }
271
+
272
+ async function loadTrafficData() {
273
+ try {
274
+ // Simulate API call for traffic data
275
+ const trafficData = {
276
+ homeToWork: 45,
277
+ workToHome: 55,
278
+ congestionLevel: 'high'
279
+ };
280
+
281
+ updateTrafficUI(trafficData);
282
+ } catch (error) {
283
+ console.error('Error loading traffic data:', error);
284
+ }
285
+ }
286
+
287
+ function updateTrafficUI(data) {
288
+ const trafficElement = document.querySelector('[data-traffic="time"]');
289
+ if (trafficElement) {
290
+ trafficElement.textContent = `${data.homeToWork} นาที`;
291
+ }
292
+ }
293
+
294
+ async function loadNutritionData() {
295
+ try {
296
+ // Simulate API call for nutrition data
297
+ const nutritionData = {
298
+ calories: {
299
+ consumed: 1250,
300
+ goal: 2000
301
+ },
302
+ macros: {
303
+ protein: 45,
304
+ carbs: 180,
305
+ fat: 55
306
+ },
307
+ meals: [
308
+ { name: 'ข้าวมันไก่', time: '08:30', calories: 450 },
309
+ { name: 'กะเพราหมูกรอบ', time: '12:00', calories: 550 }
310
+ ]
311
+ };
312
+
313
+ updateNutritionUI(nutritionData);
314
+ } catch (error) {
315
+ console.error('Error loading nutrition data:', error);
316
+ }
317
+ }
318
+
319
+ function updateNutritionUI(data) {
320
+ // Update calories display
321
+ const caloriesElement = document.querySelector('[data-nutrition="calories"]');
322
+ if (caloriesElement) {
323
+ caloriesElement.textContent = `${data.calories.consumed} / ${data.calories.goal}`;
324
+ }
325
+
326
+ // Update macros display
327
+ Object.keys(data.macros).forEach(macro => {
328
+ const macroElement = document.querySelector(`[data-nutrition="${macro}"]`);
329
+ if (macroElement) {
330
+ macroElement.textContent = `${data.macros[macro]}g`;
331
+ }
332
+ });
333
+ }
334
+
335
+ function initializeCharts() {
336
+ // Initialize any chart libraries
337
+ // This would use Chart.js or similar library
338
+ console.log('Charts initialized');
339
+ }
340
+
341
+ function initializeAnimations() {
342
+ // Initialize animations and transitions
343
+ console.log('Animations initialized');
344
+ }
345
+
346
+ // Utility functions
347
+ function openCamera() {
348
+ // Implement camera functionality
349
+ console.log('Opening camera...');
350
+ showToast('กำลังเปิดกล้อง...');
351
+ }
352
+
353
+ function showActivityModal() {
354
+ // Show activity logging modal
355
+ console.log('Showing activity modal...');
356
+ }
357
+
358
+ function showFoodModal() {
359
+ // Show food logging modal
360
+ console.log('Showing food modal...');
361
+ }
362
+
363
+ function startMeditation() {
364
+ // Start meditation session
365
+ console.log('Starting meditation...');
366
+ showToast('เริ่มการนั่งสมาธิ...');
367
+ }
368
+
369
+ function showToast(message, type = 'success') {
370
+ // Create and show toast notification
371
+ const toast = document.createElement('div');
372
+ toast.className = 'toast';
373
+ toast.textContent = message;
374
+
375
+ if (type === 'error') {
376
+ toast.style.backgroundColor = '#ef4444';
377
+ }
378
+
379
+ document.body.appendChild(toast);
380
+
381
+ setTimeout(() => {
382
+ toast.remove();
383
+ }, 3000);
384
+ }
385
+
386
+ // Simulate real-time data updates
387
+ setInterval(() => {
388
+ // Update time-based data
389
+ updateTime();
390
+ updateRealTimeMetrics();
391
+ }, 60000); // Update every minute
392
+
393
+ function updateTime() {
394
+ const now = new Date();
395
+ const timeElements = document.querySelectorAll('[data-time]');
396
+ timeElements.forEach(element => {
397
+ element.textContent = now.toLocaleTimeString('th-TH');
398
+ });
399
+ }
400
+
401
+ function updateRealTimeMetrics() {
402
+ // Update metrics that change in real-time
403
+ // This would fetch fresh data from APIs
404
+ console.log('Updating real-time metrics...');
405
+ }
406
+
407
+ // Handle visibility change
408
+ document.addEventListener('visibilitychange', function() {
409
+ if (document.visibilityState === 'visible') {
410
+ // App is visible, refresh data
411
+ loadInitialData();
412
+ }
413
+ });
414
+
415
+ // Handle network connectivity
416
+ window.addEventListener('online', function() {
417
+ showToast('กลับมาออนไลน์แล้ว');
418
+ loadInitialData();
419
+ });
420
+
421
+ window.addEventListener('offline', function() {
422
+ showToast('ขาดการเชื่อมต่อ', 'error');
423
+ });
424
+
425
+ // Performance monitoring
426
+ if ('PerformanceObserver' in window) {
427
+ const perfObserver = new PerformanceObserver((list) => {
428
+ list.getEntries().forEach((entry) => {
429
+ console.log('Performance:', entry.name, entry.duration);
430
+ });
431
+ });
432
+
433
+ perfObserver.observe({ entryTypes: ['measure'] });
434
+ }
435
+
436
+ // Service Worker registration (for PWA)
437
+ if ('serviceWorker' in navigator) {
438
+ window.addEventListener('load', function() {
439
+ navigator.serviceWorker.register('/sw.js')
440
+ .then((registration) => {
441
+ console.log('SW registered: ', registration);
442
+ })
443
+ .catch((registrationError) => {
444
+ console.log('SW registration failed: ', registrationError);
445
+ });
446
+ });
447
+ }
style.css CHANGED
@@ -1,28 +1,387 @@
 
 
 
 
 
 
 
1
  body {
2
- padding: 2rem;
3
- font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  }
5
 
6
- h1 {
7
- font-size: 16px;
8
- margin-top: 0;
9
  }
10
 
11
- p {
12
- color: rgb(107, 114, 128);
13
- font-size: 15px;
14
- margin-bottom: 10px;
15
- margin-top: 5px;
16
  }
17
 
18
- .card {
19
- max-width: 620px;
20
- margin: 0 auto;
21
- padding: 16px;
22
- border: 1px solid lightgray;
23
- border-radius: 16px;
24
  }
25
 
26
- .card p:last-child {
27
- margin-bottom: 0;
 
 
 
28
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Global Styles */
2
+ * {
3
+ margin: 0;
4
+ padding: 0;
5
+ box-sizing: border-box;
6
+ }
7
+
8
  body {
9
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Kanit', 'Sarabun', sans-serif;
10
+ -webkit-font-smoothing: antialiased;
11
+ -moz-osx-font-smoothing: grayscale;
12
+ }
13
+
14
+ .container {
15
+ max-width: 480px;
16
+ margin: 0 auto;
17
+ }
18
+
19
+ /* Custom Scrollbar */
20
+ ::-webkit-scrollbar {
21
+ width: 6px;
22
+ }
23
+
24
+ ::-webkit-scrollbar-track {
25
+ background: #f1f1f1;
26
+ }
27
+
28
+ ::-webkit-scrollbar-thumb {
29
+ background: #888;
30
+ border-radius: 3px;
31
+ }
32
+
33
+ ::-webkit-scrollbar-thumb:hover {
34
+ background: #555;
35
+ }
36
+
37
+ /* Animations */
38
+ @keyframes fadeIn {
39
+ from {
40
+ opacity: 0;
41
+ transform: translateY(10px);
42
+ }
43
+ to {
44
+ opacity: 1;
45
+ transform: translateY(0);
46
+ }
47
+ }
48
+
49
+ .page-content.active {
50
+ animation: fadeIn 0.3s ease-out;
51
+ }
52
+
53
+ @keyframes slideUp {
54
+ from {
55
+ transform: translateY(100%);
56
+ }
57
+ to {
58
+ transform: translateY(0);
59
+ }
60
+ }
61
+
62
+ @keyframes heartbeat {
63
+ 0%, 100% {
64
+ transform: scale(1);
65
+ }
66
+ 50% {
67
+ transform: scale(1.1);
68
+ }
69
+ }
70
+
71
+ .heartbeat {
72
+ animation: heartbeat 1.5s ease-in-out infinite;
73
+ }
74
+
75
+ /* Utility Classes */
76
+ .transition-all {
77
+ transition: all 0.3s ease;
78
  }
79
 
80
+ .shadow-glow {
81
+ box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
 
82
  }
83
 
84
+ .bg-health-gradient {
85
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
 
 
 
86
  }
87
 
88
+ .text-health-gradient {
89
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
90
+ -webkit-background-clip: text;
91
+ -webkit-text-fill-color: transparent;
 
 
92
  }
93
 
94
+ /* Responsive */
95
+ @media (max-width: 640px) {
96
+ .container {
97
+ padding: 0 16px;
98
+ }
99
  }
100
+
101
+ /* Custom Toggle Switch */
102
+ .toggle-switch {
103
+ position: relative;
104
+ width: 48px;
105
+ height: 24px;
106
+ }
107
+
108
+ .toggle-switch input {
109
+ opacity: 0;
110
+ width: 0;
111
+ height: 0;
112
+ }
113
+
114
+ .toggle-slider {
115
+ position: absolute;
116
+ cursor: pointer;
117
+ top: 0;
118
+ left: 0;
119
+ right: 0;
120
+ bottom: 0;
121
+ background-color: #ccc;
122
+ transition: .4s;
123
+ border-radius: 24px;
124
+ }
125
+
126
+ .toggle-slider:before {
127
+ position: absolute;
128
+ content: "";
129
+ height: 16px;
130
+ width: 16px;
131
+ left: 4px;
132
+ bottom: 4px;
133
+ background-color: white;
134
+ transition: .4s;
135
+ border-radius: 50%;
136
+ }
137
+
138
+ input:checked + .toggle-slider {
139
+ background-color: #6366f1;
140
+ }
141
+
142
+ input:checked + .toggle-slider:before {
143
+ transform: translateX(24px);
144
+ }
145
+
146
+ /* Loading Spinner */
147
+ .spinner {
148
+ border: 3px solid #f3f3f3;
149
+ border-top: 3px solid #6366f1;
150
+ border-radius: 50%;
151
+ width: 40px;
152
+ height: 40px;
153
+ animation: spin 1s linear infinite;
154
+ }
155
+
156
+ @keyframes spin {
157
+ 0% { transform: rotate(0deg); }
158
+ 100% { transform: rotate(360deg); }
159
+ }
160
+
161
+ /* Card Hover Effects */
162
+ .card-hover {
163
+ transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
164
+ }
165
+
166
+ .card-hover:hover {
167
+ transform: translateY(-2px);
168
+ box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
169
+ }
170
+
171
+ /* Button Styles */
172
+ .btn-primary {
173
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
174
+ color: white;
175
+ padding: 12px 24px;
176
+ border-radius: 12px;
177
+ font-weight: 600;
178
+ border: none;
179
+ cursor: pointer;
180
+ transition: all 0.3s ease;
181
+ }
182
+
183
+ .btn-primary:hover {
184
+ transform: translateY(-2px);
185
+ box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
186
+ }
187
+
188
+ .btn-secondary {
189
+ background: white;
190
+ color: #6366f1;
191
+ padding: 12px 24px;
192
+ border-radius: 12px;
193
+ font-weight: 600;
194
+ border: 2px solid #6366f1;
195
+ cursor: pointer;
196
+ transition: all 0.3s ease;
197
+ }
198
+
199
+ .btn-secondary:hover {
200
+ background: #6366f1;
201
+ color: white;
202
+ }
203
+
204
+ /* Input Styles */
205
+ .input-field {
206
+ width: 100%;
207
+ padding: 12px 16px;
208
+ border: 2px solid #e5e7eb;
209
+ border-radius: 12px;
210
+ font-size: 16px;
211
+ transition: all 0.3s ease;
212
+ }
213
+
214
+ .input-field:focus {
215
+ outline: none;
216
+ border-color: #6366f1;
217
+ box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
218
+ }
219
+
220
+ /* Badge Styles */
221
+ .badge-success {
222
+ background-color: #10b981;
223
+ color: white;
224
+ padding: 4px 12px;
225
+ border-radius: 20px;
226
+ font-size: 12px;
227
+ font-weight: 600;
228
+ }
229
+
230
+ .badge-warning {
231
+ background-color: #f59e0b;
232
+ color: white;
233
+ padding: 4px 12px;
234
+ border-radius: 20px;
235
+ font-size: 12px;
236
+ font-weight: 600;
237
+ }
238
+
239
+ .badge-danger {
240
+ background-color: #ef4444;
241
+ color: white;
242
+ padding: 4px 12px;
243
+ border-radius: 20px;
244
+ font-size: 12px;
245
+ font-weight: 600;
246
+ }
247
+
248
+ /* Modal Styles */
249
+ .modal {
250
+ position: fixed;
251
+ top: 0;
252
+ left: 0;
253
+ width: 100%;
254
+ height: 100%;
255
+ background-color: rgba(0, 0, 0, 0.5);
256
+ display: flex;
257
+ align-items: center;
258
+ justify-content: center;
259
+ z-index: 1000;
260
+ }
261
+
262
+ .modal-content {
263
+ background: white;
264
+ border-radius: 20px;
265
+ padding: 24px;
266
+ max-width: 400px;
267
+ width: 90%;
268
+ animation: slideUp 0.3s ease-out;
269
+ }
270
+
271
+ /* Toast Notification */
272
+ .toast {
273
+ position: fixed;
274
+ bottom: 100px;
275
+ left: 50%;
276
+ transform: translateX(-50%);
277
+ background: #1f2937;
278
+ color: white;
279
+ padding: 12px 24px;
280
+ border-radius: 50px;
281
+ font-size: 14px;
282
+ z-index: 2000;
283
+ animation: slideUp 0.3s ease-out;
284
+ }
285
+
286
+ /* Chart Styles */
287
+ .chart-container {
288
+ position: relative;
289
+ height: 200px;
290
+ width: 100%;
291
+ }
292
+
293
+ /* Progress Bar Styles */
294
+ .progress-bar {
295
+ width: 100%;
296
+ height: 8px;
297
+ background-color: #e5e7eb;
298
+ border-radius: 4px;
299
+ overflow: hidden;
300
+ }
301
+
302
+ .progress-fill {
303
+ height: 100%;
304
+ border-radius: 4px;
305
+ transition: width 0.3s ease;
306
+ }
307
+
308
+ /* Tab Styles */
309
+ .tab-container {
310
+ display: flex;
311
+ background: white;
312
+ border-radius: 12px;
313
+ padding: 4px;
314
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
315
+ }
316
+
317
+ .tab-button {
318
+ flex: 1;
319
+ padding: 8px 16px;
320
+ border-radius: 8px;
321
+ font-weight: 500;
322
+ transition: all 0.3s ease;
323
+ border: none;
324
+ background: transparent;
325
+ cursor: pointer;
326
+ }
327
+
328
+ .tab-button.active {
329
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
330
+ color: white;
331
+ }
332
+
333
+ /* List Styles */
334
+ .list-item {
335
+ padding: 16px;
336
+ border-bottom: 1px solid #f3f4f6;
337
+ transition: background-color 0.3s ease;
338
+ }
339
+
340
+ .list-item:hover {
341
+ background-color: #f9fafb;
342
+ }
343
+
344
+ .list-item:last-child {
345
+ border-bottom: none;
346
+ }
347
+
348
+ /* Floating Action Button */
349
+ .fab {
350
+ position: fixed;
351
+ bottom: 100px;
352
+ right: 20px;
353
+ width: 56px;
354
+ height: 56px;
355
+ border-radius: 50%;
356
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
357
+ color: white;
358
+ border: none;
359
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
360
+ cursor: pointer;
361
+ display: flex;
362
+ align-items: center;
363
+ justify-content: center;
364
+ transition: all 0.3s ease;
365
+ z-index: 100;
366
+ }
367
+
368
+ .fab:hover {
369
+ transform: scale(1.1);
370
+ box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
371
+ }
372
+
373
+ /* Skeleton Loader */
374
+ .skeleton {
375
+ background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
376
+ background-size: 200% 100%;
377
+ animation: loading 1.5s infinite;
378
+ }
379
+
380
+ @keyframes loading {
381
+ 0% {
382
+ background-position: 200% 0;
383
+ }
384
+ 100% {
385
+ background-position: -200% 0;
386
+ }
387
+ }