优化了样式和图标

This commit is contained in:
2023-12-18 06:31:59 +00:00
parent b7675248c3
commit 5a8e5d093a
3 changed files with 17 additions and 12 deletions

View File

@ -1,6 +1,9 @@
body { body {
margin: 0; margin: 0;
font-family: Arial, sans-serif; font-family: Arial, sans-serif;
min-height: 100vh; /* 设置 body 的最小高度为视口的高度 */
display: flex;
flex-direction: column;
} }
header { header {
@ -22,7 +25,7 @@ header {
} }
.user-bar span { .user-bar span {
margin-right: 20px; /* Add spacing between "Welcome, Guest" and "Actions" */ margin-right: 20px;
} }
.user-bar a { .user-bar a {
@ -43,15 +46,15 @@ header {
padding: 10px 15px; padding: 10px 15px;
background-color: #007bff; background-color: #007bff;
color: #fff; color: #fff;
border: 2px solid #0056b3; /* Dark blue border */ border: 2px solid #0056b3;
border-radius: 5px; /* Rounded corners */ border-radius: 5px;
cursor: pointer; cursor: pointer;
display: inline-block; display: inline-block;
} }
.action-button:hover, .action-button:hover,
.dropdown-content:hover { .dropdown-content:hover {
background-color: #87CEFA; /* Light blue background on hover */ background-color: #87CEFA;
} }
.dropdown { .dropdown {
@ -62,12 +65,12 @@ header {
.dropdown-content { .dropdown-content {
display: none; display: none;
position: absolute; position: absolute;
background-color: #87CEFA; /* Light blue background */ background-color: #87CEFA;
box-shadow: 0 8px 16px rgba(0,0,0,0.1); box-shadow: 0 8px 16px rgba(0,0,0,0.1);
z-index: 1; z-index: 1;
max-width: 150px; max-width: 150px;
right: 0; right: 0;
top: 100%; /* Position below the action button */ top: 100%;
} }
.dropdown-content a { .dropdown-content a {
@ -75,9 +78,9 @@ header {
padding: 10px; padding: 10px;
text-decoration: none; text-decoration: none;
color: #333; color: #333;
text-align: center; /* Horizontally center the text */ text-align: center;
width: 100%; /* Make the width 100% */ width: 100%;
box-sizing: border-box; /* Include padding in the width */ box-sizing: border-box;
} }
.dropdown-content a:hover { .dropdown-content a:hover {
@ -89,8 +92,7 @@ header {
} }
.main-content { .main-content {
/*margin-top: 40px; /* Adjust margin to account for the fixed user-bar */ flex: 1;
height: 80vh;
display: flex; display: flex;
} }
@ -98,7 +100,7 @@ nav {
width: 200px; width: 200px;
background-color: #f4f4f4; background-color: #f4f4f4;
padding: 20px; padding: 20px;
height: 80vh; min-height: calc(100vh - 70px); /* 70px 是 header 的高度,设置 nav 的最小高度 */
} }
nav a { nav a {

BIN
frontend/Web/book.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -111,6 +111,9 @@ backend.stdout.on('data', (data) => {
app.get('/', (req, res) => { app.get('/', (req, res) => {
res.sendFile(join(__dirname, 'index.html')); res.sendFile(join(__dirname, 'index.html'));
}); });
app.get('/favicon.ico', (req, res) => {
res.sendFile(join(__dirname, 'book.ico'));
});
app.get('/communication.js', (req, res) => { app.get('/communication.js', (req, res) => {
res.sendFile(join(__dirname, 'communication.js')); res.sendFile(join(__dirname, 'communication.js'));
}); });