-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented loading skeletons for images
- Loading branch information
Showing
2 changed files
with
16 additions
and
11 deletions.
There are no files selected for viewing
17 changes: 14 additions & 3 deletions
17
src/app/shared/gallery/components/gallery-inline/gallery-inline.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,20 @@ | ||
<div class="gallery-container flex"> | ||
<ng-container *ngFor="let image of images; index as i;"> | ||
<!-- | ||
Subtract 0.001 from the aspect ratio to force it down a bit and thus slightly shrink the resulting width. | ||
Sometimes it's 1px too wide, so this nasty hack fixes it | ||
--> | ||
<div [ngClass]="{'mr-2': i < images.length - 1}" | ||
class="gallery-item cursor-pointer" | ||
(click)="onImageClick(image, i)"> | ||
<img [src]="image.thumbnailUrl" [alt]="image.altText" /> | ||
[ngStyle]="{ | ||
'width': 'auto', | ||
'height': image.thumbnailHeightPx + ' px', | ||
'aspect-ratio': image.aspectRatio - 0.001 | ||
}" | ||
class="gallery-item skeleton"> | ||
<img [src]="image.thumbnailUrl" | ||
[alt]="image.altText" | ||
(click)="onImageClick(image, i)" | ||
class="cursor-pointer" /> | ||
</div> | ||
</ng-container> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters