fix(web,api): lecteur — worker pdf.js dédié, shell commun et préférences par livre
Régression worker PDF : le worker pdf.js est désormais instancié une seule fois via un port dédié (?worker&url) et reconfiguré à chaque montage, au lieu d'un workerSrc recalculé qui cassait le rendu. - ReaderShell : chrome commun aux lecteurs (toolbar, zones de tap, statut) et contrat ReaderControls pour EPUB/PDF/CBZ - préférences de lecture par livre (mode horizontal/vertical, fit) : table reader_preferences + migrations idempotentes, module API, DTO partagés, client web avec fallback localStorage hors-ligne Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -643,13 +643,18 @@ select {
|
||||
|
||||
.reader-page {
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
grid-template-rows: auto auto minmax(0, 1fr) auto;
|
||||
gap: 10px;
|
||||
height: 100vh;
|
||||
min-height: 100vh;
|
||||
padding: 14px;
|
||||
overflow: hidden;
|
||||
background: #120e0b;
|
||||
}
|
||||
|
||||
.reader-topbar {
|
||||
position: relative;
|
||||
z-index: 5;
|
||||
justify-content: space-between;
|
||||
padding: 10px;
|
||||
border: 1px solid var(--line);
|
||||
@ -667,20 +672,65 @@ select {
|
||||
font-size: 0.82rem;
|
||||
}
|
||||
|
||||
.reader-toolbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.reader-toolbar .icon-only {
|
||||
width: 40px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.reader-toolbar .active {
|
||||
border-color: rgba(213, 168, 77, 0.72);
|
||||
color: var(--brass);
|
||||
background: rgba(213, 168, 77, 0.14);
|
||||
}
|
||||
|
||||
.reader-status {
|
||||
position: relative;
|
||||
z-index: 4;
|
||||
}
|
||||
|
||||
.reader-stage {
|
||||
position: relative;
|
||||
display: grid;
|
||||
place-items: stretch;
|
||||
min-height: 0;
|
||||
min-width: 0;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.reader-mode-vertical .reader-stage {
|
||||
overflow-y: auto;
|
||||
overscroll-behavior: contain;
|
||||
}
|
||||
|
||||
.reader-content {
|
||||
display: grid;
|
||||
min-height: 0;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.pdf-reader,
|
||||
.epub-reader,
|
||||
.cbz-reader {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
gap: 10px;
|
||||
min-height: calc(100vh - 120px);
|
||||
min-height: 0;
|
||||
min-width: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.epub-host {
|
||||
display: grid;
|
||||
width: min(100%, 980px);
|
||||
height: calc(100vh - 170px);
|
||||
min-height: 460px;
|
||||
height: 100%;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.epub-view {
|
||||
@ -694,8 +744,9 @@ select {
|
||||
|
||||
.pdf-reader canvas,
|
||||
.cbz-reader img {
|
||||
display: block;
|
||||
max-width: min(100%, 980px);
|
||||
max-height: calc(100vh - 170px);
|
||||
max-height: 100%;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius);
|
||||
background: #f7f0df;
|
||||
@ -706,6 +757,26 @@ select {
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.reader-mode-vertical .pdf-reader,
|
||||
.reader-mode-vertical .cbz-reader {
|
||||
align-content: start;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
.reader-mode-vertical .pdf-reader canvas,
|
||||
.reader-mode-vertical .cbz-reader img {
|
||||
width: min(100%, 980px);
|
||||
height: auto;
|
||||
max-height: none;
|
||||
}
|
||||
|
||||
.reader-mode-horizontal .pdf-reader canvas,
|
||||
.reader-mode-horizontal .cbz-reader img {
|
||||
width: auto;
|
||||
height: auto;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.reader-fallback {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
@ -717,9 +788,68 @@ select {
|
||||
}
|
||||
|
||||
.reader-stepper {
|
||||
position: relative;
|
||||
z-index: 5;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 12px;
|
||||
min-height: 46px;
|
||||
padding: 6px;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius);
|
||||
background: rgba(38, 26, 18, 0.84);
|
||||
}
|
||||
|
||||
.reader-stepper span {
|
||||
min-width: 92px;
|
||||
color: var(--ink-muted);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.reader-side-button,
|
||||
.reader-tap-zone {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
z-index: 3;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.reader-side-button {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 58px;
|
||||
color: var(--ink);
|
||||
opacity: 0.66;
|
||||
}
|
||||
|
||||
.reader-side-button:hover {
|
||||
opacity: 1;
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
}
|
||||
|
||||
.reader-side-button:disabled,
|
||||
.reader-tap-zone:disabled {
|
||||
pointer-events: none;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.reader-side-left,
|
||||
.reader-tap-left {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.reader-side-right,
|
||||
.reader-tap-right {
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.reader-tap-zone {
|
||||
display: none;
|
||||
width: 34%;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.reader-error {
|
||||
@ -854,4 +984,80 @@ select {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
|
||||
.reader-page {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.reader-topbar {
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.reader-topbar div {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.reader-topbar strong {
|
||||
overflow: hidden;
|
||||
max-width: 38vw;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.reader-toolbar {
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
.reader-side-button {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.reader-tap-zone {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.reader-controls-hidden .reader-topbar,
|
||||
.reader-controls-hidden .reader-status,
|
||||
.reader-controls-hidden .reader-stepper {
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.reader-controls-hidden {
|
||||
grid-template-rows: 0 0 minmax(0, 1fr) 0;
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
.reader-controls-hidden .reader-topbar,
|
||||
.reader-controls-hidden .reader-status,
|
||||
.reader-controls-hidden .reader-stepper {
|
||||
overflow: hidden;
|
||||
min-height: 0;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.reader-topbar,
|
||||
.reader-status,
|
||||
.reader-stepper {
|
||||
transition: opacity 0.16s ease;
|
||||
}
|
||||
|
||||
.reader-stepper {
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.reader-stepper .ghost-button {
|
||||
flex: 1 1 0;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.epub-host {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.reader-mode-vertical .pdf-reader canvas,
|
||||
.reader-mode-vertical .cbz-reader img {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user