From 87c3f091f5140f8bea8957458b4a775a6b0b6cfa Mon Sep 17 00:00:00 2001 From: Imran Khan Date: Sun, 25 Oct 2020 09:24:09 +0100 Subject: [PATCH] feat: add loader for better UX --- .../scroll-top/scroll-top.component.ts | 4 +- .../components/photography.component.html | 168 +++++++++--------- .../components/photography.component.scss | 9 + .../components/photography.component.ts | 4 + .../services/helper.service.ts | 4 +- 5 files changed, 105 insertions(+), 84 deletions(-) diff --git a/src/app/packages/frame.pck/components/scroll-top/scroll-top.component.ts b/src/app/packages/frame.pck/components/scroll-top/scroll-top.component.ts index 0a08762..3380bf6 100755 --- a/src/app/packages/frame.pck/components/scroll-top/scroll-top.component.ts +++ b/src/app/packages/frame.pck/components/scroll-top/scroll-top.component.ts @@ -21,8 +21,8 @@ export class ScrollTopComponent implements OnInit, OnDestroy { private unSubscribe = new Subject(); ngOnInit() { - // listen: scroll to top - HelperService.detectScroll() + // listen: window scroll + HelperService.detectWindowScroll() .pipe( // we are only interested in the scrollY value of these events // let's create a stream with only these values diff --git a/src/app/packages/modules.pck/photography.mod/components/photography.component.html b/src/app/packages/modules.pck/photography.mod/components/photography.component.html index ca0a2b9..2348e16 100644 --- a/src/app/packages/modules.pck/photography.mod/components/photography.component.html +++ b/src/app/packages/modules.pck/photography.mod/components/photography.component.html @@ -1,90 +1,98 @@
- -
- -
- - - - -
- {{ sliderImageActive['title'] }} -
-
-
+ +
+
- - + +
+ +
+ +
+
-
+ \ No newline at end of file diff --git a/src/app/packages/modules.pck/photography.mod/components/photography.component.scss b/src/app/packages/modules.pck/photography.mod/components/photography.component.scss index fd8ae23..1d8fab1 100644 --- a/src/app/packages/modules.pck/photography.mod/components/photography.component.scss +++ b/src/app/packages/modules.pck/photography.mod/components/photography.component.scss @@ -3,6 +3,15 @@ .ik-photography { background-color: var(--tc4); + .ik-page-loader { + margin-top: 30px; + text-align: center; + + .ik-icon { + font-size: cd-fontSize(s40); + } + } + .ik-slider-wrapper { .ik-photo { position: relative; diff --git a/src/app/packages/modules.pck/photography.mod/components/photography.component.ts b/src/app/packages/modules.pck/photography.mod/components/photography.component.ts index d007dea..978eaf3 100644 --- a/src/app/packages/modules.pck/photography.mod/components/photography.component.ts +++ b/src/app/packages/modules.pck/photography.mod/components/photography.component.ts @@ -27,6 +27,7 @@ import { HelperService } from '../../../utilities.pck/accessories.mod/services/h export class PhotographyComponent implements OnInit { public faIcon = [faPlane, faExpand, faCircleNotch]; public photography = photography; + public isPageLoaded = false; public sliderList = {}; public sliderInterval; @@ -138,6 +139,9 @@ export class PhotographyComponent implements OnInit { // stop loader this.loadMoreLoader = false; + + // page loaded + this.isPageLoaded = true; } /** diff --git a/src/app/packages/utilities.pck/accessories.mod/services/helper.service.ts b/src/app/packages/utilities.pck/accessories.mod/services/helper.service.ts index 2f98a48..c0dd6e6 100755 --- a/src/app/packages/utilities.pck/accessories.mod/services/helper.service.ts +++ b/src/app/packages/utilities.pck/accessories.mod/services/helper.service.ts @@ -30,9 +30,9 @@ export class HelperService { } /** - * detect: scroll + * detect: window scroll */ - public static detectScroll() { + public static detectWindowScroll() { return fromEvent(window, 'scroll'); }