Archived
feat: pdf reader
This commit is contained in:
@@ -14,7 +14,10 @@ import type {
|
||||
import type { SettingsPersistMode } from "../../hooks/useReadingSettings";
|
||||
|
||||
interface ReadingSettingsPanelProps {
|
||||
format?: "epub" | "pdf";
|
||||
settings: ReadingSettings;
|
||||
pdfScale?: number;
|
||||
onPdfScaleChange?: (scale: number) => void;
|
||||
isOpen: boolean;
|
||||
onClose: () => void;
|
||||
onUpdate: (
|
||||
@@ -44,7 +47,10 @@ const ORIENTATION_OPTIONS: { value: OrientationLock; labelKey: string }[] = [
|
||||
];
|
||||
|
||||
export default function ReadingSettingsPanel({
|
||||
format = "epub",
|
||||
settings,
|
||||
pdfScale = 1.25,
|
||||
onPdfScaleChange,
|
||||
isOpen,
|
||||
onClose,
|
||||
onUpdate,
|
||||
@@ -115,6 +121,26 @@ export default function ReadingSettingsPanel({
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{format === "pdf" && onPdfScaleChange && (
|
||||
<section className="settings-section">
|
||||
<h3 className="settings-section-title">
|
||||
{t("reader.pdfZoom", { value: Math.round(pdfScale * 100) })}
|
||||
</h3>
|
||||
<input
|
||||
type="range"
|
||||
min="0.75"
|
||||
max="2.5"
|
||||
step="0.05"
|
||||
value={pdfScale}
|
||||
onChange={(e) => onPdfScaleChange(Number(e.target.value))}
|
||||
className="settings-slider"
|
||||
aria-label={t("reader.pdfZoomAria")}
|
||||
/>
|
||||
</section>
|
||||
)}
|
||||
|
||||
{format === "epub" && (
|
||||
<>
|
||||
<section className="settings-section">
|
||||
<h3 className="settings-section-title">{t("reader.font")}</h3>
|
||||
<div className="font-grid">
|
||||
@@ -184,6 +210,8 @@ export default function ReadingSettingsPanel({
|
||||
aria-label={t("reader.marginWidthAria")}
|
||||
/>
|
||||
</section>
|
||||
</>
|
||||
)}
|
||||
|
||||
<section className="settings-section">
|
||||
<h3 className="settings-section-title">
|
||||
|
||||
Reference in New Issue
Block a user