changed header and hero img
This commit is contained in:
@@ -72,55 +72,73 @@
|
||||
}
|
||||
</div>
|
||||
} @else {
|
||||
<!-- DEXAR VERSION - Original -->
|
||||
<div class="home-container">
|
||||
<header class="hero hero-compact">
|
||||
<h1>{{ brandName }}</h1>
|
||||
<p>Ваш маркетплейс товаров и услуг</p>
|
||||
</header>
|
||||
<!-- 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">
|
||||
<a routerLink="/search" class="dexar-btn-primary">
|
||||
Перейти в каталог
|
||||
</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>
|
||||
|
||||
<!-- Items Carousel -->
|
||||
<app-items-carousel />
|
||||
|
||||
@if (loading()) {
|
||||
<div class="loading">
|
||||
<div class="spinner"></div>
|
||||
<div class="dexar-loading">
|
||||
<div class="dexar-spinner"></div>
|
||||
<p>Загрузка категорий...</p>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (error()) {
|
||||
<div class="error">
|
||||
<div class="dexar-error">
|
||||
<p>{{ error() }}</p>
|
||||
<button (click)="loadCategories()">Попробовать снова</button>
|
||||
<button (click)="loadCategories()" class="dexar-retry-btn">Попробовать снова</button>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (!loading() && !error()) {
|
||||
<section class="categories">
|
||||
<h2>Категории</h2>
|
||||
<section class="dexar-categories">
|
||||
<h2 class="dexar-categories-title">Категории</h2>
|
||||
@if (getTopLevelCategories().length === 0) {
|
||||
<div class="empty-categories">
|
||||
<div class="empty-icon">📦</div>
|
||||
<div class="dexar-empty-categories">
|
||||
<div class="dexar-empty-icon">📦</div>
|
||||
<h3>Категории пока отсутствуют</h3>
|
||||
<p>Скоро здесь появятся категории товаров</p>
|
||||
</div>
|
||||
} @else {
|
||||
<div class="categories-grid">
|
||||
<div class="dexar-categories-grid">
|
||||
@for (category of getTopLevelCategories(); track category.categoryID) {
|
||||
<div class="category-card">
|
||||
<a [routerLink]="['/category', category.categoryID]" class="category-link">
|
||||
<div class="category-media">
|
||||
@if (category.icon) {
|
||||
<img [src]="category.icon" [alt]="category.name" loading="lazy" decoding="async" />
|
||||
} @else {
|
||||
<div class="category-fallback">{{ category.name }}</div>
|
||||
}
|
||||
</div>
|
||||
<h3>{{ category.name }}</h3>
|
||||
</a>
|
||||
</div>
|
||||
}
|
||||
<div class="dexar-category-card">
|
||||
<a [routerLink]="['/category', category.categoryID]" class="dexar-category-link">
|
||||
<div class="dexar-category-media">
|
||||
@if (category.icon) {
|
||||
<img [src]="category.icon" [alt]="category.name" loading="lazy" decoding="async" />
|
||||
} @else {
|
||||
<div class="dexar-category-fallback">{{ category.name }}</div>
|
||||
}
|
||||
</div>
|
||||
<h3>{{ category.name }}</h3>
|
||||
</a>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</section>
|
||||
|
||||
@@ -701,3 +701,500 @@
|
||||
transform: translateY(-4px);
|
||||
}
|
||||
}
|
||||
|
||||
// ========== DEXAR REDESIGN 2026 STYLES ==========
|
||||
.dexar-home {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
// Hero Section
|
||||
.dexar-hero {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 600px;
|
||||
background-image: url('/assets/images/hero_background_desktop.webp');
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
overflow: hidden;
|
||||
|
||||
// Mobile hero image
|
||||
@media (max-width: 768px) {
|
||||
background-image: url('/assets/images/hero_background_mobile.webp');
|
||||
}
|
||||
}
|
||||
|
||||
.dexar-hero-overlay {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: linear-gradient(
|
||||
to right,
|
||||
rgba(255, 255, 255, 0.9) 0%,
|
||||
rgba(255, 255, 255, 0.7) 50%,
|
||||
rgba(255, 255, 255, 0.3) 100%
|
||||
);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 56px;
|
||||
}
|
||||
|
||||
.dexar-hero-content {
|
||||
max-width: 660px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 18px;
|
||||
animation: fadeInUp 0.8s ease-out;
|
||||
}
|
||||
|
||||
@keyframes fadeInUp {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(30px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
.dexar-hero-title {
|
||||
font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
||||
font-weight: 500;
|
||||
font-size: 57px;
|
||||
color: #1e3c38;
|
||||
line-height: 1.2;
|
||||
margin: 0;
|
||||
animation: fadeInUp 0.8s ease-out 0.1s both;
|
||||
}
|
||||
|
||||
.dexar-hero-subtitle {
|
||||
font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
||||
font-weight: 500;
|
||||
font-size: 34px;
|
||||
color: #1e3c38;
|
||||
line-height: 1.3;
|
||||
margin: 0;
|
||||
animation: fadeInUp 0.8s ease-out 0.2s both;
|
||||
}
|
||||
|
||||
.dexar-hero-tagline {
|
||||
font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
||||
font-weight: 500;
|
||||
font-size: 34px;
|
||||
color: #1e3c38;
|
||||
line-height: 1.3;
|
||||
margin: 0;
|
||||
animation: fadeInUp 0.8s ease-out 0.3s both;
|
||||
}
|
||||
|
||||
.dexar-hero-actions {
|
||||
display: flex;
|
||||
gap: 20px;
|
||||
margin-top: 20px;
|
||||
animation: fadeInUp 0.8s ease-out 0.4s both;
|
||||
}
|
||||
|
||||
.dexar-btn-primary {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 337px;
|
||||
height: 60px;
|
||||
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;
|
||||
color: #ffffff;
|
||||
text-decoration: none;
|
||||
letter-spacing: 1.08px;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
box-shadow: 0 4px 12px rgba(73, 118, 113, 0.3);
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 6px 16px rgba(73, 118, 113, 0.4);
|
||||
}
|
||||
|
||||
&:active {
|
||||
transform: translateY(0px);
|
||||
box-shadow: 0 2px 8px rgba(73, 118, 113, 0.3);
|
||||
}
|
||||
}
|
||||
|
||||
.dexar-btn-secondary {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 9px;
|
||||
width: 264px;
|
||||
height: 60px;
|
||||
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;
|
||||
color: #1e3c38;
|
||||
letter-spacing: 1.08px;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||
|
||||
svg {
|
||||
width: 11px;
|
||||
height: 16px;
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: #ffffff;
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
|
||||
|
||||
svg {
|
||||
transform: translateX(3px);
|
||||
}
|
||||
}
|
||||
|
||||
&:active {
|
||||
transform: translateY(0px);
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
// Loading & Error States
|
||||
.dexar-loading,
|
||||
.dexar-error {
|
||||
text-align: center;
|
||||
padding: 60px 20px;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.dexar-spinner {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border: 4px solid #f3f3f3;
|
||||
border-top: 4px solid #497671;
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
margin: 0 auto 20px;
|
||||
}
|
||||
|
||||
.dexar-error {
|
||||
button {
|
||||
margin-top: 20px;
|
||||
padding: 12px 28px;
|
||||
background: #497671;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 13px;
|
||||
cursor: pointer;
|
||||
font-size: 1.1rem;
|
||||
font-weight: 500;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:hover {
|
||||
background: #3d635f;
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 12px rgba(73, 118, 113, 0.3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Categories Section
|
||||
.dexar-categories {
|
||||
max-width: 1200px;
|
||||
margin: 50px auto;
|
||||
padding: 0 56px;
|
||||
}
|
||||
|
||||
.dexar-categories-title {
|
||||
font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
||||
font-size: 2.5rem;
|
||||
font-weight: 600;
|
||||
margin-bottom: 40px;
|
||||
color: #1e3c38;
|
||||
}
|
||||
|
||||
.dexar-empty-categories {
|
||||
text-align: center;
|
||||
padding: 80px 20px;
|
||||
background: white;
|
||||
border-radius: 16px;
|
||||
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
|
||||
|
||||
.dexar-empty-icon {
|
||||
font-size: 4rem;
|
||||
margin-bottom: 20px;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 1.8rem;
|
||||
color: #1e3c38;
|
||||
margin: 0 0 12px 0;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
p {
|
||||
color: #667a77;
|
||||
font-size: 1.1rem;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.dexar-categories-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
||||
gap: 30px;
|
||||
animation: fadeIn 0.6s ease-in 0.3s both;
|
||||
}
|
||||
|
||||
.dexar-category-card {
|
||||
background: white;
|
||||
border-radius: 16px;
|
||||
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
|
||||
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 4px;
|
||||
background: linear-gradient(90deg, #497671 0%, #a7ceca 100%);
|
||||
transform: scaleX(0);
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-8px);
|
||||
box-shadow: 0 12px 32px rgba(73, 118, 113, 0.2);
|
||||
|
||||
&::before {
|
||||
transform: scaleX(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.dexar-category-link {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
padding: 20px;
|
||||
|
||||
h3 {
|
||||
font-size: 1.3rem;
|
||||
font-weight: 600;
|
||||
color: #1e3c38;
|
||||
margin: 16px 0 0 0;
|
||||
transition: color 0.3s ease;
|
||||
}
|
||||
|
||||
&:hover h3 {
|
||||
color: #497671;
|
||||
}
|
||||
}
|
||||
|
||||
.dexar-category-media {
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
background: #f5f5f5;
|
||||
border-radius: 12px;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
&:hover img {
|
||||
transform: scale(1.05);
|
||||
}
|
||||
}
|
||||
|
||||
.dexar-category-fallback {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 3rem;
|
||||
font-weight: 700;
|
||||
color: #497671;
|
||||
background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
|
||||
}
|
||||
|
||||
// Responsive Design
|
||||
@media (max-width: 1200px) {
|
||||
.dexar-hero {
|
||||
height: 500px;
|
||||
}
|
||||
|
||||
.dexar-hero-overlay {
|
||||
padding: 0 40px;
|
||||
}
|
||||
|
||||
.dexar-hero-title {
|
||||
font-size: 48px;
|
||||
}
|
||||
|
||||
.dexar-hero-subtitle,
|
||||
.dexar-hero-tagline {
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.dexar-categories {
|
||||
padding: 0 40px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 992px) {
|
||||
.dexar-hero {
|
||||
height: 450px;
|
||||
}
|
||||
|
||||
.dexar-hero-overlay {
|
||||
padding: 0 32px;
|
||||
}
|
||||
|
||||
.dexar-hero-title {
|
||||
font-size: 42px;
|
||||
}
|
||||
|
||||
.dexar-hero-subtitle,
|
||||
.dexar-hero-tagline {
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.dexar-btn-primary {
|
||||
width: 280px;
|
||||
height: 54px;
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
.dexar-btn-secondary {
|
||||
width: 220px;
|
||||
height: 54px;
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
.dexar-categories {
|
||||
padding: 0 32px;
|
||||
}
|
||||
|
||||
.dexar-categories-grid {
|
||||
grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
|
||||
gap: 24px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.dexar-hero {
|
||||
height: 400px;
|
||||
background-position: right center;
|
||||
}
|
||||
|
||||
.dexar-hero-overlay {
|
||||
padding: 0 20px;
|
||||
background: linear-gradient(
|
||||
to bottom,
|
||||
rgba(255, 255, 255, 0.95) 0%,
|
||||
rgba(255, 255, 255, 0.85) 100%
|
||||
);
|
||||
}
|
||||
|
||||
.dexar-hero-title {
|
||||
font-size: 36px;
|
||||
}
|
||||
|
||||
.dexar-hero-subtitle,
|
||||
.dexar-hero-tagline {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.dexar-hero-actions {
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.dexar-btn-primary,
|
||||
.dexar-btn-secondary {
|
||||
width: 100%;
|
||||
max-width: 320px;
|
||||
height: 50px;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.dexar-categories {
|
||||
margin: 40px auto;
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
.dexar-categories-title {
|
||||
font-size: 2rem;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.dexar-categories-grid {
|
||||
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.dexar-category-media {
|
||||
height: 160px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.dexar-hero {
|
||||
height: 350px;
|
||||
}
|
||||
|
||||
.dexar-hero-title {
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.dexar-hero-subtitle,
|
||||
.dexar-hero-tagline {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.dexar-hero-actions {
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.dexar-btn-primary,
|
||||
.dexar-btn-secondary {
|
||||
height: 46px;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.dexar-categories-grid {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.dexar-category-card:hover {
|
||||
transform: translateY(-4px);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Component, OnInit, signal, computed, ChangeDetectionStrategy } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { RouterLink } from '@angular/router';
|
||||
import { Router, RouterLink } from '@angular/router';
|
||||
import { ApiService } from '../../services';
|
||||
import { Category } from '../../models';
|
||||
import { environment } from '../../../environments/environment';
|
||||
@@ -40,7 +40,7 @@ export class HomeComponent implements OnInit {
|
||||
return cache;
|
||||
});
|
||||
|
||||
constructor(private apiService: ApiService) {}
|
||||
constructor(private apiService: ApiService, private router: Router) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.loadCategories();
|
||||
@@ -68,4 +68,8 @@ export class HomeComponent implements OnInit {
|
||||
getSubCategories(parentID: number): Category[] {
|
||||
return this.subcategoriesCache().get(parentID) || [];
|
||||
}
|
||||
|
||||
navigateToSearch(): void {
|
||||
this.router.navigate(['/search']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user