File size: 16,380 Bytes
f93e15c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
```html
<!DOCTYPE html>
<html lang="th" class="dark">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>โปรไฟล์ - ชีพจร</title>
    <link rel="icon" type="image/x-icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🌿</text></svg>">
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
    <link rel="stylesheet" href="style.css">
</head>
<body class="bg-gray-900 text-white font-sans pb-20">
    <!-- Main Container -->
    <div class="min-h-screen bg-gradient-to-br from-gray-900 via-gray-800 to-gray-900">
        <!-- Header -->
        <header class="px-4 pt-12 pb-6">
            <div class="flex items-center justify-between">
                <div>
                    <h1 class="text-2xl font-bold bg-gradient-to-r from-indigo-400 to-purple-500 bg-clip-text text-transparent">
                        โปรไฟล์
                    </h1>
                    <p class="text-gray-400 text-sm mt-1">จัดการข้อมูลและการตั้งค่าของคุณ 👤</p>
                </div>
                <button onclick="window.location.href='index.html'" class="w-10 h-10 rounded-full bg-gray-800 flex items-center justify-center">
                    <i data-feather="arrow-left" class="w-5 h-5"></i>
                </button>
            </div>
        </header>

        <!-- User Profile -->
        <section class="px-4 mb-6">
            <div class="glass-card rounded-2xl p-6 border border-gray-700/50 text-center">
                <div class="w-24 h-24 mx-auto mb-4 relative">
                    <div class="w-full h-full rounded-full bg-gradient-to-r from-green-400 to-emerald-500 p-0.5">
                        <img src="http://static.photos/people/200x200/42" alt="Profile" class="w-full h-full rounded-full object-cover border-2 border-gray-900">
                    </div>
                    <div class="absolute -bottom-1 -right-1 w-6 h-6 bg-green-400 rounded-full border-2 border-gray-900 flex items-center justify-center">
                        <i data-feather="check" class="w-3 h-3 text-gray-900"></i>
                    </div>
                </div>
                <h2 class="text-xl font-bold mb-1">คุณพิมพ์</h2>
                <p class="text-gray-400 text-sm mb-4">สมาชิกตั้งแต่ มกราคม 2024</p>
                
                <div class="grid grid-cols-3 gap-4 text-center">
                    <div>
                        <p class="text-lg font-bold text-green-400">127</p>
                        <p class="text-xs text-gray-400">วันติดต่อกัน</p>
                    </div>
                    <div>
                        <p class="text-lg font-bold text-blue-400">2,847</p>
                        <p class="text-xs text-gray-400">คะแนนรวม</p>
                    </div>
                    <div>
                        <p class="text-lg font-bold text-purple-400">15</p>
                        <p class="text-xs text-gray-400">ความท้าทาย</p>
                    </div>
                </div>
            </div>
        </section>

        <!-- Health Goals -->
        <section class="px-4 mb-6">
            <div class="glass-card rounded-2xl p-5 border border-gray-700/50">
                <h3 class="text-lg font-semibold mb-4 flex items-center gap-2">
                    <i data-feather="target" class="w-5 h-5 text-red-400"></i>
                    เป้าหมายสุขภาพ
                </h3>
                
                <div class="space-y-4">
                    <div>
                        <div class="flex justify-between text-sm mb-2">
                            <span>น้ำหนักเป้าหมาย</span>
                            <span class="text-green-400">55 kg</span>
                        </div>
                        <div class="bg-gray-700 rounded-full h-2">
                            <div class="bg-gradient-to-r from-green-400 to-emerald-500 h-2 rounded-full" style="width: 75%"></div>
                        </div>
                        <p class="text-xs text-gray-400 mt-1">คงเหลือ 3 kg • 2 เดือน</p>
                    </div>
                    
                    <div>
                        <div class="flex justify-between text-sm mb-2">
                            <span>ออกกำลังกายรายสัปดาห์</span>
                            <span class="text-blue-400">4/5 วัน</span>
                        </div>
                        <div class="bg-gray-700 rounded-full h-2">
                            <div class="bg-gradient-to-r from-blue-400 to-indigo-500 h-2 rounded-full" style="width: 80%"></div>
                        </div>
                    </div>
                    
                    <div>
                        <div class="flex justify-between text-sm mb-2">
                            <span>การนอนให้ครบ 7 ชม.</span>
                            <span class="text-purple-400">5/7 วัน</span>
                        </div>
                        <div class="bg-gray-700 rounded-full h-2">
                            <div class="bg-gradient-to-r from-purple-500 to-pink-600 h-2 rounded-full" style="width: 71%"></div>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Settings -->
        <section class="px-4 mb-6">
            <div class="glass-card rounded-2xl p-5 border border-gray-700/50">
                <h3 class="text-lg font-semibold mb-4 flex items-center gap-2">
                    <i data-feather="settings" class="w-5 h-5 text-gray-400"></i>
                    การตั้งค่า
                </h3>
                
                <div class="space-y-3">
                    <button class="w-full flex items-center justify-between p-3 bg-gray-800/30 rounded-xl hover:bg-gray-700/50 transition-colors" onclick="showComingSoon()">
                        <div class="flex items-center gap-3">
                            <i data-feather="bell" class="w-5 h-5 text-yellow-400"></i>
                            <span class="text-sm font-medium">การแจ้งเตือน</span>
                        </div>
                        <i data-feather="chevron-right" class="w-4 h-4 text-gray-400"></i>
                    </button>
                    
                    <button class="w-full flex items-center justify-between p-3 bg-gray-800/30 rounded-xl hover:bg-gray-700/50 transition-colors" onclick="showComingSoon()">
                        <div class="flex items-center gap-3">
                            <i data-feather="shield" class="w-5 h-5 text-green-400"></i>
                            <span class="text-sm font-medium">ความเป็นส่วนตัว</span>
                        </div>
                        <i data-feather="chevron-right" class="w-4 h-4 text-gray-400"></i>
                    </button>
                    
                    <button class="w-full flex items-center justify-between p-3 bg-gray-800/30 rounded-xl hover:bg-gray-700/50 transition-colors" onclick="showComingSoon()">
                        <div class="flex items-center gap-3">
                            <i data-feather="smartphone" class="w-5 h-5 text-blue-400"></i>
                            <span class="text-sm font-medium">อุปกรณ์ที่เชื่อมต่อ</span>
                        </div>
                        <i data-feather="chevron-right" class="w-4 h-4 text-gray-400"></i>
                    </button>
                    
                    <button class="w-full flex items-center justify-between p-3 bg-gray-800/30 rounded-xl hover:bg-gray-700/50 transition-colors" onclick="showComingSoon()">
                        <div class="flex items-center gap-3">
                            <i data-feather="download" class="w-5 h-5 text-purple-400"></i>
                            <span class="text-sm font-medium">สำรองข้อมูล</span>
                        </div>
                        <i data-feather="chevron-right" class="w-4 h-4 text-gray-400"></i>
                    </button>
                </div>
            </div>
        </section>

        <!-- Data Export -->
        <section class="px-4 mb-6">
            <div class="glass-card rounded-2xl p-5 border border-gray-700/50">
                <h3 class="text-lg font-semibold mb-4 flex items-center gap-2">
                    <i data-feather="upload" class="w-5 h-5 text-indigo-400"></i>
                    ข้อมูลของฉัน
                </h3>
                
                <p class="text-sm text-gray-400 mb-4">ส่งออกข้อมูลสุขภาพของคุณเพื่อวิเคราะห์เพิ่มเติม</p>
                
                <div class="flex gap-3">
                    <button onclick="exportData('csv')" class="flex-1 bg-gradient-to-r from-indigo-500 to-purple-600 py-3 rounded-xl text-sm font-medium transition-all hover:scale-[1.02]">
                        <i data-feather="file-text" class="w-4 h-4 inline mr-1"></i>
                        CSV
                    </button>
                    <button onclick="exportData('pdf')" class="flex-1 bg-gradient-to-r from-pink-500 to-rose-600 py-3 rounded-xl text-sm font-medium transition-all hover:scale-[1.02]">
                        <i data-feather="file" class="w-4 h-4 inline mr-1"></i>
                        PDF
                    </button>
                </div>
            </div>
        </section>

        <!-- About & Support -->
        <section class="px-4 mb-6">
            <div class="glass-card rounded-2xl p-5 border border-gray-700/50">
                <h3 class="text-lg font-semibold mb-4 flex items-center gap-2">
                    <i data-feather="help-circle" class="w-5 h-5 text-cyan-400"></i>
                    เกี่ยวกับ
                </h3>
                
                <div class="space-y-3">
                    <button class="w-full flex items-center justify-between p-3 bg-gray-800/30 rounded-xl hover:bg-gray-700/50 transition-colors" onclick="showComingSoon()">
                        <div class="flex items-center gap-3">
                            <i data-feather="info" class="w-5 h-5 text-gray-400"></i>
                            <span class="text-sm font-medium">เกี่ยวกับ ชีพจร</span>
                        </div>
                        <i data-feather="chevron-right" class="w-4 h-4 text-gray-400"></i>
                    </button>
                    
                    <button class="w-full flex items-center justify-between p-3 bg-gray-800/30 rounded-xl hover:bg-gray-700/50 transition-colors" onclick="showComingSoon()">
                        <div class="flex items-center gap-3">
                            <i data-feather="life-buoy" class="w-5 h-5 text-cyan-400"></i>
                            <span class="text-sm font-medium">ศูนย์ช่วยเหลือ</span>
                        </div>
                        <i data-feather="chevron-right" class="w-4 h-4 text-gray-400"></i>
                    </button>
                    
                    <button class="w-full flex items-center justify-between p-3 bg-gray-800/30 rounded-xl hover:bg-gray-700/50 transition-colors" onclick="showComingSoon()">
                        <div class="flex items-center gap-3">
                            <i data-feather="star" class="w-5 h-5 text-yellow-400"></i>
                            <span class="text-sm font-medium">ให้คะแนนแอป</span>
                        </div>
                        <i data-feather="chevron-right" class="w-4 h-4 text-gray-400"></i>
                    </button>
                </div>
            </div>
        </section>

        <!-- Logout -->
        <section class="px-4 mb-6">
            <button onclick="logout()" class="w-full bg-red-500/20 border border-red-500/30 text-red-400 py-3 rounded-xl font-medium hover:bg-red-500/30 transition-colors">
                <i data-feather="log-out" class="w-4 h-4 inline mr-2"></i>
                ออกจากระบบ
            </button>
        </section>
    </div>

    <!-- Bottom Navigation -->
    <main-navbar></main-navbar>

    <!-- Scripts -->
    <script src="components/navbar.js"></script>
    <script src="script.js"></script>
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // Set active page in navbar
            const navbar = document.querySelector('main-navbar');
            if (navbar) {
                navbar.setActivePage('profile');
            }
        });

        function showComingSoon() {
            showNotification('ฟีเจอร์นี้กำลังพัฒนา เร็วๆ นี้!', 'info');
        }

        function exportData(format) {
            showNotification(`กำลังส่งออกข้อมูลเป็น ${format.toUpperCase()}...`, 'info');
            
            setTimeout(() => {
                showNotification(`ส่งออกข้อมูล ${format.toUpperCase()} สำเร็จ!`, 'success');
                
                // Simulate download
                const blob = new Blob(['ข้อมูลสุขภาพของคุณ...'], { type: format === 'csv' ? 'text/csv' : 'application/pdf' });
                const url = URL.createObjectURL(blob);
                const a = document.createElement('a');
                a.href = url;
                a.download = `health-data-${new Date().toISOString().split('T')[0]}.${format}`;
                a.click();
                URL.revokeObjectURL(url);
            }, 2000);
        }

        function logout() {
            const modal = document.createElement('div');
            modal.className = 'fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4';
            modal.innerHTML = `
                <div class="glass-card rounded-2xl p-6 max-w-sm w-full border border-gray-700/50">
                    <div class="text-center">
                        <div class="w-16 h-16 bg-red-500 rounded-full mx-auto mb-4 flex items-center justify-center">
                            <i data-feather="log-out" class="w-8 h-8 text-white"></i>
                        </div>
                        <h3 class="text-xl font-bold mb-2">ยืนยันการออกจากระบบ</h3>
                        <p class="text-gray-400 mb-6">คุณต้องการออกจากระบบใช่ไหม?</p>
                        
                        <div class="flex gap-3">
                            <button onclick="this.closest('.fixed').remove()" class="flex-1 bg-gray-700 hover:bg-gray-600 py-3 rounded-xl font-medium transition-colors">
                                ยกเลิก
                            </button>
                            <button onclick="confirmLogout()" class="flex-1 bg-red-500 hover:bg-red-600 py-3 rounded-xl font-medium transition-colors">
                                ออกจากระบบ
                            </button>
                        </div>
                    </div>
                </div>
            `;
            
            document.body.appendChild(modal);
            feather.replace();
        }

        function confirmLogout() {
            // Clear user data
            localStorage.clear();
            
            showNotification('ออกจากระบบสำเร็จ', 'success');
            
            setTimeout(() => {
                window.location.href = 'login.html';
            }, 1500);
        }
    </script>
    <script>feather.replace();</script>
</body>
</html>
>>>>>>> REPLACE