Spaces:
Running
Running
File size: 6,417 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 | ```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">
<!-- Main Container -->
<div class="min-h-screen bg-gradient-to-br from-gray-900 via-gray-800 to-gray-900 flex items-center justify-center p-4">
<!-- Login Card -->
<div class="glass-card rounded-2xl p-6 w-full max-w-sm border border-gray-700/50">
<!-- Logo -->
<div class="text-center mb-8">
<div class="w-20 h-20 mx-auto mb-4 bg-gradient-to-r from-green-400 to-emerald-500 rounded-full flex items-center justify-center">
<span class="text-3xl">🌿</span>
</div>
<h1 class="text-2xl font-bold bg-gradient-to-r from-green-400 to-emerald-500 bg-clip-text text-transparent">
ชีพจร
</h1>
<p class="text-gray-400 text-sm mt-1">แดชบอร์ดสุขภาพส่วนตัวของคุณ</p>
</div>
<!-- Login Form -->
<form id="loginForm" class="space-y-4">
<div>
<label class="block text-sm font-medium mb-2">อีเมล</label>
<input type="email" id="email" class="w-full px-4 py-3 bg-gray-800 border border-gray-700 rounded-xl text-white placeholder-gray-400 focus:outline-none focus:border-green-400" placeholder="your@email.com" required>
</div>
<div>
<label class="block text-sm font-medium mb-2">รหัสผ่าน</label>
<input type="password" id="password" class="w-full px-4 py-3 bg-gray-800 border border-gray-700 rounded-xl text-white placeholder-gray-400 focus:outline-none focus:border-green-400" placeholder="••••••••" required>
</div>
<div class="flex items-center justify-between">
<label class="flex items-center gap-2">
<input type="checkbox" class="w-4 h-4 rounded border-gray-600 text-green-600 focus:ring-green-500">
<span class="text-sm text-gray-300">จำฉันไว้</span>
</label>
<a href="#" onclick="showComingSoon()" class="text-sm text-green-400 hover:underline">ลืมรหัสผ่าน?</a>
</div>
<button type="submit" class="w-full bg-gradient-to-r from-green-500 to-emerald-600 py-3 rounded-xl font-medium transition-all hover:scale-[1.02]">
เข้าสู่ระบบ
</button>
</form>
<!-- Social Login -->
<div class="mt-6">
<div class="relative">
<div class="absolute inset-0 flex items-center">
<div class="w-full border-t border-gray-700"></div>
</div>
<div class="relative text-center">
<span class="px-2 bg-gray-900 text-sm text-gray-400">หรือเข้าสู่ระบบด้วย</span>
</div>
</div>
<div class="mt-4 grid grid-cols-2 gap-3">
<button onclick="socialLogin('google')" class="w-full flex items-center justify-center gap-2 py-2 bg-gray-800 border border-gray-700 rounded-xl hover:bg-gray-700 transition-colors">
<span class="text-sm">G</span>
<span class="text-sm">Google</span>
</button>
<button onclick="socialLogin('apple')" class="w-full flex items-center justify-center gap-2 py-2 bg-gray-800 border border-gray-700 rounded-xl hover:bg-gray-700 transition-colors">
<i data-feather="apple" class="w-4 h-4"></i>
<span class="text-sm">Apple</span>
</button>
</div>
</div>
<!-- Sign Up Link -->
<div class="text-center mt-6">
<p class="text-sm text-gray-400">
ยังไม่มีบัญชี?
<a href="#" onclick="showComingSoon()" class="text-green-400 hover:underline">สมัครสมาชิก</a>
</p>
</div>
</div>
</div>
<script src="script.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
// Check if user is already logged in
const currentUser = localStorage.getItem('currentUser');
if (currentUser) {
window.location.href = 'index.html';
return;
}
// Handle login form
document.getElementById('loginForm').addEventListener('submit', function(e) {
e.preventDefault();
const email = document.getElementById('email').value;
const password = document.getElementById('password').value;
// Simulate login
login(email, password);
});
});
function login(email, password) {
showNotification('กำลังเข้าสู่ระบบ...', 'info');
// Simulate API call
setTimeout(() => {
// Mock user data
const user = {
id: 'user_' + Date.now(),
email: email,
name: 'คุณพิมพ์',
createdAt: new Date().toISOString()
};
localStorage.setItem('currentUser', |