very first commit

This commit is contained in:
sdarbinyan
2026-01-18 18:57:06 +04:00
commit bd80896886
152 changed files with 28211 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
<svg width="80" height="80" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M3 4h2l2.5 10.5a2 2 0 0 0 2 1.5H17a2 2 0 0 0 2-1.5L21 7H6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<circle cx="10" cy="19" r="1.5" stroke="currentColor" stroke-width="2"/>
<circle cx="17" cy="19" r="1.5" stroke="currentColor" stroke-width="2"/>
</svg>

After

Width:  |  Height:  |  Size: 411 B

View File

@@ -0,0 +1,7 @@
:host {
display: block;
svg {
color: var(--primary-color);
}
}

View File

@@ -0,0 +1,9 @@
import { Component } from '@angular/core';
@Component({
selector: 'app-empty-cart-icon',
standalone: true,
templateUrl: './empty-cart-icon.component.html',
styleUrls: ['./empty-cart-icon.component.scss']
})
export class EmptyCartIconComponent {}

View File

@@ -0,0 +1,97 @@
<!-- novo VERSION - Modern Clean Footer -->
@if (isnovo) {
<footer class="novo-footer">
<div class="novo-footer-container">
<div class="novo-footer-top">
<div class="novo-footer-col">
<h4>{{ brandName }}</h4>
<p class="novo-footer-desc">Современный маркетплейс для комфортных покупок</p>
</div>
<div class="novo-footer-col">
<h4>Компания</h4>
<ul class="novo-footer-links">
<li><a routerLink="/about">О нас</a></li>
<li><a routerLink="/contacts">Контакты</a></li>
<li><a routerLink="/company-details">Реквизиты</a></li>
</ul>
</div>
<div class="novo-footer-col">
<h4>Поддержка</h4>
<ul class="novo-footer-links">
<li><a routerLink="/faq">FAQ</a></li>
<li><a routerLink="/delivery">Доставка</a></li>
<li><a routerLink="/guarantee">Гарантия</a></li>
</ul>
</div>
<div class="novo-footer-col">
<h4>Правовая информация</h4>
<ul class="novo-footer-links">
<li><a routerLink="/public-offer">Оферта</a></li>
<li><a routerLink="/privacy-policy">Конфиденциальность</a></li>
<li><a routerLink="/return-policy">Возврат</a></li>
</ul>
</div>
</div>
<div class="novo-footer-bottom">
<div class="novo-copyright">
<p>© {{ currentYear }} {{ brandName }}</p>
</div>
<div class="novo-payment-icons">
<img src="/assets/images/mir-logo.svg" alt="МИР" loading="lazy" width="40" height="28" />
<img src="/assets/images/visa-logo.svg" alt="Visa" loading="lazy" width="40" height="28" />
<img src="/assets/images/mastercard-logo.svg" alt="Mastercard" loading="lazy" width="40" height="28" />
</div>
</div>
</div>
</footer>
} @else {
<!-- DEXAR VERSION - Original -->
<footer class="footer">
<div class="footer-container">
<div class="footer-section">
<h3>Информация</h3>
<ul>
<li><a routerLink="/about">О компании</a></li>
<li><a routerLink="/contacts">Контакты</a></li>
<li><a routerLink="/company-details">Реквизиты организации</a></li>
</ul>
</div>
<div class="footer-section">
<h3>Документы</h3>
<ul>
<li><a routerLink="/payment-terms">Правила оплаты</a></li>
<li><a routerLink="/return-policy">Политика возврата</a></li>
<li><a routerLink="/public-offer">Публичная оферта</a></li>
<li><a routerLink="/privacy-policy">Политика конфиденциальности</a></li>
</ul>
</div>
<div class="footer-section">
<h3>Помощь</h3>
<ul>
<li><a routerLink="/faq">Часто задаваемые вопросы</a></li>
<li><a routerLink="/delivery">Доставка</a></li>
<li><a routerLink="/guarantee">Гарантия</a></li>
</ul>
</div>
<div class="footer-section payment-systems">
<h3>Способы оплаты</h3>
<div class="payment-logos">
<img src="/assets/images/mir-logo.svg" alt="МИР" class="payment-logo" loading="lazy" decoding="async" width="60" height="40" />
<img src="/assets/images/visa-logo.svg" alt="Visa" class="payment-logo" loading="lazy" decoding="async" width="60" height="40" />
<img src="/assets/images/mastercard-logo.svg" alt="Mastercard" class="payment-logo" loading="lazy" decoding="async" width="60" height="40" />
</div>
</div>
</div>
<div class="footer-bottom">
<p>&copy; {{ currentYear }} {{ brandName }}. Все права защищены.</p>
</div>
</footer>
}

View File

