diff --git a/src/components/ColonPost.astro b/src/components/ColonPost.astro index 715e286..ee922db 100644 --- a/src/components/ColonPost.astro +++ b/src/components/ColonPost.astro @@ -3,183 +3,189 @@ import { getLatestColonPost } from '@lib/api/colon-posts'; import Author from '@components/AuthorDisplay.astro'; const colonPost = await getLatestColonPost(); - --- {colonPost && (
-
-
- {colonPost.featuredImage?.node?.sourceUrl && ( - +
+ +
+ {colonPost.featuredImage?.node?.sourceUrl ? ( + {colonPost.featuredImage.node.altText + ) : ( +
)} - -
- -
- -

{colonPost.secondaryTitle || colonPost.title}

-
+ + +
+
+ + +

{colonPost.secondaryTitle || colonPost.title}

+
+ + +
+ {new Date(colonPost.date).toLocaleDateString('ru-RU')} + | + +
+
)} + + + /* Если нужно точное соответствие макету, можно добавить медиа-запросы под свои нужды */ + \ No newline at end of file diff --git a/src/components/EndnewsList.astro b/src/components/EndnewsList.astro index cc41e2c..c9a9591 100644 --- a/src/components/EndnewsList.astro +++ b/src/components/EndnewsList.astro @@ -2,7 +2,6 @@ import { getLatestAnews } from '../lib/api/posts.js'; import { fetchWPRestGet } from "@/lib/api/wp-rest-get-client"; - // Даты/время function formatDate(dateString: string): string { const date = new Date(dateString); @@ -51,118 +50,129 @@ const hasNews = newsPosts.length > 0; const hasTop = topPosts.length > 0; // По умолчанию открываем вкладку, где есть данные -const defaultTab: "news" | "top" = hasTop ? "top" : "news"; +const defaultTab: "news" | "top" = hasNews ? "news" : "top"; --- {(hasNews || hasTop) && ( -
-
-

Новости

-
- - {/* Radio-кнопки ВНЕ .endnews-tabs для работы CSS-селекторов */} - - - - {/* Только labels в блоке табов */} +
+ {/* Табы на всю ширину, каждый по 50% - теперь div'ы */}
- - +
Новости
+
Топ‑10
- {/* Контент: две панели, показываем нужную через :checked */} + {/* Контент: две панели */}
-
+
{Object.entries(groupedNews).map(([dateKey, datePosts]) => (
{formatDate(dateKey + 'T00:00:00')}
- - {datePosts.map((post) => ( - - ))} + + {/* Переделано в ul > li */} +
    + {datePosts.map((post) => ( +
  • +
    {formatTime(post.date)}
    + +
  • + ))} +
))}
-
- {topPosts.map((post, i) => ( - - ))} - - {!hasTop &&
Топ пока пуст
} +
+ {topPosts.length > 0 ? ( + + ) : ( +
Топ пока пуст
+ )}
)} + + - + \ No newline at end of file diff --git a/src/components/MainMenu.astro b/src/components/MainMenu.astro index 6bc6c61..13b6dff 100644 --- a/src/components/MainMenu.astro +++ b/src/components/MainMenu.astro @@ -17,24 +17,41 @@ if (!menu) { --- @@ -43,16 +60,88 @@ if (!menu) { + + \ No newline at end of file diff --git a/src/components/MainPostWidget.astro b/src/components/MainPostWidget.astro index c88f5ea..2c8eb0d 100644 --- a/src/components/MainPostWidget.astro +++ b/src/components/MainPostWidget.astro @@ -136,7 +136,7 @@ const formattedDate = postDate.toLocaleDateString('ru-RU', { left: 16px; padding: 6px 12px; border-radius: 4px; - font-size: 0.75rem; + font-size: 0.625rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; @@ -164,7 +164,7 @@ const formattedDate = postDate.toLocaleDateString('ru-RU', { .title-overlay { margin: 0 0 12px 0; - font-size: 1.5rem; + font-size: 1.4rem; font-weight: 700; line-height: 1.3; } @@ -182,7 +182,6 @@ const formattedDate = postDate.toLocaleDateString('ru-RU', { .author-overlay { font-size: 0.875rem; opacity: 0.9; - font-style: italic; } /* Адаптивность */ diff --git a/src/components/NewsSingle.astro b/src/components/NewsSingle.astro index f1cf3b9..31bec31 100644 --- a/src/components/NewsSingle.astro +++ b/src/components/NewsSingle.astro @@ -1,4 +1,8 @@ --- +import { stripHtml } from '@/utils/htmlhelpers'; +import Author from '@components/AuthorDisplay.astro'; +import Subscribe from '@components/SubscribePost.astro'; +import ShareButtons from '@components/ShareButtons.astro'; interface Props { post: any; @@ -6,18 +10,114 @@ interface Props { } const { post, pageInfo } = Astro.props; - --- {post ? ( -
-

{post.title}

-
- {post.date && } -
- {post.content &&
} -
+
+
+ +

{post.title}

+ {post.secondaryTitle &&

{post.secondaryTitle}

} + + {post.featuredImage?.node?.sourceUrl && ( + + )} + + {post.content &&
} +
+ + + + +
) : (
Новость не найдена
)} + diff --git a/src/components/SubscribePost.astro b/src/components/SubscribePost.astro new file mode 100644 index 0000000..3dc65a8 --- /dev/null +++ b/src/components/SubscribePost.astro @@ -0,0 +1,10 @@ +--- + +--- +
+ +

+ Читайте на смартфоне наши Telegram-каналы: Профиль-News, и журнал Профиль. Скачивайте полностью бесплатное мобильное приложение журнала "Профиль". +

+ +
diff --git a/src/layouts/MainLayout.astro b/src/layouts/MainLayout.astro index ddb78b2..cd844f4 100644 --- a/src/layouts/MainLayout.astro +++ b/src/layouts/MainLayout.astro @@ -3,6 +3,7 @@ const { title, description } = Astro.props; import Header from '../components/Header/Header.astro'; +import Header_lite from '../components/Header/Header_lite.astro'; import CurrentDate from '../components/Header/CurrentDate.astro'; import Footer from '../components/Footer.astro'; @@ -34,7 +35,7 @@ import '../styles/global.css';