CSNET's picture
โปรดสร้าง HTML5 Web Application ที่มีรูปลักษณ์และฟังก์ชันการทำงานหลักคล้ายแอป WHOOP โดยใช้ DeepSite AI เพื่อให้เป็นแอปที่ใช้งานได้จริง (Full Functionality Mockup) เน้นการแสดงผลข้อมูลสุขภาพและสมรรถนะในรูปแบบ Dashboard และ Detailed Views
28f4aa5 verified
Raw History Blame Contribute Delete
7.57 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sleep - WHOOP Health Tracker</title>
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
<link rel="stylesheet" href="style.css">
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<script src="https://unpkg.com/feather-icons"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script src="components/navbar.js"></script>
</head>
<body class="bg-black text-white min-h-screen">
<custom-navbar active="sleep"></custom-navbar>
<main class="container mx-auto px-4 py-6 max-w-7xl">
<!-- Sleep Performance -->
<div class="mb-8">
<div class="bg-gray-900 rounded-2xl p-6 border border-gray-800">
<h1 class="text-3xl font-bold mb-6">Last Night's Sleep</h1>
<div class="grid md:grid-cols-3 gap-6">
<div class="text-center">
<div class="text-5xl font-bold text-blue-400" id="sleepPerformance">--</div>
<div class="text-gray-400 mt-2">Sleep Performance</div>
<div class="text-sm text-gray-500">%</div>
</div>
<div class="text-center">
<div class="text-5xl font-bold text-purple-400" id="sleepDuration">--</div>
<div class="text-gray-400 mt-2">Sleep Duration</div>
<div class="text-sm text-gray-500">hours</div>
</div>
<div class="text-center">
<div class="text-5xl font-bold text-green-400" id="sleepEfficiency">--</div>
<div class="text-gray-400 mt-2">Sleep Efficiency</div>
<div class="text-sm text-gray-500">%</div>
</div>
</div>
</div>
</div>
<!-- Sleep Stages -->
<div class="grid md:grid-cols-2 gap-6 mb-8">
<div class="bg-gray-900 rounded-2xl p-6 border border-gray-800">
<h2 class="text-xl font-bold mb-4">Sleep Stages</h2>
<div class="h-64 flex items-center justify-center">
<canvas id="sleepStagesChart"></canvas>
</div>
<div class="grid grid-cols-2 gap-4 mt-4">
<div class="flex items-center">
<div class="w-4 h-4 bg-purple-500 rounded mr-2"></div>
<span class="text-sm">Deep: <span id="deepSleep">--</span>h</span>
</div>
<div class="flex items-center">
<div class="w-4 h-4 bg-blue-400 rounded mr-2"></div>
<span class="text-sm">REM: <span id="remSleep">--</span>h</span>
</div>
<div class="flex items-center">
<div class="w-4 h-4 bg-blue-300 rounded mr-2"></div>
<span class="text-sm">Light: <span id="lightSleep">--</span>h</span>
</div>
<div class="flex items-center">
<div class="w-4 h-4 bg-gray-400 rounded mr-2"></div>
<span class="text-sm">Awake: <span id="awakeTime">--</span>h</span>
</div>
</div>
</div>
<!-- Sleep Planner -->
<div class="bg-gray-900 rounded-2xl p-6 border border-gray-800">
<h2 class="text-xl font-bold mb-4 flex items-center">
<i data-feather="moon" class="w-5 h-5 mr-2"></i>
Sleep Planner
</h2>
<div class="space-y-4">
<div class="bg-gray-800 rounded-lg p-4">
<div class="text-sm text-gray-400">Recommended Bedtime</div>
<div class="text-2xl font-bold text-purple-400" id="bedtime">--</div>
</div>
<div class="bg-gray-800 rounded-lg p-4">
<div class="text-sm text-gray-400">Target Wake Time</div>
<div class="text-2xl font-bold text-yellow-400" id="wakeTime">--</div>
</div>
<div class="bg-gray-800 rounded-lg p-4">
<div class="text-sm text-gray-400">Sleep Need</div>
<div class="text-2xl font-bold text-blue-400" id="sleepNeed">--</div>
</div>
</div>
<div class="mt-4 p-3 bg-yellow-900/30 border border-yellow-700 rounded-lg">
<p class="text-sm text-yellow-400">
<i data-feather="alert-triangle" class="w-4 h-4 inline mr-1"></i>
Based on yesterday's strain, you need more rest tonight
</p>
</div>
</div>
</div>
<!-- Weekly Sleep Pattern -->
<div class="bg-gray-900 rounded-2xl p-6 border border-gray-800">
<h2 class="text-xl font-bold mb-4">Weekly Sleep Pattern</h2>
<div class="h-64">
<canvas id="weeklySleepChart"></canvas>
</div>
</div>
<!-- Sleep Quality Factors -->
<div class="mt-8 bg-gradient-to-r from-gray-900 to-gray-800 rounded-2xl p-6 border border-gray-700">
<h2 class="text-xl font-bold mb-4">Sleep Quality Factors</h2>
<div class="grid md:grid-cols-3 gap-4">
<div class="bg-gray-800/50 rounded-lg p-4">
<div class="flex items-center justify-between mb-2">
<span class="text-gray-400">Consistency</span>
<span class="text-green-400 font-bold">85%</span>
</div>
<div class="w-full bg-gray-700 rounded-full h-2">
<div class="bg-green-400 h-2 rounded-full" style="width: 85%"></div>
</div>
</div>
<div class="bg-gray-800/50 rounded-lg p-4">
<div class="flex items-center justify-between mb-2">
<span class="text-gray-400">Efficiency</span>
<span class="text-blue-400 font-bold">92%</span>
</div>
<div class="w-full bg-gray-700 rounded-full h-2">
<div class="bg-blue-400 h-2 rounded-full" style="width: 92%"></div>
</div>
</div>
<div class="bg-gray-800/50 rounded-lg p-4">
<div class="flex items-center justify-between mb-2">
<span class="text-gray-400">Disturbances</span>
<span class="text-yellow-400 font-bold">Low</span>
</div>
<div class="w-full bg-gray-700 rounded-full h-2">
<div class="bg-yellow-400 h-2 rounded-full" style="width: 20%"></div>
</div>
</div>
</div>
</div>
</main>
<script src="script.js"></script>
<script src="mockData.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
feather.replace();
initializeSleepPage();
});
</script>
</body>
</html>