Responsive UI enhancements for mobile device
This commit is contained in:
committed by
Aditya Chandel
parent
99d43bca1e
commit
60e7ff8403
@@ -50,6 +50,13 @@
|
|||||||
border-width: 1px 1px 0px 1px;
|
border-width: 1px 1px 0px 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.book-browser-footer {
|
||||||
|
left: 0%;
|
||||||
|
right: 0%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.topbar-item {
|
.topbar-item {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import {Component, inject, OnInit} from '@angular/core';
|
import {Component, inject, OnInit} from '@angular/core';
|
||||||
import {AppMenuitemComponent} from './app.menuitem.component';
|
import {AppMenuitemComponent} from './app.menuitem.component';
|
||||||
import { AsyncPipe } from '@angular/common';
|
import {AsyncPipe} from '@angular/common';
|
||||||
import {MenuModule} from 'primeng/menu';
|
import {MenuModule} from 'primeng/menu';
|
||||||
import {LibraryService} from '../../../book/service/library.service';
|
import {LibraryService} from '../../../book/service/library.service';
|
||||||
import {Observable, of} from 'rxjs';
|
import {Observable, of} from 'rxjs';
|
||||||
@@ -141,6 +141,7 @@ export class AppMenuComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
openChangelogDialog() {
|
openChangelogDialog() {
|
||||||
|
const isMobile = window.innerWidth <= 768;
|
||||||
this.dynamicDialogRef = this.dialogService.open(VersionChangelogDialogComponent, {
|
this.dynamicDialogRef = this.dialogService.open(VersionChangelogDialogComponent, {
|
||||||
header: 'What’s New',
|
header: 'What’s New',
|
||||||
modal: true,
|
modal: true,
|
||||||
@@ -149,8 +150,9 @@ export class AppMenuComponent implements OnInit {
|
|||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
top: '10%',
|
top: '10%',
|
||||||
bottom: '10%',
|
bottom: '10%',
|
||||||
minWidth: '800px',
|
width: isMobile ? '90vw' : '800px',
|
||||||
maxWidth: '800px',
|
maxWidth: isMobile ? '90vw' : '800px',
|
||||||
|
minWidth: isMobile ? '90vw' : '800px',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -140,11 +140,20 @@ export class AppTopBarComponent implements OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private openDialog(component: any, header: string, top: string) {
|
private openDialog(component: any, header: string, top: string) {
|
||||||
|
const isMobile = window.innerWidth <= 768;
|
||||||
this.ref = this.dialogService.open(component, {
|
this.ref = this.dialogService.open(component, {
|
||||||
header,
|
header,
|
||||||
modal: true,
|
modal: true,
|
||||||
closable: true,
|
closable: true,
|
||||||
style: { position: 'absolute', top },
|
style: {
|
||||||
|
position: 'absolute',
|
||||||
|
top,
|
||||||
|
...(isMobile && {
|
||||||
|
width: '90vw',
|
||||||
|
maxWidth: '90vw',
|
||||||
|
minWidth: '90vw',
|
||||||
|
}),
|
||||||
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,9 +1,9 @@
|
|||||||
.tabpanels-responsive {
|
.tabpanels-responsive {
|
||||||
height: calc(100vh - 9.7rem);
|
height: calc(100dvh - 9.7rem);
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
.tabpanels-responsive {
|
.tabpanels-responsive {
|
||||||
height: calc(100vh - 8.5rem);
|
height: calc(100dvh - 8.5rem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+42
-10
@@ -12,9 +12,8 @@
|
|||||||
<img
|
<img
|
||||||
[attr.src]="urlHelper.getCoverUrl(book.id, book.metadata?.coverUpdatedOn)"
|
[attr.src]="urlHelper.getCoverUrl(book.id, book.metadata?.coverUpdatedOn)"
|
||||||
alt="Image"
|
alt="Image"
|
||||||
width="250"
|
|
||||||
[ngClass]="{ 'brightness-50': isUploading }"
|
[ngClass]="{ 'brightness-50': isUploading }"
|
||||||
class="transition-all duration-300 ease-in-out"/>
|
class="w-[200px] md:w-[250px] transition-all duration-300 ease-in-out"/>
|
||||||
@if (isUploading) {
|
@if (isUploading) {
|
||||||
<p-progressSpinner
|
<p-progressSpinner
|
||||||
class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 z-10">
|
class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 z-10">
|
||||||
@@ -54,7 +53,7 @@
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col flex-grow pl-2">
|
<div class="flex flex-col flex-grow md:pl-2">
|
||||||
|
|
||||||
<div class="flex flex-col md:flex-row w-full gap-4 pb-1">
|
<div class="flex flex-col md:flex-row w-full gap-4 pb-1">
|
||||||
<div class="flex flex-col gap-1 md:w-2/3">
|
<div class="flex flex-col gap-1 md:w-2/3">
|
||||||
@@ -426,7 +425,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="mt-auto">
|
<div class="mt-auto">
|
||||||
<p-divider></p-divider>
|
<p-divider></p-divider>
|
||||||
<div class="flex flex-col gap-2 px-2 pt-4 md:pb-4 z-10">
|
<div class="flex flex-col gap-2 px-0 md:px-2 pt-4 md:pb-4 z-10">
|
||||||
|
|
||||||
<!-- Desktop Buttons -->
|
<!-- Desktop Buttons -->
|
||||||
<div class="hidden sm:flex justify-between w-full gap-4">
|
<div class="hidden sm:flex justify-between w-full gap-4">
|
||||||
@@ -473,7 +472,8 @@
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
<div class="flex gap-4 items-center flex-wrap ml-auto">
|
<div class="flex justify-between items-center w-full gap-4">
|
||||||
|
<div class="flex gap-4">
|
||||||
<p-button
|
<p-button
|
||||||
icon="pi pi-bolt"
|
icon="pi pi-bolt"
|
||||||
[outlined]="true"
|
[outlined]="true"
|
||||||
@@ -485,12 +485,44 @@
|
|||||||
</p-button>
|
</p-button>
|
||||||
|
|
||||||
@if (book.bookType === 'PDF' || book.bookType === 'EPUB') {
|
@if (book.bookType === 'PDF' || book.bookType === 'EPUB') {
|
||||||
<p-button icon="pi pi-refresh" [outlined]="true" severity="danger" (onClick)="restoreMetadata()" pTooltip="Restore" tooltipPosition="top"></p-button>
|
<p-button
|
||||||
|
icon="pi pi-refresh"
|
||||||
|
[outlined]="true"
|
||||||
|
severity="danger"
|
||||||
|
(onClick)="restoreMetadata()"
|
||||||
|
pTooltip="Restore"
|
||||||
|
tooltipPosition="top">
|
||||||
|
</p-button>
|
||||||
}
|
}
|
||||||
<p-button icon="pi pi-lock-open" [outlined]="true" severity="success" (onClick)="unlockAll()" pTooltip="Unlock All" tooltipPosition="top"></p-button>
|
|
||||||
<p-button icon="pi pi-lock" [outlined]="true" severity="warn" (onClick)="lockAll()" pTooltip="Lock All" tooltipPosition="top"></p-button>
|
<p-button
|
||||||
<p-divider layout="vertical" />
|
icon="pi pi-lock-open"
|
||||||
<p-button label="Save" icon="pi pi-check" [loading]="isSaving" [disabled]="isSaving" type="submit"></p-button>
|
[outlined]="true"
|
||||||
|
severity="success"
|
||||||
|
(onClick)="unlockAll()"
|
||||||
|
pTooltip="Unlock All"
|
||||||
|
tooltipPosition="top">
|
||||||
|
</p-button>
|
||||||
|
|
||||||
|
<p-button
|
||||||
|
icon="pi pi-lock"
|
||||||
|
[outlined]="true"
|
||||||
|
severity="warn"
|
||||||
|
(onClick)="lockAll()"
|
||||||
|
pTooltip="Lock All"
|
||||||
|
tooltipPosition="top">
|
||||||
|
</p-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<p-button
|
||||||
|
label="Save"
|
||||||
|
icon="pi pi-check"
|
||||||
|
[loading]="isSaving"
|
||||||
|
[disabled]="isSaving"
|
||||||
|
type="submit">
|
||||||
|
</p-button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
+19
-3
@@ -9,7 +9,7 @@
|
|||||||
} @else {
|
} @else {
|
||||||
<form class="flex flex-col w-full h-full pt-2 min-w-full md:min-w-[60rem] pr-0 md:pr-2 pl-0 md:pl-2" [formGroup]="form" (ngSubmit)="onSubmit()">
|
<form class="flex flex-col w-full h-full pt-2 min-w-full md:min-w-[60rem] pr-0 md:pr-2 pl-0 md:pl-2" [formGroup]="form" (ngSubmit)="onSubmit()">
|
||||||
|
|
||||||
<div class="grid grid-cols-1 md:flex md:flex-row w-full gap-4 md:items-end">
|
<div class="grid grid-cols-1 md:flex md:flex-row w-full gap-2 md:gap-4 md:items-end">
|
||||||
|
|
||||||
<div class="flex flex-col gap-1 w-full max-w-full md:w-3/12">
|
<div class="flex flex-col gap-1 w-full max-w-full md:w-3/12">
|
||||||
<label for="provider">Providers</label>
|
<label for="provider">Providers</label>
|
||||||
@@ -50,12 +50,27 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
@if (loading) {
|
@if (loading) {
|
||||||
<div class="flex justify-center items-center mt-8">
|
<div class="flex justify-center items-center flex-col gap-4 h-[40dvh] md:h-[70dvh] text-center">
|
||||||
<p-progress-spinner ariaLabel="loading"/>
|
<p-progress-spinner ariaLabel="Loading metadata..."/>
|
||||||
|
<p class="text-gray-300">
|
||||||
|
Fetching metadata from your selected sources.<br/>
|
||||||
|
This may take a few moments...
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
@if (!loading) {
|
@if (!loading) {
|
||||||
|
@if (searchTriggered && allFetchedMetadata.length === 0) {
|
||||||
|
<div class="flex flex-col items-center justify-center h-[50dvh] md:h-[70dvh] text-center">
|
||||||
|
<p class="text-gray-300">No metadata results found.<br/>Try adjusting your search criteria.</p>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
@if (!searchTriggered && allFetchedMetadata.length === 0) {
|
||||||
|
<div class="flex flex-col items-center justify-center h-[50dvh] md:h-[70dvh] text-center">
|
||||||
|
<p class="text-gray-300">Start by searching for metadata using the search bar above.</p>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
@if (allFetchedMetadata.length > 0) {
|
||||||
<div class="mt-4 md:mt-8 flex-1 overflow-y-auto">
|
<div class="mt-4 md:mt-8 flex-1 overflow-y-auto">
|
||||||
@for (metadata of allFetchedMetadata; track metadata) {
|
@for (metadata of allFetchedMetadata; track metadata) {
|
||||||
<div class="book-item flex flex-col w-full">
|
<div class="book-item flex flex-col w-full">
|
||||||
@@ -85,5 +100,6 @@
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</form>
|
</form>
|
||||||
}
|
}
|
||||||
|
|||||||
+2
@@ -40,6 +40,7 @@ export class MetadataSearcherComponent implements OnInit, OnDestroy {
|
|||||||
allFetchedMetadata: BookMetadata[] = [];
|
allFetchedMetadata: BookMetadata[] = [];
|
||||||
bookId!: number;
|
bookId!: number;
|
||||||
loading: boolean = false;
|
loading: boolean = false;
|
||||||
|
searchTriggered = false;
|
||||||
|
|
||||||
@Input() book$!: Observable<Book | null>;
|
@Input() book$!: Observable<Book | null>;
|
||||||
|
|
||||||
@@ -120,6 +121,7 @@ export class MetadataSearcherComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onSubmit(): void {
|
onSubmit(): void {
|
||||||
|
this.searchTriggered = true;
|
||||||
if (this.form.valid) {
|
if (this.form.valid) {
|
||||||
const providerKeys = this.form.get('provider')?.value;
|
const providerKeys = this.form.get('provider')?.value;
|
||||||
if (!providerKeys) return;
|
if (!providerKeys) return;
|
||||||
|
|||||||
+3
-1
@@ -187,7 +187,8 @@
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
<div class="grid md:grid-cols-3 gap-y-2.5 text-sm pt-2 md:pt-4 text-gray-700 dark:text-gray-300 max-w-6xl">
|
<div class="px-1 md:px-0">
|
||||||
|
<div class="grid md:grid-cols-3 gap-y-2.5 text-sm pt-2 md:pt-4 pb-2 text-gray-300 max-w-6xl">
|
||||||
<p class="whitespace-nowrap max-w-[250px] overflow-hidden text-ellipsis">
|
<p class="whitespace-nowrap max-w-[250px] overflow-hidden text-ellipsis">
|
||||||
<span class="font-bold">Publisher: </span>
|
<span class="font-bold">Publisher: </span>
|
||||||
@if (book?.metadata?.publisher) {
|
@if (book?.metadata?.publisher) {
|
||||||
@@ -279,6 +280,7 @@
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
@if (userService.userState$ | async; as userData) {
|
@if (userService.userState$ | async; as userData) {
|
||||||
<div class="flex flex-wrap gap-3 pt-6">
|
<div class="flex flex-wrap gap-3 pt-6">
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
<div class="min-w-[300px] md:min-w-[500px]">
|
<div class="min-w-[300px] md:min-w-[500px]">
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
<div class="flex flex-col gap-4">
|
<div class="flex flex-col gap-4 py-4">
|
||||||
<h2 class="text-xl font-semibold">User Profile</h2>
|
<h2 class="text-xl font-semibold">User Profile</h2>
|
||||||
<div class="px-4 py-2">
|
<div class="px-4 py-2">
|
||||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||||
|
|||||||
Reference in New Issue
Block a user