@@ -0,0 +1,219 @@
.footer {
background-color: #1a1a1a;
color: #ffffff;
margin-top: auto;
padding: 3rem 0 1rem;
border-top: 1px solid #333;
.footer-container {
max-width: 1200px;
margin: 0 auto;
padding: 0 2rem;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 2rem;
}
.footer-section {
h3 {
font-size: 1.1rem;
font-weight: 600;
margin-bottom: 1rem;
color: #ffffff;
}
ul {
list-style: none;
padding: 0;
margin: 0;
li {
margin-bottom: 0.5rem;
a {
color: #b0b0b0;
text-decoration: none;
transition: color 0.2s ease;
font-size: 0.95rem;
&:hover {
color: #ffffff;
}
}
}
}
&.payment-systems {
.payment-logos {
display: flex;
gap: 1rem;
align-items: center;
flex-wrap: wrap;
.payment-logo {
height: 40px;
width: auto;
background: white;
padding: 0.5rem;
border-radius: 4px;
}
}
}
}
.footer-bottom {
max-width: 1200px;
margin: 0 auto;
padding: 2rem 2rem 0;
margin-top: 2rem;
border-top: 1px solid #333;
text-align: center;
p {
color: #808080;
font-size: 0.9rem;
margin: 0;
}
}
@media (max-width: 768px) {
padding: 2rem 0 1rem;
.footer-container {
grid-template-columns: 1fr;
gap: 1.5rem;
padding: 0 1rem;
}
.footer-section {
h3 {
font-size: 1rem;
}
}
}
}
// ========== novo FOOTER STYLES ==========
.novo-footer {
background: var(--text-primary);
color: white;
margin-top: auto;
padding: 3rem 0 0;
}
.novo-footer-container {
max-width: 1400px;
margin: 0 auto;
padding: 0 2rem;
}
.novo-footer-top {
display: grid;
grid-template-columns: 2fr 1fr 1fr 1fr;
gap: 3rem;
padding-bottom: 3rem;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.novo-footer-col {
h4 {
font-size: 1.1rem;
font-weight: 600;
margin-bottom: 1.25rem;
color: white;
}
.novo-footer-desc {
color: rgba(255, 255, 255, 0.7);
line-height: 1.6;
font-size: 0.95rem;
}
}
.novo-footer-links {
list-style: none;
padding: 0;
margin: 0;
li {
margin-bottom: 0.75rem;
a {
color: rgba(255, 255, 255, 0.7);
text-decoration: none;
font-size: 0.95rem;
transition: all 0.3s;
display: inline-block;
&:hover {
color: white;
transform: translateX(4px);
}
}
}
}
.novo-footer-bottom {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1.5rem 0;
}
.novo-copyright {
p {
color: rgba(255, 255, 255, 0.6);
font-size: 0.9rem;
margin: 0;
}
}
.novo-payment-icons {
display: flex;
gap: 0.75rem;
align-items: center;
img {
height: 28px;
width: auto;
background: white;
padding: 0.25rem 0.5rem;
border-radius: 6px;
opacity: 0.9;
transition: opacity 0.3s;
&:hover {
opacity: 1;
}
}
}
@media (max-width: 968px) {
.novo-footer-top {
grid-template-columns: 1fr 1fr;
gap: 2rem;
}
}
@media (max-width: 600px) {
.novo-footer {
padding: 2rem 0 0;
}
.novo-footer-container {
padding: 0 1rem;
}
.novo-footer-top {
grid-template-columns: 1fr;
gap: 2rem;
padding-bottom: 2rem;
}
.novo-footer-bottom {
flex-direction: column;
gap: 1rem;
padding: 1rem 0;
text-align: center;
}
}

View File

@@ -0,0 +1,18 @@
import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterLink } from '@angular/router';
import { environment } from '../../../environments/environment';
@Component({
selector: 'app-footer',
standalone: true,
imports: [CommonModule, RouterLink],
templateUrl: './footer.component.html',
styleUrls: ['./footer.component.scss']
})
export class FooterComponent {
currentYear = new Date().getFullYear();
brandName = environment.brandName;
contactEmail = environment.contactEmail;
isnovo = environment.theme === 'novo';
}

View File

