5 Commits
5 changed files with 148 additions and 14 deletions
+1 -1
View File
@@ -1 +1 @@
2.0.3 2.1.0
+3 -3
View File
@@ -177,7 +177,7 @@ export default function Forum() {
<div style={{ marginBottom: 16 }}> <div style={{ marginBottom: 16 }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 8, marginBottom: 4 }}> <div style={{ display: 'flex', alignItems: 'center', gap: 8, marginBottom: 4 }}>
<h3 style={{ fontWeight: 600, fontSize: 20, margin: 0 }}>{currentCat.name}</h3> <h3 style={{ fontWeight: 600, fontSize: 20, margin: 0 }}>{currentCat.name}</h3>
<span className="chip" style={{ cursor: 'default', fontSize: 12, padding: '1px 8px', color: 'var(--md-ref-on-surface-variant)', border: '1px solid var(--md-ref-outline-variant)' }}>板块</span> <span className="chip chip-static">板块</span>
</div> </div>
<p className="text-muted" style={{ fontSize: 14 }}>{currentCat.description || ''}</p> <p className="text-muted" style={{ fontSize: 14 }}>{currentCat.description || ''}</p>
{currentCat.announcement && ( {currentCat.announcement && (
@@ -214,9 +214,9 @@ export default function Forum() {
<span>{p.created_at}</span> <span>{p.created_at}</span>
<span>{p.reply_count || 0} 回复</span> <span>{p.reply_count || 0} 回复</span>
<span style={{ color: 'var(--md-ref-outline)', margin: '0 4px' }}>|</span> <span style={{ color: 'var(--md-ref-outline)', margin: '0 4px' }}>|</span>
<span className="chip" style={{ cursor: 'default', fontSize: 11, padding: '1px 8px', background: 'transparent', border: '1px solid var(--md-ref-outline-variant)', color: 'var(--md-ref-on-surface-variant)' }}>{catName}</span> <span className="chip chip-static">{catName}</span>
{p.sub_category ? ( {p.sub_category ? (
<span className="chip" style={{ cursor: 'default', fontSize: 11, padding: '1px 8px', background: 'var(--md-ref-secondary-container)', color: 'var(--md-ref-on-secondary-container)' }}>{p.sub_category}</span> <span className="chip chip-tonal">{p.sub_category}</span>
) : null} ) : null}
</div> </div>
</Link> </Link>
+7 -7
View File
@@ -1,12 +1,12 @@
{ {
"name": "rainweb-links", "name": "rainweb-links",
"version": "2.0.3", "version": "2.1.0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "rainweb-links", "name": "rainweb-links",
"version": "2.0.3", "version": "2.1.0",
"dependencies": { "dependencies": {
"@emotion/react": "^11.14.0", "@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.1", "@emotion/styled": "^11.14.1",
@@ -506,7 +506,7 @@
} }
}, },
"node_modules/@emotion/utils": { "node_modules/@emotion/utils": {
"version": "2.0.3", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-1.4.2.tgz", "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-1.4.2.tgz",
"integrity": "sha512-3vLclRofFziIa3J2wDh9jjbkUz9qk5Vi3IZ/FSTKViB0k+ef0fPV7dYrUIugbgupYDx7v9ud/SjrtEP8Y4xLoA==", "integrity": "sha512-3vLclRofFziIa3J2wDh9jjbkUz9qk5Vi3IZ/FSTKViB0k+ef0fPV7dYrUIugbgupYDx7v9ud/SjrtEP8Y4xLoA==",
"license": "MIT" "license": "MIT"
@@ -1320,7 +1320,7 @@
} }
}, },
"node_modules/concat-stream": { "node_modules/concat-stream": {
"version": "2.0.3", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz",
"integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==",
"engines": [ "engines": [
@@ -1480,7 +1480,7 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/depd": { "node_modules/depd": {
"version": "2.0.3", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
"integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
"license": "MIT", "license": "MIT",
@@ -1557,7 +1557,7 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/encodeurl": { "node_modules/encodeurl": {
"version": "2.0.3", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz",
"integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==",
"license": "MIT", "license": "MIT",
@@ -2557,7 +2557,7 @@
} }
}, },
"node_modules/ms": { "node_modules/ms": {
"version": "2.0.3", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
"license": "MIT" "license": "MIT"
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "rainweb-links", "name": "rainweb-links",
"version": "2.0.3", "version": "2.1.0",
"description": "链接聚合管理平台", "description": "链接聚合管理平台",
"main": "server.js", "main": "server.js",
"scripts": { "scripts": {
+136 -2
View File
@@ -556,14 +556,41 @@ table tr:hover td {
} }
.chip:hover { .chip:hover {
background: var(--md-ref-surface-variant);
border-color: var(--md-ref-outline); border-color: var(--md-ref-outline);
transform: translateY(-1px); transform: translateY(-1px);
} }
/* 选中态优先级:hover 不覆盖 active(保持 primary-container 底) */
.chip.active:hover {
background: var(--md-ref-primary-container);
border-color: transparent;
}
.chip:active { .chip:active {
transform: translateY(0); transform: translateY(0);
} }
/* 装饰性静态徽标(替代内联样式):不可点、紧凑尺寸;
static=描边中性,tonal=次级色容器(均无交互态) */
.chip.chip-static {
background: transparent;
border: 1px solid var(--md-ref-outline-variant);
color: var(--md-ref-on-surface-variant);
cursor: default;
font-size: 12px;
padding: 1px 8px;
}
.chip.chip-tonal {
background: var(--md-ref-secondary-container);
color: var(--md-ref-on-secondary-container);
border-color: transparent;
cursor: default;
font-size: 12px;
padding: 1px 8px;
}
@keyframes chipPop { @keyframes chipPop {
from { transform: scale(0.92); } from { transform: scale(0.92); }
50% { transform: scale(1.06); } 50% { transform: scale(1.06); }
@@ -1006,9 +1033,15 @@ table tr:hover td {
gap: 8px; gap: 8px;
/* div/span → button 后补偿:保持块级填充、左对齐与自然高度 */ /* div/span → button 后补偿:保持块级填充、左对齐与自然高度 */
font-family: inherit; font-family: inherit;
min-height: 40px;
height: auto; height: auto;
justify-content: flex-start; justify-content: flex-start;
text-align: left; text-align: inherit;
/* B2 div→button 后补偿:清除 UA 默认浅色按钮底/描边;同时基础态保留
主题化底色(surface-container)而非透明——否则深色模式下非选中按钮
与页面暗底融为一体,点击切换分类后"背景消失"(沿用 .chip 的既有模式) */
background: var(--md-ref-surface-container);
border: 1px solid transparent;
} }
.forum-cat-item:hover { background: var(--md-ref-surface-variant); } .forum-cat-item:hover { background: var(--md-ref-surface-variant); }
@@ -1495,6 +1528,7 @@ table tr:hover td {
/* ===== Markdown toggle ===== */ /* ===== Markdown toggle ===== */
.toggle-group { display: flex; gap: 8px; margin-bottom: 16px; } .toggle-group { display: flex; gap: 8px; margin-bottom: 16px; }
.toggle-btn { padding: 6px 16px; border-radius: 100px; font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid var(--md-ref-outline-variant); background: transparent; color: var(--md-ref-on-surface-variant); } .toggle-btn { padding: 6px 16px; border-radius: 100px; font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid var(--md-ref-outline-variant); background: transparent; color: var(--md-ref-on-surface-variant); }
.toggle-btn:hover { background: var(--md-ref-surface-variant); }
.toggle-btn.active { background: var(--md-ref-primary-container); color: var(--md-ref-on-primary-container); border-color: transparent; } .toggle-btn.active { background: var(--md-ref-primary-container); color: var(--md-ref-on-primary-container); border-color: transparent; }
/* ===== Captcha ===== */ /* ===== Captcha ===== */
@@ -2253,7 +2287,7 @@ body.has-wallpaper .article-toc-side {
} }
.article-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; } .article-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.article-tag-chip { text-decoration: none; transition: all 0.2s; } .article-tag-chip { text-decoration: none; transition: all 0.2s; }
.article-tag-chip:hover { border-color: var(--md-ref-primary); background: var(--md-ref-primary-container); } .article-tag-chip:hover { border-color: var(--md-ref-primary); background: var(--md-ref-surface-variant); }
.article-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; } .article-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.like-btn { .like-btn {
height: 34px; height: 34px;
@@ -2678,3 +2712,103 @@ body.has-wallpaper .article-toc-side {
align-items: center; align-items: center;
gap: 4px; gap: 4px;
} }
/* ============================================================
Markdown Indigo 定制(.md-body
—— 只做文本级渲染;除代码块(okaidia 暗底)外全部背景透明,
由卡片磨砂玻璃接管;颜色全部走主题 CSS 变量,
浅/深色随 data-theme 自动切换。
============================================================ */
/* 正文基调:透明背景,文字色走主题变量 */
.md-body {
color: var(--md-ref-on-surface);
line-height: 1.75;
}
/* 标题:Indigo 排版(字重 500 / 行高 1.3),h1/h2 带左侧竖线 + 下边框 */
.md-body h1, .md-body h2, .md-body h3, .md-body h4, .md-body h5, .md-body h6 {
color: var(--md-ref-on-surface);
font-weight: 500;
line-height: 1.3;
margin: 1.5em 0 .6em;
}
.md-body h1, .md-body h2 {
padding: .25em 0 .25em .75em;
border-left: 6px solid var(--md-ref-primary);
border-bottom: 1px solid var(--md-ref-outline-variant);
}
/* 加粗 / 删除线:不加 Indigo 的「」引号,仅保留字重;删除线走主题灰 */
.md-body strong { font-weight: 700; }
.md-body del, .md-body s { color: var(--md-ref-outline); }
/* 链接:主题主色 + Indigo 下边框式下划线 */
.md-body a {
color: var(--md-ref-primary);
text-decoration: none;
border-bottom: 1px solid color-mix(in srgb, var(--md-ref-primary) 40%, transparent);
}
.md-body a:hover { border-bottom-color: var(--md-ref-primary); }
/* 行内代码:主题容器色背景(可换肤),透明背景不出现 */
.md-body code {
background: var(--md-ref-surface-container);
color: var(--md-ref-on-surface);
padding: 2px 6px;
border-radius: 4px;
font-size: .9em;
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Courier New', monospace;
}
/* 引用块:Indigo 左粗线(主题主色)+ 主题浅底 */
.md-body blockquote {
margin: 1em 0;
padding: .5em 1em;
border-left: 4px solid var(--md-ref-primary);
background: var(--md-ref-surface-container-low);
border-radius: 0 8px 8px 0;
color: color-mix(in srgb, var(--md-ref-primary) 70%, var(--md-ref-on-surface));
}
.md-body blockquote > :last-child { margin-bottom: 0; }
.md-body blockquote > :first-child { margin-top: 0; }
/* 代码块:唯一保留背景的元素 —— okaidia 暗色主题 */
.md-body pre {
background: #272822;
color: #f8f8f2;
padding: 16px;
border-radius: 12px;
overflow-x: auto;
margin: 1em 0;
font-size: 13px;
line-height: 1.6;
text-shadow: 0 1px rgba(0, 0, 0, .3);
tab-size: 4;
}
.md-body pre code {
background: none;
color: #f8f8f2;
padding: 0;
font-size: inherit;
text-shadow: 0 1px rgba(0, 0, 0, .3);
}
.md-body pre::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 2px; }
/* okaidia 语法高亮(token 出现时生效,如后续接入 highlight.js/prism */
.md-body .token.cdata, .md-body .token.comment, .md-body .token.doctype, .md-body .token.prolog { color: #8292a2; }
.md-body .token.punctuation { color: #f8f8f2; }
.md-body .token.namespace { opacity: .7; }
.md-body .token.constant, .md-body .token.deleted, .md-body .token.property, .md-body .token.symbol, .md-body .token.tag { color: #f92672; }
.md-body .token.boolean, .md-body .token.number { color: #ae81ff; }
.md-body .token.attr-name, .md-body .token.builtin, .md-body .token.char, .md-body .token.inserted, .md-body .token.selector, .md-body .token.string { color: #a6e22e; }
.md-body .token.entity, .md-body .token.operator, .md-body .token.url, .md-body .token.variable { color: #f8f8f2; }
.md-body .token.atrule, .md-body .token.attr-value, .md-body .token.class-name, .md-body .token.function { color: #e6db74; }
.md-body .token.keyword { color: #66d9ef; }
.md-body .token.important, .md-body .token.regex { color: #fd971f; }
.md-body .token.bold, .md-body .token.important { font-weight: 700; }
.md-body .token.italic { font-style: italic; }
/* 深色模式:文本色跟随 on-surface 浅色变体;代码块保持 okaidia 暗底不变 */
[data-theme="dark"] .md-body { color: var(--md-ref-on-surface); }
[data-theme="dark"] .md-body blockquote { background: var(--md-ref-surface-container); }