feat(ui): 优化项目描述折叠交互与样式
- 调整项目描述最大高度从100px到80px - 更新折叠遮罩渐变效果适配日夜主题 - 重构切换按钮样式为内联文本链接形式 - 修改展开收起逻辑使用innerHTML动态更新内容 - 添加箭头图标指示当前折叠状态 - 移除冗余CSS类定义提升代码整洁度
This commit is contained in:
@@ -1476,23 +1476,33 @@ a:not(.nav-logo):not(.nav-links a):not(.social-link):not(.btn):not(.footer-info
|
||||
margin-bottom: 1.5rem;
|
||||
line-height: 1.6;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* 项目描述折叠样式 */
|
||||
.project-description.collapsible {
|
||||
position: relative;
|
||||
max-height: 100px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.project-description.collapsible::after {
|
||||
.project-description.collapsible {
|
||||
max-height: 80px;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.theme-day .project-description.collapsible::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 40px;
|
||||
background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, var(--glass-alpha)));
|
||||
height: 30px;
|
||||
background: linear-gradient(to bottom, transparent, rgba(248, 249, 250, 0.8));
|
||||
}
|
||||
|
||||
.theme-night .project-description.collapsible::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 30px;
|
||||
background: linear-gradient(to bottom, transparent, rgba(30, 30, 30, 0.8));
|
||||
}
|
||||
|
||||
.project-description.expanded {
|
||||
@@ -1503,28 +1513,28 @@ a:not(.nav-logo):not(.nav-links a):not(.social-link):not(.btn):not(.footer-info
|
||||
display: none;
|
||||
}
|
||||
|
||||
.project-description.collapsible {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.toggle-description {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
color: var(--text-strong);
|
||||
background: none;
|
||||
border: none;
|
||||
padding: 0.5rem 1rem;
|
||||
border-radius: 20px;
|
||||
cursor: pointer;
|
||||
font-size: 0.9rem;
|
||||
margin-top: 1rem;
|
||||
transition: all 0.3s ease;
|
||||
margin-left: 5px;
|
||||
vertical-align: baseline;
|
||||
text-decoration: underline;
|
||||
padding: 0;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 3px;
|
||||
}
|
||||
|
||||
.toggle-description:hover {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.project-description.collapsible + .toggle-description {
|
||||
display: inline-block;
|
||||
.arrow {
|
||||
font-size: 0.8em;
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
.project-stats {
|
||||
|
||||
Reference in New Issue
Block a user