added 代码折叠 修复bug

This commit is contained in:
Vaica committed 2026-01-30 22:18:19 +08:00
1 parent c115c7c0fb
commit 33a6ce2d85
4 files changed
+212 -35

No files matched your search

+94
View File
@@ -196,8 +196,102 @@ code {
background-color: #f6f8fa; /* Day Mode */
color: #24292e;
border: 1px solid #d0d7de;
/* Hide scrollbar but allow scrolling */
scrollbar-width: none; /* Firefox */
-ms-overflow-style: none; /* IE 10+ */
}
pre::-webkit-scrollbar,
code::-webkit-scrollbar {
display: none; /* Chrome/Safari/Webkit */
}
/* Code Folding */
.code-fold-container {
position: relative;
margin-bottom: 1rem;
border-radius: 4px; /* Optional: match highlight radius */
}
.code-fold-container.collapsed {
max-height: 360px;
overflow: hidden;
}
/* Ensure inner code blocks don't have bottom margin when wrapped */
.code-fold-container .highlight,
.code-fold-container pre {
margin-bottom: 0;
}
.code-expand-btn {
display: none;
position: absolute;
bottom: -7px;
left: -146px;
width: 100%;
height: 80px;
text-align: center;
/* Gradient Background for Fade Effect */
background: linear-gradient(180deg, rgba(246, 248, 250, 0) 0%, rgba(246, 248, 250, 0.9) 50%, rgba(246, 248, 250, 1) 100%);
border: none;
color: #586069;
cursor: pointer;
z-index: 10;
font-size: 13px;
transition: all 0.2s;
align-items: center;
justify-content: center;
padding-top: 20px;
}
/* Show button when collapsed */
.code-fold-container.collapsed .code-expand-btn {
display: flex;
}
/* Button Pill Style */
.code-expand-btn span {
background: rgba(255, 255, 255, 0.9);
padding: 6px 16px;
border-radius: 20px;
box-shadow: 0 2px 8px rgba(0,0,0,0.08);
display: flex;
align-items: center;
border: 1px solid rgba(0,0,0,0.05);
transition: all 0.2s ease;
}
.code-expand-btn:hover span {
background: #fff;
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0,0,0,0.12);
color: #0366d6;
}
/* Dark Mode Support */
[data-theme="dark"] .code-expand-btn {
background: linear-gradient(180deg, rgba(40, 42, 54, 0) 0%, rgba(40, 42, 54, 0.9) 50%, rgba(40, 42, 54, 1) 100%);
color: #f8f8f2;
}
[data-theme="dark"] .code-expand-btn span {
background: rgba(68, 71, 90, 0.8);
border-color: rgba(255,255,255,0.05);
}
[data-theme="dark"] .code-expand-btn:hover span {
background: #44475a;
color: #8be9fd;
}
/* Artalk AI Comment Integration */
.atk-list.has-ai-comment .atk-list-no-comment {
display: none !important;
}
[data-theme="dark"] pre,
[data-theme="dark"] code {
background-color: #282a36; /* Night Mode */