仿苹果风格的用户登录界面
<?php
include 'common.php';
if ($user->hasLogin()) {
$response->redirect($options->adminUrl);
}
$rememberName = htmlspecialchars(\Typecho\Cookie::get('__typecho_remember_name', ''));
\Typecho\Cookie::delete('__typecho_remember_name');
$bodyClass = 'body-100';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"
/>
<meta
http-equiv="X-UA-Compatible"
content="ie=edge"
/>
<title>会员登录</title>
<style>
body {
margin: 0;
font-family: "PingFang SC", "Microsoft Yahei", sans-serif;
}
.container {
width: 100vw;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background: url("./img/demo-2-bg.jpg") fixed no-repeat;
background-size: cover;
}
.login-form {
width: 240px;
/* height: 220px; */
display: flex;
flex-direction: column;
padding: 30px;
text-align: center;
position: relative;
z-index: 100;
background: inherit;
border-radius: 18px;
overflow: hidden; /* 隐藏多余的模糊效果*/
}
.login-form::before {
content: "";
width: calc(100% + 20px);
height: calc(100% + 20px);
position: absolute;
top: -10px;
left: -10px;
overflow: hidden;
background: inherit;
box-shadow: inset 0 0 0 200px rgba(255, 255, 255, 0.25);
filter: blur(6px);
z-index: -1;
}
.login-form h2 {
font-size: 18px;
font-weight: 400;
color: #3d5245;
}
.login-form input,
.login-form button {
margin: 6px 0;
height: 36px;
border: none;
background-color: rgba(255, 255, 255, 0.3);
border-radius: 4px;
padding: 0 14px;
color: #3d5245;
}
.login-form input::placeholder {
color: #3d5245;
}
.login-form button:focus,
.login-form input:focus {
outline: 0;
}
.login-form button {
margin-top: 12px;
background-color: rgba(57, 88, 69, 0.4);
color: white;
position: relative;
overflow: hidden;
cursor: pointer;
transition: 0.4s;
}
.login-form button:hover {
background-color: rgba(12, 80, 38, 0.67);
}
.sub button{
width: 197px;
}
.forget_pw{
display: flex;
justify-content:space-around;
margin-top: 5px;
}
</style>
</head>
<body>
<div class="container">
<form class="login-form" method="post" name="login" role="form" action="<?php $options->loginAction();?>" >
<div class="text-l w-100">
<input type="text" id="name" name="name" value="<?php echo $rememberName; ?>" placeholder="<?php _e('请输入用户名'); ?>" autofocus />
<input type="password" id="password" name="password" placeholder="<?php _e('请输入密码'); ?>" />
<!-- <button class="btn btn-l w-100 primary"></button> -->
</div>
<div class="sub">
<button type="submit" > <?php _e('立即登录'); ?></button>
</div>
<div class="forget_pw" >
<a href="#">忘记密码</a>
<a href="http://test/admin/register.php">立即注册</a>
</div>
</form>
</div>
</div>
</body>
<script src="https://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
<script>
$(document).ready(function () {
$('#name').focus();
});
</script>