From 8550e6ecc5cf1dd64e6cd76c7fb798446dc986c4 Mon Sep 17 00:00:00 2001 From: albivkt Date: Sun, 6 Jul 2025 19:09:22 +0300 Subject: [PATCH] Enhance responsiveness and layout across multiple components: Added new screen sizes in Tailwind configuration, improved padding and margins in various sections, and updated styles for better mobile compatibility. Adjusted header and footer designs for improved user experience. --- public/styles/global.css | 270 +++++++++++++++++- src/components/About.astro | 28 +- src/components/Breadcrumbs.astro | 2 +- src/components/FloatingFAQ.astro | 44 +-- src/components/Footer.astro | 58 ++-- src/components/Header.astro | 61 ++-- src/components/Hero.astro | 70 ++--- src/components/InfoSection.astro | 90 +++--- src/components/Products.astro | 44 +-- src/components/Up.astro | 4 +- src/layouts/Layout.astro | 2 +- src/pages/404.astro | 2 +- src/pages/[slug].astro | 46 +-- .../blog/affinazh-dragocennyh-metallov.astro | 2 +- src/pages/blog/index.astro | 72 ++--- .../platinovye-metally-promyshlennost.astro | 2 +- .../sertifikaciya-kontrolj-kachestva.astro | 2 +- src/pages/cities.astro | 108 +++---- src/pages/faq.astro | 90 +++--- tailwind.config.mjs | 1 + vercel.json | 2 +- 21 files changed, 632 insertions(+), 368 deletions(-) diff --git a/public/styles/global.css b/public/styles/global.css index e88d570..3bd2a6d 100644 --- a/public/styles/global.css +++ b/public/styles/global.css @@ -30,22 +30,276 @@ body { color: #2c2c2c; } +/* Отступы от фиксированного хедера */ +.header-offset { + padding-top: 4rem; /* 64px */ +} + +@media (min-width: 320px) { + .header-offset { + padding-top: 4.5rem; /* 72px */ + } +} + +@media (min-width: 480px) { + .header-offset { + padding-top: 5rem; /* 80px */ + } +} + +@media (min-width: 640px) { + .header-offset { + padding-top: 5.5rem; /* 88px */ + } +} + +@media (min-width: 768px) { + .header-offset { + padding-top: 6rem; /* 96px */ + } +} + +@media (min-width: 1024px) { + .header-offset { + padding-top: 7rem; /* 112px */ + } +} + +/* Планшетные стили */ +@media (min-width: 768px) and (max-width: 1023px) { + /* Оптимизация для планшетов */ + .tablet-grid { + grid-template-columns: repeat(2, 1fr); + } + + .tablet-text-lg { + font-size: 1.125rem; + } + + .tablet-p-6 { + padding: 1.5rem; + } + + .tablet-gap-6 { + gap: 1.5rem; + } + + /* Увеличиваем размер кликабельных элементов для планшетов */ + .tablet-touch-target { + min-height: 48px; + min-width: 48px; + } +} + +/* Портретная ориентация планшетов */ +@media (min-width: 768px) and (max-width: 1023px) and (orientation: portrait) { + .tablet-portrait-stack { + flex-direction: column; + } + + .tablet-portrait-full { + width: 100%; + } + + .tablet-portrait-center { + text-align: center; + } +} + +/* Альбомная ориентация планшетов */ +@media (min-width: 768px) and (max-width: 1023px) and (orientation: landscape) { + .tablet-landscape-grid { + grid-template-columns: repeat(3, 1fr); + } + + .tablet-landscape-flex { + display: flex; + align-items: center; + } +} + +/* Ноутбучные стили */ +@media (min-width: 1024px) and (max-width: 1439px) { + /* Оптимизация для ноутбуков */ + .laptop-grid { + grid-template-columns: repeat(3, 1fr); + } + + .laptop-text-xl { + font-size: 1.25rem; + } + + .laptop-p-8 { + padding: 2rem; + } + + .laptop-gap-8 { + gap: 2rem; + } + + /* Компактные отступы для ноутбуков */ + .laptop-compact { + padding: 1rem 2rem; + } + + .laptop-sidebar { + width: 280px; + } +} + +/* Оптимизация для touch-устройств */ +@media (hover: none) and (pointer: coarse) { + /* Увеличиваем размер кликабельных элементов */ + button, + .btn, + a[role="button"], + input[type="button"], + input[type="submit"] { + min-height: 44px; + min-width: 44px; + padding: 12px 16px; + } + + /* Убираем hover эффекты для touch-устройств */ + .hover\:scale-105:hover { + transform: none; + } + + /* Добавляем активные состояния для touch */ + .touch-active:active { + transform: scale(0.95); + transition: transform 0.1s ease; + } +} + +/* Улучшенная прокрутка для планшетов */ +@media (min-width: 768px) and (max-width: 1023px) { + .scroll-smooth { + scroll-behavior: smooth; + } + + /* Скрываем скроллбары на планшетах для более чистого вида */ + .hide-scrollbar { + -ms-overflow-style: none; + scrollbar-width: none; + } + + .hide-scrollbar::-webkit-scrollbar { + display: none; + } +} + +/* Адаптивная типографика */ +@media (min-width: 768px) and (max-width: 1023px) { + .responsive-text-sm { + font-size: 0.875rem; + } + + .responsive-text-base { + font-size: 1rem; + } + + .responsive-text-lg { + font-size: 1.125rem; + } + + .responsive-text-xl { + font-size: 1.25rem; + } + + .responsive-text-2xl { + font-size: 1.5rem; + } +} + +@media (min-width: 1024px) and (max-width: 1439px) { + .responsive-text-sm { + font-size: 0.875rem; + } + + .responsive-text-base { + font-size: 1rem; + } + + .responsive-text-lg { + font-size: 1.125rem; + } + + .responsive-text-xl { + font-size: 1.25rem; + } + + .responsive-text-2xl { + font-size: 1.5rem; + } + + .responsive-text-3xl { + font-size: 1.875rem; + } +} + /* Кастомные стили */ .social-icon { - transition: - transform 0.3s ease, - color 0.3s ease; + transition: transform 0.3s ease, opacity 0.3s ease; } .social-icon:hover { transform: scale(1.1); - color: #facc15; + opacity: 0.8; } -.social-icon img { - transition: filter 0.3s ease; +/* Анимации */ +@keyframes fadeIn { + from { + opacity: 0; + transform: translateY(20px); + } + to { + opacity: 1; + transform: translateY(0); + } } -.social-icon:hover img { - filter: brightness(1.2) saturate(1.2); +.fade-in { + animation: fadeIn 0.6s ease-out; +} + +/* Специальные стили для модальных окон на планшетах */ +@media (min-width: 768px) and (max-width: 1023px) { + .modal-tablet { + max-width: 90vw; + max-height: 90vh; + } + + .modal-tablet .modal-content { + padding: 2rem; + } + + .modal-tablet .modal-header { + font-size: 1.5rem; + } + + .modal-tablet .modal-text { + font-size: 1rem; + } +} + +/* Специальные стили для модальных окон на ноутбуках */ +@media (min-width: 1024px) and (max-width: 1439px) { + .modal-laptop { + max-width: 80vw; + max-height: 85vh; + } + + .modal-laptop .modal-content { + padding: 2.5rem; + } + + .modal-laptop .modal-header { + font-size: 1.75rem; + } + + .modal-laptop .modal-text { + font-size: 1.125rem; + } } diff --git a/src/components/About.astro b/src/components/About.astro index de6d2bc..11ea700 100644 --- a/src/components/About.astro +++ b/src/components/About.astro @@ -14,37 +14,37 @@ const about = {
-
-
+
+
-
+

{about.title}

-
-

{about.paragraph1}

+
+

{about.paragraph1}

-
- - + -
+
{ about.imageUrls.map((imageUrl, index) => ( -
+
{`О + -
+ +
+ + + diff --git a/src/components/Hero.astro b/src/components/Hero.astro index 6020773..38b925c 100644 --- a/src/components/Hero.astro +++ b/src/components/Hero.astro @@ -1,5 +1,5 @@
@@ -7,30 +7,30 @@
-
-
+
+
-
+

Драгоценные металлы высшей пробы

-

+

ООО «ДМДК» — ведущий поставщик аффинированных драгоценных металлов. Блеск и надежность в каждом грамме.

-
+
-
-
-
15+
-
лет опыта
+
+
+
15+
+
лет опыта
-
-
99.9%
-
чистота металлов
+
+
99.9%
+
чистота металлов
-
-
50+
-
городов
+
+
50+
+
городов
-
-
24/7
-
поддержка
+
+
24/7
+
поддержка
- -
-
-
Листай ниже
-
- - - -
-
-
+
diff --git a/src/components/InfoSection.astro b/src/components/InfoSection.astro index cfcb277..cc40302 100644 --- a/src/components/InfoSection.astro +++ b/src/components/InfoSection.astro @@ -2,39 +2,39 @@ // Компонент информационного блока с ссылками на важные страницы --- -
+
-
-
-
+
+
+
-
-
-

+
+
+

Экспертиза и сервис

-

+

Профессиональная поддержка, экспертные знания и комплексные решения для вашего бизнеса

-
+
-
-
+
+
-
- +
+
-

Экспертный блог

-

Глубокие знания о драгоценных металлах, технологиях аффинажа и рыночных тенденциях

- +

Экспертный блог

+

Глубокие знания о драгоценных металлах, технологиях аффинажа и рыночных тенденциях

+
Читать статьи - + @@ -42,19 +42,19 @@
-
-
+
+
-
- +
+
-

Вопросы и ответы

-

Исчерпывающие ответы на вопросы о продукции, сотрудничестве и технических решениях

- +

Вопросы и ответы

+

Исчерпывающие ответы на вопросы о продукции, сотрудничестве и технических решениях

+
Найти ответы - + @@ -62,20 +62,20 @@
-
-
+
+
-
- +
+
-

Региональная сеть

-

Широкая география присутствия, надежная логистика и локальная поддержка клиентов

- +

Региональная сеть

+

Широкая география присутствия, надежная логистика и локальная поддержка клиентов

+
География работы - + @@ -83,19 +83,19 @@
-
-
+
+
-
- +
+
-

Документооборот

-

Полная юридическая информация, реквизиты и документы для ведения бизнеса

- +

Документооборот

+

Полная юридическая информация, реквизиты и документы для ведения бизнеса

+
Документы - + @@ -104,12 +104,12 @@
-
-
- +
+
+ - Профессиональная поддержка 24/7 + Профессиональная поддержка 24/7
diff --git a/src/components/Products.astro b/src/components/Products.astro index b9ba63b..2b951f5 100644 --- a/src/components/Products.astro +++ b/src/components/Products.astro @@ -20,7 +20,7 @@ const categories = }`); --- -
+
@@ -30,56 +30,56 @@ const categories =

ПРОДУКЦИЯ

-
+
{ categories.map((category, index) => (
-
2 ? 'grid grid-cols-2 gap-1 max-w-[80px]' : 'flex flex-col space-y-2 max-w-[70px]'}`}> +
2 ? 'grid grid-cols-2 gap-1 max-w-[70px] xs:max-w-[80px]' : 'flex flex-col space-y-1.5 xs:space-y-2 max-w-[60px] xs:max-w-[70px]'}`}> {category.elements.map((element, idx) => (
2 ? 'w-9 h-9' : 'w-14 h-14'}`} + class={`relative flex flex-col items-center justify-center rounded-lg text-white font-bold shadow-lg backdrop-blur-sm border border-white/20 shrink-0 ${category.elements.length > 2 ? 'w-8 h-8 xs:w-9 xs:h-9' : 'w-12 h-12 xs:w-14 xs:h-14'}`} style={`background: linear-gradient(135deg, ${category.color}ee, ${category.color}aa);`} > 2 ? 'text-xs' : 'text-sm'}>{element.element} - 2 ? 'text-[10px]' : 'text-xs'}`}> + 2 ? 'text-[9px] xs:text-[10px]' : 'text-xs'}`}> {element.elementNumber}
))}
-
-
-

+
+
+

{category.title.toUpperCase()}

-