修改并复用了样式

This commit is contained in:
2023-12-17 01:08:32 +00:00
parent 09edd8de81
commit 5d120e7439
7 changed files with 130 additions and 577 deletions

View File

@ -3,122 +3,8 @@
<head> <head>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Panel - ZYM's Book Store</title> <title>Admin Panel - ZYM's Book Store</title>
<link rel="stylesheet" href="basic.css">
<style> <style>
body {
margin: 0;
font-family: Arial, sans-serif;
}
header {
background-color: #333;
color: #fff;
padding: 10px 0;
text-align: center;
}
.user-bar {
float: right;
padding: 10px;
background-color: #007bff;
}
.user-bar span {
margin-right: 20px; /* Add spacing between "Welcome, Guest" and "Actions" */
}
.user-bar a {
color: #fff;
margin-right: 10px;
text-decoration: none;
}
.user-bar a:hover {
text-decoration: underline;
}
.action-button-container {
display: inline-block;
}
.action-button {
padding: 10px 15px;
background-color: #007bff;
color: #fff;
border: 2px solid #0056b3; /* Dark blue border */
border-radius: 5px; /* Rounded corners */
cursor: pointer;
display: inline-block;
}
.action-button:hover,
.dropdown-content:hover {
background-color: #87CEFA; /* Light blue background on hover */
}
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #87CEFA; /* Light blue background */
box-shadow: 0 8px 16px rgba(0,0,0,0.1);
z-index: 1;
max-width: 150px;
right: 0;
top: 100%; /* Position below the action button */
}
.dropdown-content a {
display: block;
padding: 10px;
text-decoration: none;
color: #333;
text-align: center; /* Horizontally center the text */
width: 100%; /* Make the width 100% */
box-sizing: border-box; /* Include padding in the width */
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
.main-content {
height: 80vh;
display: flex;
}
nav {
width: 200px;
background-color: #f4f4f4;
padding: 20px;
height: 80vh;
}
nav a {
display: block;
padding: 10px;
margin-bottom: 10px;
text-decoration: none;
color: #333;
border-radius: 5px;
transition: background-color 0.3s ease;
}
nav a:hover {
background-color: #ddd;
}
.content {
flex: 1;
padding: 20px;
}
.passwd-box { .passwd-box {
width: 300px; width: 300px;
padding: 20px; padding: 20px;

121
frontend/Web/basic.css Normal file
View File

@ -0,0 +1,121 @@
body {
margin: 0;
font-family: Arial, sans-serif;
}
header {
background-color: #333;
color: #fff;
padding: 10px 0;
text-align: center;
position: relative;
}
.user-bar {
position: absolute;
top: 100%;
right: 0;
transform: translateY(-100%);
padding: 10px;
background-color: #007bff;
z-index: 1000;
}
.user-bar span {
margin-right: 20px; /* Add spacing between "Welcome, Guest" and "Actions" */
}
.user-bar a {
color: #fff;
margin-right: 10px;
text-decoration: none;
}
.user-bar a:hover {
text-decoration: underline;
}
.action-button-container {
display: inline-block;
}
.action-button {
padding: 10px 15px;
background-color: #007bff;
color: #fff;
border: 2px solid #0056b3; /* Dark blue border */
border-radius: 5px; /* Rounded corners */
cursor: pointer;
display: inline-block;
}
.action-button:hover,
.dropdown-content:hover {
background-color: #87CEFA; /* Light blue background on hover */
}
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #87CEFA; /* Light blue background */
box-shadow: 0 8px 16px rgba(0,0,0,0.1);
z-index: 1;
max-width: 150px;
right: 0;
top: 100%; /* Position below the action button */
}
.dropdown-content a {
display: block;
padding: 10px;
text-decoration: none;
color: #333;
text-align: center; /* Horizontally center the text */
width: 100%; /* Make the width 100% */
box-sizing: border-box; /* Include padding in the width */
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
.main-content {
/*margin-top: 40px; /* Adjust margin to account for the fixed user-bar */
height: 80vh;
display: flex;
}
nav {
width: 200px;
background-color: #f4f4f4;
padding: 20px;
height: 80vh;
}
nav a {
display: block;
padding: 10px;
margin-bottom: 10px;
text-decoration: none;
color: #333;
border-radius: 5px;
transition: background-color 0.3s ease;
}
nav a:hover {
background-color: #ddd;
}
.content {
flex: 1;
padding: 20px;
}

View File

@ -3,123 +3,7 @@
<head> <head>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ZYM's Book Store</title> <title>ZYM's Book Store</title>
<style> <link rel="stylesheet" href="basic.css">
body {
margin: 0;
font-family: Arial, sans-serif;
}
header {
background-color: #333;
color: #fff;
padding: 10px 0;
text-align: center;
}
.user-bar {
float: right;
padding: 10px;
background-color: #007bff;
}
.user-bar span {
margin-right: 20px; /* Add spacing between "Welcome, Guest" and "Actions" */
}
.user-bar a {
color: #fff;
margin-right: 10px;
text-decoration: none;
}
.user-bar a:hover {
text-decoration: underline;
}
.action-button-container {
display: inline-block;
}
.action-button {
padding: 10px 15px;
background-color: #007bff;
color: #fff;
border: 2px solid #0056b3; /* Dark blue border */
border-radius: 5px; /* Rounded corners */
cursor: pointer;
display: inline-block;
}
.action-button:hover,
.dropdown-content:hover {
background-color: #87CEFA; /* Light blue background on hover */
}
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #87CEFA; /* Light blue background */
box-shadow: 0 8px 16px rgba(0,0,0,0.1);
z-index: 1;
max-width: 150px;
right: 0;
top: 100%; /* Position below the action button */
}
.dropdown-content a {
display: block;
padding: 10px;
text-decoration: none;
color: #333;
text-align: center; /* Horizontally center the text */
width: 100%; /* Make the width 100% */
box-sizing: border-box; /* Include padding in the width */
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
.main-content {
height: 80vh;
display: flex;
}
nav {
width: 200px;
background-color: #f4f4f4;
padding: 20px;
height: 80vh;
}
nav a {
display: block;
padding: 10px;
margin-bottom: 10px;
text-decoration: none;
color: #333;
border-radius: 5px;
transition: background-color 0.3s ease;
}
nav a:hover {
background-color: #ddd;
}
.content {
flex: 1;
padding: 20px;
}
</style>
</head> </head>
<body> <body>

View File

@ -110,6 +110,10 @@ app.get('/sessioninit.js', (req, res) => {
res.sendFile(join(__dirname, 'sessioninit.js')); res.sendFile(join(__dirname, 'sessioninit.js'));
}); });
app.get('/basic.css', (req, res) => {
res.sendFile(join(__dirname, 'basic.css'));
});
io.on('connection', async (socket) => { io.on('connection', async (socket) => {
console.log('a user connected'); console.log('a user connected');
socket.on('disconnect', () => { socket.on('disconnect', () => {

View File

@ -3,122 +3,8 @@
<head> <head>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>login - ZYM's Book Store</title> <title>login - ZYM's Book Store</title>
<link rel="stylesheet" href="basic.css">
<style> <style>
body {
margin: 0;
font-family: Arial, sans-serif;
}
header {
background-color: #333;
color: #fff;
padding: 10px 0;
text-align: center;
}
.user-bar {
float: right;
padding: 10px;
background-color: #007bff;
}
.user-bar span {
margin-right: 20px; /* Add spacing between "Welcome, Guest" and "Actions" */
}
.user-bar a {
color: #fff;
margin-right: 10px;
text-decoration: none;
}
.user-bar a:hover {
text-decoration: underline;
}
.action-button-container {
display: inline-block;
}
.action-button {
padding: 10px 15px;
background-color: #007bff;
color: #fff;
border: 2px solid #0056b3; /* Dark blue border */
border-radius: 5px; /* Rounded corners */
cursor: pointer;
display: inline-block;
}
.action-button:hover,
.dropdown-content:hover {
background-color: #87CEFA; /* Light blue background on hover */
}
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #87CEFA; /* Light blue background */
box-shadow: 0 8px 16px rgba(0,0,0,0.1);
z-index: 1;
max-width: 150px;
right: 0;
top: 100%; /* Position below the action button */
}
.dropdown-content a {
display: block;
padding: 10px;
text-decoration: none;
color: #333;
text-align: center; /* Horizontally center the text */
width: 100%; /* Make the width 100% */
box-sizing: border-box; /* Include padding in the width */
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
.main-content {
height: 80vh;
display: flex;
}
nav {
width: 200px;
background-color: #f4f4f4;
padding: 20px;
height: 80vh;
}
nav a {
display: block;
padding: 10px;
margin-bottom: 10px;
text-decoration: none;
color: #333;
border-radius: 5px;
transition: background-color 0.3s ease;
}
nav a:hover {
background-color: #ddd;
}
.content {
flex: 1;
padding: 20px;
}
.login-box { .login-box {
width: 300px; width: 300px;
padding: 20px; padding: 20px;

View File

@ -3,122 +3,8 @@
<head> <head>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>change password - ZYM's Book Store</title> <title>change password - ZYM's Book Store</title>
<link rel="stylesheet" href="basic.css">
<style> <style>
body {
margin: 0;
font-family: Arial, sans-serif;
}
header {
background-color: #333;
color: #fff;
padding: 10px 0;
text-align: center;
}
.user-bar {
float: right;
padding: 10px;
background-color: #007bff;
}
.user-bar span {
margin-right: 20px; /* Add spacing between "Welcome, Guest" and "Actions" */
}
.user-bar a {
color: #fff;
margin-right: 10px;
text-decoration: none;
}
.user-bar a:hover {
text-decoration: underline;
}
.action-button-container {
display: inline-block;
}
.action-button {
padding: 10px 15px;
background-color: #007bff;
color: #fff;
border: 2px solid #0056b3; /* Dark blue border */
border-radius: 5px; /* Rounded corners */
cursor: pointer;
display: inline-block;
}
.action-button:hover,
.dropdown-content:hover {
background-color: #87CEFA; /* Light blue background on hover */
}
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #87CEFA; /* Light blue background */
box-shadow: 0 8px 16px rgba(0,0,0,0.1);
z-index: 1;
max-width: 150px;
right: 0;
top: 100%; /* Position below the action button */
}
.dropdown-content a {
display: block;
padding: 10px;
text-decoration: none;
color: #333;
text-align: center; /* Horizontally center the text */
width: 100%; /* Make the width 100% */
box-sizing: border-box; /* Include padding in the width */
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
.main-content {
height: 80vh;
display: flex;
}
nav {
width: 200px;
background-color: #f4f4f4;
padding: 20px;
height: 80vh;
}
nav a {
display: block;
padding: 10px;
margin-bottom: 10px;
text-decoration: none;
color: #333;
border-radius: 5px;
transition: background-color 0.3s ease;
}
nav a:hover {
background-color: #ddd;
}
.content {
flex: 1;
padding: 20px;
}
.passwd-box { .passwd-box {
width: 300px; width: 300px;
padding: 20px; padding: 20px;

View File

@ -3,122 +3,8 @@
<head> <head>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>register - ZYM's Book Store</title> <title>register - ZYM's Book Store</title>
<link rel="stylesheet" href="basic.css">
<style> <style>
body {
margin: 0;
font-family: Arial, sans-serif;
}
header {
background-color: #333;
color: #fff;
padding: 10px 0;
text-align: center;
}
.user-bar {
float: right;
padding: 10px;
background-color: #007bff;
}
.user-bar span {
margin-right: 20px; /* Add spacing between "Welcome, Guest" and "Actions" */
}
.user-bar a {
color: #fff;
margin-right: 10px;
text-decoration: none;
}
.user-bar a:hover {
text-decoration: underline;
}
.action-button-container {
display: inline-block;
}
.action-button {
padding: 10px 15px;
background-color: #007bff;
color: #fff;
border: 2px solid #0056b3; /* Dark blue border */
border-radius: 5px; /* Rounded corners */
cursor: pointer;
display: inline-block;
}
.action-button:hover,
.dropdown-content:hover {
background-color: #87CEFA; /* Light blue background on hover */
}
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #87CEFA; /* Light blue background */
box-shadow: 0 8px 16px rgba(0,0,0,0.1);
z-index: 1;
max-width: 150px;
right: 0;
top: 100%; /* Position below the action button */
}
.dropdown-content a {
display: block;
padding: 10px;
text-decoration: none;
color: #333;
text-align: center; /* Horizontally center the text */
width: 100%; /* Make the width 100% */
box-sizing: border-box; /* Include padding in the width */
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
.main-content {
height: 80vh;
display: flex;
}
nav {
width: 200px;
background-color: #f4f4f4;
padding: 20px;
height: 80vh;
}
nav a {
display: block;
padding: 10px;
margin-bottom: 10px;
text-decoration: none;
color: #333;
border-radius: 5px;
transition: background-color 0.3s ease;
}
nav a:hover {
background-color: #ddd;
}
.content {
flex: 1;
padding: 20px;
}
.register-box { .register-box {
width: 300px; width: 300px;
padding: 20px; padding: 20px;