diff --git a/.browserslistrc b/.browserslistrc new file mode 100644 index 0000000..1a243af --- /dev/null +++ b/.browserslistrc @@ -0,0 +1,7 @@ +last 10 Chrome version +last 10 Firefox version +last 10 Edge major versions +last 2 Safari major versions +last 2 iOS major versions +Firefox ESR +not IE >= 0 # IE is dead \ No newline at end of file diff --git a/src/app/app.component.html b/src/app/app.component.html index 7e959e5..916fff9 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -19,17 +19,29 @@ - list Service - collections Slides - error Alerts - search Search - image Themes + + list Service + + + collections Slides + + + error Alerts + + + search Search + + + image Themes + Main View Stage View Chord View - settings Settings + + settings Settings + diff --git a/src/app/components/chord-view/chord-view.component.html b/src/app/components/chord-view/chord-view.component.html index e653a25..8c468b3 100644 --- a/src/app/components/chord-view/chord-view.component.html +++ b/src/app/components/chord-view/chord-view.component.html @@ -17,7 +17,7 @@
- + diff --git a/src/app/components/no-items.scss b/src/app/components/no-items.scss new file mode 100644 index 0000000..faf764a --- /dev/null +++ b/src/app/components/no-items.scss @@ -0,0 +1,29 @@ +.no-items { + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + + &-title { + display: flex; + align-items: center; + color: gray; + + .icon { + margin-right: 0.25em; + } + } + + &-actions { + display: flex; + justify-content: center; + gap: 1em; + margin-top: 0.25em; + + button, a { + text-decoration: none; + font-size: 0.813rem; + height: 28px; + } + } +} diff --git a/src/app/components/overlay.scss b/src/app/components/overlay.scss index 9d4fc62..918710f 100644 --- a/src/app/components/overlay.scss +++ b/src/app/components/overlay.scss @@ -138,6 +138,7 @@ .back-button { background: #fff; + color: #000; } @media screen and (max-width: ($mobile-breakpoint - 0.125px)){ diff --git a/src/app/components/service/service-list/service-list.component.html b/src/app/components/service/service-list/service-list.component.html index 1f057f3..cc15b36 100644 --- a/src/app/components/service/service-list/service-list.component.html +++ b/src/app/components/service/service-list/service-list.component.html @@ -1,7 +1,23 @@ - + + + + +
+
+ info + No service items. +
+ +
+
diff --git a/src/app/components/service/service-list/service-list.component.ts b/src/app/components/service/service-list/service-list.component.ts index d562064..c85969c 100644 --- a/src/app/components/service/service-list/service-list.component.ts +++ b/src/app/components/service/service-list/service-list.component.ts @@ -7,12 +7,13 @@ import { ServiceItem } from '../../../responses'; @Component({ selector: 'openlp-service-list', templateUrl: './service-list.component.html', - styleUrls: ['./service-list.component.scss'], + styleUrls: ['./service-list.component.scss', '../../no-items.scss'], }) export class ServiceListComponent implements OnInit, OnDestroy { items: ServiceItem[] = []; _subscription: Subscription; + loading = false; @Output() itemSelected = new EventEmitter(); @@ -25,7 +26,11 @@ export class ServiceListComponent implements OnInit, OnDestroy { } fetchServiceItems() { - this.openlpService.getServiceItems().subscribe(items => this.items = items); + this.loading = true; + this.openlpService.getServiceItems().subscribe(items => { + this.items = items; + this.loading = false; + }); } constructor(private openlpService: OpenLPService) { diff --git a/src/app/components/slides/slide-list/slide-list.component.html b/src/app/components/slides/slide-list/slide-list.component.html index 7cd0b86..3af4b63 100644 --- a/src/app/components/slides/slide-list/slide-list.component.html +++ b/src/app/components/slides/slide-list/slide-list.component.html @@ -1 +1,23 @@ - \ No newline at end of file + + + + +
+
+ info + No slide items. +
+ +
+
\ No newline at end of file diff --git a/src/app/components/slides/slide-list/slide-list.component.ts b/src/app/components/slides/slide-list/slide-list.component.ts index 5a02da5..de82291 100644 --- a/src/app/components/slides/slide-list/slide-list.component.ts +++ b/src/app/components/slides/slide-list/slide-list.component.ts @@ -7,13 +7,14 @@ import { OpenLPService } from '../../../openlp.service'; @Component({ selector: 'openlp-slide-list', templateUrl: './slide-list.component.html', - styleUrls: ['./slide-list.component.scss'], + styleUrls: ['./slide-list.component.scss', '../../no-items.scss'], }) export class SlideListComponent implements OnInit, OnDestroy { slides: Slide[] = null; @Output() slideSelected = new EventEmitter(); _subscription: Subscription; + loading = false; constructor(private openlpService: OpenLPService) { this._subscription = openlpService.stateChanged$.subscribe(item => this.fetchSlides()); @@ -32,7 +33,9 @@ export class SlideListComponent implements OnInit, OnDestroy { } fetchSlides() { + this.loading = true; this.openlpService.getServiceItem().subscribe(serviceItem => { + this.loading = false; if (serviceItem instanceof Array) { this.slides = serviceItem; } diff --git a/src/app/components/stage-view/stage-view.component.html b/src/app/components/stage-view/stage-view.component.html index 4c4786c..29a4403 100644 --- a/src/app/components/stage-view/stage-view.component.html +++ b/src/app/components/stage-view/stage-view.component.html @@ -10,7 +10,7 @@
- +
diff --git a/src/app/components/stage-view/stage-view.component.ts b/src/app/components/stage-view/stage-view.component.ts index 2fea349..c78d924 100644 --- a/src/app/components/stage-view/stage-view.component.ts +++ b/src/app/components/stage-view/stage-view.component.ts @@ -41,6 +41,8 @@ export class StageViewComponent implements OnInit, OnDestroy { setInterval(() => this.time = new Date(), 1000); } + nextSlides: Slide[] = []; + ngOnInit() { this.updateCurrentSlides(null, null); this.openlpService.stateChanged$.subscribe(item => this.updateCurrentSlides(item.item, item.slide)); @@ -74,16 +76,13 @@ export class StageViewComponent implements OnInit, OnDestroy { }); } - get nextSlides(): Slide[] { - return this.currentSlides.slice(this.activeSlide + 1); - } - setNewSlides(slides: Slide[], currentSlide: number): void { if (slides.length === 0) { return; } this.currentSlides = slides; this.activeSlide = slides.findIndex(s => s.selected); + this.nextSlides = this.currentSlides.slice(this.activeSlide + 1); this.updateTags(); } @@ -129,4 +128,8 @@ export class StageViewComponent implements OnInit, OnDestroy { lastIndex = index; } } + + trackByIndex(index: number, el: any) { + return index; + } } diff --git a/src/styles.scss b/src/styles.scss index 43423ea..7d30870 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -1,11 +1,25 @@ /* You can add global styles to this file, and also import other style files */ +@use '@angular/material' as mat; @import '@angular/material/theming'; -@include mat-core(); -$primary: mat-palette($mat-indigo); -$accent: mat-palette($mat-light-blue, A200, A100, A400); -$theme: mat-light-theme($primary, $accent); -@include angular-material-theme($theme); +@include mat.core(); +$olp-primary: mat.define-palette(mat.$indigo-palette, 500); +$olp-accent: mat.define-palette(mat.$pink-palette, A200, A100, A400); + +// The "warn" palette is optional and defaults to red if not specified. +$olp-warn: mat.define-palette(mat.$red-palette); + +$olp-theme: mat.define-light-theme(( + color: ( + primary: $olp-primary, + accent: $olp-accent, + warn: $olp-warn, + ), + density: 0, +)); + +// Including only used components +@include mat.all-component-themes($olp-theme); * { -webkit-font-smoothing: antialiased; @@ -111,3 +125,13 @@ footer { footer { z-index: 1; } + +// This rule is to avoid the left menu scrolling with the page itself. +.mat-drawer.mat-sidenav { + position: fixed; + padding-top: $mat-toolbar-height-desktop; + + @media ($mat-xsmall) { + padding-top: $mat-toolbar-height-mobile; + } +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index eca712c..e666790 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,7 +9,8 @@ "emitDecoratorMetadata": true, "experimentalDecorators": true, "resolveJsonModule": true, - "target": "es5", + "target": "es2022", + "useDefineForClassFields": false, "typeRoots": [ "node_modules/@types" ],