From 6ea490bf6943d8dd62a7a569c666f557cfb8c471 Mon Sep 17 00:00:00 2001 From: Zuoling Rong Date: Fri, 31 Jan 2025 21:14:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=A1=E7=89=87=E8=BE=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 - style.css | 212 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 204 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index dca4305..1a4df5d 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,6 @@ python -m http.server 8000 ## 开发计划 -- [ ] 添加明暗主题切换 - [ ] 支持自定义分类 - [ ] 添加更多动画效果 - [ ] 支持数据持久化 diff --git a/style.css b/style.css index d16936d..a96ccad 100644 --- a/style.css +++ b/style.css @@ -11,6 +11,7 @@ body { background-color: #1a1b1e; color: #e4e6eb; min-height: 100vh; + overflow-x: hidden; } /* 布局 */ @@ -19,6 +20,7 @@ body { min-height: 100vh; opacity: 0; animation: fadeIn 0.3s ease-out forwards; + overflow-x: hidden; } /* 侧边栏样式 */ @@ -84,17 +86,19 @@ body { .content { flex: 1; margin-left: 250px; - padding: 2rem; + padding: 2rem 0; background-color: #1a1b1e; position: relative; min-height: 100vh; + overflow-x: hidden; + max-width: calc(100vw - 250px); } /* 搜索框 */ .search-box { position: relative; max-width: 600px; - margin-bottom: 3rem; + margin: 0 2rem 3rem 2rem; } .search-box::after { @@ -159,7 +163,7 @@ body { /* 欢迎区域 */ .welcome-section { - margin-bottom: 3rem; + margin: 0 2rem 3rem 2rem; } .welcome-section h2 { @@ -184,7 +188,7 @@ body { background-color: #2d2e32; border-radius: 15px; padding: 2rem; - margin-bottom: 2rem; + margin: 0 2rem 2rem 2rem; transform: translateZ(0); will-change: transform, opacity; animation: none; @@ -208,15 +212,15 @@ body { /* 网站卡片网格 */ .sites-grid { display: grid; - grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); - gap: 1.5rem; + grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); + gap: 1.2rem; } /* 网站卡片样式 */ .site-card { background-color: #3a3b3f; border-radius: 12px; - padding: 1.5rem; + padding: 1.2rem; text-decoration: none; color: inherit; transition: all 0.3s ease; @@ -227,6 +231,8 @@ body { backface-visibility: hidden; transform: translateZ(0); will-change: transform; + max-width: 100%; + position: relative; } .site-card:hover { @@ -250,6 +256,183 @@ body { color: #8b8c8f; } +/* 添加编辑按钮 */ +.edit-buttons { + position: absolute; + top: 0.5rem; + right: 0.5rem; + display: flex; + gap: 0.5rem; + opacity: 0; + transition: opacity 0.3s ease; +} + +.site-card:hover .edit-buttons { + opacity: 1; +} + +.edit-btn, .delete-btn { + background: none; + border: none; + color: #8b8c8f; + cursor: pointer; + padding: 0.3rem; + border-radius: 4px; + transition: all 0.3s ease; +} + +.edit-btn:hover, .delete-btn:hover { + color: #fff; + background-color: #4a4b4f; +} + +/* 添加网站按钮 */ +.add-site-btn { + background-color: #3a3b3f; + border: 2px dashed #4a4b4f; + border-radius: 12px; + padding: 1.2rem; + color: #8b8c8f; + cursor: pointer; + transition: all 0.3s ease; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + min-height: 160px; +} + +.add-site-btn:hover { + background-color: #4a4b4f; + border-color: #5a5b5f; + color: #fff; +} + +.add-site-btn i { + font-size: 2rem; + margin-bottom: 0.5rem; +} + +/* 模态框样式 */ +.modal { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.5); + display: none; + justify-content: center; + align-items: center; + z-index: 1000; +} + +.modal.active { + display: flex; +} + +.modal-content { + background-color: #2d2e32; + border-radius: 15px; + padding: 2rem; + width: 90%; + max-width: 500px; + position: relative; +} + +.modal-header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 1.5rem; +} + +.modal-header h3 { + color: #fff; + font-size: 1.2rem; +} + +.close-modal { + background: none; + border: none; + color: #8b8c8f; + cursor: pointer; + font-size: 1.5rem; + padding: 0.5rem; + transition: color 0.3s ease; +} + +.close-modal:hover { + color: #fff; +} + +/* 表单样式 */ +.site-form { + display: flex; + flex-direction: column; + gap: 1rem; +} + +.form-group { + display: flex; + flex-direction: column; + gap: 0.5rem; +} + +.form-group label { + color: #8b8c8f; + font-size: 0.9rem; +} + +.form-group input, .form-group select { + background-color: #3a3b3f; + border: none; + border-radius: 8px; + padding: 0.8rem 1rem; + color: #fff; + font-size: 1rem; +} + +.form-group input:focus, .form-group select:focus { + outline: none; + background-color: #4a4b4f; +} + +.form-actions { + display: flex; + justify-content: flex-end; + gap: 1rem; + margin-top: 1.5rem; +} + +.btn { + padding: 0.8rem 1.5rem; + border: none; + border-radius: 8px; + cursor: pointer; + font-size: 1rem; + transition: all 0.3s ease; +} + +.btn-primary { + background-color: #4a9eff; + color: #fff; +} + +.btn-primary:hover { + background-color: #3a8eef; +} + +.btn-secondary { + background-color: #3a3b3f; + color: #8b8c8f; +} + +.btn-secondary:hover { + background-color: #4a4b4f; + color: #fff; +} + /* 响应式设计 */ @media (max-width: 768px) { .sidebar { @@ -275,7 +458,7 @@ body { .content { margin-left: 70px; - padding: 1rem; + padding: 1rem 0; } .welcome-section h2 { @@ -293,6 +476,19 @@ body { #search-results { transform: translateY(10px); } + + .category { + margin: 0 1rem 2rem 1rem; + padding: 1.5rem; + } + + .welcome-section { + margin: 0 1rem 2rem 1rem; + } + + .search-box { + margin: 0 1rem 2rem 1rem; + } } /* 动画效果 */