From 92c60162ed784b8beea335383948ccb576a10aef Mon Sep 17 00:00:00 2001 From: Joseph Milazzo Date: Thu, 17 Mar 2022 10:54:50 -0500 Subject: [PATCH] Side Nav Fixes (#1161) * Fixed an issue where there was extra padding on top/bottom of readers when side nav was hidden. * Fixed a bug where fit to screen wasn't forcing width scaling * Added back total pages to many pages * Fixed the padding on series detail cards * Tweaked carousels to match series detail padding * Fixed an issue where large amount of libraries could have 2 highlighted at once due to how highlight logic works on routes. * Cleaned up some extra space in card detail layout due to moving title into compainion bar * Moved some gloabls to global and moved color-scheme to body tag * Moved scrollbar onto the body itself which helps with page jank on loading and fixes scrollbar not working with theme --- .../app/all-series/all-series.component.html | 1 + UI/Web/src/app/app.component.html | 17 +++++++---------- UI/Web/src/app/app.component.scss | 4 ++-- .../card-detail-layout.component.html | 2 +- .../all-collections.component.html | 1 + .../collection-detail.component.html | 1 - .../library-detail.component.html | 1 + .../manga-reader/manga-reader.component.html | 6 +++++- .../app/manga-reader/manga-reader.component.ts | 5 +++++ .../reading-lists/reading-lists.component.html | 1 + .../series-detail/series-detail.component.html | 10 +++++----- .../side-nav-item/side-nav-item.component.ts | 4 ++++ .../sidenav/side-nav/side-nav.component.html | 10 +++++----- UI/Web/src/styles.scss | 7 +------ UI/Web/src/theme/components/_carousel.scss | 2 +- UI/Web/src/theme/utilities/_global.scss | 12 ++++++++++++ 16 files changed, 52 insertions(+), 32 deletions(-) diff --git a/UI/Web/src/app/all-series/all-series.component.html b/UI/Web/src/app/all-series/all-series.component.html index 76f9cc623..4b14d76c0 100644 --- a/UI/Web/src/app/all-series/all-series.component.html +++ b/UI/Web/src/app/all-series/all-series.component.html @@ -3,6 +3,7 @@ All Series +
{{pagination?.totalItems}} Series
-
+
-
- -
- -
-
- +
+
- - +
+ + +
diff --git a/UI/Web/src/app/app.component.scss b/UI/Web/src/app/app.component.scss index 97b30aa2b..ce79eb9de 100644 --- a/UI/Web/src/app/app.component.scss +++ b/UI/Web/src/app/app.component.scss @@ -1,5 +1,5 @@ .content-wrapper { - padding: calc(56px) 10px 0; + padding: 0 10px 0; height: 100%; } @@ -19,7 +19,7 @@ } .content-wrapper { - padding: calc(56px) 10px 0; + padding: 0 10px 0; overflow: hidden; &.closed { diff --git a/UI/Web/src/app/cards/card-detail-layout/card-detail-layout.component.html b/UI/Web/src/app/cards/card-detail-layout/card-detail-layout.component.html index 2b4a003aa..6de989b21 100644 --- a/UI/Web/src/app/cards/card-detail-layout/card-detail-layout.component.html +++ b/UI/Web/src/app/cards/card-detail-layout/card-detail-layout.component.html @@ -1,5 +1,5 @@ -
+

diff --git a/UI/Web/src/app/collections/all-collections/all-collections.component.html b/UI/Web/src/app/collections/all-collections/all-collections.component.html index a3eda8d16..c39a3091c 100644 --- a/UI/Web/src/app/collections/all-collections/all-collections.component.html +++ b/UI/Web/src/app/collections/all-collections/all-collections.component.html @@ -3,6 +3,7 @@ Collections

+
{{collections.length}} Items

- {{collectionTag.title}}

diff --git a/UI/Web/src/app/library-detail/library-detail.component.html b/UI/Web/src/app/library-detail/library-detail.component.html index 9240670ef..bc139e610 100644 --- a/UI/Web/src/app/library-detail/library-detail.component.html +++ b/UI/Web/src/app/library-detail/library-detail.component.html @@ -3,6 +3,7 @@ {{libraryName}} +
{{pagination?.totalItems}} Series
diff --git a/UI/Web/src/app/manga-reader/manga-reader.component.html b/UI/Web/src/app/manga-reader/manga-reader.component.html index ae6563fd9..a59d7115a 100644 --- a/UI/Web/src/app/manga-reader/manga-reader.component.html +++ b/UI/Web/src/app/manga-reader/manga-reader.component.html @@ -37,7 +37,11 @@ ondragstart="return false;" onselectstart="return false;">
-
+
diff --git a/UI/Web/src/app/manga-reader/manga-reader.component.ts b/UI/Web/src/app/manga-reader/manga-reader.component.ts index 4ae108b45..47b52f35e 100644 --- a/UI/Web/src/app/manga-reader/manga-reader.component.ts +++ b/UI/Web/src/app/manga-reader/manga-reader.component.ts @@ -655,6 +655,11 @@ export class MangaReaderComponent implements OnInit, AfterViewInit, OnDestroy { } val = formControl?.value; + if (this.isCoverImage() && this.layoutMode == LayoutMode.Single && val !== FITTING_OPTION.WIDTH && this.shouldRenderAsFitSplit()) { + // Rewriting to fit to width for this cover image + return FITTING_OPTION.WIDTH; + } + if (this.isCoverImage() && this.layoutMode !== LayoutMode.Single) { return val + ' cover double'; diff --git a/UI/Web/src/app/reading-list/reading-lists/reading-lists.component.html b/UI/Web/src/app/reading-list/reading-lists/reading-lists.component.html index bea3c8d11..43ac34bb1 100644 --- a/UI/Web/src/app/reading-list/reading-lists/reading-lists.component.html +++ b/UI/Web/src/app/reading-list/reading-lists/reading-lists.component.html @@ -3,6 +3,7 @@ Reading Lists +
{{pagination?.totalItems}} Items
- @@ -79,12 +79,12 @@
- - @@ -96,7 +96,7 @@
- @@ -108,7 +108,7 @@
- diff --git a/UI/Web/src/app/sidenav/side-nav-item/side-nav-item.component.ts b/UI/Web/src/app/sidenav/side-nav-item/side-nav-item.component.ts index 1cfba6d75..5d6150c9b 100644 --- a/UI/Web/src/app/sidenav/side-nav-item/side-nav-item.component.ts +++ b/UI/Web/src/app/sidenav/side-nav-item/side-nav-item.component.ts @@ -57,6 +57,10 @@ export class SideNavItemComponent implements OnInit, OnDestroy { return; } + if (!page.endsWith('/')) { + page = page + '/'; + } + if (this.comparisonMethod === 'equals' && page === this.link) { this.highlighted = true; return; diff --git a/UI/Web/src/app/sidenav/side-nav/side-nav.component.html b/UI/Web/src/app/sidenav/side-nav/side-nav.component.html index 1c5353a09..3da017a47 100644 --- a/UI/Web/src/app/sidenav/side-nav/side-nav.component.html +++ b/UI/Web/src/app/sidenav/side-nav/side-nav.component.html @@ -8,10 +8,10 @@
- - - - + + + +
@@ -19,7 +19,7 @@
- diff --git a/UI/Web/src/styles.scss b/UI/Web/src/styles.scss index b1d070433..4238fa834 100644 --- a/UI/Web/src/styles.scss +++ b/UI/Web/src/styles.scss @@ -64,12 +64,7 @@ label, select, .clickable { cursor: default; } -html, body { height: 100%; color-scheme: var(--color-scheme); } -body { - margin: 0; - font-family: var(--body-font-family); - color: var(--body-text-color); -} + // Needed for fullscreen app-root { diff --git a/UI/Web/src/theme/components/_carousel.scss b/UI/Web/src/theme/components/_carousel.scss index a31a83961..d99ad9703 100644 --- a/UI/Web/src/theme/components/_carousel.scss +++ b/UI/Web/src/theme/components/_carousel.scss @@ -1,3 +1,3 @@ .swiper-slide { - margin: 0 5px; + margin: 0 0.25rem; } \ No newline at end of file diff --git a/UI/Web/src/theme/utilities/_global.scss b/UI/Web/src/theme/utilities/_global.scss index 2b377acc3..5c8bdeef0 100644 --- a/UI/Web/src/theme/utilities/_global.scss +++ b/UI/Web/src/theme/utilities/_global.scss @@ -1,5 +1,17 @@ // Global styles for the site. Keep this as small as possible +html, body { height: 100%; overflow: hidden; } +body { + margin: 0; + font-family: var(--body-font-family); + color: var(--body-text-color); + color-scheme: var(--color-scheme); + max-height: 100%; + overflow-y: auto; + margin-top: 56px; +} + + hr { background-color: var(--hr-color); }