@@ -0,0 +1,96 @@
<!-- novo VERSION - Modern Minimalist Header -->
@if (isnovo) {
<header class="novo-header">
<div class="novo-header-container">
<div class="novo-left">
<a routerLink="/" class="novo-logo" (click)="closeMenu()">
<app-logo />
<!-- <span class="novo-brand">{{ brandName }}</span> -->
</a>
</div>
<nav class="novo-nav" [class.novo-nav-open]="menuOpen">
<div class="novo-nav-links">
<a routerLink="/" routerLinkActive="novo-active" [routerLinkActiveOptions]="{exact: true}" (click)="closeMenu()" class="novo-link">
Главная
</a>
<a routerLink="/search" routerLinkActive="novo-active" (click)="closeMenu()" class="novo-link">
Поиск
</a>
<a routerLink="/about" (click)="closeMenu()" class="novo-link">
О нас
</a>
<a routerLink="/contacts" (click)="closeMenu()" class="novo-link">
Контакты
</a>
</div>
</nav>
<div class="novo-right">
<app-language-selector />
<a routerLink="/cart" routerLinkActive="novo-cart-active" class="novo-cart" (click)="closeMenu()">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="9" cy="21" r="1"></circle>
<circle cx="20" cy="21" r="1"></circle>
<path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"></path>
</svg>
@if (cartItemCount() > 0) {
<span class="novo-cart-badge">{{ cartItemCount() }}</span>
}
</a>
<button class="menu-toggle" (click)="toggleMenu()" [class.active]="menuOpen">
<span></span>
<span></span>
<span></span>
</button>
</div>
</div>
</header>
} @else {
<!-- DEXAR VERSION - Original -->
<header class="header">
<div class="header-container">
<a routerLink="/" class="logo" (click)="closeMenu()">
<app-logo />
<!-- <span class="logo-text">{{ brandName }}</span> -->
</a>
<nav class="nav" [class.nav-open]="menuOpen">
<a routerLink="/" routerLinkActive="active" [routerLinkActiveOptions]="{exact: true}" (click)="closeMenu()">
<span class="nav-icon">🏠</span>
<span class="nav-text">Главная</span>
</a>
<a routerLink="/search" routerLinkActive="active" (click)="closeMenu()">
<span class="nav-icon">🔍</span>
<span class="nav-text">Поиск</span>
</a>
<a routerLink="/cart" routerLinkActive="active" class="cart-link" (click)="closeMenu()">
<span class="nav-icon">🛒</span>
<span class="nav-text">Корзина</span>
@if (cartItemCount() > 0) {
<span class="cart-badge">{{ cartItemCount() }}</span>
}
</a>
</nav>
<a routerLink="/cart" routerLinkActive="active" class="cart-link-mobile" (click)="closeMenu()">
<span class="cart-icon">🛒</span>
@if (cartItemCount() > 0) {
<span class="cart-badge">{{ cartItemCount() }}</span>
}
</a>
<div class="header-actions">
<app-language-selector />
</div>
<button class="menu-toggle" (click)="toggleMenu()" [class.active]="menuOpen">
<span></span>
<span></span>
<span></span>
</button>
</div>
</header>
}

View File

