Новые изменения в файлах
This commit is contained in:
parent
9100de28a4
commit
28f41cf346
4 changed files with 15 additions and 14 deletions
|
|
@ -24,7 +24,7 @@ const {
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
<h3 class="lock-title">{title}</h3>
|
<h3 class="lock-title">{title}</h3>
|
||||||
<p class="lock-text" style:display={description ? 'block' : 'none'}>{description}</p>
|
<p class="lock-text" style={`display: ${description ? 'block' : 'none'}`}>{description}</p>
|
||||||
<a href={buttonHref} class="auth-button">{buttonText}</a>
|
<a href={buttonHref} class="auth-button">{buttonText}</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@ const { initialLikes = 0, initialDislikes = 0, postId } = Astro.props;
|
||||||
} else {
|
} else {
|
||||||
if (userAction === 'dislike') {
|
if (userAction === 'dislike') {
|
||||||
dislikes--;
|
dislikes--;
|
||||||
dislikeBtn.classList.remove('active');
|
dislikeBtn?.classList.remove('active');
|
||||||
}
|
}
|
||||||
likes++;
|
likes++;
|
||||||
userAction = 'like';
|
userAction = 'like';
|
||||||
|
|
@ -126,7 +126,7 @@ const { initialLikes = 0, initialDislikes = 0, postId } = Astro.props;
|
||||||
} else {
|
} else {
|
||||||
if (userAction === 'like') {
|
if (userAction === 'like') {
|
||||||
likes--;
|
likes--;
|
||||||
likeBtn.classList.remove('active');
|
likeBtn?.classList.remove('active');
|
||||||
}
|
}
|
||||||
dislikes++;
|
dislikes++;
|
||||||
userAction = 'dislike';
|
userAction = 'dislike';
|
||||||
|
|
|
||||||
|
|
@ -182,17 +182,18 @@ const categories = ['Все', ...new Set(posts.map((post: any) => post.data.cate
|
||||||
// Фильтруем карточки
|
// Фильтруем карточки
|
||||||
cards.forEach((card) => {
|
cards.forEach((card) => {
|
||||||
const cardCategory = card.getAttribute('data-category');
|
const cardCategory = card.getAttribute('data-category');
|
||||||
|
const el = card as HTMLElement;
|
||||||
if (category === 'Все' || cardCategory === category) {
|
if (category === 'Все' || cardCategory === category) {
|
||||||
card.style.display = '';
|
el.style.display = '';
|
||||||
card.style.opacity = '0';
|
el.style.opacity = '0';
|
||||||
card.style.transform = 'translateY(20px)';
|
el.style.transform = 'translateY(20px)';
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
card.style.transition = 'opacity 0.4s ease, transform 0.4s ease';
|
el.style.transition = 'opacity 0.4s ease, transform 0.4s ease';
|
||||||
card.style.opacity = '1';
|
el.style.opacity = '1';
|
||||||
card.style.transform = 'translateY(0)';
|
el.style.transform = 'translateY(0)';
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
card.style.display = 'none';
|
el.style.display = 'none';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
import Layout from '@layouts/Layout.astro';
|
import Layout from '@layouts/Layout.astro';
|
||||||
import { SITE_URL } from '@constants';
|
import { SITE_URL } from '@constants';
|
||||||
import PageHero from '@components/base/PageHero.astro';
|
import PageHero from '@components/base/PageHero.astro';
|
||||||
import Faq from '@components/faq/FaqItem.astro';
|
import FaqSection from '@components/faq/FaqItem.astro';
|
||||||
import Pagination from '@components/base/Pagination.astro';
|
import PaginationComp from '@components/base/Pagination.astro';
|
||||||
|
|
||||||
const ITEMS_PER_PAGE = 10;
|
const ITEMS_PER_PAGE = 10;
|
||||||
|
|
||||||
|
|
@ -120,14 +120,14 @@ const currentFaqItems = allFaqItems.slice(startIndex, endIndex);
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<section class="faq-page-section">
|
<section class="faq-page-section">
|
||||||
<Faq
|
<FaqSection
|
||||||
faqItems={currentFaqItems}
|
faqItems={currentFaqItems}
|
||||||
showTitle={false}
|
showTitle={false}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{totalPages > 1 && (
|
{totalPages > 1 && (
|
||||||
<div class="site-container">
|
<div class="site-container">
|
||||||
<Pagination
|
<PaginationComp
|
||||||
currentPage={validPage}
|
currentPage={validPage}
|
||||||
totalPages={totalPages}
|
totalPages={totalPages}
|
||||||
baseUrl="/faq"
|
baseUrl="/faq"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue