mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-07-09 03:04:19 -04:00
Tidying up (#1944)
* Fixing nav logo * Adding emulate book for single renderer * enabling control * forcing hardware acceleration on infinite scroller * Fixing review comments - Refactoring bookshadow to use shared css - Adding issue comment for hardware acceleration hack * Fixing bookshadow happening on first and last page
This commit is contained in:
parent
d14e8823c8
commit
f88f62afcb
@ -71,7 +71,7 @@ img {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
::ng-deep .image-container.book-shadow.center-double:before {
|
::ng-deep .image-container.book-shadow[class*="double-offset"]:before, ::ng-deep .image-container.book-shadow.wide:before {
|
||||||
content: '';
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
@ -85,7 +85,7 @@ img {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@supports (-moz-appearance:none) {
|
@supports (-moz-appearance:none) {
|
||||||
::ng-deep .image-container.book-shadow.center-double:before {
|
::ng-deep .image-container.book-shadow[class*="double-offset"]:before, ::ng-deep .image-container.book-shadow.wide:before {
|
||||||
box-shadow:
|
box-shadow:
|
||||||
0px 0px calc(17px*3.14) 25px rgb(0 0 0 / 43%),
|
0px 0px calc(17px*3.14) 25px rgb(0 0 0 / 43%),
|
||||||
0px 0px calc(2px*3.14) 2px rgb(0 0 0 / 43%),
|
0px 0px calc(2px*3.14) 2px rgb(0 0 0 / 43%),
|
||||||
|
@ -132,6 +132,7 @@ export class DoubleRendererComponent implements OnInit, OnDestroy, ImageRenderer
|
|||||||
if (value[0] && value[1].fitting === FITTING_OPTION.WIDTH) return 'fit-to-width-double-offset';
|
if (value[0] && value[1].fitting === FITTING_OPTION.WIDTH) return 'fit-to-width-double-offset';
|
||||||
if (value[0] && value[1].fitting === FITTING_OPTION.HEIGHT) return 'fit-to-height-double-offset';
|
if (value[0] && value[1].fitting === FITTING_OPTION.HEIGHT) return 'fit-to-height-double-offset';
|
||||||
if (value[0] && value[1].fitting === FITTING_OPTION.ORIGINAL) return 'original-double-offset';
|
if (value[0] && value[1].fitting === FITTING_OPTION.ORIGINAL) return 'original-double-offset';
|
||||||
|
if (this.mangaReaderService.isWidePage(this.pageNum) ) return 'double-offset';
|
||||||
return '';
|
return '';
|
||||||
}),
|
}),
|
||||||
filter(_ => this.isValid()),
|
filter(_ => this.isValid()),
|
||||||
|
@ -133,6 +133,7 @@ export class DoubleReverseRendererComponent implements OnInit, OnDestroy, ImageR
|
|||||||
if (value[0] && value[1].fitting === FITTING_OPTION.WIDTH) return 'fit-to-width-double-offset';
|
if (value[0] && value[1].fitting === FITTING_OPTION.WIDTH) return 'fit-to-width-double-offset';
|
||||||
if (value[0] && value[1].fitting === FITTING_OPTION.HEIGHT) return 'fit-to-height-double-offset';
|
if (value[0] && value[1].fitting === FITTING_OPTION.HEIGHT) return 'fit-to-height-double-offset';
|
||||||
if (value[0] && value[1].fitting === FITTING_OPTION.ORIGINAL) return 'original-double-offset';
|
if (value[0] && value[1].fitting === FITTING_OPTION.ORIGINAL) return 'original-double-offset';
|
||||||
|
if (this.mangaReaderService.isWidePage(this.pageNum) ) return 'double-offset';
|
||||||
return '';
|
return '';
|
||||||
}),
|
}),
|
||||||
filter(_ => this.isValid()),
|
filter(_ => this.isValid()),
|
||||||
|
@ -31,7 +31,12 @@ img, .full-width {
|
|||||||
height: auto;
|
height: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This is to force hardware acceleration to help address https://github.com/Kareadita/Kavita/issues/1848
|
||||||
|
*:not(html) {
|
||||||
|
-webkit-transform: translate3d(0, 0, 0);
|
||||||
|
-moz-transform: translate3d(0, 0, 0);
|
||||||
|
transform: translate3d(0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
@keyframes move-up-down {
|
@keyframes move-up-down {
|
||||||
0%, 100% {
|
0%, 100% {
|
||||||
|
@ -527,7 +527,7 @@ export class MangaReaderComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
this.generalSettingsForm.get('pageSplitOption')?.setValue(this.user.preferences.pageSplitOption);
|
this.generalSettingsForm.get('pageSplitOption')?.setValue(this.user.preferences.pageSplitOption);
|
||||||
this.generalSettingsForm.get('pageSplitOption')?.enable();
|
this.generalSettingsForm.get('pageSplitOption')?.enable();
|
||||||
this.generalSettingsForm.get('fittingOption')?.enable();
|
this.generalSettingsForm.get('fittingOption')?.enable();
|
||||||
this.generalSettingsForm.get('emulateBook')?.disable();
|
this.generalSettingsForm.get('emulateBook')?.enable();
|
||||||
} else {
|
} else {
|
||||||
this.generalSettingsForm.get('pageSplitOption')?.setValue(PageSplitOption.NoSplit);
|
this.generalSettingsForm.get('pageSplitOption')?.setValue(PageSplitOption.NoSplit);
|
||||||
this.generalSettingsForm.get('pageSplitOption')?.disable();
|
this.generalSettingsForm.get('pageSplitOption')?.disable();
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<ng-container *ngIf="isValid() && !this.mangaReaderService.shouldSplit(this.currentImage, this.pageSplit)">
|
<ng-container *ngIf="isValid() && !this.mangaReaderService.shouldSplit(this.currentImage, this.pageSplit)">
|
||||||
<div class="image-container {{imageFitClass$ | async}}"
|
<div class="image-container {{imageFitClass$ | async}} {{emulateBookClass$ | async}}"
|
||||||
[style.filter]="(darkenss$ | async) ?? '' | safeStyle" [style.height]="(imageContainerHeight$ | async) ?? '' | safeStyle">
|
[style.filter]="(darkenss$ | async) ?? '' | safeStyle" [style.height]="(imageContainerHeight$ | async) ?? '' | safeStyle">
|
||||||
<ng-container *ngIf="currentImage">
|
<ng-container *ngIf="currentImage">
|
||||||
<img alt=" "
|
<img alt=" "
|
||||||
|
@ -31,6 +31,7 @@ export class SingleRendererComponent implements OnInit, OnDestroy, ImageRenderer
|
|||||||
showClickOverlayClass$!: Observable<string>;
|
showClickOverlayClass$!: Observable<string>;
|
||||||
readerModeClass$!: Observable<string>;
|
readerModeClass$!: Observable<string>;
|
||||||
darkenss$: Observable<string> = of('brightness(100%)');
|
darkenss$: Observable<string> = of('brightness(100%)');
|
||||||
|
emulateBookClass$!: Observable<string>;
|
||||||
currentImage!: HTMLImageElement;
|
currentImage!: HTMLImageElement;
|
||||||
layoutMode: LayoutMode = LayoutMode.Single;
|
layoutMode: LayoutMode = LayoutMode.Single;
|
||||||
pageSplit: PageSplitOption = PageSplitOption.FitSplit;
|
pageSplit: PageSplitOption = PageSplitOption.FitSplit;
|
||||||
@ -54,6 +55,13 @@ export class SingleRendererComponent implements OnInit, OnDestroy, ImageRenderer
|
|||||||
takeUntil(this.onDestroy)
|
takeUntil(this.onDestroy)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
this.emulateBookClass$ = this.readerSettings$.pipe(
|
||||||
|
map(data => data.emulateBook),
|
||||||
|
map(enabled => enabled ? 'book-shadow' : ''),
|
||||||
|
filter(_ => this.isValid()),
|
||||||
|
takeUntil(this.onDestroy)
|
||||||
|
);
|
||||||
|
|
||||||
this.imageContainerHeight$ = this.readerSettings$.pipe(
|
this.imageContainerHeight$ = this.readerSettings$.pipe(
|
||||||
map(values => values.fitting),
|
map(values => values.fitting),
|
||||||
map(mode => {
|
map(mode => {
|
||||||
@ -119,7 +127,7 @@ export class SingleRendererComponent implements OnInit, OnDestroy, ImageRenderer
|
|||||||
this.mangaReaderService.shouldRenderAsFitSplit(this.pageSplit)
|
this.mangaReaderService.shouldRenderAsFitSplit(this.pageSplit)
|
||||||
) {
|
) {
|
||||||
// Rewriting to fit to width for this cover image
|
// Rewriting to fit to width for this cover image
|
||||||
return FITTING_OPTION.WIDTH + ' fit-to-screen';
|
return FITTING_OPTION.WIDTH + ' fit-to-screen wide';
|
||||||
}
|
}
|
||||||
|
|
||||||
return fit;
|
return fit;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<a class="visually-hidden-focusable focus-visible" href="javascript:void(0);" (click)="moveFocus()">Skip to main content</a>
|
<a class="visually-hidden-focusable focus-visible" href="javascript:void(0);" (click)="moveFocus()">Skip to main content</a>
|
||||||
<a class="side-nav-toggle" *ngIf="navService?.sideNavVisibility$ | async" (click)="hideSideNav()"><i class="fas fa-bars"></i></a>
|
<a class="side-nav-toggle" *ngIf="navService?.sideNavVisibility$ | async" (click)="hideSideNav()"><i class="fas fa-bars"></i></a>
|
||||||
<a class="navbar-brand dark-exempt" routerLink="/libraries" routerLinkActive="active">
|
<a class="navbar-brand dark-exempt" routerLink="/libraries" routerLinkActive="active">
|
||||||
<img width="28px" height="28px" class="logo" src="../../assets/images/logo.png" alt="kavita icon" aria-hidden="true"/>
|
<img width="28px" height="28px" class="logo" src="assets/images/logo.png" alt="kavita icon" aria-hidden="true"/>
|
||||||
<span class="d-none d-md-inline logo"> Kavita</span>
|
<span class="d-none d-md-inline logo"> Kavita</span>
|
||||||
</a>
|
</a>
|
||||||
<ul class="navbar-nav col me-auto">
|
<ul class="navbar-nav col me-auto">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user