上傳檔案到「modules/story-summary」
This commit is contained in:
3192
modules/story-summary/story-summary-a.css
Normal file
3192
modules/story-summary/story-summary-a.css
Normal file
File diff suppressed because it is too large
Load Diff
@@ -73,11 +73,11 @@
|
||||
'陌生': 'trend-stranger', '投缘': 'trend-click', '亲密': 'trend-close', '交融': 'trend-merge'
|
||||
};
|
||||
|
||||
const DEFAULT_FILTER_RULES = [
|
||||
const DEFAULT_FILTER_RULES = [
|
||||
{ start: '<think>', end: '</think>' },
|
||||
{ start: '<thinking>', end: '</thinking>' },
|
||||
{ start: '```', end: '```' },
|
||||
];
|
||||
];
|
||||
|
||||
// ═══════════════════════════════════════════════════════════════════════════
|
||||
// State
|
||||
@@ -1640,6 +1640,42 @@ const DEFAULT_FILTER_RULES = [
|
||||
|
||||
bindEvents();
|
||||
|
||||
// === EASTER EGG: 连续点击「调试」Tab 5 次切换新野兽派主题(localStorage 持久化)===
|
||||
(function () {
|
||||
const STORAGE_KEY = 'xb-theme-alt';
|
||||
const CSS_A = 'story-summary.css';
|
||||
const CSS_B = 'story-summary-a.css';
|
||||
const link = document.querySelector('link[rel="stylesheet"]');
|
||||
if (!link) return;
|
||||
|
||||
// 启动时:根据持久化状态设置 CSS
|
||||
if (localStorage.getItem(STORAGE_KEY) === '1') {
|
||||
link.setAttribute('href', CSS_B);
|
||||
}
|
||||
|
||||
// 点击计数器
|
||||
let clickCount = 0, clickTimer = null;
|
||||
const debugTab = document.querySelector('.settings-tab[data-tab="tab-debug"]');
|
||||
if (!debugTab) return;
|
||||
|
||||
debugTab.addEventListener('click', function () {
|
||||
clickCount++;
|
||||
clearTimeout(clickTimer);
|
||||
clickTimer = setTimeout(() => { clickCount = 0; }, 2000);
|
||||
|
||||
if (clickCount >= 5) {
|
||||
clickCount = 0;
|
||||
clearTimeout(clickTimer);
|
||||
const isAlt = localStorage.getItem(STORAGE_KEY) === '1';
|
||||
const next = isAlt ? CSS_A : CSS_B;
|
||||
localStorage.setItem(STORAGE_KEY, isAlt ? '0' : '1');
|
||||
link.setAttribute('href', next);
|
||||
console.log(`[Easter Egg] Theme toggled → ${next}`);
|
||||
}
|
||||
});
|
||||
})();
|
||||
// === END EASTER EGG ===
|
||||
|
||||
// Notify parent
|
||||
postMsg('FRAME_READY');
|
||||
}
|
||||
|
||||
@@ -2377,10 +2377,9 @@ h1 span {
|
||||
font-weight: 500;
|
||||
color: var(--txt2);
|
||||
transition: all .2s;
|
||||
}
|
||||
|
||||
.settings-collapse-header:hover {
|
||||
background: var(--bdr);
|
||||
background: var(--bg3);
|
||||
border: 2px solid var(--bdr);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.collapse-icon {
|
||||
@@ -2769,124 +2768,7 @@ h1 span {
|
||||
记忆锚点区域(L0)
|
||||
═══════════════════════════════════════════════════════════════════════════ */
|
||||
|
||||
.anchor-section {
|
||||
margin-top: 20px;
|
||||
padding: 16px;
|
||||
background: linear-gradient(135deg, rgba(255, 193, 7, 0.05), rgba(255, 152, 0, 0.05));
|
||||
border: 1px solid rgba(255, 193, 7, 0.3);
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.anchor-header {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.anchor-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 600;
|
||||
color: var(--txt);
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.anchor-icon {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.anchor-hint {
|
||||
font-size: 0.75rem;
|
||||
color: var(--txt3);
|
||||
}
|
||||
|
||||
.anchor-stats {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-size: 0.8125rem;
|
||||
color: var(--txt2);
|
||||
margin-bottom: 12px;
|
||||
padding: 8px 12px;
|
||||
background: var(--bg2);
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.anchor-stat-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.anchor-stat-label {
|
||||
color: var(--txt3);
|
||||
}
|
||||
|
||||
.anchor-stat-value strong {
|
||||
color: var(--hl);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.anchor-stat-sep {
|
||||
color: var(--txt3);
|
||||
}
|
||||
|
||||
.anchor-stat-pending {
|
||||
color: #f59e0b;
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
|
||||
.anchor-stat-pending strong {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.anchor-progress {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.anchor-actions {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.anchor-actions .btn {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.vector-empty-warning {
|
||||
font-size: 0.75rem;
|
||||
color: #f59e0b;
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.anchor-section {
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.anchor-stats {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.anchor-stat-sep {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.anchor-title {
|
||||
font-size: 0.8125rem;
|
||||
}
|
||||
|
||||
.anchor-stats {
|
||||
font-size: 0.75rem;
|
||||
padding: 6px 10px;
|
||||
}
|
||||
}
|
||||
|
||||
/* ═══════════════════════════════════════════════════════════════════════════
|
||||
Metrics Log Styling
|
||||
@@ -3386,3 +3268,80 @@ h1 span {
|
||||
border-color: var(--bdr2);
|
||||
}
|
||||
}
|
||||
|
||||
/* ═══════════════════════════════════════════════════════════════════════════
|
||||
Neo-Brutalism UI Styles
|
||||
═══════════════════════════════════════════════════════════════════════════ */
|
||||
|
||||
.neo-card {
|
||||
background: var(--bg2);
|
||||
border: 2px solid var(--bdr);
|
||||
border-radius: 8px;
|
||||
box-shadow: 4px 4px 0 var(--bdr);
|
||||
padding: 16px;
|
||||
margin-bottom: 24px;
|
||||
transition: transform 0.2s, box-shadow 0.2s;
|
||||
/* Ensure it doesn't overlap with flow */
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.neo-card:hover {
|
||||
transform: translate(1px, 1px);
|
||||
box-shadow: 3px 3px 0 var(--bdr);
|
||||
}
|
||||
|
||||
.neo-card-title {
|
||||
font-size: 0.875rem;
|
||||
font-weight: 700;
|
||||
margin-bottom: 16px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
color: var(--txt);
|
||||
padding-bottom: 8px;
|
||||
border-bottom: 2px solid var(--bdr);
|
||||
}
|
||||
|
||||
.neo-badge {
|
||||
/* Explicitly requested Black Background & White Text */
|
||||
background: #000;
|
||||
color: #fff;
|
||||
padding: 2px 8px;
|
||||
border-radius: 4px;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 800;
|
||||
letter-spacing: 0.05em;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/* Specific tweaks for neo-card content */
|
||||
.neo-card .settings-row {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.neo-card .vector-stats {
|
||||
background: var(--bg3);
|
||||
border: 1px solid var(--bdr);
|
||||
padding: 10px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.neo-card .settings-hint {
|
||||
color: var(--txt2);
|
||||
}
|
||||
|
||||
/* Tools section styling */
|
||||
.neo-tools-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-top: 32px;
|
||||
margin-bottom: 16px;
|
||||
padding-bottom: 8px;
|
||||
border-bottom: 2px dashed var(--bdr);
|
||||
color: var(--txt3);
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
font-size: 0.75rem;
|
||||
letter-spacing: 0.1em;
|
||||
}
|
||||
|
||||
@@ -358,22 +358,26 @@
|
||||
</div>
|
||||
|
||||
<div id="vector-config-area" class="hidden">
|
||||
<!-- API Key -->
|
||||
<div class="settings-row" style="margin-top:16px">
|
||||
|
||||
<!-- Step 0: API Key -->
|
||||
<div class="neo-card" style="margin-top: 24px;">
|
||||
<div class="neo-card-title">
|
||||
<span class="neo-badge">Step.0</span>
|
||||
<span>填写 API Key</span>
|
||||
</div>
|
||||
<div class="settings-row">
|
||||
<div class="settings-field full">
|
||||
<label>硅基流动 API Key</label>
|
||||
<input type="password" id="vector-api-key" placeholder="sk-xxx">
|
||||
<div class="settings-hint">
|
||||
💡 <a href="https://siliconflow.cn" target="_blank">硅基流动</a>
|
||||
内置使用的模型完全免费,注册拿 Key 即可。建议完成实名认证以获得更高并发
|
||||
内置使用的模型完全免费。建议实名认证以获得更高并发。
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 测试连接 -->
|
||||
<div class="settings-row">
|
||||
<div class="settings-field full">
|
||||
<div class="engine-status-row">
|
||||
<div class="engine-status-row" style="margin-top: 0;">
|
||||
<div class="engine-status" id="online-api-status">
|
||||
<span class="status-dot"></span>
|
||||
<span class="status-text">未测试</span>
|
||||
@@ -382,94 +386,78 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 文本过滤规则 -->
|
||||
<div class="settings-collapse" id="filter-rules-collapse">
|
||||
<div class="settings-collapse-header" id="filter-rules-toggle">
|
||||
<span>文本过滤规则 · <strong id="filter-rules-count">0</strong> 条</span>
|
||||
<svg class="collapse-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
||||
stroke-width="2">
|
||||
<polyline points="6 9 12 15 18 9"></polyline>
|
||||
</svg>
|
||||
</div>
|
||||
<div class="settings-collapse-content hidden" id="filter-rules-content">
|
||||
<div class="filter-rules-section" style="margin-top:0">
|
||||
<div class="filter-rules-header">
|
||||
<p class="settings-hint" style="margin:0">过滤干扰内容(如思考标签)</p>
|
||||
<button class="btn btn-sm btn-add" id="btn-add-filter-rule">
|
||||
<svg viewBox="0 0 24 24" width="14" height="14" fill="none"
|
||||
stroke="currentColor" stroke-width="2">
|
||||
<line x1="12" y1="5" x2="12" y2="19"></line>
|
||||
<line x1="5" y1="12" x2="19" y2="12"></line>
|
||||
</svg>
|
||||
添加
|
||||
</button>
|
||||
</div>
|
||||
<div id="filter-rules-list" class="filter-rules-list"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ═══════════════════════════════════════════════════════════ -->
|
||||
<!-- 记忆锚点(L0 文本层)-->
|
||||
<!-- ═══════════════════════════════════════════════════════════ -->
|
||||
<div class="anchor-section">
|
||||
<div class="anchor-header">
|
||||
<div class="anchor-title">
|
||||
<span class="anchor-icon">📌</span>
|
||||
<span>记忆锚点</span>
|
||||
<!-- Step 1: Memory Anchors -->
|
||||
<div class="neo-card">
|
||||
<div class="neo-card-title">
|
||||
<span class="neo-badge">Step.1</span>
|
||||
<span>生成记忆锚点</span>
|
||||
</div>
|
||||
<div class="anchor-hint">从对话中提取叙事锚点(情绪、地点、动作、揭示等),首次提取较慢(约每百楼 3 分钟)</div>
|
||||
<div class="settings-hint" style="margin-bottom: 12px; margin-top: -8px;">
|
||||
从对话中提取叙事锚点(情绪、地点、动作、揭示等)。首次提取较慢(约每百楼 3 分钟)。
|
||||
</div>
|
||||
|
||||
<div class="anchor-stats" id="anchor-stats">
|
||||
<div class="anchor-stat-item">
|
||||
<span class="anchor-stat-label">已提取楼层:</span>
|
||||
<span class="anchor-stat-value"><strong id="anchor-extracted">0</strong></span>
|
||||
<!-- Stats -->
|
||||
<div class="settings-row">
|
||||
<div class="settings-field full">
|
||||
<div class="vector-stats" id="anchor-stats">
|
||||
<div class="vector-stat-col">
|
||||
<span class="vector-stat-label">已提取:</span>
|
||||
<span class="vector-stat-value"><strong
|
||||
id="anchor-extracted">0</strong></span>
|
||||
</div>
|
||||
<span class="anchor-stat-sep">/</span>
|
||||
<div class="anchor-stat-item">
|
||||
<span class="anchor-stat-label">总 AI 楼层:</span>
|
||||
<span class="anchor-stat-value"><strong id="anchor-total">0</strong></span>
|
||||
<span class="vector-stat-sep">/</span>
|
||||
<div class="vector-stat-col">
|
||||
<span class="vector-stat-label">总楼层:</span>
|
||||
<span class="vector-stat-value"><strong
|
||||
id="anchor-total">0</strong></span>
|
||||
</div>
|
||||
<div class="anchor-stat-pending" id="anchor-pending-wrap">
|
||||
<span>(待提取 <strong id="anchor-pending">0</strong> 楼)</span>
|
||||
<div class="vector-stat-col" id="anchor-pending-wrap"
|
||||
style="color: #f59e0b;">
|
||||
(待提取 <strong id="anchor-pending">0</strong>)
|
||||
</div>
|
||||
<span class="anchor-stat-sep">·</span>
|
||||
<div class="anchor-stat-item">
|
||||
<span class="anchor-stat-label">L0 Atoms:</span>
|
||||
<span class="anchor-stat-value"><strong id="anchor-atoms-count">0</strong>
|
||||
条</span>
|
||||
<span class="vector-stat-sep">·</span>
|
||||
<div class="vector-stat-col">
|
||||
<span class="vector-stat-label">L0 Atoms:</span>
|
||||
<span class="vector-stat-value"><strong
|
||||
id="anchor-atoms-count">0</strong></span>
|
||||
</div>
|
||||
<span class="anchor-stat-sep" id="anchor-extra-sep" style="display:none">·</span>
|
||||
<div class="anchor-stat-item" id="anchor-extra-wrap" style="display:none">
|
||||
<span class="vector-stat-sep" id="anchor-extra-sep"
|
||||
style="display:none">·</span>
|
||||
<div class="vector-stat-col" id="anchor-extra-wrap" style="display:none">
|
||||
<span id="anchor-extra"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 进度条 -->
|
||||
<div class="anchor-progress hidden" id="anchor-progress">
|
||||
<!-- Progress -->
|
||||
<div class="engine-progress hidden" id="anchor-progress">
|
||||
<div class="progress-bar">
|
||||
<div class="progress-inner"></div>
|
||||
</div>
|
||||
<span class="progress-text">0/0</span>
|
||||
</div>
|
||||
|
||||
<!-- 操作按钮 -->
|
||||
<div class="anchor-actions" id="anchor-action-row">
|
||||
<button class="btn btn-sm btn-p" id="btn-anchor-generate">生成</button>
|
||||
<button class="btn btn-sm btn-del" id="btn-anchor-clear">清空</button>
|
||||
<button class="btn btn-sm hidden" id="btn-anchor-cancel">取消</button>
|
||||
<!-- Buttons -->
|
||||
<div class="settings-btn-row" id="anchor-action-row">
|
||||
<button class="btn btn-sm btn-p" id="btn-anchor-generate"
|
||||
style="flex:1">生成锚点</button>
|
||||
<button class="btn btn-sm btn-del" id="btn-anchor-clear" style="flex:1">清空</button>
|
||||
<button class="btn btn-sm hidden" id="btn-anchor-cancel" style="flex:1">取消</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ═══════════════════════════════════════════════════════════ -->
|
||||
<!-- 当前聊天向量 -->
|
||||
<!-- ═══════════════════════════════════════════════════════════ -->
|
||||
<div class="vector-chat-section">
|
||||
<!-- Step 2: Generate Vectors -->
|
||||
<div class="neo-card">
|
||||
<div class="neo-card-title">
|
||||
<span class="neo-badge">Step.2</span>
|
||||
<span>生成向量</span>
|
||||
</div>
|
||||
|
||||
<div class="settings-row">
|
||||
<div class="settings-field full">
|
||||
<label>当前聊天向量</label>
|
||||
<div class="vector-stats" id="vector-stats">
|
||||
<div class="vector-stat-col">
|
||||
<span class="vector-stat-label">L0 Vectors:</span>
|
||||
@@ -492,13 +480,14 @@
|
||||
<div class="vector-mismatch-warning hidden" id="vector-mismatch-warning">
|
||||
⚠ 需重新生成向量
|
||||
</div>
|
||||
<div class="vector-empty-warning hidden" id="vector-empty-l0-warning">
|
||||
<div class="vector-empty-warning hidden" id="vector-empty-l0-warning"
|
||||
style="font-size: 0.75rem; color: #f59e0b; margin-top: 6px;">
|
||||
⚠ 记忆锚点为空,建议先生成
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 进度条 -->
|
||||
<!-- Progress -->
|
||||
<div class="engine-progress hidden" id="vector-gen-progress">
|
||||
<div class="progress-bar">
|
||||
<div class="progress-inner"></div>
|
||||
@@ -506,31 +495,61 @@
|
||||
<span class="progress-text">0%</span>
|
||||
</div>
|
||||
|
||||
<!-- 操作按钮 -->
|
||||
<!-- Buttons -->
|
||||
<div class="settings-btn-row" id="vector-action-row">
|
||||
<button class="btn btn-sm btn-p" id="btn-gen-vectors">生成向量</button>
|
||||
<button class="btn btn-sm btn-del" id="btn-clear-vectors">清除</button>
|
||||
<button class="btn btn-sm hidden" id="btn-cancel-vectors">取消</button>
|
||||
<button class="btn btn-sm btn-p" id="btn-gen-vectors" style="flex:1">生成向量</button>
|
||||
<button class="btn btn-sm btn-del" id="btn-clear-vectors" style="flex:1">清除</button>
|
||||
<button class="btn btn-sm hidden" id="btn-cancel-vectors" style="flex:1">取消</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="settings-hint" style="margin-top:8px">
|
||||
向量化现有数据
|
||||
<!-- Tools & Settings -->
|
||||
<div>
|
||||
<div class="neo-tools-header">
|
||||
<span>设置与工具</span>
|
||||
<span style="opacity:0.5">///</span>
|
||||
</div>
|
||||
|
||||
<!-- 导入导出 -->
|
||||
<div class="vector-io-section">
|
||||
<!-- Filter Rules -->
|
||||
<div class="settings-collapse" id="filter-rules-collapse"
|
||||
style="margin-top:0; margin-bottom: 16px;">
|
||||
<div class="settings-collapse-header" id="filter-rules-toggle">
|
||||
<span>文本过滤规则 · <strong id="filter-rules-count">0</strong> 条</span>
|
||||
<svg class="collapse-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
||||
stroke-width="2">
|
||||
<polyline points="6 9 12 15 18 9"></polyline>
|
||||
</svg>
|
||||
</div>
|
||||
<div class="settings-collapse-content hidden" id="filter-rules-content"
|
||||
style="border-left: 1px solid var(--bdr); border-right: 1px solid var(--bdr); border-bottom: 1px solid var(--bdr); border-radius: 0 0 6px 6px; margin-top: -2px;">
|
||||
<div class="filter-rules-header">
|
||||
<p class="settings-hint" style="margin:0">过滤干扰内容(如思考标签)</p>
|
||||
<button class="btn btn-sm btn-add" id="btn-add-filter-rule">
|
||||
<svg viewBox="0 0 24 24" width="14" height="14" fill="none"
|
||||
stroke="currentColor" stroke-width="2">
|
||||
<line x1="12" y1="5" x2="12" y2="19"></line>
|
||||
<line x1="5" y1="12" x2="19" y2="12"></line>
|
||||
</svg> 添加
|
||||
</button>
|
||||
</div>
|
||||
<div id="filter-rules-list" class="filter-rules-list"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Import/Export -->
|
||||
<div class="settings-row">
|
||||
<div class="settings-field full">
|
||||
<label>向量迁移</label>
|
||||
<div class="settings-btn-row" style="margin-top:8px">
|
||||
<button class="btn btn-sm" id="btn-export-vectors">导出</button>
|
||||
<button class="btn btn-sm" id="btn-import-vectors">导入</button>
|
||||
<button class="btn btn-sm" id="btn-export-vectors"
|
||||
style="flex:1">导出向量数据</button>
|
||||
<button class="btn btn-sm" id="btn-import-vectors"
|
||||
style="flex:1">导入向量数据</button>
|
||||
</div>
|
||||
<div class="settings-hint" id="vector-io-status"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user