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