style changes

This commit is contained in:
sdarbinyan
2026-02-14 02:34:11 +04:00
parent 751ad48489
commit 4238d59fc6
20 changed files with 1448 additions and 1032 deletions

View File

@@ -1,7 +1,8 @@
.category-container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
padding: 24px;
font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.error,
@@ -14,42 +15,54 @@
flex-direction: column;
align-items: center;
justify-content: center;
color: #697777;
font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.error button {
margin-top: 20px;
padding: 10px 24px;
background: var(--primary-color);
background: #497671;
color: white;
border: none;
border-radius: 6px;
border-radius: 8px;
cursor: pointer;
font-size: 1rem;
font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
font-weight: 500;
transition: all 0.2s ease;
&:hover {
background: var(--primary-hover);
background: #3a5f5b;
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(73, 118, 113, 0.3);
}
}
.items-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
gap: 24px;
grid-template-columns: repeat(4, 1fr);
gap: 30px;
margin-bottom: 40px;
width: 100%;
}
.item-card {
background: white;
border-radius: 12px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
overflow: hidden;
transition: transform 0.2s, box-shadow 0.2s;
width: 100%;
display: flex;
flex-direction: column;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
&:hover {
transform: translateY(-4px);
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
.item-image {
box-shadow: 0 6px 8px 0 rgba(0, 0, 0, 0.2);
}
.item-details {
box-shadow: 0 6px 8px 0 rgba(0, 0, 0, 0.2);
}
}
}
@@ -64,27 +77,27 @@
.item-image {
position: relative;
width: 100%;
padding-top: 75%; // 4:3 aspect ratio
background: #f5f5f5;
aspect-ratio: 4 / 3;
border: 1px solid #d3dad9;
border-radius: 13px 13px 0 0;
box-shadow: 0 3px 4px 0 rgba(0, 0, 0, 0.15);
overflow: hidden;
border-radius: 12px;
display: flex;
align-items: center;
justify-content: center;
background: #f5f5f5;
img {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: contain;
background: white;
padding: 12px;
transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), filter 0.4s ease;
filter: drop-shadow(0 2px 6px rgba(0,0,0,0.06));
transition: transform 0.3s ease;
}
&:hover img {
transform: scale(1.06) translateY(-2px);
filter: drop-shadow(0 12px 24px rgba(0,0,0,0.15)) brightness(1.03);
transform: scale(1.05);
}
}
@@ -98,33 +111,47 @@
border-radius: 20px;
font-weight: 600;
font-size: 0.9rem;
font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
z-index: 1;
}
.item-details {
padding: 16px;
width: 100%;
border: 1px solid #d3dad9;
border-top: none;
border-radius: 0 0 13px 13px;
padding: 12px 16px;
box-shadow: 0 3px 4px 0 rgba(0, 0, 0, 0.15);
background: #f5f3f9;
flex: 1;
display: flex;
flex-direction: column;
gap: 8px;
gap: 6px;
transition: background 0.3s ease;
}
.item-name {
font-size: 1.1rem;
font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
font-weight: 600;
font-size: clamp(14px, 1.4vw, 18px);
color: #1e3c38;
margin: 0;
color: #333;
line-height: 1.3;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
min-height: calc(2 * 1.3em);
}
.item-rating {
display: flex;
align-items: center;
gap: 8px;
font-size: 0.9rem;
color: #333;
gap: 6px;
font-size: 0.85rem;
color: #697777;
font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
.rating-stars {
color: #ffa502;
@@ -142,15 +169,17 @@
.original-price {
text-decoration: line-through;
color: #555;
font-size: 0.9rem;
color: #697777;
font-size: 0.85rem;
font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.discounted-price,
.current-price {
font-size: 1.3rem;
font-size: clamp(16px, 1.6vw, 22px);
font-weight: 700;
color: var(--primary-color);
color: #497671;
font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.item-stock {
@@ -162,16 +191,16 @@
.bar-segment {
width: 20px;
height: 6px;
background: #e0e0e0;
background: #d3dad9;
border-radius: 3px;
transition: background 0.2s;
&.filled.high {
background: #2ed573;
background: #497671;
}
&.filled.medium {
background: #ffa502;
background: #a1b4b5;
}
&.filled.low {
@@ -184,16 +213,19 @@
.add-to-cart-btn {
width: 100%;
padding: 12px;
background: var(--primary-color);
background: #497671;
color: white;
border: none;
font-size: 1rem;
border-radius: 0 0 13px 13px;
font-size: 0.95rem;
font-weight: 600;
font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
cursor: pointer;
transition: background 0.2s;
transition: all 0.2s ease;
margin-top: -1px;
&:hover {
background: var(--primary-hover);
background: #3a5f5b;
}
&:active {
@@ -209,8 +241,8 @@
.spinner {
width: 40px;
height: 40px;
border: 4px solid #f3f3f3;
border-top: 4px solid var(--primary-color);
border: 4px solid #d3dad9;
border-top: 4px solid #497671;
border-radius: 50%;
animation: spin 1s linear infinite;
margin: 0 auto 12px;
@@ -222,22 +254,65 @@
}
.no-more {
color: #555;
color: #697777;
padding: 40px 20px;
}
// Responsive
@media (max-width: 1200px) {
.items-grid {
grid-template-columns: repeat(3, 1fr);
gap: 24px;
}
}
@media (max-width: 992px) {
.items-grid {
grid-template-columns: repeat(3, 1fr);
gap: 20px;
}
}
@media (max-width: 768px) {
.items-grid {
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
grid-template-columns: repeat(2, 1fr);
gap: 16px;
}
.item-name {
font-size: 0.95rem;
font-size: clamp(12px, 3vw, 16px);
}
.discounted-price,
.current-price {
font-size: 1.1rem;
font-size: clamp(14px, 3.5vw, 18px);
}
.item-details {
padding: 10px 12px;
}
}
@media (max-width: 480px) {
.category-container {
padding: 12px;
}
.items-grid {
grid-template-columns: repeat(2, 1fr);
gap: 12px;
}
.item-details {
padding: 8px 10px;
}
.item-card:hover {
transform: translateY(-2px);
}
.add-to-cart-btn {
padding: 10px;
font-size: 0.85rem;
}
}

View File

@@ -20,18 +20,18 @@
<div class="categories-grid">
@for (cat of subcategories(); track trackByCategoryId($index, cat)) {
<div class="category-card">
<a [routerLink]="['/category', cat.categoryID]" class="category-link">
<div class="category-media">
@if (cat.icon) {
<img [src]="cat.icon" [alt]="cat.name" loading="lazy" decoding="async" />
} @else {
<div class="category-fallback">{{ cat.name }}</div>
}
</div>
<h3>{{ cat.name }}</h3>
</a>
</div>
<a [routerLink]="['/category', cat.categoryID]" class="category-card">
<div class="category-image">
@if (cat.icon) {
<img [src]="cat.icon" [alt]="cat.name" loading="lazy" decoding="async" />
} @else {
<div class="category-fallback">{{ cat.name.charAt(0) }}</div>
}
</div>
<div class="category-info">
<h3 class="category-name">{{ cat.name }}</h3>
</div>
</a>
}
</div>
}

View File

@@ -1,9 +1,9 @@
.subcategories-container {
max-width: 1100px;
max-width: 1200px;
margin: 0 auto;
padding: 24px;
// Loading состояние
// Loading state
.loading {
display: flex;
flex-direction: column;
@@ -15,20 +15,21 @@
.spinner {
width: 48px;
height: 48px;
border: 4px solid #f3f4f6;
border-top-color: #3b82f6;
border: 4px solid #d3dad9;
border-top-color: #497671;
border-radius: 50%;
animation: spin 0.8s linear infinite;
}
p {
color: #6b7280;
color: #697777;
font-size: 1rem;
font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
margin: 0;
}
}
// Error состояние
// Error state
.error {
display: flex;
flex-direction: column;
@@ -41,25 +42,27 @@
p {
color: #dc2626;
font-size: 1rem;
font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
text-align: center;
margin: 0;
}
button {
padding: 10px 24px;
background: #3b82f6;
background: #497671;
color: white;
border: none;
border-radius: 8px;
font-size: 0.95rem;
font-weight: 500;
font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
cursor: pointer;
transition: all 0.2s ease;
&:hover {
background: #2563eb;
background: #3a5f5b;
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
box-shadow: 0 4px 12px rgba(73, 118, 113, 0.3);
}
&:active {
@@ -69,144 +72,134 @@
}
.sub-header {
margin-bottom: 24px;
position: relative;
padding-bottom: 12px;
&::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
width: 60px;
height: 3px;
background: linear-gradient(90deg, #3b82f6, #8b5cf6);
border-radius: 2px;
}
margin-bottom: 28px;
h2 {
font-size: 1.75rem;
color: #1f2937;
font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
font-size: 2rem;
color: #1e3c38;
margin: 0;
font-weight: 600;
font-weight: 700;
letter-spacing: -0.02em;
}
}
.categories-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
gap: 20px;
grid-template-columns: repeat(4, 1fr);
gap: 30px;
width: 100%;
}
.category-card {
background: white;
border-radius: 12px;
box-shadow: 0 2px 8px rgba(0,0,0,0.06);
height: 100%;
width: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
transition: all 0.3s ease;
animation: fadeInUp 0.5s ease backwards;
cursor: pointer;
// Анимация появления с задержкой для каждой карточки
@for $i from 1 through 20 {
&:nth-child(#{$i}) {
animation-delay: #{$i * 0.05}s;
}
}
text-decoration: none;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
&:hover {
transform: translateY(-4px);
box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}
.category-link {
display: flex;
flex-direction: column;
flex: 1;
text-decoration: none;
color: inherit;
position: relative;
min-height: 200px;
.category-media {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
background: linear-gradient(135deg, #f6f7fb 0%, #e9ecf5 100%);
transition: transform 0.3s ease;
.category-image {
box-shadow: 0 6px 8px 0 rgba(0, 0, 0, 0.2);
}
&:hover .category-media {
transform: scale(1.05);
}
.category-media img {
width: 100%;
height: 100%;
object-fit: contain;
background: white;
transition: opacity 0.3s ease;
}
.category-fallback {
text-align: center;
font-weight: 600;
font-size: 1.1rem;
padding: 20px;
color: #6b7280;
}
h3 {
position: absolute;
bottom: 0;
left: 0;
right: 0;
text-align: center;
margin: 0;
font-size: 0.95rem;
color: white;
padding: 12px 14px;
background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.4) 70%, transparent);
z-index: 1;
font-weight: 500;
transition: all 0.3s ease;
text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
&:hover h3 {
padding: 16px 14px;
background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.5) 70%, transparent);
.category-info {
box-shadow: 0 6px 8px 0 rgba(0, 0, 0, 0.2);
}
}
}
// Keyframes для анимаций
.category-image {
width: 100%;
aspect-ratio: 4 / 3;
border: 1px solid #d3dad9;
border-radius: 13px 13px 0 0;
box-shadow: 0 3px 4px 0 rgba(0, 0, 0, 0.15);
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
background: #f5f5f5;
img {
width: 100%;
height: 100%;
object-fit: cover;
transition: transform 0.3s ease;
}
&:hover img {
transform: scale(1.05);
}
}
.category-fallback {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
font-size: 5rem;
font-weight: 700;
color: #497671;
font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
}
.category-info {
width: 100%;
border: 1px solid #d3dad9;
border-top: none;
border-radius: 0 0 13px 13px;
padding: 12px 16px;
box-shadow: 0 3px 4px 0 rgba(0, 0, 0, 0.15);
background: #f5f3f9;
display: flex;
flex-direction: column;
justify-content: center;
gap: 2px;
transition: background 0.3s ease;
}
.category-name {
font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
font-weight: 600;
font-size: clamp(14px, 1.4vw, 18px);
color: #1e3c38;
margin: 0;
line-height: 1.3;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
min-height: calc(2 * 1.3em);
}
// Keyframes
@keyframes spin {
to { transform: rotate(360deg); }
}
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
// Responsive
@media (max-width: 1200px) {
padding: 24px;
.categories-grid {
grid-template-columns: repeat(3, 1fr);
gap: 24px;
}
}
@media (max-width: 992px) {
.categories-grid {
grid-template-columns: repeat(3, 1fr);
gap: 20px;
}
}
// Мобильная версия
@media (max-width: 768px) {
padding: 16px;
@@ -220,24 +213,14 @@
.categories-grid {
grid-template-columns: repeat(2, 1fr);
gap: 12px;
gap: 16px;
}
.category-card {
border-radius: 10px;
.category-link {
min-height: 140px;
h3 {
font-size: 0.85rem;
padding: 10px 8px;
}
}
.category-info {
padding: 10px 12px;
}
}
// Очень маленькие экраны
@media (max-width: 480px) {
padding: 12px;
@@ -250,52 +233,16 @@
}
.categories-grid {
gap: 10px;
grid-template-columns: repeat(2, 1fr);
gap: 12px;
}
.category-card {
.category-link {
min-height: 120px;
h3 {
font-size: 0.8rem;
padding: 8px 6px;
}
.category-fallback {
font-size: 0.95rem;
padding: 12px;
}
}
}
}
// Большие экраны
@media (min-width: 1200px) {
padding: 32px;
.sub-header {
margin-bottom: 28px;
h2 {
font-size: 2rem;
}
.category-info {
padding: 8px 10px;
}
.categories-grid {
gap: 24px;
grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.category-card {
.category-link {
min-height: 220px;
h3 {
font-size: 1rem;
padding: 14px 16px;
}
}
.category-card:hover {
transform: translateY(-2px);
}
}
}