Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/mobile UI poc #3121

Merged
merged 11 commits into from
Aug 21, 2024
81 changes: 81 additions & 0 deletions UI/Web/src/_series-detail-common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,84 @@
.nav-tabs {
flex-wrap: nowrap;
}

.upper-details {
font-size: 0.9rem;
}

::ng-deep .carousel-container .header i.fa-plus, ::ng-deep .carousel-container .header i.fa-pen{
border-width: 1px;
border-style: solid;
border-radius: 5px;
border-color: var(--primary-color);
padding: 5px;
vertical-align: middle;

&:hover {
background-color: var(--primary-color-dark-shade);
}
}

::ng-deep .image-container.mobile-bg app-image img {
max-height: 400px;
object-fit: contain;
}

@media (max-width: 768px) {
.carousel-tabs-container {
mask-image: linear-gradient(transparent, black 0%, black 90%, transparent 100%);
-webkit-mask-image: linear-gradient(to right, transparent, black 0%, black 90%, transparent 100%);
}
}

::ng-deep .image-container.mobile-bg app-image img {
max-height: 100dvh !important;
object-fit: cover !important;
}

/* col-lg */
@media screen and (max-width: 991px) {
.image-container.mobile-bg{
width: 100vw;
top: calc(var(--nav-offset) - 20px);
left: 0;
pointer-events: none;
position: fixed !important;
display: block !important;
max-height: unset !important;
max-width: unset !important;
height: 100dvh !important;
}

::ng-deep .image-container.mobile-bg app-image img {
max-height: unset !important;
opacity: 0.05 !important;
filter: blur(5px) !important;
max-width: 100dvw;
height: 100dvh !important;
overflow: hidden;
position: absolute;
top: 0;
left: 0;
object-fit: cover;
}

.progress-banner {
display:none;
}

.under-image {
display: none;
}

}
.upper-details {
font-size: 0.9rem;
}

@media (max-width: 768px) {
.carousel-tabs-container {
mask-image: linear-gradient(transparent, black 0%, black 90%, transparent 100%);
-webkit-mask-image: linear-gradient(to right, transparent, black 0%, black 90%, transparent 100%);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<div class="input-group">
<input id="settings-hostname" aria-describedby="hostname-validations" class="form-control" formControlName="hostName" type="text"
[class.is-invalid]="formControl.invalid && formControl.touched">
<button class="btn btn-outline-secondary" (click)="autofillGmail()">{{t('gmail-label')}}</button>
<button class="btn btn-outline-secondary" (click)="autofillOutlook()">{{t('outlook-label')}}</button>
<button type="button" class="btn btn-outline-secondary" (click)="autofillGmail()">{{t('gmail-label')}}</button>
<button type="button" class="btn btn-outline-secondary" (click)="autofillOutlook()">{{t('outlook-label')}}</button>
</div>

@if(settingsForm.dirty || settingsForm.touched) {
Expand All @@ -39,7 +39,7 @@
{{formControl.value | defaultValue}}
</ng-template>
<ng-template #edit>
<input type="text" class="form-control" aria-describedby="email-header" formControlName="senderAddress" id="settings-sender-address" />
<input type="text" class="form-control" formControlName="senderAddress" id="settings-sender-address" />
</ng-template>
</app-setting-item>
}
Expand All @@ -52,7 +52,7 @@
{{formControl.value | defaultValue}}
</ng-template>
<ng-template #edit>
<input type="text" class="form-control" aria-describedby="email-header" formControlName="senderDisplayName" id="settings-sender-displayname" />
<input type="text" class="form-control" formControlName="senderDisplayName" id="settings-sender-displayname" />
</ng-template>
</app-setting-item>
}
Expand All @@ -78,7 +78,7 @@
{{formControl.value | defaultValue}}
</ng-template>
<ng-template #edit>
<input type="number" inputmode="numeric" min="1" class="form-control" aria-describedby="email-header" formControlName="port" id="settings-port" />
<input type="number" inputmode="numeric" min="1" class="form-control" formControlName="port" id="settings-port" />
</ng-template>
</app-setting-item>
}
Expand All @@ -89,7 +89,7 @@
<app-setting-switch [title]="t('enable-ssl-label')">
<ng-template #switch>
<div class="form-check form-switch">
<input id="setting-enable-ssl" type="checkbox" class="form-check-input" formControlName="enableOpds">
<input id="setting-enable-ssl" type="checkbox" class="form-check-input" formControlName="enableSsl">
</div>
</ng-template>
</app-setting-switch>
Expand All @@ -103,7 +103,7 @@
{{formControl.value | defaultValue}}
</ng-template>
<ng-template #edit>
<input type="text" class="form-control" aria-describedby="email-header" formControlName="userName" id="settings-username" />
<input type="text" class="form-control" formControlName="userName" id="settings-username" />
</ng-template>
</app-setting-item>
}
Expand All @@ -116,7 +116,7 @@
{{formControl.value ? '********' : null | defaultValue}}
</ng-template>
<ng-template #edit>
<input type="text" class="form-control" aria-describedby="email-header" formControlName="password" id="settings-password" />
<input type="text" class="form-control" formControlName="password" id="settings-password" />
</ng-template>
</app-setting-item>
}
Expand All @@ -129,7 +129,7 @@
{{formControl.value | bytes}}
</ng-template>
<ng-template #edit>
<input type="number" inputmode="numeric" min="1" class="form-control" aria-describedby="email-header" formControlName="sizeLimit" id="settings-size-limit" />
<input type="number" inputmode="numeric" min="1" class="form-control" formControlName="sizeLimit" id="settings-size-limit" />
</ng-template>
</app-setting-item>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ <h4>{{t('networking-settings-title')}}</h4>
<div class="input-group">
<input id="settings-baseurl" aria-describedby="settings-baseurl-help" class="form-control" formControlName="baseUrl" type="text"
[class.is-invalid]="formControl.invalid && formControl.touched">
<button class="btn btn-outline-secondary" (click)="resetBaseUrl()">{{t('reset')}}</button>
<button type="button" class="btn btn-outline-secondary" (click)="resetBaseUrl()">{{t('reset')}}</button>
</div>

