Initial commit
This commit is contained in:
372
style.css
Normal file
372
style.css
Normal file
@@ -0,0 +1,372 @@
|
||||
/* 全局样式 */
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||
line-height: 1.6;
|
||||
background-color: #1a1b1e;
|
||||
color: #e4e6eb;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
/* 布局 */
|
||||
.layout {
|
||||
display: flex;
|
||||
min-height: 100vh;
|
||||
opacity: 0;
|
||||
animation: fadeIn 0.3s ease-out forwards;
|
||||
}
|
||||
|
||||
/* 侧边栏样式 */
|
||||
.sidebar {
|
||||
width: 250px;
|
||||
background-color: #2d2e32;
|
||||
padding: 2rem 1rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2rem;
|
||||
position: fixed;
|
||||
height: 100vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.logo h1 {
|
||||
font-size: 1.5rem;
|
||||
color: #fff;
|
||||
margin-bottom: 2rem;
|
||||
padding-left: 0.5rem;
|
||||
}
|
||||
|
||||
.nav-section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 0.9rem;
|
||||
color: #8b8c8f;
|
||||
padding: 0.5rem;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.nav-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
padding: 0.8rem;
|
||||
color: #a1a2a5;
|
||||
text-decoration: none;
|
||||
border-radius: 8px;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.nav-item:hover {
|
||||
background-color: #3a3b3f;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.nav-item.active {
|
||||
background-color: #3a3b3f;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.nav-item i {
|
||||
width: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* 主内容区域 */
|
||||
.content {
|
||||
flex: 1;
|
||||
margin-left: 250px;
|
||||
padding: 2rem;
|
||||
background-color: #1a1b1e;
|
||||
position: relative;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
/* 搜索框 */
|
||||
.search-box {
|
||||
position: relative;
|
||||
max-width: 600px;
|
||||
margin-bottom: 3rem;
|
||||
}
|
||||
|
||||
.search-box::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
right: 3.5rem;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 50%;
|
||||
opacity: 0;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.search-box.has-results::after {
|
||||
background-color: #4caf50;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.search-box.no-results::after {
|
||||
background-color: #f44336;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.search-box input {
|
||||
width: 100%;
|
||||
padding: 1rem 4.5rem 1rem 1.5rem;
|
||||
border: none;
|
||||
border-radius: 12px;
|
||||
background-color: #2d2e32;
|
||||
color: #fff;
|
||||
font-size: 1rem;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.search-box input:focus {
|
||||
outline: none;
|
||||
background-color: #3a3b3f;
|
||||
}
|
||||
|
||||
.search-box input::placeholder {
|
||||
color: #8b8c8f;
|
||||
}
|
||||
|
||||
.search-box i {
|
||||
position: absolute;
|
||||
right: 1.5rem;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
color: #8b8c8f;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.search-box.has-results i {
|
||||
color: #4caf50;
|
||||
}
|
||||
|
||||
.search-box.no-results i {
|
||||
color: #f44336;
|
||||
}
|
||||
|
||||
/* 欢迎区域 */
|
||||
.welcome-section {
|
||||
margin-bottom: 3rem;
|
||||
}
|
||||
|
||||
.welcome-section h2 {
|
||||
font-size: 2.5rem;
|
||||
color: #fff;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.welcome-section h3 {
|
||||
font-size: 2rem;
|
||||
color: #4a9eff;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.welcome-section .subtitle {
|
||||
color: #8b8c8f;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
|
||||
/* 分类样式 */
|
||||
.category {
|
||||
background-color: #2d2e32;
|
||||
border-radius: 15px;
|
||||
padding: 2rem;
|
||||
margin-bottom: 2rem;
|
||||
transform: translateZ(0);
|
||||
will-change: transform, opacity;
|
||||
animation: none;
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s ease;
|
||||
}
|
||||
|
||||
.category h2 {
|
||||
color: #fff;
|
||||
margin-bottom: 1.5rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.8rem;
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.category h2 i {
|
||||
color: #4a9eff;
|
||||
}
|
||||
|
||||
/* 网站卡片网格 */
|
||||
.sites-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
|
||||
gap: 1.5rem;
|
||||
}
|
||||
|
||||
/* 网站卡片样式 */
|
||||
.site-card {
|
||||
background-color: #3a3b3f;
|
||||
border-radius: 12px;
|
||||
padding: 1.5rem;
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
transition: all 0.3s ease;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
backface-visibility: hidden;
|
||||
transform: translateZ(0);
|
||||
will-change: transform;
|
||||
}
|
||||
|
||||
.site-card:hover {
|
||||
transform: translateY(-5px);
|
||||
background-color: #4a4b4f;
|
||||
}
|
||||
|
||||
.site-card i {
|
||||
font-size: 2rem;
|
||||
margin-bottom: 1rem;
|
||||
color: #4a9eff;
|
||||
}
|
||||
|
||||
.site-card h3 {
|
||||
margin-bottom: 0.5rem;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.site-card p {
|
||||
font-size: 0.9rem;
|
||||
color: #8b8c8f;
|
||||
}
|
||||
|
||||
/* 响应式设计 */
|
||||
@media (max-width: 768px) {
|
||||
.sidebar {
|
||||
width: 70px;
|
||||
padding: 1rem 0.5rem;
|
||||
}
|
||||
|
||||
.sidebar .logo h1,
|
||||
.sidebar .section-title,
|
||||
.sidebar .nav-item span {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.nav-item {
|
||||
padding: 0.8rem;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.nav-item i {
|
||||
margin: 0;
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.content {
|
||||
margin-left: 70px;
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.welcome-section h2 {
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
.welcome-section h3 {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.page {
|
||||
transform: translateX(10px);
|
||||
}
|
||||
|
||||
#search-results {
|
||||
transform: translateY(10px);
|
||||
}
|
||||
}
|
||||
|
||||
/* 动画效果 */
|
||||
@keyframes fadeIn {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(20px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
.category {
|
||||
animation: fadeIn 0.5s ease-out forwards;
|
||||
}
|
||||
|
||||
/* 页面切换动画 */
|
||||
.page {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
transform: translateX(20px);
|
||||
transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0.3s;
|
||||
will-change: opacity, transform;
|
||||
}
|
||||
|
||||
.page.active {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
transform: translateX(0);
|
||||
transition-delay: 0s;
|
||||
}
|
||||
|
||||
/* 搜索结果页面特殊处理 */
|
||||
#search-results {
|
||||
transform: translateY(20px);
|
||||
}
|
||||
|
||||
#search-results.active {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
/* 搜索结果区域动画 */
|
||||
.search-section {
|
||||
opacity: 0;
|
||||
transform: translateY(10px);
|
||||
transition: opacity 0.3s ease, transform 0.3s ease;
|
||||
}
|
||||
|
||||
.search-section[style*="display: block"] {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
/* 优化卡片动画 */
|
||||
.site-card {
|
||||
backface-visibility: hidden;
|
||||
transform: translateZ(0);
|
||||
will-change: transform;
|
||||
}
|
||||
|
||||
/* 优化动画性能 */
|
||||
.category {
|
||||
transform: translateZ(0);
|
||||
will-change: transform, opacity;
|
||||
animation: none;
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s ease;
|
||||
}
|
||||
|
||||
.category[style*="display: block"],
|
||||
.page.active .category {
|
||||
opacity: 1;
|
||||
}
|
||||
Reference in New Issue
Block a user