Cleanup dashboard css

This commit is contained in:
aditya.chandel
2024-12-27 21:55:17 -07:00
parent f26190a61e
commit da153d6c04
2 changed files with 12 additions and 75 deletions
@@ -1,18 +1,15 @@
<div class="dashboard-scroller-container">
<div class="book-list-container"> <h2 class="dashboard-scroller-title">{{ title }}</h2>
<div class="last-read-title-container"> <div *ngIf="(books$ | async)?.length === 0">
<h2 class="last-read-title">{{ title }}</h2> <h4>No books available.</h4>
<div *ngIf="(books$ | async)?.length === 0">
<h4>No books available.</h4>
</div>
</div> </div>
<div class="book-list" <div class="infinite-scroller"
infiniteScroll infiniteScroll
[infiniteScrollDistance]="2" [infiniteScrollDistance]="2"
[infiniteScrollThrottle]="50" [infiniteScrollThrottle]="50"
#scrollContainer #scrollContainer
[horizontal]="true"> [horizontal]="true">
<div class="book-item" *ngFor="let book of books$ | async"> <div class="infinite-scroller-a-book" *ngFor="let book of books$ | async">
<app-book-card [book]="book" [isCheckboxEnabled]="false"></app-book-card> <app-book-card [book]="book" [isCheckboxEnabled]="false"></app-book-card>
</div> </div>
</div> </div>
@@ -1,12 +1,8 @@
.book-list-container { .dashboard-scroller-container {
margin-bottom: 20px; margin-bottom: 20px;
} }
.last-read-title-container { .dashboard-scroller-title {
}
.last-read-title {
font-size: 1.5rem; font-size: 1.5rem;
color: var(--text-color); color: var(--text-color);
margin-bottom: 10px; margin-bottom: 10px;
@@ -14,79 +10,23 @@
text-align: left; text-align: left;
} }
.book-list { .infinite-scroller {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
overflow-x: auto; overflow-x: auto;
overflow-y: hidden; overflow-y: hidden;
scroll-snap-type: x mandatory; scroll-snap-type: x mandatory;
padding: 10px; padding: 5px;
gap: 20px; gap: 20px;
height: 100%; height: 100%;
box-sizing: border-box; box-sizing: border-box;
} }
.book-item { .infinite-scroller-a-book {
overflow: hidden; overflow: hidden;
background-color: var(--surface-card); background-color: var(--surface-card);
border-radius: 8px; border-radius: 8px;
flex: 0 0 12%; flex: 0 0 9.5%;
scroll-snap-align: start; scroll-snap-align: start;
position: relative; position: relative;
} }
.book-cover {
height: 225px;
object-fit: cover;
background-color: #444;
transition: background-color 0.3s ease, filter 0.3s ease;
position: relative;
border: none;
}
.book-item:hover .book-cover {
filter: blur(2px);
}
.book-info {
padding: 5px;
text-align: center;
}
h4 {
font-size: 0.9rem;
color: var(--text-color);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 100%;
margin-bottom: 3px;
}
p {
color: var(--text-color-secondary);
font-size: 0.8rem;
line-height: 1.2;
margin: 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.info-btn, .read-btn {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -20%);
display: none;
margin: -60px 0;
}
.book-item:hover .info-btn {
display: block;
}
.book-item:hover .read-btn {
display: block;
top: 75%;
}