CommunityAPP_UI/login.html

127 lines
2.8 KiB
HTML

<!DOCTYPE html>
<html lang="zh-Hant">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>登入畫面</title>
<style>
body {
background-color: #f0f2f5;
font-family: sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.login-container {
background: #fff;
padding: 40px 20px 20px 20px;
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
text-align: center;
width: 320px;
position: relative;
transform: scale(1.2); /* 放大 20% */
transform-origin: center; /* 設定縮放中心 */
}
.login-container h1 {
font-size: 24px;
margin-bottom: 10px;
color: #333;
}
.login-container img {
max-width: 100%;
height: auto;
margin-top: 10px;
margin-bottom: 20px;
border-radius: 8px;
}
input[type="text"],
input[type="password"] {
width: 100%;
padding: 10px;
margin: 10px 0;
border-radius: 6px;
border: 1px solid #ccc;
box-sizing: border-box;
font-size: 14px;
}
button {
width: 100%;
padding: 10px;
background-color: #4a90e2;
color: white;
border: none;
border-radius: 6px;
cursor: pointer;
font-size: 16px;
}
button:hover {
background-color: #357abd;
}
.link-buttons {
margin-top: 20px;
display: flex;
justify-content: space-between;
gap: 8px;
}
.link-buttons a {
flex: 1;
text-align: center;
padding: 10px 5px;
background-color: #e0e0e0;
border-radius: 6px;
color: #333;
text-decoration: none;
font-size: 14px;
}
.link-buttons a:hover {
background-color: #d5d5d5;
}
</style>
</head>
<body>
<div class="login-container">
<h1>社區通</h1> <!-- 新增標題 -->
<img src="https://i.postimg.cc/vcZgwKv3/image.png" alt="登入圖示">
<form id="loginForm" onsubmit="return handleLogin(event)">
<input type="text" id="username" placeholder="帳號" required>
<input type="password" id="password" placeholder="密碼" required>
<button type="submit">登入</button>
</form>
<div class="link-buttons">
<a href="resgiter.html">新住戶</a>
<a href="forgot_password.html">忘記密碼</a>
</div>
</div>
<script>
function handleLogin(event) {
event.preventDefault();
const username = document.getElementById('username').value.trim();
if (username === 'admin') {
window.location.href = 'main.html';
} else {
window.location.href = 'resgiter_4.html';
}
}
</script>
</body>
</html>