-

-

+
-
-
-
+
+
+ {{ index + 1 }} из {{ cartProduct.modifiers.length }}
+
+
-
+
diff --git a/angular/src/app/components/product-modal/product-modal.component.scss b/angular/src/app/components/product-modal/product-modal.component.scss
index 7ac6c09..b447ea8 100644
--- a/angular/src/app/components/product-modal/product-modal.component.scss
+++ b/angular/src/app/components/product-modal/product-modal.component.scss
@@ -1,100 +1,140 @@
:host {
- .product-modal {
- position: relative;
- padding-bottom: 60px;
+ .product-modal {
+ position: relative;
+ padding-bottom: 39px;
+ display: flex;
+ flex-direction: row;
+ gap: 32px;
- &>img {
- width: 100%;
- border-radius: 1.125rem;
- margin-top: 16px;
- }
-
- &__footer {
- width: 100%;
- height: auto;
- display: flex;
- position: absolute;
- bottom: 0;
- padding-top: 8px;
- border-top: solid #d1d1d1 1px;
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- }
-
- &__footer-price {
- font-size: 18px;
- font-weight: 600;
- }
-
- &__add-to-cart {
- padding: 8px 26px;
- background: #C43F00;
- border: none;
- border-radius: 1.125rem;
- color: #fff;
- }
-
- &__modifier {
- border: 1px solid rgba(128, 128, 128, 0.23);
- margin: 0.5em 0;
- padding-bottom: 6px;
- border-radius: 1.125rem;
-
- a {
- width: 100%;
- display: block;
- padding: 0.75em;
- border-radius: 0.15em;
- transition: background .3s ease;
- }
-
- .options-container {
- transition: opacity .5s ease;
- padding-left: 16px;
- display: none;
- opacity: 0;
-
- &.isShow {
- display: block;
- opacity: 1;
- }
- }
-
- &.no-valid {
- border-color: #cc0000;
- }
- }
-
- &__modifier-icon {
- float: right;
-
- &::before,
- &::after {
- display: inline-block;
- font-size: 14px;
- transition: transform .5s ease;
- }
-
- &::before {
- content: "\\";
- transform: rotate(346deg);
- }
-
- &::after {
- content: "/";
- transform: rotate(14deg);
- }
-
- &.isShow {
- &::before {
- transform: rotate(76deg);
- }
-
- &::after {
- transform: rotate(104deg);
- }
- }
- }
+ &__information-container {
+ max-width: calc(50% - 16px);
+ img {
+ width: 100%;
+ border-radius: 1.125rem;
+ height: fit-content;
+ object-fit: cover;
+ }
}
-}
\ No newline at end of file
+
+ &__description {
+ margin-top: 8px;
+ font-size: 14px;
+ }
+
+ // & > img {
+ // width: 50%;
+ // border-radius: 1.125rem;
+ // height: fit-content;
+ // object-fit: cover;
+ // }
+
+ &__footer {
+ width: 100%;
+ height: auto;
+ display: flex;
+ position: absolute;
+ bottom: -14px;
+ padding-top: 16px;
+ border-top: solid #d1d1d1 1px;
+ flex-direction: row;
+ justify-content: space-between;
+ align-items: center;
+ }
+
+ &__footer-price {
+ font-size: 18px;
+ font-weight: 600;
+ }
+
+ &__footer-buttons {
+ display: flex;
+ flex-direction: row;
+ gap: 8px;
+ }
+
+ &__add-to-cart {
+ padding: 8px 26px;
+ background: var(--orange-main);
+ border: none;
+ border-radius: 1.125rem;
+ color: #fff;
+ }
+
+ &__modifier {
+ border: 1px solid rgba(128, 128, 128, 0.23);
+ margin: 0.5em 0;
+ padding-bottom: 6px;
+ border-radius: 1.125rem;
+
+ a {
+ width: 100%;
+ display: block;
+ padding: 0.75em;
+ border-radius: 0.15em;
+ transition: background 0.3s ease;
+ }
+
+ .options-container {
+ transition: opacity 0.5s ease;
+ padding-left: 16px;
+ display: none;
+ opacity: 0;
+
+ &.isShow {
+ display: block;
+ opacity: 1;
+ }
+ }
+
+ &.no-valid {
+ border-color: #cc0000;
+ }
+ }
+
+ &__modifiers-container {
+ height: 400px;
+ overflow-y: auto;
+ }
+
+ &__modifier-icon {
+ float: right;
+
+ &::before,
+ &::after {
+ display: inline-block;
+ font-size: 14px;
+ transition: transform 0.5s ease;
+ }
+
+ &::before {
+ content: "\\";
+ transform: rotate(346deg);
+ }
+
+ &::after {
+ content: "/";
+ transform: rotate(14deg);
+ }
+
+ &.isShow {
+ &::before {
+ transform: rotate(76deg);
+ }
+
+ &::after {
+ transform: rotate(104deg);
+ }
+ }
+ }
+ }
+
+ @media screen and (max-width: 1070px) {
+ .product-modal {
+ flex-direction: column;
+
+ &__information-container {
+ max-width: 100%;
+ }
+ }
+ }
+}
diff --git a/angular/src/app/components/product-modal/product-modal.component.ts b/angular/src/app/components/product-modal/product-modal.component.ts
index d2e54af..b531452 100644
--- a/angular/src/app/components/product-modal/product-modal.component.ts
+++ b/angular/src/app/components/product-modal/product-modal.component.ts
@@ -32,7 +32,7 @@ export class ProductModalComponent implements OnInit {
this.product = this.config.data.product
this.modifiersGroups = this.config.data.modifiersGroups
this.modifiers = this.config.data.modifiers
- this.cartProduct = new CartProduct(this.product.id, this.product.name, this.modifiersFilter(), this.modifiers);
+ this.cartProduct = new CartProduct(this.product.id, this.product.name, this.modifiersFilter(), this.modifiers, this.product.price);
}
modifiersFilter(): ModifiersGroup[] {
@@ -43,25 +43,6 @@ export class ProductModalComponent implements OnInit {
return this.modifiers.filter((modifier) => modifier.groupId === modifierGroup.id)
}
- changeQuantity(event: any) {
- const value: ChangeValue = event.value
- const modifierGroup: CartModifier = event.modifierGroup
- const option: Modifier = event.option
-
- const modifGroup = this.cartProduct.modifiers.find((modifGroup) => modifGroup.idLocal === modifierGroup.idLocal)
- const modifier = modifGroup?.options.find((modifier) => modifier.idLocal == option.idLocal)
-
- if (!modifier) return
- if (!modifier.quantity && modifier.quantity !== 0) modifier.quantity = modifier.restrictions.byDefault
- if (value.type === 'minus') {
- modifier.quantity -= value.variableQuantity
- } else {
- modifier.quantity += value.variableQuantity
- }
- }
-
-
-
selectedOptions(modifier: ModifiersGroup): Modifier[] {
const cartModifier = this.cartProduct.modifiers.find(cartModifier => cartModifier.id === modifier.id)
if (modifier.restrictions.maxQuantity === 1 && modifier.restrictions.minQuantity === 1) {
@@ -103,6 +84,15 @@ export class ProductModalComponent implements OnInit {
element.setAttribute('isShow', 'true')
}
+ changeProductAmount({type, variableQuantity}: ChangeValue) {
+ if (type === 'plus') {
+ this.cartProduct.increment()
+ } else {
+ this.cartProduct.decrement()
+ }
+
+ }
+
addToCart(event: Event) {
if (event) {
event.preventDefault()
diff --git a/angular/src/app/components/user-data-order/user-data-order.component.scss b/angular/src/app/components/user-data-order/user-data-order.component.scss
index d1eddc4..012640d 100644
--- a/angular/src/app/components/user-data-order/user-data-order.component.scss
+++ b/angular/src/app/components/user-data-order/user-data-order.component.scss
@@ -68,7 +68,7 @@
flex-direction: column;
align-items: center;
gap: 8px;
- border: solid #09467f 1px;
+ border: solid var(--orange-main) 1px;
border-radius: 16px;
overflow: hidden;
padding-bottom: 16px;
@@ -137,7 +137,7 @@
}
.elementor-button--checkout {
- background-color: #09467f;
+ background-color: var(--orange-main);
color: #fff;
border-radius: 6px;
display: flex;
diff --git a/angular/src/app/directives/change-quantity-option.directive.spec.ts b/angular/src/app/directives/change-quantity-option.directive.spec.ts
new file mode 100644
index 0000000..6127623
--- /dev/null
+++ b/angular/src/app/directives/change-quantity-option.directive.spec.ts
@@ -0,0 +1,8 @@
+import { ChangeQuantityOptionDirective } from './change-quantity-option.directive';
+
+describe('ChangeQuantityOptionDirective', () => {
+ it('should create an instance', () => {
+ const directive = new ChangeQuantityOptionDirective();
+ expect(directive).toBeTruthy();
+ });
+});
diff --git a/angular/src/app/directives/change-quantity-option.directive.ts b/angular/src/app/directives/change-quantity-option.directive.ts
new file mode 100644
index 0000000..a9518bf
--- /dev/null
+++ b/angular/src/app/directives/change-quantity-option.directive.ts
@@ -0,0 +1,65 @@
+import {
+ Directive,
+ ElementRef,
+ HostListener,
+ Input,
+ OnInit,
+} from '@angular/core';
+import { CartModifier, Modifier } from '../interface/data';
+import { CartProduct } from '../models/cart-product';
+
+@Directive({
+ selector: '[appChangeQuantityOption]',
+})
+export class ChangeQuantityOptionDirective implements OnInit {
+ @Input() option!: Modifier;
+ @Input() modifier!: CartModifier;
+ @Input() product!: CartProduct;
+
+ constructor(private el: ElementRef) {}
+
+ ngOnInit(): void {
+ this.option.quantity = this.option.restrictions.byDefault;
+
+ if (!this.modifier.lastChangeOption && this.option.restrictions.byDefault) {
+ this.modifier.lastChangeOption = this.option.idLocal;
+ }
+ }
+
+ @HostListener('click') onOptionClick() {
+ this.changeQuantity({ option: this.option, modifier: this.modifier });
+ }
+
+ changeQuantity({
+ option,
+ modifier,
+ }: {
+ option: Modifier;
+ modifier: CartModifier;
+ }): void {
+ if (!option.quantity && option.quantity !== 0) {
+ return;
+ }
+ const quantity = option.quantity;
+ const allQuantity = modifier.allQuantity;
+ const maxOptionQ = option.restrictions.maxQuantity;
+ const minOptionQ = option.restrictions.minQuantity;
+ const maxModifierQ = modifier.restrictions.maxQuantity;
+ const minModifierQ = modifier.restrictions.minQuantity;
+ const plusCondition =
+ (quantity < maxOptionQ && allQuantity < maxModifierQ) ||
+ (maxOptionQ === 0 && (allQuantity < maxModifierQ || maxModifierQ === 0));
+
+ if (!plusCondition && quantity > minOptionQ && allQuantity > minModifierQ) {
+ this.product.decrementOption(modifier.idLocal, option.idLocal);
+ }
+ if (allQuantity === maxModifierQ && modifier.lastChangeOption) {
+ this.product.decrementOption(modifier.idLocal, modifier.lastChangeOption);
+ this.changeQuantity({ option, modifier });
+ }
+ if (plusCondition) {
+ this.product.incrementOption(modifier.idLocal, option.idLocal);
+ modifier.lastChangeOption = option.idLocal;
+ }
+ }
+}
diff --git a/angular/src/app/interface/data.ts b/angular/src/app/interface/data.ts
index 48ae207..93731f2 100644
--- a/angular/src/app/interface/data.ts
+++ b/angular/src/app/interface/data.ts
@@ -157,6 +157,7 @@ export interface Modifier {
groupId: string,
price?: number,
quantity?: number,
+ image?: string;
restrictions: {
minQuantity: number,
maxQuantity: number,
@@ -166,6 +167,7 @@ export interface Modifier {
}
export interface CartModifier {
+ lastChangeOption?: string;
id: string;
idLocal: string;
name: string;
diff --git a/angular/src/app/models/cart-product.ts b/angular/src/app/models/cart-product.ts
index 68885e3..f59bf0e 100644
--- a/angular/src/app/models/cart-product.ts
+++ b/angular/src/app/models/cart-product.ts
@@ -1,14 +1,15 @@
-import { CartModifier, Modifier, ModifiersGroup, Option } from "../interface/data";
+import { CartModifier, Modifier, ModifiersGroup } from "../interface/data";
import { v4 as uuidv4 } from 'uuid';
export class CartProduct {
- constructor(id: string, name: string, modifiers: ModifiersGroup[] = [], options: Modifier[], amount: number = 1) {
+ constructor(id: string, name: string, modifiers: ModifiersGroup[] = [], options: Modifier[], price: number, amount: number = 1) {
this.id = id;
this.guid = uuidv4();
this.amount = amount;
this.name = name;
+ this.price = price * amount
this.modifiers = modifiers.map(modifier => ({
name: modifier.name,
id: modifier.id,
@@ -33,6 +34,7 @@ export class CartProduct {
guid: string;
amount: number;
name: string;
+ price: number;
modifiers: CartModifier[];
increment(): void {
@@ -45,6 +47,29 @@ export class CartProduct {
}
}
+ incrementOption(modifierId: string, optionId: string): void {
+ const modifier = this.modifiers.find((modifier) => modifier.idLocal === modifierId)
+ const option = modifier?.options.find((option) => option.idLocal === optionId)
+ if (!option?.quantity && option?.quantity !== 0) return
+ option.quantity++
+ }
+
+ decrementOption(modifierId: string, optionId: string): void {
+ const modifier = this.modifiers.find((modifier) => modifier.idLocal === modifierId)
+ const option = modifier?.options.find((option) => option.idLocal === optionId)
+ if (!option?.quantity && option?.quantity !== 0) return
+ option.quantity--
+ }
+
+ get finalPrice(): number{
+ const modifiersPrice = this.modifiers.reduce
((previousValue, currentValue) => {
+ return previousValue + currentValue.options.reduce((previousOptionValue, currentOptionValue) => {
+ return previousOptionValue + Number(currentOptionValue.price ? currentOptionValue.price * (currentOptionValue.quantity ?? 0) : 0);
+ }, 0);
+ }, 0);
+ return (Number(this.price) + modifiersPrice) * this.amount;
+ }
+
// addOption(modifier: ModifiersGroup, option: Modifier): void {
// const productModifier = this.modifiers.find(value => value.id === modifier.id);
// if (productModifier) {
diff --git a/angular/src/app/pages/account/account.component.html b/angular/src/app/pages/account/account.component.html
index 887238d..e204b93 100644
--- a/angular/src/app/pages/account/account.component.html
+++ b/angular/src/app/pages/account/account.component.html
@@ -6,7 +6,11 @@
>
-
a {
+ & > a {
font-style: normal;
font-weight: 700;
font-size: 18px;
@@ -124,7 +135,7 @@
text-align-last: left;
}
- &>p {
+ & > p {
font-style: normal;
font-weight: 400;
font-size: 12px;
@@ -140,24 +151,28 @@
}
}
}
- }
+ .mat-tab-group {
+ width: calc(100% - 432px);
+ }
+ }
+
.top-left-attribute {
width: 10px;
height: 5px;
- background: #09467f;
+ background: var(--orange-main);
left: 0;
position: absolute;
top: 69px;
}
-
+
.version {
opacity: 0.5;
position: absolute;
bottom: 60px;
}
-
}
+
@media screen and (min-width: 550px) {
.woocommerce {
@@ -170,18 +185,30 @@
border: solid 1px #dfdfdf;
border-radius: 12px;
box-shadow: 0 0 6px 2px rgb(223 223 223);
- transition: top .4s cubic-bezier(0.57, -0.43, 0.41, 1.3);
+ transition: top 0.4s cubic-bezier(0.57, -0.43, 0.41, 1.3);
top: -60px;
-
- &[isShow=true] {
+
+ &[isShow="true"] {
top: 8px;
}
}
-
+
.version {
bottom: 20px;
}
}
}
-}
\ No newline at end of file
+ @media screen and (max-width: 895px) {
+ .woocommerce {
+ .account-page {
+ flex-direction: column;
+ width: 100%;
+
+ .mat-tab-group {
+ width: 100%;
+ }
+ }
+ }
+ }
+}
diff --git a/angular/src/app/pages/account/bonus-program/bonus-program.component.scss b/angular/src/app/pages/account/bonus-program/bonus-program.component.scss
index 25b60a2..ed9cbd9 100644
--- a/angular/src/app/pages/account/bonus-program/bonus-program.component.scss
+++ b/angular/src/app/pages/account/bonus-program/bonus-program.component.scss
@@ -22,11 +22,12 @@
}
.card-container {
- background: #09467f;
+ background: var(--orange-main);
box-shadow: 0px 0px 5px rgb(0 0 0 / 15%);
border-radius: 15px;
margin-top: 11px;
overflow: hidden;
+ min-width: 400px;
max-width: 400px;
width: 100%;
@@ -65,7 +66,7 @@
}
&__content {
- background-color: #09467f;
+ background-color: var(--orange-main);
color: #fff;
.info {
@@ -195,9 +196,17 @@
margin-top: 12px;
height: 36px;
border-radius: 8px;
- background: #09467f;
- border-color: #09467f;
+ background: var(--orange-main);
+ border-color: var(--orange-main);
color: #fff;
}
}
+
+ @media screen and (max-width: 895px) {
+ .woocommerce-MyAccount-content {
+ .card-container {
+ min-width: auto;
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/angular/src/app/pages/account/orders/orders.component.html b/angular/src/app/pages/account/orders/orders.component.html
index 5edb57d..66ab42f 100644
--- a/angular/src/app/pages/account/orders/orders.component.html
+++ b/angular/src/app/pages/account/orders/orders.component.html
@@ -1,5 +1,5 @@
-
{{ currentPage.name }}
+
diff --git a/angular/src/app/pages/account/orders/orders.component.scss b/angular/src/app/pages/account/orders/orders.component.scss
index 68d3bb8..c3c839d 100644
--- a/angular/src/app/pages/account/orders/orders.component.scss
+++ b/angular/src/app/pages/account/orders/orders.component.scss
@@ -1,7 +1,7 @@
.show-more-orders {
text-align: center;
cursor: pointer;
- color: #09467f;
+ color: var(--orange-main);
margin-top: 16px;
}
.woocommerce-MyAccount-content {
@@ -9,7 +9,7 @@
margin-left: calc(50vw - 200px);
}
.woocommerce-orders-table {
- border: 2px solid #dee2e6;
+ // border: 2px solid #dee2e6;
border-bottom: 0;
border-radius: 0.25rem;
border-collapse: separate;
diff --git a/angular/src/app/pages/account/ref-system/ref-system.component.scss b/angular/src/app/pages/account/ref-system/ref-system.component.scss
index e955a14..3f9b4f2 100644
--- a/angular/src/app/pages/account/ref-system/ref-system.component.scss
+++ b/angular/src/app/pages/account/ref-system/ref-system.component.scss
@@ -8,7 +8,7 @@
margin: 0 auto;
.share {
width: 50px;
- background-color: #09467f;
+ background-color: var(--orange-main);
border-radius: 8px;
display: flex;
justify-content: center;
@@ -19,7 +19,7 @@
}
}
.copy {
- background-color: #09467f;
+ background-color: var(--orange-main);
color: #fff;
border-radius: 8px;
width: calc(100% - 66px);
diff --git a/angular/src/app/pages/cart/cart.component.scss b/angular/src/app/pages/cart/cart.component.scss
index 7fa17da..15f878d 100644
--- a/angular/src/app/pages/cart/cart.component.scss
+++ b/angular/src/app/pages/cart/cart.component.scss
@@ -155,7 +155,7 @@
padding: 12px;
display: block;
width: fit-content;
- background: #09467f;
+ background: var(--orange-main);
border-radius: 4px;
text-decoration: none;
color: #fff;
diff --git a/angular/src/app/pages/products/products.component.html b/angular/src/app/pages/products/products.component.html
index d52de88..d29b2e3 100644
--- a/angular/src/app/pages/products/products.component.html
+++ b/angular/src/app/pages/products/products.component.html
@@ -1,111 +1,165 @@
-
-
-
-
-
- {{group.label}}
-
-
-
-
-
+
+
+
+ {{ group.label }}
+
+
-
+
+
-
-
{{selectedGroup.label}}
-
- Все
- >
- {{selectedGroup.label}}
-
+
+
{{ selectedGroup.label }}
+
+ Все
+ >
+ {{ selectedGroup.label }}
-
-
-
-
-
-

-

-
-
Lorem ipsum dolor sit amet consectetur
- adipisicing elit.
- Odio consequuntur voluptates est.
-
-
-
+
+
+
+
+
+
+

+
+
+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Odio
+ consequuntur voluptates est.
+
+
-
-
-
-
-

-

-
-
Lorem ipsum dolor sit amet consectetur adipisicing
- elit.
- Odio consequuntur voluptates est.
-
-
+
+
+
+
+
+
+

+

+
-
-
-
-
-
-
-
-
{{message.summary}}
-
{{message.detail}}
-
-
-
-
-
+
+
+
+
+
+
{{ message.summary }}
+
{{ message.detail }}
+
+
+
+
+
-
-
\ No newline at end of file
+
+
diff --git a/angular/src/app/pages/products/products.component.scss b/angular/src/app/pages/products/products.component.scss
index 3feb093..a252809 100644
--- a/angular/src/app/pages/products/products.component.scss
+++ b/angular/src/app/pages/products/products.component.scss
@@ -1,258 +1,269 @@
:host {
- .products-container {
- width: 100%;
- max-width: 1208px;
+ .products-container {
+ width: 100%;
+ max-width: 1208px;
+ display: flex;
+ flex-direction: column;
+ margin: 0 auto 16px;
+
+ &__category-name-container {
+ margin-bottom: 16px;
+
+ h1 {
+ font-size: 30px;
+ font-weight: 500;
+ }
+
+ .bread-crumbs {
+ font-weight: 600;
+ color: #9d9d9d;
+ font-size: 16px;
+
+ .all {
+ margin-right: 4px;
+ cursor: pointer;
+ }
+
+ .selected-category {
+ color: var(--orange-main);
+ margin-left: 4px;
+ }
+ }
+ }
+
+ &__filters-container {
+ width: 100%;
+ margin: 12px auto 24px auto;
+ display: flex;
+ flex-wrap: nowrap;
+ justify-content: space-between;
+ flex-direction: row;
+ align-items: center;
+
+ label {
+ margin: 8px;
+ font-size: 14px;
+ }
+ }
+
+ &__categories-container {
+ display: flex;
+ flex-direction: row;
+ justify-content: space-between;
+ font-size: 14px;
+ align-items: center;
+ overflow-x: auto;
+ width: 100%;
+ margin-right: 16px;
+ gap: 8px;
+
+ &::-webkit-scrollbar {
+ height: 0;
+ }
+
+ &::-webkit-scrollbar-track {
+ -webkit-box-shadow: 5px 5px 5px -5px rgba(34, 60, 80, 0.2) inset;
+ background-color: #f9f9fd;
+ border-radius: 10px;
+ }
+
+ &::-webkit-scrollbar-thumb {
+ border-radius: 10px;
+ background: linear-gradient(180deg, #00c6fb, #005bea);
+ }
+
+ .group-container {
+ font-weight: 600;
+ padding: 8px 24px;
+ transition: all 0.5s;
+ border-radius: 1.125rem;
+ text-align: center;
+ background: #ededed;
+ border: none;
+ min-width: fit-content;
+ cursor: pointer;
+
+ &.non-visible {
+ display: none;
+ }
+
+ &.active {
+ color: #fff;
+ background: var(--orange-main);
+ border: none;
+ // box-shadow: 0 0 10px 5px rgb(221 221 221);
+ }
+
+ &:hover {
+ color: #fff;
+ background: var(--orange-main);
+ border: none;
+ // box-shadow: 0 0 10px 5px rgb(221 221 221);
+ }
+ }
+ }
+
+ &__items {
+ width: 100%;
+ display: flex;
+ flex-direction: row;
+ flex-wrap: wrap;
+ gap: 16px;
+ margin: 0 auto;
+ }
+
+ &__category-container {
+ display: flex;
+ flex-direction: column;
+
+ .header {
display: flex;
- flex-direction: column;
- margin: 0 auto 16px;
+ justify-content: space-between;
+ align-items: center;
+ margin: 48px 0 16px;
- &__category-name-container {
- margin-bottom: 16px;
-
- h1 {
- font-size: 30px;
- font-weight: 500;
- }
-
- .bread-crumbs {
- font-weight: 600;
- color: #9d9d9d;
- font-size: 16px;
-
- .all {
- margin-right: 4px;
- cursor: pointer;
- }
-
- .selected-category {
- color: #c43f00;
- margin-left: 4px;
- }
- }
+ h2 {
+ margin: 0;
+ font-size: 30px;
+ font-weight: 500;
+ max-width: 150px;
}
- &__filters-container {
- width: 100%;
- margin: 12px auto 24px auto;
- display: flex;
- flex-wrap: nowrap;
- justify-content: space-between;
- flex-direction: row;
- align-items: center;
+ button {
+ padding: 8px 26px;
+ background: var(--orange-main);
+ border: none;
+ border-radius: 1.125rem;
+ color: #fff;
+ transition: all 0.3s;
- label {
- margin: 8px;
- font-size: 14px;
- }
- }
-
- &__categories-container {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- font-size: 14px;
- align-items: center;
- overflow-x: auto;
- width: 100%;
- margin-right: 16px;
- gap: 8px;
-
- &::-webkit-scrollbar {
- width: 0;
- }
-
- .group-container {
- font-weight: 600;
- padding: 8px 24px;
- transition: all 0.5s;
- border-radius: 1.125rem;
- text-align: center;
- background: #ededed;
- border: none;
- cursor: pointer;
-
- &.non-visible {
- display: none;
- }
-
- &.active {
- color: #fff;
- background: #09467f;
- border: none;
- // box-shadow: 0 0 10px 5px rgb(221 221 221);
- }
-
- &:hover {
- color: #fff;
- background: #09467f;
- border: none;
- // box-shadow: 0 0 10px 5px rgb(221 221 221);
- }
- }
- }
-
- &__items {
- width: 100%;
- display: flex;
- flex-direction: row;
- flex-wrap: wrap;
- gap: 16px;
- margin: 0 auto;
-
- }
-
- &__category-container {
- display: flex;
- flex-direction: column;
-
- .header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin: 48px 0 16px;
-
- h2 {
- margin: 0;
- font-size: 30px;
- font-weight: 500;
- max-width: 150px;
- }
-
- button {
- padding: 8px 26px;
- background: #1D3F5F;
- border: none;
- border-radius: 1.125rem;
- color: #fff;
- transition: all .3s;
-
- &:hover {
- box-shadow: 0 0 10px 5px rgb(211 211 211);
- }
- }
- }
- }
-
- &__item {
- height: auto;
- min-height: 200px;
- width: 290px;
- display: flex;
- flex-direction: column;
- align-items: center;
- position: relative;
- padding-bottom: 38Px;
- transition: all .3s;
- cursor: pointer;
-
- img {
- width: 100%;
- margin: 0 auto;
- height: 190px;
- object-fit: cover;
- border-radius: 1.125rem;
- transition: all .3s;
- }
-
- &:hover {
- scale: 1.01;
- border: none;
-
- img {
- box-shadow: 0 0 10px 5px rgb(221 221 221);
- border: none;
- }
- }
- }
-
- &__name-container {
- width: 100%;
- display: flex;
- align-items: flex-start;
- margin-top: 8px;
-
- p {
- font-size: 18px;
- font-weight: 600;
- width: 100%;
- margin-bottom: 6px;
- }
- }
-
- &__add-to-cart {
- padding: 8px 26px;
- background: #C43F00;
- border: none;
- border-radius: 1.125rem;
- color: #fff;
- }
-
- &__item-footer {
- display: flex;
- width: 100%;
- justify-content: space-between;
- align-items: center;
- position: absolute;
- bottom: 0;
-
- &>span {
- font-size: 18px;
- font-weight: 600;
- }
- }
-
- &__product-composition {
- font-size: 12px;
- font-weight: 400;
- line-height: 1.375;
+ &:hover {
+ box-shadow: 0 0 10px 5px rgb(211 211 211);
+ }
}
+ }
}
- // @media screen and (max-width: 1549px) {
- // .products-container {
- // &__items {
- // max-width: 1208px;
- // }
- // &__filters-container {
- // max-width: 1208px;
- // }
- // }
- // }
+ &__item {
+ height: auto;
+ min-height: 200px;
+ width: 290px;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ position: relative;
+ padding-bottom: 38px;
+ transition: all 0.3s;
+ cursor: pointer;
- @media screen and (max-width: 1243px) {
- .products-container {
- max-width: 902px;
+ img {
+ width: 100%;
+ margin: 0 auto;
+ height: 190px;
+ object-fit: cover;
+ border-radius: 1.125rem;
+ transition: all 0.3s;
+ }
+
+ &:hover {
+ scale: 1.01;
+ border: none;
+
+ img {
+ box-shadow: 0 0 10px 5px rgb(221 221 221);
+ border: none;
}
+ }
}
- @media screen and (max-width: 937px) {
- .products-container {
- max-width: 596px;
+ &__name-container {
+ width: 100%;
+ display: flex;
+ align-items: flex-start;
+ margin-top: 8px;
- &__filters-container {
- flex-direction: column-reverse;
- gap: 8px;
- }
- }
+ p {
+ font-size: 18px;
+ font-weight: 600;
+ width: 100%;
+ margin-bottom: 6px;
+ }
}
- @media screen and (max-width: 631px) {
- .products-container {
- max-width: 400px;
-
- &__item {
- width: 100%;
- }
- }
+ &__add-to-cart {
+ padding: 8px 26px;
+ background: var(--orange-main);
+ border: none;
+ border-radius: 1.125rem;
+ color: #fff;
}
- // @media screen and (max-width: 631px) {
- // .products-container {
- // // max-width: none;
+ &__item-footer {
+ display: flex;
+ width: 100%;
+ justify-content: space-between;
+ align-items: center;
+ position: absolute;
+ bottom: 0;
- // &__item {
- // width: 100%;
- // }
- // }
- // }
-}
\ No newline at end of file
+ & > span {
+ font-size: 18px;
+ font-weight: 600;
+ }
+ }
+
+ &__product-composition {
+ font-size: 12px;
+ font-weight: 400;
+ line-height: 1.375;
+ }
+ }
+
+ // @media screen and (max-width: 1549px) {
+ // .products-container {
+ // &__items {
+ // max-width: 1208px;
+ // }
+ // &__filters-container {
+ // max-width: 1208px;
+ // }
+ // }
+ // }
+
+ @media screen and (max-width: 1243px) {
+ .products-container {
+ max-width: 902px;
+ }
+ }
+
+ @media screen and (max-width: 937px) {
+ .products-container {
+ max-width: 596px;
+
+ &__filters-container {
+ flex-direction: column-reverse;
+ gap: 8px;
+ }
+ }
+ }
+
+ @media screen and (max-width: 631px) {
+ .products-container {
+ max-width: 400px;
+
+ &__item {
+ width: 100%;
+ }
+ }
+ }
+
+ // @media screen and (max-width: 631px) {
+ // .products-container {
+ // // max-width: none;
+
+ // &__item {
+ // width: 100%;
+ // }
+ // }
+ // }
+}
diff --git a/angular/src/app/pages/products/products.component.ts b/angular/src/app/pages/products/products.component.ts
index b0db22e..6e1687b 100644
--- a/angular/src/app/pages/products/products.component.ts
+++ b/angular/src/app/pages/products/products.component.ts
@@ -130,20 +130,24 @@ export class ProductsComponent implements OnInit {
if (event) {
event.preventDefault()
}
+ const productModalWidth = product.modifiers_group.length ? '94vw' : '50vw'
+ const productModalMaxWidth = product.modifiers_group.length ? '1400px' : '500px'
const ref = this.dialogService.open(ProductModalComponent, {
header: product.name,
- width: 'auto',
+ width: 'fit-content',
style: {
- 'max-width': '90vw',
+ 'max-width': productModalMaxWidth,
+ 'min-width': '300px',
'max-height': '90vh',
- 'border-radius': '1.125rem'
+ 'border-radius': '1.125rem',
+ width: productModalWidth
},
contentStyle: {
'max-height': '90vh',
height: 'auto',
- 'max-width': '600px',
overflow: 'auto',
},
+ styleClass: 'product-modal-view',
data: {
product: product,
modifiersGroups: this.modifiersGroups,
diff --git a/angular/src/styles.scss b/angular/src/styles.scss
index 7dfca5e..1365f4f 100644
--- a/angular/src/styles.scss
+++ b/angular/src/styles.scss
@@ -16,12 +16,14 @@ blockquote,q{quotes:none}
blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}
table{border-collapse:collapse;border-spacing:0}
+:root {
+ --orange-main: #C43F00;
+}
+
* {
font-family: 'Raleway', sans-serif;
}
-$base_color: red;
-
.p-inputtext {
width: 100%;
border: 1px solid #B8DEFF;
@@ -71,11 +73,11 @@ button {
.p-toast-message-custom {
background-color: #fff;
- border: solid #09467F;
+ border: solid var(--orange-main);
border-width: 0 0 0 6px;
color: #000;
.p-toast-icon-close {
- color: #09467F;
+ color: var(--orange-main);
}
}
@@ -197,6 +199,31 @@ p-toast[key="c"] .p-toast {
}
}
+@media screen and (max-width: 1070px) {
+ .product-modal-view {
+ width: 50vw !important;
+ }
+}
+
+@media screen and (max-width: 800px) {
+ .product-modal-view {
+ width: 70vw !important;
+ }
+}
+
+@media screen and (max-width: 600px) {
+ .product-modal-view {
+ width: 80vw !important;
+ }
+}
+
+@media screen and (max-width: 450px) {
+ .product-modal-view {
+ width: 94vw !important;
+ }
+}
+
+
.p-calendar {
width: 100%;