style changes
This commit is contained in:
@@ -126,9 +126,13 @@
|
||||
} @else {
|
||||
<div class="dexar-categories-grid">
|
||||
@for (category of getTopLevelCategories(); track category.categoryID) {
|
||||
<a [routerLink]="['/category', category.categoryID]" class="dexar-category-card">
|
||||
<a [routerLink]="['/category', category.categoryID]"
|
||||
class="dexar-category-card"
|
||||
[class.dexar-category-card--wide]="isWideCategory(category.categoryID)">
|
||||
<div class="dexar-category-image">
|
||||
@if (category.icon) {
|
||||
@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" />
|
||||
} @else {
|
||||
<div class="dexar-category-fallback">{{ category.name.charAt(0) }}</div>
|
||||
|
||||
@@ -741,10 +741,10 @@
|
||||
}
|
||||
|
||||
.dexar-hero-content {
|
||||
max-width: 660px;
|
||||
max-width: 600px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 18px;
|
||||
gap: 12px;
|
||||
animation: fadeInUp 0.8s ease-out;
|
||||
}
|
||||
|
||||
@@ -762,7 +762,7 @@
|
||||
.dexar-hero-title {
|
||||
font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
||||
font-weight: 500;
|
||||
font-size: 57px;
|
||||
font-size: 42px;
|
||||
color: #1e3c38;
|
||||
line-height: 1.2;
|
||||
margin: 0;
|
||||
@@ -772,7 +772,7 @@
|
||||
.dexar-hero-subtitle {
|
||||
font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
||||
font-weight: 500;
|
||||
font-size: 34px;
|
||||
font-size: 24px;
|
||||
color: #1e3c38;
|
||||
line-height: 1.3;
|
||||
margin: 0;
|
||||
@@ -782,7 +782,7 @@
|
||||
.dexar-hero-tagline {
|
||||
font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
||||
font-weight: 500;
|
||||
font-size: 34px;
|
||||
font-size: 24px;
|
||||
color: #1e3c38;
|
||||
line-height: 1.3;
|
||||
margin: 0;
|
||||
@@ -791,8 +791,8 @@
|
||||
|
||||
.dexar-hero-actions {
|
||||
display: flex;
|
||||
gap: 20px;
|
||||
margin-top: 20px;
|
||||
gap: 16px;
|
||||
margin-top: 12px;
|
||||
animation: fadeInUp 0.8s ease-out 0.4s both;
|
||||
}
|
||||
|
||||
@@ -800,14 +800,14 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 337px;
|
||||
height: 60px;
|
||||
width: 280px;
|
||||
height: 48px;
|
||||
background: linear-gradient(360deg, #497671 0%, #a7ceca 100%);
|
||||
border: 1px solid #d3dad9;
|
||||
border-radius: 13px;
|
||||
font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
||||
font-weight: 500;
|
||||
font-size: 27px;
|
||||
font-size: 20px;
|
||||
color: #ffffff;
|
||||
text-decoration: none;
|
||||
letter-spacing: 1.08px;
|
||||
@@ -831,14 +831,14 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 9px;
|
||||
width: 264px;
|
||||
height: 60px;
|
||||
width: 220px;
|
||||
height: 48px;
|
||||
background: #f5f5f5;
|
||||
border: 1px solid #d3dad9;
|
||||
border-radius: 13px;
|
||||
font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
||||
font-weight: 500;
|
||||
font-size: 27px;
|
||||
font-size: 20px;
|
||||
color: #1e3c38;
|
||||
letter-spacing: 1.08px;
|
||||
cursor: pointer;
|
||||
@@ -1037,6 +1037,7 @@
|
||||
margin: 0;
|
||||
line-height: 1.3;
|
||||
display: -webkit-box;
|
||||
line-clamp: 2;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
@@ -1053,10 +1054,23 @@
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
// Wide category card (spans 2 columns)
|
||||
.dexar-category-card--wide {
|
||||
grid-column: span 2;
|
||||
|
||||
.dexar-category-image {
|
||||
aspect-ratio: 8 / 3;
|
||||
|
||||
img {
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Responsive Design
|
||||
@media (max-width: 1200px) {
|
||||
.dexar-hero {
|
||||
height: 500px;
|
||||
height: 380px;
|
||||
}
|
||||
|
||||
.dexar-hero-overlay {
|
||||
@@ -1064,12 +1078,12 @@
|
||||
}
|
||||
|
||||
.dexar-hero-title {
|
||||
font-size: 48px;
|
||||
font-size: 38px;
|
||||
}
|
||||
|
||||
.dexar-hero-subtitle,
|
||||
.dexar-hero-tagline {
|
||||
font-size: 28px;
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
.dexar-categories {
|
||||
@@ -1084,7 +1098,7 @@
|
||||
|
||||
@media (max-width: 992px) {
|
||||
.dexar-hero {
|
||||
height: 450px;
|
||||
height: 340px;
|
||||
}
|
||||
|
||||
.dexar-hero-overlay {
|
||||
@@ -1092,24 +1106,24 @@
|
||||
}
|
||||
|
||||
.dexar-hero-title {
|
||||
font-size: 42px;
|
||||
font-size: 34px;
|
||||
}
|
||||
|
||||
.dexar-hero-subtitle,
|
||||
.dexar-hero-tagline {
|
||||
font-size: 24px;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.dexar-btn-primary {
|
||||
width: 280px;
|
||||
height: 54px;
|
||||
font-size: 22px;
|
||||
width: 240px;
|
||||
height: 44px;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.dexar-btn-secondary {
|
||||
width: 220px;
|
||||
height: 54px;
|
||||
font-size: 22px;
|
||||
width: 200px;
|
||||
height: 44px;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.dexar-categories {
|
||||
@@ -1124,7 +1138,7 @@
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.dexar-hero {
|
||||
height: 400px;
|
||||
height: 320px;
|
||||
background-position: right center;
|
||||
}
|
||||
|
||||
@@ -1138,26 +1152,26 @@
|
||||
}
|
||||
|
||||
.dexar-hero-title {
|
||||
font-size: 36px;
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.dexar-hero-subtitle,
|
||||
.dexar-hero-tagline {
|
||||
font-size: 20px;
|
||||
font-size: 17px;
|
||||
}
|
||||
|
||||
.dexar-hero-actions {
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
gap: 12px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.dexar-btn-primary,
|
||||
.dexar-btn-secondary {
|
||||
width: 100%;
|
||||
max-width: 320px;
|
||||
height: 50px;
|
||||
font-size: 20px;
|
||||
max-width: 280px;
|
||||
height: 42px;
|
||||
font-size: 17px;
|
||||
}
|
||||
|
||||
.dexar-categories {
|
||||
@@ -1182,26 +1196,26 @@
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.dexar-hero {
|
||||
height: 350px;
|
||||
height: 280px;
|
||||
}
|
||||
|
||||
.dexar-hero-title {
|
||||
font-size: 28px;
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.dexar-hero-subtitle,
|
||||
.dexar-hero-tagline {
|
||||
font-size: 18px;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.dexar-hero-actions {
|
||||
gap: 12px;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.dexar-btn-primary,
|
||||
.dexar-btn-secondary {
|
||||
height: 46px;
|
||||
font-size: 18px;
|
||||
height: 40px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.dexar-categories {
|
||||
|
||||
@@ -20,6 +20,7 @@ export class HomeComponent implements OnInit {
|
||||
isnovo = environment.theme === 'novo';
|
||||
categories = signal<Category[]>([]);
|
||||
itemCounts = signal<Map<number, number>>(new Map());
|
||||
wideCategories = signal<Set<number>>(new Set());
|
||||
loading = signal(true);
|
||||
error = signal<string | null>(null);
|
||||
|
||||
@@ -55,6 +56,7 @@ export class HomeComponent implements OnInit {
|
||||
this.categories.set(categories);
|
||||
this.loading.set(false);
|
||||
this.loadItemCounts();
|
||||
this.detectWideImages(categories);
|
||||
},
|
||||
error: (err) => {
|
||||
this.error.set('Failed to load categories');
|
||||
@@ -97,6 +99,30 @@ export class HomeComponent implements OnInit {
|
||||
return this.subcategoriesCache().get(parentID) || [];
|
||||
}
|
||||
|
||||
isWideCategory(categoryID: number): boolean {
|
||||
return this.wideCategories().has(categoryID);
|
||||
}
|
||||
|
||||
private detectWideImages(categories: Category[]): void {
|
||||
const topLevel = categories.filter(c => c.parentID === 0);
|
||||
topLevel.forEach(cat => {
|
||||
const src = cat.wideBanner || null;
|
||||
if (!src) return;
|
||||
const img = new Image();
|
||||
img.onload = () => {
|
||||
const ratio = img.naturalWidth / img.naturalHeight;
|
||||
if (ratio > 2) {
|
||||
this.wideCategories.update(set => {
|
||||
const next = new Set(set);
|
||||
next.add(cat.categoryID);
|
||||
return next;
|
||||
});
|
||||
}
|
||||
};
|
||||
img.src = src;
|
||||
});
|
||||
}
|
||||
|
||||
navigateToSearch(): void {
|
||||
this.router.navigate(['/search']);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user