optimising and making it better

This commit is contained in:
sdarbinyan
2026-02-26 21:54:21 +04:00
parent 7a00a8f1e3
commit 10b4974719
58 changed files with 318 additions and 1804 deletions

View File

@@ -130,7 +130,7 @@
class="dexar-category-card"
[class.dexar-category-card--wide]="isWideCategory(category.categoryID)">
<div class="dexar-category-image">
@if (isWideCategory(category.categoryID) && category.wideBanner && category.wideBanner !== true) {
@if (isWideCategory(category.categoryID) && category.wideBanner) {
<img [src]="category.wideBanner" [alt]="category.name" loading="lazy" decoding="async" />
} @else if (category.icon) {
<img [src]="category.icon" [alt]="category.name" loading="lazy" decoding="async" />

View File

@@ -87,12 +87,6 @@ export class HomeComponent implements OnInit {
topLevel.forEach(cat => {
if (!cat.wideBanner) return;
// API may send wideBanner as a boolean flag instead of a URL
if (cat.wideBanner === true) {
this.wideCategories.update(set => { const next = new Set(set); next.add(cat.categoryID); return next; });
return;
}
const img = new Image();
img.onload = () => {
const ratio = img.naturalWidth / img.naturalHeight;
@@ -104,7 +98,7 @@ export class HomeComponent implements OnInit {
});
}
};
img.src = cat.wideBanner as string;
img.src = cat.wideBanner;
});
}