增加阅读是pdf中高亮显示

This commit is contained in:
yhy
2026-08-29 22:46:28 +08:00
parent 3a2438f566
commit 1475f8b3c5
17 changed files with 2125 additions and 95 deletions
+200 -4
View File
@@ -3,13 +3,32 @@
flex-direction: column;
gap: 8px;
padding: 8px;
min-height: 320px;
min-height: 0;
box-sizing: border-box;
font-size: 13px;
-moz-user-select: text;
user-select: text;
}
.chatpapers-pane-body {
min-height: 0 !important;
}
collapsible-section:not([open]) > :not(.head) .chatpapers-root,
collapsible-section:not([open]) > :not(.head) .chatpapers-lecture-root {
min-height: 0 !important;
padding-block: 0;
overflow: hidden;
}
collapsible-section[open] > :not(.head) .chatpapers-root {
min-height: 240px;
}
collapsible-section[open] > :not(.head) .chatpapers-lecture-root {
min-height: 180px;
}
.chatpapers-header {
display: flex;
flex-direction: column;
@@ -216,9 +235,9 @@
}
.chatpapers-messages {
flex: 1;
min-height: 180px;
max-height: 420px;
flex: 1 1 auto;
min-height: 0;
max-height: min(420px, 45vh);
overflow: auto;
border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
border-radius: 8px;
@@ -856,6 +875,183 @@
line-height: 1.4;
}
.chatpapers-lecture-mode-tabs {
display: flex;
gap: 0;
padding: 3px;
border-radius: 10px;
background: #e8eef0;
border: 1px solid #c5d3d8;
}
.chatpapers-lecture-mode-tab {
flex: 1;
-moz-appearance: none;
appearance: none;
padding: 8px 10px;
border: none;
border-radius: 8px;
background: transparent;
font-size: 12px;
font-weight: 700;
cursor: pointer;
color: #4a5568;
transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.chatpapers-lecture-mode-tab:hover:not(.is-active) {
background: rgba(255, 255, 255, 0.55);
color: #2d3748;
}
.chatpapers-lecture-mode-tab.is-active,
.chatpapers-lecture-mode-tab[aria-selected="true"] {
color: #ffffff;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}
.chatpapers-lecture-mode-tabs.mode-paragraph
.chatpapers-lecture-mode-tab[data-mode="paragraph"].is-active,
.chatpapers-lecture-mode-tabs.mode-paragraph
.chatpapers-lecture-mode-tab[data-mode="paragraph"][aria-selected="true"] {
background: #1f7a8c;
}
.chatpapers-lecture-mode-tabs.mode-overview
.chatpapers-lecture-mode-tab[data-mode="overview"].is-active,
.chatpapers-lecture-mode-tabs.mode-overview
.chatpapers-lecture-mode-tab[data-mode="overview"][aria-selected="true"] {
background: #2563eb;
}
.chatpapers-lecture-granularity-tabs {
display: none;
gap: 0;
padding: 2px;
margin-top: 2px;
border-radius: 8px;
background: #f3f6f8;
border: 1px solid #d8e2e8;
}
.chatpapers-lecture-granularity-tabs.is-visible {
display: flex;
}
.chatpapers-lecture-granularity-tab {
flex: 1;
-moz-appearance: none;
appearance: none;
padding: 6px 8px;
border: none;
border-radius: 6px;
background: transparent;
font-size: 11px;
font-weight: 700;
cursor: pointer;
color: #64748b;
transition: background 0.15s ease, color 0.15s ease;
}
.chatpapers-lecture-granularity-tab:hover:not(.is-active) {
background: rgba(255, 255, 255, 0.7);
color: #334155;
}
.chatpapers-lecture-granularity-tab.is-active,
.chatpapers-lecture-granularity-tab[aria-selected="true"] {
background: #ffffff;
color: #1f7a8c;
box-shadow: 0 1px 3px rgba(31, 122, 140, 0.2);
outline: 1px solid rgba(31, 122, 140, 0.35);
}
.chatpapers-lecture-sentence-item .chatpapers-lecture-beat-title {
font-size: 11px;
}
.chatpapers-lecture-para-original.is-active-sentence {
border-left: 3px solid #1f7a8c;
padding-left: 8px;
background: color-mix(in srgb, #1f7a8c 8%, transparent);
}
.chatpapers-lecture-sentence-list {
display: flex;
flex-direction: column;
gap: 4px;
}
.chatpapers-lecture-sentence-chip {
padding: 4px 8px;
border-radius: 6px;
border: 1px solid color-mix(in srgb, #1f7a8c 20%, transparent);
cursor: pointer;
font-size: 11px;
line-height: 1.35;
}
.chatpapers-lecture-sentence-chip.is-active {
background: color-mix(in srgb, #1f7a8c 12%, transparent);
border-color: color-mix(in srgb, #1f7a8c 40%, transparent);
}
.chatpapers-lecture-pdf-sync-hint {
margin-top: 4px;
font-size: 10px;
opacity: 0.72;
font-style: italic;
}
.chatpapers-lecture-para-detail {
display: flex;
flex-direction: column;
gap: 6px;
padding: 10px;
border-radius: 8px;
background: color-mix(in srgb, #1f7a8c 5%, transparent);
border: 1px solid color-mix(in srgb, #1f7a8c 15%, transparent);
font-size: 12px;
line-height: 1.45;
max-height: 200px;
overflow-y: auto;
}
.chatpapers-lecture-para-kind {
font-size: 11px;
font-weight: 600;
opacity: 0.75;
}
.chatpapers-lecture-para-role {
font-size: 11px;
opacity: 0.85;
font-style: italic;
}
.chatpapers-lecture-para-original-label,
.chatpapers-lecture-para-translation-label,
.chatpapers-lecture-para-context-label {
font-size: 10px;
font-weight: 600;
opacity: 0.6;
text-transform: uppercase;
letter-spacing: 0.04em;
margin-top: 4px;
}
.chatpapers-lecture-para-original {
opacity: 0.9;
}
.chatpapers-lecture-para-translation {
font-weight: 500;
}
.chatpapers-lecture-para-context {
opacity: 0.85;
}
.chatpapers-lecture-player {
display: flex;
flex-direction: column;
+46 -10
View File
@@ -1,5 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
<!-- ChatPapers voice lecture: paper + headphones -->
<!-- ChatPapers 语音伴读:论文 + 声波 + 耳机(与对话气泡图标区分) -->
<path
fill="context-fill"
fill-opacity="0.92"
@@ -10,19 +10,55 @@
fill-opacity="0.35"
d="M10.6 2.85v2.35c0 .45.37.82.82.82h2.35L10.6 2.85z"
/>
<!-- 声波(替代对话图标的横线文本) -->
<rect x="4.4" y="8.35" width="1.15" height="2.8" rx="0.4" fill="context-fill" fill-opacity="0.5" />
<rect x="6.05" y="7.25" width="1.15" height="4.2" rx="0.4" fill="context-fill" fill-opacity="0.72" />
<rect x="7.7" y="8.65" width="1.15" height="2.2" rx="0.4" fill="context-fill" fill-opacity="0.5" />
<rect x="9.35" y="7.75" width="1.15" height="3.5" rx="0.4" fill="context-fill" fill-opacity="0.62" />
<!-- 耳机头梁 -->
<path
stroke="context-fill"
stroke-opacity="0.92"
stroke-width="1.15"
stroke-linecap="round"
fill="none"
d="M12.85 9.15c0-1.55 1.15-2.8 2.55-2.8s2.55 1.25 2.55 2.8"
/>
<!-- 左耳罩 -->
<rect
x="11.55"
y="9.05"
width="2.15"
height="3.55"
rx="0.85"
fill="context-fill"
fill-opacity="0.92"
/>
<!-- 右耳罩 -->
<rect
x="14.55"
y="9.05"
width="2.15"
height="3.55"
rx="0.85"
fill="context-fill"
fill-opacity="0.92"
/>
<!-- 向外声波弧线 -->
<path
stroke="context-stroke"
stroke-opacity="0.55"
stroke-width="0.9"
stroke-opacity="0.45"
stroke-width="0.85"
stroke-linecap="round"
d="M4.35 7.1h5.1M4.35 9.15h4.2"
fill="none"
d="M17.15 10.1c.55.45.9 1.05.9 1.75s-.35 1.3-.9 1.75"
/>
<path
fill="context-fill"
d="M12.1 8.35c1.45 0 2.65 1.15 2.65 2.55v2.1c0 .35-.28.62-.62.62h-.75v1.05c0 .55-.45 1-1 1h-.55c-.55 0-1-.45-1-1v-1.05h-.55c-.35 0-.62-.28-.62-.62v-2.1c0-1.4 1.2-2.55 2.65-2.55z"
/>
<path
fill="context-fill"
d="M16.55 9.05c1.05 0 1.9.82 1.9 1.85v1.35c0 1-.85 1.85-1.9 1.85-.35 0-.62-.28-.62-.62v-3.8c0-.35.28-.62.62-.62z"
stroke="context-stroke"
stroke-opacity="0.3"
stroke-width="0.85"
stroke-linecap="round"
fill="none"
d="M17.85 10.1c.85.7 1.35 1.65 1.35 2.75s-.5 2.05-1.35 2.75"
/>
</svg>

Before

Width:  |  Height:  |  Size: 1020 B

After

Width:  |  Height:  |  Size: 1.9 KiB

+18
View File
@@ -82,6 +82,24 @@ lecture-play-complete = Playback finished
lecture-beat-tts-pending = Synthesizing
lecture-beat-tts-failed = Failed
lecture-reprepare = Re-prepare
lecture-save-note = Save note
lecture-note-saved = Lecture note saved to Zotero
lecture-mode-overview = Overview
lecture-mode-paragraph = Paragraph reading
lecture-paragraph-list-title = Paper paragraphs (original, then translation)
lecture-para-label = Para { $n }
lecture-para-original = Original
lecture-para-translation = Translation
lecture-para-context = Context
lecture-granularity-paragraph = By paragraph
lecture-granularity-sentence = By sentence
lecture-sentence-list-title = Sentences (original, then explanation)
lecture-sentence-label = P{ $p }·S{ $s }
lecture-sentence-list-hint = Sentences in this paragraph
lecture-pdf-sync-hint = The matching passage is highlighted in the PDF reader while playing.
lecture-playing-en = Playing: original
lecture-playing-zh = Playing: translation
lecture-status-ready-step2 = Ready: { $count } paragraphs + note synced
lecture-no-pdf = No PDF attachment on this item
lecture-attach-error = Cannot read PDF attachment
lecture-mount-error = Failed to load voice lecture pane
+18
View File
@@ -82,6 +82,24 @@ lecture-play-complete = 本轮讲解播放完毕
lecture-beat-tts-pending = 合成中
lecture-beat-tts-failed = 失败
lecture-reprepare = 重新备课
lecture-save-note = 保存笔记
lecture-note-saved = 伴读笔记已写入 Zotero 子笔记
lecture-mode-overview = 整体讲解
lecture-mode-paragraph = 逐段精读
lecture-paragraph-list-title = 论文段落(先读原文,再听译文)
lecture-para-label = 段落 { $n }
lecture-para-original = 原文
lecture-para-translation = 译文 / 讲解
lecture-para-context = 上下文衔接
lecture-granularity-paragraph = 按段
lecture-granularity-sentence = 按句
lecture-sentence-list-title = 逐句精读(先读原文,再听讲解)
lecture-sentence-label = 段{ $p }·句{ $s }
lecture-sentence-list-hint = 本段各句
lecture-pdf-sync-hint = 播放时会在 PDF 阅读器中高亮对应原文。
lecture-playing-en = 正在播放:原文朗读
lecture-playing-zh = 正在播放:中文讲解
lecture-status-ready-step2 = 备课完成:{ $count } 段逐段精读可播放,笔记已同步
lecture-no-pdf = 当前条目没有可用的 PDF 附件
lecture-attach-error = 无法读取 PDF 附件
lecture-mount-error = 语音伴读面板加载失败