From 7d4289bd9e51e158dae9320f661bb8a866f5454a Mon Sep 17 00:00:00 2001 From: Web-serfer Date: Tue, 7 Apr 2026 20:53:26 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD=D0=B0=20?= =?UTF-8?q?=D1=84=D0=BE=D1=80=D0=BC=D0=B0=20=D0=BF=D0=BE=D0=B8=D1=81=D0=BA?= =?UTF-8?q?=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/base/SearchModal.astro | 385 +++++++++++------- .../src/components/blog/BlogCategories.astro | 121 ++++-- frontend/src/pages/blog/index.astro | 62 +-- 3 files changed, 353 insertions(+), 215 deletions(-) diff --git a/frontend/src/components/base/SearchModal.astro b/frontend/src/components/base/SearchModal.astro index 4bc6972..966274a 100644 --- a/frontend/src/components/base/SearchModal.astro +++ b/frontend/src/components/base/SearchModal.astro @@ -1,5 +1,18 @@ --- -const title = 'Поиск статей'; +import { blogPosts } from '@data/blogData'; + +const title = 'Поиск по статьям'; + +const searchData = blogPosts.map(post => ({ + title: post.title, + description: post.description, + slug: post.slug, + category: post.category, + categoryColor: post.categoryColor, + date: post.date +})); + +const postsJson = JSON.stringify(searchData); --- - - + \ No newline at end of file diff --git a/frontend/src/components/blog/BlogCategories.astro b/frontend/src/components/blog/BlogCategories.astro index 339d435..9e181fc 100644 --- a/frontend/src/components/blog/BlogCategories.astro +++ b/frontend/src/components/blog/BlogCategories.astro @@ -7,16 +7,27 @@ export interface Props { const { categories, activeCategory = 'Все' } = Astro.props; --- -
-
- {categories.map((cat) => ( - + ))} +
+ + - ))} +
@@ -26,13 +37,38 @@ const { categories, activeCategory = 'Все' } = Astro.props; background: #f8fafc; } - .categories-wrapper { + .categories-inner { display: flex; - flex-wrap: wrap; - gap: 0.75rem; + align-items: center; justify-content: center; - max-width: 900px; - margin: 0 auto; + gap: 0.75rem; + flex-wrap: wrap; + } + + .categories-wrapper { + display: contents; + } + + .search-icon-btn { + background: #ffffff; + border: 2px solid #e2e8f0; + color: #64748b; + width: 42px; + height: 42px; + border-radius: 2rem; + cursor: pointer; + transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; + } + + .search-icon-btn:hover { + border-color: #d4af37; + color: #d4af37; + transform: translateY(-2px); + box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3); } .category-btn { @@ -87,6 +123,10 @@ const { categories, activeCategory = 'Все' } = Astro.props; } @media (max-width: 640px) { + .categories-inner { + flex-wrap: wrap; + } + .categories-wrapper { gap: 0.5rem; } @@ -99,29 +139,54 @@ const { categories, activeCategory = 'Все' } = Astro.props; diff --git a/frontend/src/pages/blog/index.astro b/frontend/src/pages/blog/index.astro index c4a64d0..26114c1 100644 --- a/frontend/src/pages/blog/index.astro +++ b/frontend/src/pages/blog/index.astro @@ -5,7 +5,6 @@ import BlogHero from '@components/blog/BlogHero.astro'; import BlogCategories from '@components/blog/BlogCategories.astro'; import BlogCard from '@components/blog/BlogCard.astro'; import BlogPagination from '@components/blog/BlogPagination.astro'; -import SearchIcon from '@components/blog/SearchIcon.astro'; import SearchModal from '@components/base/SearchModal.astro'; import { blogPosts, categories } from '@data/blogData'; --- @@ -16,34 +15,26 @@ import { blogPosts, categories } from '@data/blogData'; canonicalLink={`${SITE_URL}/blog`} > - - -
-
-
- -

Нажмите для поиска статей

-
-
-
- +
-
+
{blogPosts.map((post) => ( - +
+ +
))}
@@ -66,28 +57,11 @@ import { blogPosts, categories } from '@data/blogData';
+ + - -