@@ -0,0 +1,451 @@
.header {
background: white;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
position: sticky;
top: 0;
z-index: 1000;
}
.header-container {
max-width: 1200px;
margin: 0 auto;
padding: 16px 20px;
display: flex;
justify-content: space-between;
align-items: center;
}
.logo {
display: flex;
align-items: center;
gap: 8px;
text-decoration: none;
color: #333;
font-size: 1.5rem;
font-weight: 700;
transition: color 0.2s;
.logo-icon {
font-size: 2rem;
}
&:hover {
color: var(--primary-hover);
}
}
/* Shared badge styling for cart count */
.cart-badge {
background: linear-gradient(135deg, #ff4757 0%, #ff6b81 100%);
color: white;
font-weight: 700;
padding: 3px 7px;
border-radius: 12px;
min-width: 20px;
text-align: center;
box-shadow: 0 3px 8px rgba(255, 71, 87, 0.4);
border: 2px solid white;
display: inline-flex;
align-items: center;
justify-content: center;
}
.nav {
display: flex;
align-items: center;
gap: 32px;
a {
display: flex;
align-items: center;
gap: 6px;
text-decoration: none;
color: #333;
font-weight: 500;
transition: all 0.2s;
position: relative;
padding: 8px 12px;
border-radius: 6px;
.nav-icon {
font-size: 1.2rem;
line-height: 1;
}
.nav-text {
font-size: 1rem;
}
&:hover {
color: var(--primary-hover);
background: rgba(85, 104, 211, 0.05);
}
&.active {
color: var(--primary-hover);
background: rgba(85, 104, 211, 0.1);
font-weight: 600;
}
}
.cart-link {
.cart-badge {
position: absolute;
top: -6px;
right: -6px;
font-size: 0.75rem;
}
}
}
.cart-link {
display: flex;
align-items: center;
gap: 6px;
position: relative;
.cart-icon {
font-size: 1.3rem;
}
.cart-badge {
position: absolute;
top: -8px;
right: -12px;
font-size: 0.8rem;
}
}
.menu-toggle {
display: none;
flex-direction: column;
gap: 5px;
background: none;
border: none;
cursor: pointer;
padding: 8px;
span {
width: 25px;
height: 3px;
background: #333;
border-radius: 2px;
transition: all 0.3s;
}
&.active {
span:nth-child(1) {
transform: rotate(45deg) translate(7px, 4.5px);
}
span:nth-child(2) {
opacity: 0;
}
span:nth-child(3) {
transform: rotate(-45deg) translate(7px, -4.5px);
}
}
}
.cart-link-mobile {
display: none;
}
.header-actions {
display: flex;
align-items: center;
gap: 12px;
margin-right: 8px;
}
@media (max-width: 768px) {
.cart-link-mobile {
display: flex;
align-items: center;
position: relative;
text-decoration: none;
margin-right: 8px;
padding: 8px;
border-radius: 6px;
transition: background 0.2s;
.cart-icon {
font-size: 1.5rem;
color: #333;
}
.cart-badge {
position: absolute;
top: 2px;
right: 2px;
font-size: 0.75rem;
}
&:hover {
background: rgba(85, 104, 211, 0.05);
}
&.active {
background: rgba(85, 104, 211, 0.1);
}
}
.nav {
position: fixed;
top: 68px;
left: 0;
right: 0;
background: white;
flex-direction: column;
gap: 0;
padding: 0;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
max-height: 0;
overflow: hidden;
transition: max-height 0.3s ease;
&.nav-open {
max-height: 300px;
}
a {
width: 100%;
padding: 16px 20px;
border-bottom: 1px solid #f0f0f0;
&::after {
display: none;
}
&.active {
background: #f5f5f5;
}
}
.cart-link {
display: none;
}
}
.menu-toggle {
display: flex;
}
.logo-text {
font-size: 1.2rem;
}
}
// ========== novo HEADER STYLES ==========
.novo-header {
background: white;
border-bottom: 1px solid var(--border-color);
position: sticky;
top: 0;
z-index: 1000;
backdrop-filter: blur(10px);
background: rgba(255, 255, 255, 0.95);
}
.novo-header-container {
max-width: 1400px;
margin: 0 auto;
padding: 1rem 2rem;
display: flex;
align-items: center;
justify-content: space-between;
}
.novo-left {
flex: 1;
}
.novo-logo {
display: flex;
align-items: center;
gap: 0.75rem;
text-decoration: none;
.novo-brand {
font-size: 1.25rem;
font-weight: 600;
color: var(--text-primary);
transition: color 0.3s;
}
&:hover .novo-brand {
color: var(--primary-color);
}
}
.novo-nav {
flex: 2;
display: flex;
justify-content: center;
.novo-nav-links {
display: flex;
gap: 2.5rem;
}
.novo-link {
color: var(--text-secondary);
text-decoration: none;
font-weight: 500;
font-size: 0.95rem;
position: relative;
padding: 0.5rem 0;
transition: color 0.3s;
&::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
width: 0;
height: 2px;
background: var(--primary-color);
transition: width 0.3s;
}
&:hover,
&.novo-active {
color: var(--primary-color);
&::after {
width: 100%;
}
}
}
}
.novo-right {
flex: 1;
display: flex;
justify-content: flex-end;
align-items: center;
gap: 1.5rem;
}
.novo-cart {
position: relative;
color: var(--text-primary);
text-decoration: none;
padding: 0.5rem;
border-radius: var(--radius-md);
transition: all 0.3s;
svg {
display: block;
}
&:hover,
&.novo-cart-active {
color: var(--primary-color);
background: var(--bg-secondary);
}
.novo-cart-badge {
position: absolute;
top: -4px;
right: -4px;
background: var(--primary-color);
color: white;
font-size: 0.7rem;
font-weight: 700;
min-width: 18px;
height: 18px;
border-radius: 9px;
display: flex;
align-items: center;
justify-content: center;
padding: 0 5px;
box-shadow: var(--shadow-sm);
}
}
.novo-menu-toggle {
display: none;
flex-direction: column;
gap: 5px;
background: none;
border: none;
cursor: pointer;
padding: 0.5rem;
span {
width: 24px;
height: 2px;
background: var(--text-primary);
border-radius: 2px;
transition: all 0.3s;
}
&.novo-active {
span:nth-child(1) {
transform: rotate(45deg) translate(6px, 6px);
}
span:nth-child(2) {
opacity: 0;
}
span:nth-child(3) {
transform: rotate(-45deg) translate(7px, -7px);
}
}
}
@media (max-width: 968px) {
.novo-nav {
position: fixed;
top: 65px;
left: 0;
right: 0;
background: white;
border-bottom: 1px solid var(--border-color);
box-shadow: var(--shadow-md);
max-height: 0;
overflow: hidden;
transition: max-height 0.3s;
&.novo-nav-open {
max-height: 300px;
}
.novo-nav-links {
width: 100%;
flex-direction: column;
gap: 0;
padding: 1rem 0;
}
.novo-link {
padding: 1rem 2rem;
border-bottom: 1px solid var(--border-color);
text-align: center;
&::after {
display: none;
}
&:hover,
&.novo-active {
background: var(--bg-secondary);
}
}
}
.novo-menu-toggle {
display: flex;
}
}
@media (max-width: 768px) {
.novo-header-container {
padding: 1rem;
}
.novo-logo .novo-brand {
font-size: 1.1rem;
}
}

View File

