add login
This commit is contained in:
@ -8,6 +8,24 @@
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<!-- 在原有HTML中添加登录模态框 -->
|
||||
<div class="modal" id="loginModal">
|
||||
<div class="modal-content">
|
||||
<span class="close">×</span>
|
||||
<h2><i class="fas fa-sign-in-alt"></i> 管理员登录</h2>
|
||||
<form id="loginForm">
|
||||
<div class="form-group">
|
||||
<label for="username"><i class="fas fa-user"></i> 用户名</label>
|
||||
<input type="text" id="username" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="password"><i class="fas fa-lock"></i> 密码</label>
|
||||
<input type="password" id="password" required>
|
||||
</div>
|
||||
<button type="submit"><i class="fas fa-sign-in-alt"></i> 登录</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<header>
|
||||
<div class="header-left">
|
||||
@ -17,14 +35,17 @@
|
||||
<i class="fas fa-search"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="header-right">
|
||||
<button id="themeBtn"><i class="fas fa-moon"></i></button>
|
||||
<button id="addSiteBtn"><i class="fas fa-plus"></i> 添加网站</button>
|
||||
<button id="manageCategoriesBtn"><i class="fas fa-tags"></i> 管理分类</button>
|
||||
<button id="exportBtn"><i class="fas fa-file-export"></i> 导出</button>
|
||||
<button id="importBtn"><i class="fas fa-file-import"></i> 导入</button>
|
||||
<input type="file" id="importFile" style="display: none;" accept=".json">
|
||||
</div>
|
||||
<div class="header-right">
|
||||
<button id="themeBtn"><i class="fas fa-moon"></i></button>
|
||||
<button id="loginBtn" style="display: none;"><i class="fas fa-sign-in-alt"></i> 登录</button>
|
||||
<button id="logoutBtn" style="display: none;"><i class="fas fa-sign-out-alt"></i> 注销</button>
|
||||
<!-- 管理员按钮默认隐藏 -->
|
||||
<button id="addSiteBtn" style="display: none;"><i class="fas fa-plus"></i> 添加网站</button>
|
||||
<button id="manageCategoriesBtn" style="display: none;"><i class="fas fa-tags"></i> 管理分类</button>
|
||||
<button id="exportBtn" style="display: none;"><i class="fas fa-file-export"></i> 导出</button>
|
||||
<button id="importBtn" style="display: none;"><i class="fas fa-file-import"></i> 导入</button>
|
||||
<input type="file" id="importFile" style="display: none;" accept=".json">
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="categories" id="categories">
|
||||
|
@ -59,9 +59,6 @@ header {
|
||||
h1 {
|
||||
font-size: 2rem;
|
||||
color: var(--primary-color);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.search-box {
|
||||
@ -87,7 +84,13 @@ h1 {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
button {
|
||||
.actions {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.actions button {
|
||||
padding: 8px 16px;
|
||||
background-color: var(--primary-color);
|
||||
color: white;
|
||||
@ -99,22 +102,21 @@ button {
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
.actions button:hover {
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
button i {
|
||||
.actions button i {
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.loading, .error {
|
||||
text-align: center;
|
||||
padding: 20px;
|
||||
color: var(--primary-color);
|
||||
}
|
||||
|
||||
.error {
|
||||
color: var(--danger-color);
|
||||
.theme-switcher button {
|
||||
background: none;
|
||||
border: none;
|
||||
color: var(--text-color);
|
||||
font-size: 1.2rem;
|
||||
cursor: pointer;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.categories {
|
||||
@ -198,12 +200,12 @@ button i {
|
||||
font-size: 12px;
|
||||
cursor: pointer;
|
||||
display: none;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.site:hover .delete-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
/* 模态框样式 */
|
||||
@ -267,7 +269,8 @@ button i {
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.form-group input {
|
||||
.form-group input,
|
||||
.form-group select {
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
border: 1px solid var(--border-color);
|
||||
@ -323,9 +326,6 @@ form button:hover {
|
||||
border-radius: 4px;
|
||||
padding: 5px 10px;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
.add-category {
|
||||
@ -351,4 +351,70 @@ form button:hover {
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
/* 拖拽样式 */
|
||||
.sortable-ghost {
|
||||
opacity: 0.5;
|
||||
background: var(--primary-color);
|
||||
}
|
||||
|
||||
.sortable-chosen {
|
||||
box-shadow: 0 0 10px var(--shadow-color);
|
||||
}
|
||||
|
||||
/* 响应式设计 */
|
||||
@media (max-width: 768px) {
|
||||
header {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
.header-left, .header-right {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
.search-box {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.actions {
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.actions button {
|
||||
flex-grow: 1;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.sites {
|
||||
grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
|
||||
}
|
||||
|
||||
.add-category {
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
|
||||
/* 添加拖拽相关样式 */
|
||||
.site[draggable="true"] {
|
||||
cursor: grab;
|
||||
}
|
||||
|
||||
.site[draggable="true"]:active {
|
||||
cursor: grabbing;
|
||||
}
|
||||
|
||||
.site.dragging {
|
||||
opacity: 0.5;
|
||||
background-color: var(--primary-color);
|
||||
}
|
||||
|
||||
/* 登录按钮样式 */
|
||||
#loginBtn, #logoutBtn {
|
||||
background-color: var(--secondary-color);
|
||||
}
|
Reference in New Issue
Block a user