chore(ui): drop book and author animations (#270)
* chore(ui): drop book and author animations * chore(ui): remove stale import
This commit is contained in:
+1
@@ -196,6 +196,7 @@
|
||||
<virtual-scroller
|
||||
#scroll
|
||||
[items]="authorList"
|
||||
[bufferAmount]="16"
|
||||
class="virtual-scroller">
|
||||
<div class="author-grid"
|
||||
#container
|
||||
|
||||
+1
-3
@@ -1,14 +1,12 @@
|
||||
<div class="author-card" [class.selected]="isSelected" role="button" tabindex="0" (click)="onCardClick($event)" (keydown.enter)="onCardClick($event)">
|
||||
<div class="cover-container" [ngClass]="{'loaded': isImageLoaded}">
|
||||
<div class="cover-container">
|
||||
@if (hasPhoto) {
|
||||
<img
|
||||
[src]="thumbnailUrl"
|
||||
class="author-photo"
|
||||
[class.loaded]="isImageLoaded"
|
||||
[alt]="author.name"
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
(load)="onImageLoad()"
|
||||
(error)="onPhotoError()"/>
|
||||
} @else {
|
||||
<div class="author-photo-placeholder">
|
||||
|
||||
+2
-28
@@ -20,16 +20,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes shimmer {
|
||||
0% {
|
||||
background-position: -200% 0;
|
||||
}
|
||||
|
||||
100% {
|
||||
background-position: 200% 0;
|
||||
}
|
||||
}
|
||||
|
||||
.cover-container {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
@@ -42,31 +32,15 @@
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.cover-container:not(.loaded) {
|
||||
background: linear-gradient(
|
||||
90deg,
|
||||
var(--surface-ground) 25%,
|
||||
var(--surface-hover, rgb(255 255 255 / 8%)) 50%,
|
||||
var(--surface-ground) 75%
|
||||
);
|
||||
background-size: 200% 100%;
|
||||
animation: shimmer 1.5s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.author-photo {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
border-radius: 8px;
|
||||
opacity: 0;
|
||||
transition: opacity 0.2s ease-in, transform 0.35s ease;
|
||||
transition: transform 0.35s ease;
|
||||
}
|
||||
|
||||
.author-photo.loaded {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.author-card:hover .author-photo.loaded {
|
||||
.author-card:hover .author-photo {
|
||||
transform: scale(1.04);
|
||||
}
|
||||
|
||||
|
||||
+1
-9
@@ -1,5 +1,4 @@
|
||||
import {ChangeDetectorRef, Component, EventEmitter, inject, Input, OnChanges, Output, SimpleChanges} from '@angular/core';
|
||||
import {NgClass} from '@angular/common';
|
||||
import {TranslocoPipe, TranslocoService} from '@jsverse/transloco';
|
||||
import {Tooltip} from 'primeng/tooltip';
|
||||
import {CheckboxChangeEvent, CheckboxModule} from 'primeng/checkbox';
|
||||
@@ -15,7 +14,7 @@ import {AuthorService} from '../../service/author.service';
|
||||
standalone: true,
|
||||
templateUrl: './author-card.component.html',
|
||||
styleUrls: ['./author-card.component.scss'],
|
||||
imports: [NgClass, TranslocoPipe, Tooltip, CheckboxModule, FormsModule, TieredMenu, Button]
|
||||
imports: [TranslocoPipe, Tooltip, CheckboxModule, FormsModule, TieredMenu, Button]
|
||||
})
|
||||
export class AuthorCardComponent implements OnChanges {
|
||||
|
||||
@@ -41,7 +40,6 @@ export class AuthorCardComponent implements OnChanges {
|
||||
private lastShiftKey = false;
|
||||
|
||||
hasPhoto = false;
|
||||
isImageLoaded = false;
|
||||
quickMatching = false;
|
||||
|
||||
items: MenuItem[] = [];
|
||||
@@ -53,12 +51,10 @@ export class AuthorCardComponent implements OnChanges {
|
||||
const curr = changes['author'].currentValue as AuthorSummary;
|
||||
if (!prev || prev.id !== curr.id || prev.hasPhoto !== curr.hasPhoto || prev.asin !== curr.asin) {
|
||||
this.hasPhoto = curr.hasPhoto;
|
||||
this.isImageLoaded = false;
|
||||
}
|
||||
}
|
||||
if (changes['cacheBuster'] && !changes['cacheBuster'].firstChange) {
|
||||
this.hasPhoto = true;
|
||||
this.isImageLoaded = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,9 +82,6 @@ export class AuthorCardComponent implements OnChanges {
|
||||
this.cardClick.emit(this.author);
|
||||
}
|
||||
|
||||
onImageLoad(): void {
|
||||
this.isImageLoaded = true;
|
||||
}
|
||||
|
||||
onPhotoError(): void {
|
||||
this.hasPhoto = false;
|
||||
@@ -163,7 +156,6 @@ export class AuthorCardComponent implements OnChanges {
|
||||
this.quickMatching = false;
|
||||
this.author = {...this.author, asin: updated.asin, hasPhoto: true};
|
||||
this.hasPhoto = true;
|
||||
this.isImageLoaded = false;
|
||||
this.menuInitialized = false;
|
||||
this.quickMatched.emit(this.author);
|
||||
this.messageService.add({
|
||||
|
||||
+1
-1
@@ -104,7 +104,7 @@
|
||||
<p>{{ t('noBooksFound') }}</p>
|
||||
</div>
|
||||
} @else {
|
||||
<virtual-scroller #scroll [items]="books" class="books-virtual-scroller">
|
||||
<virtual-scroller #scroll [items]="books" [bufferAmount]="16" class="books-virtual-scroller">
|
||||
<div class="books-grid" #container
|
||||
[ngStyle]="{'grid-template-columns': 'repeat(auto-fill, minmax(' + gridColumnMinWidth + ', 1fr))'}">
|
||||
@for (book of scroll.viewPortItems; track book.id; let i = $index) {
|
||||
|
||||
Reference in New Issue
Block a user