@if(settingsForm.dirty || settingsForm.touched) {
Expand All @@ -64,7 +64,7 @@ <h4>{{t('networking-settings-title')}}</h4>
<div class="input-group">
<input id="settings-ipaddresses" aria-describedby="settings-ipaddresses-help" class="form-control" formControlName="ipAddresses" type="text"
[class.is-invalid]="formControl.invalid && formControl.touched">
<button class="btn btn-outline-secondary" (click)="resetIPAddresses()">{{t('reset')}}</button>
<button type="button" class="btn btn-outline-secondary" (click)="resetIPAddresses()">{{t('reset')}}</button>
</div>

@if(settingsForm.dirty || settingsForm.touched) {
Expand Down
18 changes: 13 additions & 5 deletions UI/Web/src/app/chapter-detail/chapter-detail.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,22 @@

@if (chapter && series && libraryType !== null) {
<div class="row mb-0 mb-xl-3 info-container">
<div class="image-container col-5 col-sm-6 col-md-5 col-lg-5 col-xl-2 col-xxl-2 col-xxxl-2 d-none d-sm-block mb-3 position-relative">

<app-image [styles]="{'object-fit': 'contain', 'background': 'none', 'max-height': '400px'}" [imageUrl]="coverImage"></app-image>
@if (chapter.pagesRead < chapter.pages && chapter.pagesRead > 0) {
<div [ngClass]="mobileSeriesImgBackground === 'true' ? 'mobile-bg' : ''" class="image-container col-5 col-sm-6 col-md-5 col-lg-5 col-xl-2 col-xxl-2 col-xxxl-2 d-none d-sm-block mb-3 position-relative">

@if(mobileSeriesImgBackground === 'true') {
<app-image [styles]="{'background': 'none'}" [imageUrl]="coverImage"></app-image>
} @else {
<app-image [styles]="{'object-fit': 'contain', 'background': 'none', 'max-height': '400px'}" [imageUrl]="coverImage"></app-image>
}
<!-- TODO: For when continue on chapter/issue is hooked up -->
<!-- @if (chapter.pagesRead < chapter.pages && chapter.pagesRead > 0) {
<div class="progress-banner" ngbTooltip="{{(chapter.pagesRead / chapter.pages) * 100 | number:'1.0-1'}}%">
<ngb-progressbar type="primary" [value]="chapter.pagesRead" [max]="chapter.pages" [showValue]="true"></ngb-progressbar>
</div>
}
<div class="under-image">
{{t('continue-from', {title: ContinuePointTitle})}}
</div>
} -->
<div class="card-overlay"></div>
<div class="overlay-information">
<div class="overlay-information--centered">
Expand Down
7 changes: 5 additions & 2 deletions UI/Web/src/app/chapter-detail/chapter-detail.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from '@angular/core';
import {BulkOperationsComponent} from "../cards/bulk-operations/bulk-operations.component";
import {TagBadgeComponent} from "../shared/tag-badge/tag-badge.component";
import {AsyncPipe, DecimalPipe, DOCUMENT, NgStyle} from "@angular/common";
import {AsyncPipe, DecimalPipe, DOCUMENT, NgStyle, NgClass} from "@angular/common";
import {CardActionablesComponent} from "../_single-module/card-actionables/card-actionables.component";
import {CarouselReelComponent} from "../carousel/_components/carousel-reel/carousel-reel.component";
import {ExternalListItemComponent} from "../cards/external-list-item/external-list-item.component";
Expand Down Expand Up @@ -111,6 +111,7 @@ enum TabID {
TagBadgeComponent,
VirtualScrollerModule,
NgStyle,
NgClass,
AgeRatingPipe,
TimeDurationPipe,
ExternalRatingComponent,
Expand Down Expand Up @@ -184,6 +185,7 @@ export class ChapterDetailComponent implements OnInit {
downloadInProgress: boolean = false;
readingLists: ReadingList[] = [];
showDetailsTab: boolean = true;
mobileSeriesImgBackground: string | undefined;



Expand All @@ -208,7 +210,8 @@ export class ChapterDetailComponent implements OnInit {
return;
}


this.mobileSeriesImgBackground = getComputedStyle(document.documentElement)
.getPropertyValue('--mobile-series-img-background').trim();
this.seriesId = parseInt(seriesId, 10);
this.chapterId = parseInt(chapterId, 10);
this.libraryId = parseInt(libraryId, 10);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
@if (series && seriesMetadata && libraryType !== null) {
<div [ngStyle]="{'height': ScrollingBlockHeight}" class="main-container container-fluid" #scrollingBlock>
<div class="row mb-0 mb-xl-3 info-container">
<div class="image-container col-5 col-sm-6 col-md-5 col-lg-5 col-xl-2 col-xxl-2 col-xxxl-2 d-none d-sm-block mb-3 position-relative">

<app-image [styles]="{'object-fit': 'contain', 'background': 'none', 'max-height': '400px'}" [imageUrl]="seriesImage"></app-image>
<div [ngClass]="mobileSeriesImgBackground === 'true' ? 'mobile-bg' : ''" class="image-container col-5 col-sm-6 col-md-5 col-lg-5 col-xl-2 col-xxl-2 col-xxxl-2 d-none d-sm-block mb-3 position-relative">
@if(mobileSeriesImgBackground === 'true') {
<app-image [styles]="{'background': 'none'}" [imageUrl]="seriesImage"></app-image>
} @else {
<app-image [styles]="{'object-fit': 'contain', 'background': 'none', 'max-height': '400px'}" [imageUrl]="seriesImage"></app-image>
}
@if (series.pagesRead < series.pages && hasReadingProgress) {
<div class="progress-banner series" ngbTooltip="{{(series.pagesRead / series.pages) * 100 | number:'1.0-1'}}%">
<ngb-progressbar type="primary" [value]="series.pagesRead" [max]="series.pages" [showValue]="true"></ngb-progressbar>
Expand All @@ -29,7 +32,7 @@
</div>

</div>
<div class="col-xl-10 col-lg-7 col-md-7 col-xs-8 col-sm-6">
<div class="col-xl-10 col-lg-7 col-md-12 col-xs-12 col-sm-12">
<h4 class="title mb-2">
<span>{{series.name}}

Expand Down Expand Up @@ -133,7 +136,7 @@ <h4 class="title mb-2">

<div class="mt-2 upper-details">
<div class="row g-0">
<div class="col-6">
<div class="col-6 pe-5">
<span class="fw-bold">{{t('writers-title')}}</span>
<div>
<app-badge-expander [items]="seriesMetadata.writers"
Expand Down Expand Up @@ -162,7 +165,7 @@ <h4 class="title mb-2">

<div class="mt-3 mb-2 upper-details">
<div class="row g-0">
<div class="col-6">
<div class="col-6 pe-5">
<span class="fw-bold">{{t('genres-title')}}</span>
<div>
<app-badge-expander [items]="seriesMetadata.genres"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
border-bottom-right-radius: 5px;
text-align: center;
}



//
//.rating-star {
// margin-top: 2px;
Expand All @@ -40,13 +43,4 @@
}
}

.upper-details {
font-size: 0.9rem;
}

@media (max-width: 768px) {
.carousel-tabs-container {
mask-image: linear-gradient(transparent, black 0%, black 90%, transparent 100%);
-webkit-mask-image: linear-gradient(to right, transparent, black 0%, black 90%, transparent 100%);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ export class SeriesDetailComponent implements OnInit, AfterContentChecked {
isLoadingExtra = false;
libraryAllowsScrobbling = false;
isScrobbling: boolean = true;
mobileSeriesImgBackground: string | undefined;

currentlyReadingChapter: Chapter | undefined = undefined;
hasReadingProgress = false;
Expand Down Expand Up @@ -384,6 +385,7 @@ export class SeriesDetailComponent implements OnInit, AfterContentChecked {
}
}


get UseBookLogic() {
return this.libraryType === LibraryType.Book || this.libraryType === LibraryType.LightNovel;
}
Expand Down Expand Up @@ -472,6 +474,9 @@ export class SeriesDetailComponent implements OnInit, AfterContentChecked {
return;
}

this.mobileSeriesImgBackground = getComputedStyle(document.documentElement)
.getPropertyValue('--mobile-series-img-background').trim();


// Set up the download in progress
this.download$ = this.downloadService.activeDownloads$.pipe(takeUntilDestroyed(this.destroyRef), map((events) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
<ng-container *transloco="let t;">
<div class="container-fluid">


<ng-content></ng-content>




@if (subtitle) {
<div class="description text-muted" [innerHTML]="subtitle | safeHtml"></div>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ <h6 class="section-title">
</div>
<div class="col-1">
@if (showEdit) {
<button class="btn btn-text btn-sm" (click)="toggleEditMode()" [disabled]="!canEdit">
<button type="button" class="btn btn-text btn-sm" (click)="toggleEditMode()" [disabled]="!canEdit">
{{isEditMode ? t('common.close') : (editLabel || t('common.edit'))}}
</button>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ <h6 class="section-title" [id]="id || title">{{title}}
</h6>
</div>
<div class="col-1">
<button class="btn btn-text btn-sm" (click)="toggleViewMode()" [disabled]="!canEdit">{{isEditMode ? t('common.close') : t('common.edit')}}</button>
<button type="button" class="btn btn-text btn-sm" (click)="toggleViewMode()" [disabled]="!canEdit">{{isEditMode ? t('common.close') : t('common.edit')}}</button>
</div>
</div>
</div>
Expand Down
16 changes: 12 additions & 4 deletions UI/Web/src/app/volume-detail/volume-detail.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,22 @@

@if (volume && series && libraryType !== null) {
<div class="row mb-0 mb-xl-3 info-container">
<div class="image-container col-5 col-sm-6 col-md-5 col-lg-5 col-xl-2 col-xxl-2 col-xxxl-2 d-none d-sm-block mb-3">
<div [ngClass]="mobileSeriesImgBackground === 'true' ? 'mobile-bg' : ''" class="image-container col-5 col-sm-6 col-md-5 col-lg-5 col-xl-2 col-xxl-2 col-xxxl-2 d-none d-sm-block mb-3">

<app-image [styles]="{'object-fit': 'contain', 'background': 'none', 'max-height': '400px'}" [imageUrl]="coverImage"></app-image>
@if (volume.pagesRead < volume.pages && volume.pagesRead > 0) {
@if(mobileSeriesImgBackground === 'true') {
<app-image [styles]="{'background': 'none'}" [imageUrl]="coverImage"></app-image>
} @else {
<app-image [styles]="{'object-fit': 'contain', 'background': 'none', 'max-height': '400px'}" [imageUrl]="coverImage"></app-image>
}
<!-- TODO: For when continue on volume is hooked up -->
<!-- @if (volume.pagesRead < volume.pages && volume.pagesRead > 0) {
<div class="progress-banner" ngbTooltip="{{(volume.pagesRead / volume.pages) * 100 | number:'1.0-1'}}%">
<ngb-progressbar type="primary" height="5px" [value]="volume.pagesRead" [max]="volume.pages" [showValue]="true"></ngb-progressbar>
</div>
}
<div class="under-image">
{{t('continue-from', {title: ContinuePointTitle})}}
</div>
} -->
</div>
<div class="col-xl-10 col-lg-7 col-md-7 col-xs-8 col-sm-6">
<h4 class="title mb-2">
Expand Down
Loading
Loading