图书管理系统登录界面代码
时间: 2023-08-10 13:06:01 浏览: 60
下面是一个简单的图书管理系统登录界面的示例代码,包括HTML、CSS和JavaScript部分:
HTML代码:
```
<!DOCTYPE html>
<html>
<head>
<title>图书管理系统登录</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="login-page">
<div class="form">
<h2>图书管理系统登录</h2>
<form class="login-form">
<input type="text" placeholder="用户名" name="username"/>
<input type="password" placeholder="密码" name="password"/>
<button type="submit">登录</button>
</form>
</div>
</div>
<script src="script.js"></script>
</body>
</html>
```
CSS代码:
```
body {
background-color: #F7F7F7;
font-family: "Open Sans", sans-serif;
}
.login-page {
width: 360px;
padding: 8% 0 0;
margin: auto;
}
.form {
position: relative;
z-index: 1;
background: #FFFFFF;
max-width: 360px;
margin: 0 auto 100px;
padding: 45px;
text-align: center;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2), 0 5px 5px 0 rgba(0, 0, 0, 0.24);
}
.form input[type="text"],
.form input[type="password"] {
font-family: "Open Sans", sans-serif;
outline: 0;
background: #f2f2f2;
width: 100%;
border: 0;
margin: 0 0 15px;
padding: 15px;
box-sizing: border-box;
font-size: 14px;
}
.form button {
font-family: "Open Sans", sans-serif;
text-transform: uppercase;
outline: 0;
background: #4CAF50;
width: 100%;
border: 0;
padding: 15px;
color: #FFFFFF;
font-size: 14px;
-webkit-transition: all 0.3 ease;
transition: all 0.3 ease;
cursor: pointer;
}
.form button:hover,
.form button:active,
.form button:focus {
background: #43A047;
}
.form h2 {
color: #4CAF50;
font-family: "Open Sans", sans-serif;
font-size: 24px;
font-weight: 600;
margin: 0 0 15px;
}
.form input:focus + label,
.form input:valid + label {
font-size: 12px;
-webkit-transform: translateY(-20px);
transform: translateY(-20px);
}
.form label {
font-family: "Open Sans", sans-serif;
font-size: 14px;
font-weight: normal;
position: absolute;
pointer-events: none;
left: 15px;
top: 14px;
-webkit-transition: all 0.3 ease;
transition: all 0.3 ease;
color: #999;
}
.form input:focus,
.form select:focus {
border: 2px solid #4CAF50;
}
.form input:focus + label {
color: #4CAF50;
}
.form select {
font-family: "Open Sans", sans-serif;
outline: 0;
background: #f2f2f2;
width: 100%;
border: 0;
margin: 0 0 15px;
padding: 15px;
box-sizing: border-box;
font-size: 14px;
}
.form .message {
margin: 15px 0 0;
color: #b3b3b3;
font-size: 12px;
}
.form .message a {
color: #4CAF50;
text-decoration: none;
}
.form .register-form {
display: none;
}
```
JavaScript代码:
```
// 点击登录按钮后触发的事件
document.querySelector('.login-form button').addEventListener('click', function(e){
e.preventDefault();
// 获取用户名和密码
var username = document.querySelector('.login-form input[name="username"]').value;
var password = document.querySelector('.login-form input[name="password"]').value;
// TODO: 发送登录请求并处理响应结果
});
```
以上代码只是一个简单的示例,实际的图书管理系统需要根据具体需求进行开发和完善。