mirror of
https://github.com/bpatrik/pigallery2.git
synced 2024-12-12 11:15:22 +02:00
improving directory design
This commit is contained in:
parent
17581e10c7
commit
90c01c57be
@ -3,7 +3,9 @@
|
||||
style="display: inline-block;">
|
||||
|
||||
|
||||
<div class="photo-container">
|
||||
<div class="photo-container"
|
||||
[style.width.px]="size()"
|
||||
[style.height.px]="size()">
|
||||
<div class="photo" *ngIf="thumbnail && thumbnail.Available"
|
||||
[style.background-image]="getSanitizedThUrl()"></div>
|
||||
|
||||
|
@ -26,7 +26,7 @@ export class GalleryDirectoryComponent implements OnInit, OnDestroy {
|
||||
|
||||
ngOnInit() {
|
||||
if (this.directory.photos.length > 0) {
|
||||
this.thumbnail = this.thumbnailService.getThumbnail(new Photo(this.directory.photos[0], 100, 100));
|
||||
this.thumbnail = this.thumbnailService.getThumbnail(new Photo(this.directory.photos[0], this.size(), this.size()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,5 +50,14 @@ export class GalleryDirectoryComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
size() {
|
||||
let size = 220 + 5;
|
||||
const containerWidth = this.container.nativeElement.parentElement.parentElement.clientWidth;
|
||||
size = containerWidth / Math.round((containerWidth / size));
|
||||
|
||||
|
||||
return Math.floor(size - 5);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user