@@ -0,0 +1,34 @@
import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterLink, RouterLinkActive } from '@angular/router';
import { CartService } from '../../services';
import { environment } from '../../../environments/environment';
import { LogoComponent } from '../logo/logo.component';
import { LanguageSelectorComponent } from '../language-selector/language-selector.component';
@Component({
selector: 'app-header',
standalone: true,
imports: [CommonModule, RouterLink, RouterLinkActive, LogoComponent, LanguageSelectorComponent],
templateUrl: './header.component.html',
styleUrls: ['./header.component.scss']
})
export class HeaderComponent {
cartItemCount;
menuOpen = false;
brandName = environment.brandFullName;
logo = environment.logo;
isnovo = environment.theme === 'novo';
constructor(private cartService: CartService) {
this.cartItemCount = this.cartService.itemCount;
}
toggleMenu(): void {
this.menuOpen = !this.menuOpen;
}
closeMenu(): void {
this.menuOpen = false;
}
}

View File

@@ -0,0 +1,55 @@
<div class="carousel-container" [class.novo-theme]="isnovo">
@if (loading()) {
<div class="carousel-loading">
<div class="spinner"></div>
<p>Загрузка товаров...</p>
</div>
} @else if (products().length > 0) {
<p-carousel
[value]="products()"
[numVisible]="4"
[numScroll]="1"
[circular]="true"
[responsiveOptions]="responsiveOptions"
[autoplayInterval]="3000"
[showNavigators]="true"
[showIndicators]="true">
<ng-template let-product pTemplate="item">
<div class="item-card">
<a [routerLink]="['/item', product.itemID]" class="item-link">
<div class="item-image">
<img [src]="getItemImage(product)" [alt]="product.name" loading="lazy" />
@if (product.discount > 0) {
<div class="discount-badge">-{{ product.discount }}%</div>
}
</div>
<div class="item-details">
<h3 class="item-name">{{ product.name }}</h3>
<div class="item-rating" *ngIf="product.rating">
<span class="rating-stars">⭐ {{ product.rating }}</span>
<span class="rating-count">({{ product.callbacks?.length || 0 }})</span>
</div>
<div class="item-price">
@if (product.discount > 0) {
<span class="original-price">{{ product.price }} {{ product.currency }}</span>
<span class="discounted-price">{{ getDiscountedPrice(product) | number:'1.0-0' }} {{ product.currency }}</span>
} @else {
<span class="current-price">{{ product.price }} {{ product.currency }}</span>
}
</div>
</div>
</a>
<button class="add-to-cart-btn" (click)="addToCart(product)">
В корзину
</button>
</div>
</ng-template>
<ul class="p-carousel-indicator-list" data-pc-section="indicatorlist"><li class="p-carousel-indicator" data-p-active="false" data-pc-section="indicator"><button type="button" class="p-carousel-indicator-button" tabindex="-1" aria-label="1" data-pc-section="indicatorbutton"></button></li><li class="p-carousel-indicator" data-p-active="false" data-pc-section="indicator"><button type="button" class="p-carousel-indicator-button" tabindex="-1" aria-label="2" data-pc-section="indicatorbutton"></button></li><li class="p-carousel-indicator" data-p-active="false" data-pc-section="indicator"><button type="button" class="p-carousel-indicator-button" tabindex="-1" aria-label="3" data-pc-section="indicatorbutton"></button></li><li class="p-carousel-indicator" data-p-active="false" data-pc-section="indicator"><button type="button" class="p-carousel-indicator-button" tabindex="-1" aria-label="4" data-pc-section="indicatorbutton"></button></li><li class="p-carousel-indicator" data-p-active="false" data-pc-section="indicator"><button type="button" class="p-carousel-indicator-button" tabindex="-1" aria-label="5" data-pc-section="indicatorbutton"></button></li><li class="p-carousel-indicator" data-p-active="false" data-pc-section="indicator"><button type="button" class="p-carousel-indicator-button" tabindex="-1" aria-label="6" data-pc-section="indicatorbutton"></button></li><li class="p-carousel-indicator p-carousel-indicator-active" data-p-active="true" data-pc-section="indicator"><button type="button" class="p-carousel-indicator-button" tabindex="0" aria-label="7" aria-current="page" data-pc-section="indicatorbutton"></button></li><!----></ul>
</p-carousel>
}
</div>

View File

