Files
marketplaces/src/app/pages/home/home.component.html

153 lines
5.9 KiB
HTML
Raw Normal View History

2026-01-18 18:57:06 +04:00
<!-- novo VERSION - Modern Grid Layout -->
@if (isnovo) {
<div class="novo-home">
<section class="novo-hero novo-hero-compact">
<div class="novo-hero-content">
<h1 class="novo-hero-title">Добро пожаловать в {{ brandName }}</h1>
<p class="novo-hero-subtitle">Найдите всё, что нужно, в одном месте</p>
<a routerLink="/search" class="novo-hero-btn">
Начать поиск
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="5" y1="12" x2="19" y2="12"></line>
<polyline points="12 5 19 12 12 19"></polyline>
</svg>
</a>
</div>
</section>
<!-- Items Carousel -->
<app-items-carousel />
@if (loading()) {
<div class="novo-loading">
<div class="novo-spinner"></div>
<p>Загружаем категории...</p>
</div>
}
@if (error()) {
<div class="novo-error">
<div class="novo-error-icon">⚠️</div>
<h3>Что-то пошло не так</h3>
<p>{{ error() }}</p>
<button (click)="loadCategories()" class="novo-retry-btn">Попробовать снова</button>
</div>
}
@if (!loading() && !error()) {
<section class="novo-categories">
<div class="novo-section-header">
<h2>Категории товаров</h2>
<p>Выберите интересующую категорию</p>
</div>
@if (getTopLevelCategories().length === 0) {
<div class="novo-empty">
<div class="novo-empty-icon">📦</div>
<h3>Категории скоро появятся</h3>
<p>Мы работаем над наполнением каталога</p>
</div>
} @else {
<div class="novo-categories-grid">
@for (category of getTopLevelCategories(); track category.categoryID) {
<a [routerLink]="['/category', category.categoryID]" class="novo-category-card">
<div class="novo-category-image">
@if (category.icon) {
<img [src]="category.icon" [alt]="category.name" loading="lazy" />
} @else {
<div class="novo-category-placeholder">
<span>{{ category.name.charAt(0) }}</span>
</div>
}
</div>
<div class="novo-category-info">
<h3>{{ category.name }}</h3>
<span class="novo-category-arrow"></span>
</div>
</a>
}
</div>
}
</section>
}
</div>
} @else {
2026-02-14 00:45:17 +04:00
<!-- DEXAR VERSION - Redesigned 2026 -->
<div class="dexar-home">
<!-- Hero Section with Full Width Image -->
<section class="dexar-hero">
<div class="dexar-hero-overlay">
<div class="dexar-hero-content">
<h1 class="dexar-hero-title">Здесь ты найдёшь всё</h1>
<p class="dexar-hero-subtitle">Тысячи товаров в одном месте</p>
<p class="dexar-hero-tagline">просто и удобно</p>
<div class="dexar-hero-actions">
2026-02-14 01:28:08 +04:00
<a (click)="scrollToCatalog()" class="dexar-btn-primary">
2026-02-14 00:45:17 +04:00
Перейти в каталог
</a>
<button (click)="navigateToSearch()" class="dexar-btn-secondary">
Найти товар
<svg width="11" height="16" viewBox="0 0 11 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1 1L9 8L1 15" stroke="#1E3C38" stroke-width="2"/>
</svg>
</button>
</div>
</div>
</div>
</section>
2026-01-18 18:57:06 +04:00
<!-- Items Carousel -->
<app-items-carousel />
@if (loading()) {
2026-02-14 00:45:17 +04:00
<div class="dexar-loading">
<div class="dexar-spinner"></div>
2026-01-18 18:57:06 +04:00
<p>Загрузка категорий...</p>
</div>
}
@if (error()) {
2026-02-14 00:45:17 +04:00
<div class="dexar-error">
2026-01-18 18:57:06 +04:00
<p>{{ error() }}</p>
2026-02-14 00:45:17 +04:00
<button (click)="loadCategories()" class="dexar-retry-btn">Попробовать снова</button>
2026-01-18 18:57:06 +04:00
</div>
}
@if (!loading() && !error()) {
2026-02-14 01:28:08 +04:00
<section class="dexar-categories" id="catalog">
<h2 class="dexar-categories-title">Каталог товаров</h2>
2026-01-18 18:57:06 +04:00
@if (getTopLevelCategories().length === 0) {
2026-02-14 00:45:17 +04:00
<div class="dexar-empty-categories">
<div class="dexar-empty-icon">📦</div>
2026-01-18 18:57:06 +04:00
<h3>Категории пока отсутствуют</h3>
<p>Скоро здесь появятся категории товаров</p>
</div>
} @else {
2026-02-14 00:45:17 +04:00
<div class="dexar-categories-grid">
2026-01-18 18:57:06 +04:00
@for (category of getTopLevelCategories(); track category.categoryID) {
2026-02-14 02:34:11 +04:00
<a [routerLink]="['/category', category.categoryID]"
class="dexar-category-card"
[class.dexar-category-card--wide]="isWideCategory(category.categoryID)">
2026-02-14 01:28:08 +04:00
<div class="dexar-category-image">
2026-02-14 02:34:11 +04:00
@if (isWideCategory(category.categoryID) && category.wideBanner) {
<img [src]="category.wideBanner" [alt]="category.name" loading="lazy" decoding="async" />
} @else if (category.icon) {
2026-02-14 01:28:08 +04:00
<img [src]="category.icon" [alt]="category.name" loading="lazy" decoding="async" />
} @else {
<div class="dexar-category-fallback">{{ category.name.charAt(0) }}</div>
}
</div>
<div class="dexar-category-info">
<h3 class="dexar-category-name">{{ category.name }}</h3>
<p class="dexar-category-count">{{ getItemCount(category.categoryID) }} товаров</p>
</div>
</a>
2026-02-14 00:45:17 +04:00
}
2026-01-18 18:57:06 +04:00
</div>
}
</section>
}
</div>
}