Fix hover buttons
This commit is contained in:
+14
-14
@@ -2,6 +2,7 @@
|
||||
[class.selected]="isSelected"
|
||||
(mouseover)="isHovered = true"
|
||||
(mouseout)="isHovered = false">
|
||||
|
||||
<div class="cover-container" [ngClass]="{ 'shimmer': !isImageLoaded }">
|
||||
<img
|
||||
[src]="urlHelper.getCoverUrl(book.id, book.metadata?.coverUpdatedOn)"
|
||||
@@ -9,22 +10,21 @@
|
||||
[class.loaded]="isImageLoaded"
|
||||
alt="Cover of {{ book.metadata?.title }}"
|
||||
loading="lazy"
|
||||
(load)="onImageLoad()"
|
||||
/>
|
||||
(load)="onImageLoad()"/>
|
||||
|
||||
<p-button [rounded]="true" icon="pi pi-info" class="info-btn" (click)="openBookInfo(book)"></p-button>
|
||||
<p-button [rounded]="true" icon="pi pi-book" class="read-btn" (click)="readBook(book)"></p-button>
|
||||
|
||||
<p-checkbox
|
||||
*ngIf="isCheckboxEnabled"
|
||||
[(ngModel)]="isSelected"
|
||||
binary="true"
|
||||
id="select-checkbox-{{book.id}}"
|
||||
class="select-checkbox"
|
||||
(ngModelChange)="toggleSelection(isSelected || false)">
|
||||
</p-checkbox>
|
||||
</div>
|
||||
|
||||
<p-checkbox
|
||||
*ngIf="isCheckboxEnabled"
|
||||
[(ngModel)]="isSelected"
|
||||
binary="true"
|
||||
id="select-checkbox-{{book.id}}"
|
||||
class="select-checkbox"
|
||||
(ngModelChange)="toggleSelection(isSelected || false)">
|
||||
</p-checkbox>
|
||||
|
||||
<p-button [rounded]="true" icon="pi pi-info" class="read-btn" (click)="openBookInfo(book)"></p-button>
|
||||
<p-button [rounded]="true" icon="pi pi-book" class="info-btn" (click)="readBook(book)"></p-button>
|
||||
|
||||
<div class="book-info">
|
||||
<div class="book-title-container">
|
||||
<h4 class="book-title">{{ book.metadata?.title }}</h4>
|
||||
|
||||
+11
-11
@@ -83,15 +83,14 @@
|
||||
padding-left: 6px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.info-btn,
|
||||
.read-btn {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
display: none;
|
||||
transition: opacity 0.2s ease-in-out;
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
transition: opacity 0.3s ease, visibility 0.3s ease;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
@@ -105,21 +104,22 @@
|
||||
|
||||
.cover-container:hover .info-btn,
|
||||
.cover-container:hover .read-btn {
|
||||
display: block;
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.select-checkbox {
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
right: 8px;
|
||||
display: none;
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
transition: opacity 0.2s ease, visibility 0.2s ease;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.cover-container:hover .select-checkbox {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.cover-container:hover .select-checkbox,
|
||||
.book-card.selected .select-checkbox {
|
||||
display: block;
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user