|
@@ -296,20 +296,25 @@
|
|
|
color: #166534;
|
|
color: #166534;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- .reader-tool svg,
|
|
|
|
|
- .reader-settings-launcher svg {
|
|
|
|
|
- width: var(--reader-controls-icon);
|
|
|
|
|
- height: var(--reader-controls-icon);
|
|
|
|
|
- stroke: currentColor;
|
|
|
|
|
|
|
+ .reader-tool svg,
|
|
|
|
|
+ .reader-settings-launcher svg {
|
|
|
|
|
+ width: var(--reader-controls-icon);
|
|
|
|
|
+ height: var(--reader-controls-icon);
|
|
|
|
|
+ stroke: currentColor;
|
|
|
fill: none;
|
|
fill: none;
|
|
|
stroke-width: 1.8;
|
|
stroke-width: 1.8;
|
|
|
- stroke-linecap: round;
|
|
|
|
|
- stroke-linejoin: round;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .reader-tool-label {
|
|
|
|
|
- display: var(--reader-controls-label);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ stroke-linecap: round;
|
|
|
|
|
+ stroke-linejoin: round;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ #select-all-text svg {
|
|
|
|
|
+ width: calc(var(--reader-controls-icon) + 2px);
|
|
|
|
|
+ height: calc(var(--reader-controls-icon) + 2px);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .reader-tool-label {
|
|
|
|
|
+ display: var(--reader-controls-label);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
.reader-tool-stack {
|
|
.reader-tool-stack {
|
|
|
display: inline-flex;
|
|
display: inline-flex;
|
|
@@ -1160,18 +1165,18 @@
|
|
|
<span class="reader-tool-label">目录</span>
|
|
<span class="reader-tool-label">目录</span>
|
|
|
</span>
|
|
</span>
|
|
|
</button>
|
|
</button>
|
|
|
- <button id="nightModeButton" class="reader-tool" type="button" title="夜间模式" aria-label="夜间模式">
|
|
|
|
|
- <span class="reader-tool-stack">
|
|
|
|
|
- <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"/></svg>
|
|
|
|
|
- <span class="reader-tool-label">夜间</span>
|
|
|
|
|
- </span>
|
|
|
|
|
- </button>
|
|
|
|
|
- <button id="select-all-text" class="reader-tool" type="button" title="阅读整页" aria-label="阅读整页">
|
|
|
|
|
- <span class="reader-tool-stack">
|
|
|
|
|
- <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M6 4h9l3 3v13H6z"/><path d="M15 4v4h4"/><path d="M9 12h6"/><path d="M9 16h6"/></svg>
|
|
|
|
|
- <span class="reader-tool-label">整页</span>
|
|
|
|
|
- </span>
|
|
|
|
|
- </button>
|
|
|
|
|
|
|
+ <button id="nightModeButton" class="reader-tool" type="button" title="夜间模式" aria-label="夜间模式">
|
|
|
|
|
+ <span class="reader-tool-stack">
|
|
|
|
|
+ <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"/></svg>
|
|
|
|
|
+ <span class="reader-tool-label">夜间</span>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </button>
|
|
|
|
|
+ <button id="select-all-text" class="reader-tool" type="button" title="阅读整页" aria-label="阅读整页">
|
|
|
|
|
+ <span class="reader-tool-stack">
|
|
|
|
|
+ <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 13a8 8 0 0 1 16 0"/><path d="M6 13v5a2 2 0 0 0 2 2h1v-7H8a2 2 0 0 0-2 2"/><path d="M18 13v5a2 2 0 0 1-2 2h-1v-7h1a2 2 0 0 1 2 2"/></svg>
|
|
|
|
|
+ <span class="reader-tool-label">整页</span>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </button>
|
|
|
<button id="pause-play-button" class="reader-tool" type="button" title="暂停播放" aria-label="暂停播放">
|
|
<button id="pause-play-button" class="reader-tool" type="button" title="暂停播放" aria-label="暂停播放">
|
|
|
<span class="reader-tool-stack">
|
|
<span class="reader-tool-stack">
|
|
|
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M9 5v14"/><path d="M15 5v14"/></svg>
|
|
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M9 5v14"/><path d="M15 5v14"/></svg>
|
|
@@ -1180,7 +1185,7 @@
|
|
|
</button>
|
|
</button>
|
|
|
<button id="stop-play-button" class="reader-tool reader-tool-danger" type="button" title="停止播放" aria-label="停止播放">
|
|
<button id="stop-play-button" class="reader-tool reader-tool-danger" type="button" title="停止播放" aria-label="停止播放">
|
|
|
<span class="reader-tool-stack">
|
|
<span class="reader-tool-stack">
|
|
|
- <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M7 7h10v10H7z"/></svg>
|
|
|
|
|
|
|
+ <svg viewBox="0 0 24 24" aria-hidden="true"><rect x="7" y="7" width="10" height="10" rx="1.5" fill="currentColor" stroke="none"/></svg>
|
|
|
<span class="reader-tool-label">停止</span>
|
|
<span class="reader-tool-label">停止</span>
|
|
|
</span>
|
|
</span>
|
|
|
</button>
|
|
</button>
|
|
@@ -1200,7 +1205,7 @@
|
|
|
<div id="readerControlsSpacer"></div>
|
|
<div id="readerControlsSpacer"></div>
|
|
|
<div class="reader-settings-anchor">
|
|
<div class="reader-settings-anchor">
|
|
|
<button id="readerSettingsButton" class="reader-settings-launcher" type="button" title="设置" aria-label="设置" aria-expanded="false">
|
|
<button id="readerSettingsButton" class="reader-settings-launcher" type="button" title="设置" aria-label="设置" aria-expanded="false">
|
|
|
- <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3v3"/><path d="M12 18v3"/><path d="M3 12h3"/><path d="M18 12h3"/><path d="M5.6 5.6l2.1 2.1"/><path d="M16.3 16.3l2.1 2.1"/><path d="M18.4 5.6l-2.1 2.1"/><path d="M7.7 16.3l-2.1 2.1"/><circle cx="12" cy="12" r="3.5"/></svg>
|
|
|
|
|
|
|
+ <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M10.2 3h3.6l.5 2.1a7.4 7.4 0 0 1 1.7.7l1.9-1.1 2.5 2.5-1.1 1.9c.3.5.5 1.1.7 1.7l2.1.5v3.6l-2.1.5a7.4 7.4 0 0 1-.7 1.7l1.1 1.9-2.5 2.5-1.9-1.1a7.4 7.4 0 0 1-1.7.7l-.5 2.1h-3.6l-.5-2.1a7.4 7.4 0 0 1-1.7-.7l-1.9 1.1-2.5-2.5 1.1-1.9a7.4 7.4 0 0 1-.7-1.7L3 13.8v-3.6l2.1-.5c.1-.6.4-1.2.7-1.7L4.7 6.1l2.5-2.5 1.9 1.1c.5-.3 1.1-.5 1.7-.7z"/><circle cx="12" cy="12" r="2.7"/></svg>
|
|
|
</button>
|
|
</button>
|
|
|
<div id="readerSettingsPanel" class="reader-settings-panel">
|
|
<div id="readerSettingsPanel" class="reader-settings-panel">
|
|
|
<div class="reader-settings-title">阅读栏设置</div>
|
|
<div class="reader-settings-title">阅读栏设置</div>
|
|
@@ -1637,18 +1642,22 @@
|
|
|
setReaderControlsCollapsed(localStorage.getItem(READER_COLLAPSED_STORAGE_KEY) === '1');
|
|
setReaderControlsCollapsed(localStorage.getItem(READER_COLLAPSED_STORAGE_KEY) === '1');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- function updateNightModeButton(isEnabled) {
|
|
|
|
|
- nightModeButton.classList.toggle('is-active', isEnabled);
|
|
|
|
|
- nightModeButton.title = isEnabled ? '日间模式' : '夜间模式';
|
|
|
|
|
- nightModeButton.setAttribute('aria-label', isEnabled ? '日间模式' : '夜间模式');
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ function updateNightModeButton(isEnabled) {
|
|
|
|
|
+ const icon = nightModeButton.querySelector('svg');
|
|
|
|
|
+ nightModeButton.classList.toggle('is-active', isEnabled);
|
|
|
|
|
+ nightModeButton.title = isEnabled ? '日间模式' : '夜间模式';
|
|
|
|
|
+ nightModeButton.setAttribute('aria-label', isEnabled ? '日间模式' : '夜间模式');
|
|
|
|
|
+ icon.innerHTML = isEnabled
|
|
|
|
|
+ ? '<circle cx="12" cy="12" r="4" fill="none"></circle><path d="M12 2.5v2.5"/><path d="M12 19v2.5"/><path d="M4.9 4.9l1.8 1.8"/><path d="M17.3 17.3l1.8 1.8"/><path d="M2.5 12H5"/><path d="M19 12h2.5"/><path d="M4.9 19.1l1.8-1.8"/><path d="M17.3 6.7l1.8-1.8"/>'
|
|
|
|
|
+ : '<path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"></path>';
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- function setNightMode(enabled) {
|
|
|
|
|
- document.body.classList.toggle('night-reading-mode', enabled);
|
|
|
|
|
- updateNightModeButton(enabled);
|
|
|
|
|
- localStorage.setItem(NIGHT_MODE_STORAGE_KEY, enabled ? '1' : '0');
|
|
|
|
|
- syncPdfJsNightPreferences(enabled);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ function setNightMode(enabled) {
|
|
|
|
|
+ document.body.classList.toggle('night-reading-mode', enabled);
|
|
|
|
|
+ updateNightModeButton(enabled);
|
|
|
|
|
+ localStorage.setItem(NIGHT_MODE_STORAGE_KEY, enabled ? '1' : '0');
|
|
|
|
|
+ syncPdfJsNightPreferences(enabled);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
function syncPdfJsNightPreferences(enabled) {
|
|
function syncPdfJsNightPreferences(enabled) {
|
|
|
const pdfjsPreferencesKey = 'pdfjs.preferences';
|
|
const pdfjsPreferencesKey = 'pdfjs.preferences';
|