From 827dd42418339ce573ca004bef213b2f609b1907 Mon Sep 17 00:00:00 2001 From: Braun Patrik Date: Fri, 30 Dec 2016 11:58:04 +0100 Subject: [PATCH] implementing lightbox zoom animation --- frontend/app/gallery/grid/GridPhoto.ts | 1 + .../photo/photo.grid.gallery.component.ts | 10 +-- .../lightbox/lightbox.gallery.component.css | 7 ++ .../lightbox/lightbox.gallery.component.html | 12 +++- .../lightbox/lightbox.gallery.component.ts | 71 ++++++++++++++----- frontend/app/model/IRenderable.ts | 22 ++---- 6 files changed, 80 insertions(+), 43 deletions(-) diff --git a/frontend/app/gallery/grid/GridPhoto.ts b/frontend/app/gallery/grid/GridPhoto.ts index a7241cb..f803685 100644 --- a/frontend/app/gallery/grid/GridPhoto.ts +++ b/frontend/app/gallery/grid/GridPhoto.ts @@ -12,6 +12,7 @@ export class GridPhoto { thumbnailLoaded() { if (!this.isThumbnailAvailable()) { + this.photo.readyThumbnails = this.photo.readyThumbnails || []; this.photo.readyThumbnails.push(this.getThumbnailSize()); } } diff --git a/frontend/app/gallery/grid/photo/photo.grid.gallery.component.ts b/frontend/app/gallery/grid/photo/photo.grid.gallery.component.ts index 1be9c52..c1403dc 100644 --- a/frontend/app/gallery/grid/photo/photo.grid.gallery.component.ts +++ b/frontend/app/gallery/grid/photo/photo.grid.gallery.component.ts @@ -162,10 +162,12 @@ export class GalleryPhotoComponent implements IRenderable, OnInit, AfterViewInit } public getDimension(): Dimension { - return new Dimension(this.imageRef.nativeElement.offsetTop, - this.imageRef.nativeElement.offsetLeft, - this.imageRef.nativeElement.width, - this.imageRef.nativeElement.height); + return { + top: this.imageRef.nativeElement.offsetTop, + left: this.imageRef.nativeElement.offsetLeft, + width: this.imageRef.nativeElement.width, + height: this.imageRef.nativeElement.height + }; } } diff --git a/frontend/app/gallery/lightbox/lightbox.gallery.component.css b/frontend/app/gallery/lightbox/lightbox.gallery.component.css index d62e126..179d531 100644 --- a/frontend/app/gallery/lightbox/lightbox.gallery.component.css +++ b/frontend/app/gallery/lightbox/lightbox.gallery.component.css @@ -10,6 +10,12 @@ justify-content: center; /* add to align horizontal */ align-items: center; /* add to align vertical */ cursor: pointer; + transition: all 0.3s ease-in-out; +} + +gallery-lightbox-photo { + transition: all 0.3s ease-in-out; + overflow: hidden; } .blackCanvas{ @@ -20,6 +26,7 @@ width: 100%; /* Full width */ height: 100%; /* Full height */ background-color: black; + transition: all 0.3s ease-in-out; } diff --git a/frontend/app/gallery/lightbox/lightbox.gallery.component.html b/frontend/app/gallery/lightbox/lightbox.gallery.component.html index e732f11..6ed5280 100644 --- a/frontend/app/gallery/lightbox/lightbox.gallery.component.html +++ b/frontend/app/gallery/lightbox/lightbox.gallery.component.html @@ -1,14 +1,20 @@
-
+
-