@@ -0,0 +1,446 @@
.carousel-container {
width: 100%;
padding: 2rem 0;
max-width: 1400px;
margin: 0 auto;
::ng-deep {
// PrimeNG carousel wrapper
.p-carousel {
.p-carousel-content {
display: flex;
flex-direction: row;
align-items: center;
gap: 1.5rem;
}
// Navigation buttons
.p-carousel-prev,
.p-carousel-next {
width: 3rem;
height: 3rem;
border-radius: 50%;
background: white;
border: 2px solid #e5e7eb;
color: #374151;
transition: all 0.3s ease;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
align-self: center;
z-index: 10;
flex-shrink: 0;
&:hover {
background: #f9fafb;
border-color: #d1d5db;
transform: scale(1.05);
}
&:not(:disabled):hover {
background: var(--primary-color, #5568d3);
border-color: var(--primary-color, #5568d3);
color: white;
}
}
// Items container
.p-carousel-items-container {
.p-carousel-items-content {
width: 100%;
.p-carousel-item {
padding: 0 0.5rem !important;
box-sizing: border-box;
}
}
}
// Add gap between items
.p-carousel-items-content .p-carousel-item-list {
display: flex;
}
.p-carousel-item {
flex-shrink: 0;
}
// Pagination dots - using actual PrimeNG rendered classes
.p-carousel-indicator-list {
display: flex !important;
justify-content: center !important;
gap: 0.5rem !important;
padding: 1.5rem 0 !important;
margin: 0 !important;
list-style: none !important;
.p-carousel-indicator {
display: inline-block !important;
.p-carousel-indicator-button {
width: 12px !important;
height: 12px !important;
border-radius: 50% !important;
background-color: #d1d5db !important;
border: 0 !important;
padding: 0 !important;
cursor: pointer !important;
transition: all 0.3s ease !important;
&:hover {
background-color: #9ca3af !important;
transform: scale(1.2);
}
}
&.p-carousel-indicator-active .p-carousel-indicator-button {
background-color: var(--primary-color, #5568d3) !important;
width: 32px !important;
border-radius: 6px !important;
}
}
}
}
}
}
.carousel-loading,
.carousel-empty {
text-align: center;
padding: 3rem 1rem;
color: #666;
.spinner {
width: 40px;
height: 40px;
margin: 0 auto 1rem;
border: 4px solid #f3f3f3;
border-top: 4px solid var(--primary-color, #5568d3);
border-radius: 50%;
animation: spin 1s linear infinite;
}
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
// Item card styles matching your existing design
.item-card {
background: white;
border-radius: 12px;
overflow: hidden;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
transition: all 0.3s ease;
position: relative;
height: 100%;
display: flex;
flex-direction: column;
width: calc(100% - 1rem) !important;
box-sizing: border-box;
margin: 0 auto;
&:hover {
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
transform: translateY(-4px);
}
}
.item-link {
text-decoration: none;
color: inherit;
display: flex;
flex-direction: column;
flex: 1;
}
.item-image {
position: relative;
width: 100%;
height: 125px;
overflow: hidden;
background: #f5f5f5;
img {
width: 100%;
height: 100%;
object-fit: cover;
transition: transform 0.3s ease;
}
&:hover img {
transform: scale(1.08);
}
}
.discount-badge {
position: absolute;
top: 12px;
right: 12px;
background: #e74c3c;
color: white;
padding: 0.4rem 0.8rem;
border-radius: 6px;
font-size: 0.875rem;
font-weight: 700;
z-index: 10;
}
.item-details {
padding: 0.75rem;
display: flex;
flex-direction: column;
gap: 0.5rem;
flex: 1;
}
.item-name {
font-size: 0.875rem;
font-weight: 600;
margin: 0;
line-height: 1.3;
min-height: 2.6em;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
color: #1a1a1a;
transition: color 0.2s;
&:hover {
color: var(--primary-color, #5568d3);
}
}
.item-rating {
display: flex;
align-items: center;
gap: 0.25rem;
font-size: 0.75rem;
.rating-stars {
color: #fbbf24;
font-weight: 600;
}
.rating-count {
color: #6b7280;
}
}
.item-price {
display: flex;
align-items: baseline;
gap: 0.375rem;
flex-wrap: wrap;
.current-price,
.discounted-price {
font-size: 1rem;
font-weight: 700;
color: #1a1a1a;
}
.discounted-price {
color: #e74c3c;
}
.original-price {
font-size: 0.875rem;
color: #9ca3af;
text-decoration: line-through;
}
}
.add-to-cart-btn {
width: 100%;
padding: 0.625rem 1rem;
background: var(--primary-color, #5568d3);
color: white;
border: none;
border-radius: 0 0 12px 12px;
font-size: 0.875rem;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
&:hover {
background: var(--primary-hover, #4456b3);
}
&:active {
&:active {
transform: scale(0.98);
}
}
// Novo theme styles
.novo-theme {
::ng-deep {
.p-carousel {
.p-carousel-prev,
.p-carousel-next {
&:not(:disabled):hover {
background: var(--primary-color, #5568d3);
border-color: var(--primary-color, #5568d3);
}
}
.p-carousel-indicators {
.p-carousel-indicator.p-highlight button {
background: var(--primary-color, #5568d3);
}
}
}
}
.item-card {
border: 1px solid #e5e5e5;
}
.add-to-cart-btn {
background: var(--primary-color, #5568d3);
&:hover {
background: var(--primary-hover, #4456b3);
}
}
}
// Responsive styles
@media (max-width: 968px) {
.carousel-container {
padding: 0 1rem;
}
.item-image {
height: 220px;
}
}
@media (max-width: 640px) {
.item-image {
height: 200px;
}
.item-details {
padding: 1rem;
}
.item-name {
font-size: 0.9rem;
}
.item-price {
.current-price,
.discounted-price {
font-size: 1.125rem;
}
}
}
.carousel-title {
font-size: 1.5rem;
margin-bottom: 1.5rem;
}
.carousel-track {
gap: 1rem;
}
.carousel-item {
flex: 0 0 calc(50% - 0.5rem);
}
.item-image {
height: 200px;
}
.item-name {
font-size: 1rem;
}
.item-price {
.price-current,
.price-discount {
font-size: 1.25rem;
}
}
.btn-add-cart {
width: 44px;
height: 44px;
svg {
width: 18px;
height: 18px;
}
}
.carousel-btn {
width: 40px;
height: 40px;
}
.carousel-wrapper {
gap: 1rem;
}
}
@media (max-width: 640px) {
.items-carousel {
padding: 1rem 0;
}
.carousel-container {
padding: 0 0.5rem;
}
.carousel-title {
font-size: 1.25rem;
margin-bottom: 1rem;
}
.carousel-track {
gap: 0.75rem;
}
.carousel-item {
flex: 0 0 100%;
}
.item-image {
height: 220px;
}
.carousel-wrapper {
gap: 0.5rem;
}
.carousel-btn {
width: 36px;
height: 36px;
svg {
width: 20px;
height: 20px;
}
}
.item-info {
padding: 1rem;
}
.btn-add-cart {
width: 40px;
height: 40px;
}
.carousel-indicators {
margin-top: 1.5rem;
}
}

View File

@@ -0,0 +1,109 @@
import { Component, OnInit, signal } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterLink } from '@angular/router';
import { CarouselModule } from 'primeng/carousel';
import { ButtonModule } from 'primeng/button';
import { TagModule } from 'primeng/tag';
import { ApiService, CartService } from '../../services';
import { Item } from '../../models';
import { environment } from '../../../environments/environment';
@Component({
selector: 'app-items-carousel',
templateUrl: './items-carousel.component.html',
standalone: true,
imports: [CommonModule, RouterLink, CarouselModule, ButtonModule, TagModule],
styleUrls: ['./items-carousel.component.scss']
})
export class ItemsCarouselComponent implements OnInit {
products = signal<Item[]>([]);
loading = signal(true);
isnovo = environment.theme === 'novo';
responsiveOptions: any[] | undefined;
constructor(
private apiService: ApiService,
private cartService: CartService
) {}
ngOnInit() {
this.apiService.getRandomItems(10).subscribe({
next: (items) => {
this.products.set(items);
this.loading.set(false);
},
error: () => {
this.loading.set(false);
}
});
this.responsiveOptions = [
{
breakpoint: '1400px',
numVisible: 3,
numScroll: 1
},
{
breakpoint: '1199px',
numVisible: 4,
numScroll: 1
},
{
breakpoint: '767px',
numVisible: 2,
numScroll: 1
},
{
breakpoint: '575px',
numVisible: 1,
numScroll: 1
}
];
}
getSeverity(remainings: string) {
switch (remainings) {
case 'high':
return 'success';
case 'low':
return 'warn';
case 'out':
return 'danger';
default:
return 'success';
}
}
getInventoryStatus(remainings: string): string {
switch (remainings) {
case 'high':
return 'INSTOCK';
case 'low':
return 'LOWSTOCK';
case 'out':
return 'OUTOFSTOCK';
default:
return 'INSTOCK';
}
}
getItemImage(item: Item): string {
if (item.photos && item.photos.length > 0 && item.photos[0]?.url) {
return item.photos[0].url;
}
return '/assets/images/placeholder.jpg';
}
getDiscountedPrice(item: Item): number {
if (item.discount > 0) {
return item.price * (1 - item.discount / 100);
}
return item.price;
}
addToCart(item: Item): void {
this.cartService.addItem(item.itemID, 1);
}
}

View File

@@ -0,0 +1,25 @@
<div class="language-selector">
<button class="language-button" (click)="toggleDropdown()">
<img [src]="languageService.getCurrentLanguage()?.flagSvg"
[alt]="languageService.getCurrentLanguage()?.name"
class="language-flag">
<span class="language-code">{{ languageService.getCurrentLanguage()?.code?.toUpperCase() }}</span>
<svg class="dropdown-arrow" [class.rotated]="dropdownOpen" width="12" height="12" viewBox="0 0 12 12" fill="none">
<path d="M2.5 4.5L6 8L9.5 4.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</button>
<div class="language-dropdown" [class.open]="dropdownOpen">
@for (lang of languageService.languages; track lang.code) {
<button
class="language-option"
[class.active]="languageService.currentLanguage() === lang.code"
[class.disabled]="!lang.enabled"
[disabled]="!lang.enabled"
(click)="selectLanguage(lang)">
<img [src]="lang.flagSvg" [alt]="lang.name" class="option-flag">
<span class="option-name">{{ lang.name }}</span>
</button>
}
</div>
</div>

View File

@@ -0,0 +1,180 @@
.language-selector {
position: relative;
display: inline-block;
}
.language-button {
display: flex;
align-items: center;
gap: 6px;
padding: 8px 12px;
background: transparent;
border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: 8px;
color: #ffffff;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
font-weight: 500;
&:hover {
background: rgba(255, 255, 255, 0.05);
border-color: rgba(255, 255, 255, 0.3);
}
.language-flag {
width: 20px;
height: 20px;
display: inline-block;
border-radius: 2px;
}
.language-code {
text-transform: uppercase;
letter-spacing: 0.5px;
}
.dropdown-arrow {
transition: transform 0.3s ease;
opacity: 0.7;
&.rotated {
transform: rotate(180deg);
}
}
}
.language-dropdown {
position: absolute;
top: calc(100% + 8px);
right: 0;
min-width: 180px;
background: var(--card-bg, #1a1a1a);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 12px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
opacity: 0;
visibility: hidden;
transform: translateY(-10px);
transition: all 0.3s ease;
z-index: 1000;
overflow: hidden;
&.open {
opacity: 1;
visibility: visible;
transform: translateY(0);
}
}
.language-option {
display: flex;
align-items: center;
gap: 10px;
width: 100%;
padding: 12px 16px;
background: transparent;
border: none;
color: #ffffff;
cursor: pointer;
transition: background 0.2s ease;
font-size: 14px;
text-align: left;
&:hover:not(.disabled) {
background: rgba(255, 255, 255, 0.05);
}
&.active {
background: rgba(255, 255, 255, 0.1);
font-weight: 600;
}
&.disabled {
opacity: 0.5;
cursor: not-allowed;
position: relative;
}
.option-flag {
width: 24px;
height: 24px;
display: inline-block;
border-radius: 3px;
}
.option-name {
flex: 1;
}
}
// Light theme adjustments
:host-context(.novo-header),
:host-context(.header) {
.language-button {
border-color: rgba(0, 0, 0, 0.2);
color: #333333;
&:hover {
background: rgba(0, 0, 0, 0.05);
border-color: rgba(0, 0, 0, 0.3);
}
}
}
:host-context(.light-theme) {
.language-button {
border-color: rgba(0, 0, 0, 0.2);
color: #333333;
&:hover {
background: rgba(0, 0, 0, 0.05);
border-color: rgba(0, 0, 0, 0.3);
}
}
.language-dropdown {
background: #ffffff;
border-color: rgba(0, 0, 0, 0.1);
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}
.language-option {
color: #333333;
&:hover:not(.disabled) {
background: rgba(0, 0, 0, 0.05);
}
&.active {
background: rgba(0, 0, 0, 0.1);
}
}
}
// Mobile responsiveness
@media (max-width: 768px) {
.language-button {
padding: 6px 10px;
font-size: 13px;
.language-flag {
width: 18px;
height: 18px;
}
}
.language-dropdown {
min-width: 160px;
}
.language-option {
padding: 10px 14px;
font-size: 13px;
.option-flag {
width: 20px;
height: 20px;
}
}
}

View File

@@ -0,0 +1,41 @@
import { Component, HostListener, ElementRef } from '@angular/core';
import { CommonModule } from '@angular/common';
import { LanguageService, Language } from '../../services/language.service';
@Component({
selector: 'app-language-selector',
standalone: true,
imports: [CommonModule],
templateUrl: './language-selector.component.html',
styleUrls: ['./language-selector.component.scss']
})
export class LanguageSelectorComponent {
dropdownOpen = false;
constructor(
public languageService: LanguageService,
private elementRef: ElementRef
) {}
toggleDropdown(): void {
this.dropdownOpen = !this.dropdownOpen;
}
selectLanguage(lang: Language): void {
if (lang.enabled) {
this.languageService.setLanguage(lang.code);
this.dropdownOpen = false;
}
}
closeDropdown(): void {
this.dropdownOpen = false;
}
@HostListener('document:click', ['$event'])
onClickOutside(event: Event): void {
if (!this.elementRef.nativeElement.contains(event.target)) {
this.dropdownOpen = false;
}
}
}

View File

@@ -0,0 +1,18 @@
import { Component } from '@angular/core';
import { environment } from '../../../environments/environment';
@Component({
selector: 'app-logo',
standalone: true,
template: `<img [src]="logoPath" [alt]="brandName + ' logo'" class="logo-img" width="120" height="40" fetchpriority="high" />`,
styles: [`
.logo-img {
height: 40px;
width: auto;
}
`]
})
export class LogoComponent {
brandName = environment.brandName;
logoPath = `/assets/images/${environment.theme}-logo.svg`;
}