Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Commit

Permalink
feat(gallery): ambient backdrop color input
Browse files Browse the repository at this point in the history
  • Loading branch information
garygrossgarten committed Jul 9, 2019
1 parent 6cbf0da commit fe199a8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ export class FivGalleryImage implements OnInit {
this.animationParams = this.getThumbnailPosition(this.image);

this.overlay.show(49999);
this.backdropColor = this.imageService.getAverageRGB(
this.image.nativeElement
);
this.backdropColor = this.gallery.ambient
? this.imageService.getAverageRGB(this.image.nativeElement)
: '#000';
}

close(position: Position) {
Expand Down
6 changes: 4 additions & 2 deletions projects/core/src/lib/gallery/gallery.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@
</div>

<ng-container *fivIf="['desktop']">
<ion-fab [@scale] *ngIf="controlsVisible && images?.length > 0 && pagerVisible" vertical="center" horizontal="start" slot="fixed">
<ion-fab [@scale] *ngIf="controlsVisible && images?.length > 0 && pagerVisible" vertical="center" horizontal="start"
slot="fixed">
<ion-fab-button color="light" (click)="prev()" [disabled]="activeIndex === 0">
<ion-icon name="arrow-back"></ion-icon>
</ion-fab-button>
</ion-fab>
</ng-container>

<div #viewer class="viewer" fivPull [maxPullHeight]="160" [minPullHeight]="120" (fivPull)="transformSlides($event)"
(fivRefresh)="closeFromPullDown($event)" (fivCancel)="resetPan($event)" [enableScroll]="true">
(fivRefresh)="closeFromPullDown($event)" [enabled]="pullEnabled" (fivCancel)="resetPan($event)"
[enableScroll]="true">
<ion-slides #slider *ngIf="overlay.open" [ngClass]="[initialImage?.viewerState]"
(ionSlideDidChange)="slideDidChange()" (ionSlideNextStart)="ionSlideNextStart()"
(ionSlidePrevStart)="ionSlidePrevStart()" (ionSlidesDidLoad)="onSlidesLoad()" [options]="options">
Expand Down
3 changes: 3 additions & 0 deletions projects/core/src/lib/gallery/gallery.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ export class FivGallery implements OnInit, AfterContentInit {
zoomedIn: boolean;
controlsVisible = true;
@Input() pagerVisible = true;
@Input() ambient = true;
private slidesLoaded;
pullEnabled = false;

@HostListener('window:keyup', ['$event'])
keyEvent(event: KeyboardEvent) {
Expand Down Expand Up @@ -179,6 +181,7 @@ export class FivGallery implements OnInit, AfterContentInit {
this.overlay.show(50000);
this.initialImage = initial;
this.showControls();
this.pullEnabled = true
}

close() {
Expand Down

0 comments on commit fe199a8

Please sign in to comment.