CommunityAPP_UI/entry-verification.html

111 lines
3.0 KiB
HTML
Raw Permalink Normal View History

2025-04-25 15:59:56 +08:00
<!DOCTYPE html>
<html lang="zh-Hant">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>出入驗證</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" />
<style>
body {
background-color: #f7f8fa;
font-family: 'Noto Sans TC', sans-serif;
}
header {
background-color: #9eaf9f;
color: #fff;
padding: 16px;
font-size: 20px;
font-weight: bold;
text-align: center;
position: relative;
}
.back-button {
position: absolute;
top: 12px;
left: 16px;
cursor: pointer;
}
.back-button img {
width: 24px;
height: 24px;
filter: brightness(0) invert(1);
}
.verify-container {
background-color: #fff;
margin: 20px;
padding: 30px 20px;
border-radius: 12px;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
text-align: center;
}
.illustration {
width: 160px;
margin-bottom: 20px;
}
.status-message {
margin-top: 20px;
font-size: 18px;
font-weight: bold;
}
.success { color: green; }
.fail { color: red; }
</style>
</head>
<body>
<header>
<div class="back-button">
<img src="https://img.icons8.com/ios-filled/50/ffffff/left.png" onclick="history.back()" />
</div>
出入驗證
</header>
<div class="verify-container">
<!-- 美工圖:臉部辨識插圖 -->
<img src="https://img.icons8.com/color/160/face-id.png" alt="Face ID" class="illustration">
<p class="mb-4">請點擊下方按鈕,啟動臉部或指紋辨識進行驗證</p>
<button class="btn btn-primary btn-lg w-100" onclick="startBiometric()">開始驗證</button>
<div id="statusMessage" class="status-message"></div>
</div>
2025-04-29 16:59:16 +08:00
<!-- 底部選單 -->
<nav class="navbar fixed-bottom navbar-light bg-light border-top">
<div class="container justify-content-around">
<a class="nav-link text-center" href="main.html"><div>🏠<br>首頁</div></a>
<a class="nav-link text-center" href="#report"><div>🚪<br>出入</div></a>
<a class="nav-link text-center" href="#bills"><div>💬<br>訊息</div></a>
<a class="nav-link text-center" href="personal.html"><div>👤<br>住戶</div></a>
</div>
</nav>
2025-04-25 15:59:56 +08:00
<script>
async function startBiometric() {
const status = document.getElementById('statusMessage');
if (!window.PublicKeyCredential) {
status.innerHTML = '<span class="fail">❌ 此裝置不支援生物辨識。</span>';
return;
}
try {
const result = await navigator.credentials.get({
publicKey: {
challenge: new Uint8Array(32),
allowCredentials: [],
timeout: 60000,
userVerification: "required"
}
});
status.innerHTML = '<span class="success">✅ 驗證成功,歡迎進入活動現場!</span>';
} catch (err) {
status.innerHTML = `<span class="fail">❌ 驗證失敗:${err.message}</span>`;
}
}
</script>
</body>
</html>