Сайт Fakel Gym
https://fakelgym.cp.good-production.xyz/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
228 lines
17 KiB
228 lines
17 KiB
<?php
|
|
|
|
$id = 'reviews-block-' . $block['id'];
|
|
if (!empty($block['anchor'])) {
|
|
$id = $block['anchor'];
|
|
}
|
|
|
|
$classes = 'block-reviews-block';
|
|
if (!empty($block['className'])) {
|
|
$classes .= ' ' . $block['className'];
|
|
}
|
|
if (!empty($block['align'])) {
|
|
$classes .= ' align' . $block['align'];
|
|
}
|
|
|
|
$heading = get_field('heading');
|
|
$slider_tabs = get_field('slider_tabs');
|
|
$slider_video_reviews = get_field('slider_video_reviews');
|
|
$rating = get_field('rating') ?: '5.0';
|
|
$stars = get_field('stars');
|
|
?>
|
|
|
|
<div class="max-[768px]:py-[40px] reviews-block container mx-auto py-[90px]"
|
|
id="<?php echo esc_attr($id); ?>"
|
|
data-reviews-id="<?php echo esc_attr($id); ?>">
|
|
<div class="max-[768px]:gap-[24px] flex justify-between flex-wrap gap-[12px]">
|
|
<?php if ($heading) : ?>
|
|
<h2 class="text-[32px] font-bold mt-[24px]"><?php echo esc_html($heading); ?></h2>
|
|
<?php endif; ?>
|
|
|
|
<div class="max-[768px]:flex-col max-[768px]:w-full flex gap-[10px]">
|
|
<?php if ($slider_tabs && !empty($slider_tabs['slider_tab'])) : ?>
|
|
<?php foreach ($slider_tabs['slider_tab'] as $tab_index => $tab) : ?>
|
|
<?php if (!empty($tab['tab_name'])) : ?>
|
|
<button class="max-[768px]:w-full tab-button grey-gradient-button rounded-[90px] py-[8px] px-[28px] cursor-pointer transition-all <?php echo $tab_index === 0 ? 'active' : ''; ?>"
|
|
data-tab="<?php echo $tab_index; ?>"
|
|
data-rating="<?php echo esc_attr($tab['rating'] ?? $rating); ?>"
|
|
data-stars="<?php echo esc_attr($tab['stars'] ?? $stars); ?>">
|
|
<?php echo esc_html($tab['tab_name']); ?>
|
|
</button>
|
|
<?php endif; ?>
|
|
<?php endforeach; ?>
|
|
<?php endif; ?>
|
|
|
|
<?php if ($slider_video_reviews) : ?>
|
|
<button class="tab-button grey-gradient-button rounded-[90px] py-[8px] px-[28px] cursor-pointer transition-all"
|
|
data-tab="video">
|
|
Видеоотзывы
|
|
</button>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="rating-section flex gap-[20px]">
|
|
<div class="flex flex-col gap-[6px]">
|
|
<div data-reviews="rating" class="flex gap-[4px] items-center">
|
|
<?php
|
|
for ($i = 0; $i < 5; $i++) {
|
|
?>
|
|
<svg width="20" height="21" viewBox="0 0 20 21" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<g clip-path="url(#clip0_2307_14938)">
|
|
<path d="M19.5654 9.6016C19.7579 9.41536 19.894 9.17868 19.9582 8.91867C20.0224 8.65866 20.012 8.38583 19.9283 8.13144C19.8465 7.87631 19.6944 7.64939 19.4896 7.4767C19.2847 7.30402 19.0354 7.19254 18.7701 7.15506L13.9275 6.45142C13.8259 6.43666 13.7294 6.39742 13.6464 6.33706C13.5634 6.27671 13.4963 6.19707 13.4509 6.105L11.2859 1.71734C11.1682 1.47672 10.9852 1.27411 10.7577 1.13273C10.5302 0.991358 10.2674 0.916931 9.99957 0.91798C9.73178 0.917006 9.46914 0.991469 9.24171 1.13284C9.01429 1.27421 8.83127 1.47678 8.71363 1.71734L6.54823 6.1054C6.45612 6.29243 6.2775 6.42178 6.07126 6.45182L1.22864 7.15547C0.963355 7.19294 0.713995 7.30442 0.509148 7.47711C0.304302 7.64979 0.152261 7.87671 0.0704546 8.13184C-0.0132531 8.38623 -0.0236151 8.65906 0.0405555 8.91907C0.104726 9.17908 0.240834 9.41576 0.43329 9.602L3.93709 13.0173C4.08647 13.1631 4.15496 13.3729 4.11971 13.578L3.29312 18.4006C3.25573 18.6055 3.26439 18.8161 3.31849 19.0173C3.37259 19.2184 3.47076 19.405 3.6059 19.5636C4.03281 20.071 4.7781 20.2255 5.37402 19.9124L9.70482 17.6352C9.79609 17.5887 9.8971 17.5644 9.99957 17.5644C10.102 17.5644 10.2031 17.5887 10.2943 17.6352L14.6255 19.9124C14.8309 20.0219 15.06 20.0793 15.2927 20.0794C15.716 20.0794 16.1173 19.8911 16.3932 19.5636C16.5284 19.4051 16.6266 19.2185 16.6807 19.0173C16.7348 18.8161 16.7434 18.6055 16.706 18.4006L15.879 13.578C15.8617 13.4767 15.8693 13.3728 15.9011 13.2751C15.9329 13.1774 15.988 13.0889 16.0616 13.0173L19.5654 9.6016Z"
|
|
fill="url(#paint0_linear_2307_14938)"/>
|
|
</g>
|
|
<defs>
|
|
<linearGradient id="paint0_linear_2307_14938" x1="-0.000976562" y1="10.4987"
|
|
x2="19.9997" y2="10.4987"
|
|
gradientUnits="userSpaceOnUse">
|
|
<stop offset="0.394231" stop-color="#FFD65A"/>
|
|
<stop offset="0.929023" stop-color="#FFE595"/>
|
|
</linearGradient>
|
|
<clipPath id="clip0_2307_14938">
|
|
<rect width="20" height="20" fill="white" transform="translate(0 0.5)"/>
|
|
</clipPath>
|
|
</defs>
|
|
</svg>
|
|
<?php
|
|
}
|
|
?>
|
|
<span class="ml-[8px] font-[600] text-[20px] leading-[115%]">5.0</span>
|
|
</div>
|
|
<div class="max-[768px]:ml-0 font-[500] ml-auto text-[16px] leading-[145%] text-[#6c6b6b]">
|
|
(
|
|
<span data-reviews="stars">
|
|
<?php
|
|
$star_count = $slider_tabs && !empty($slider_tabs['slider_tab'])
|
|
? ($slider_tabs['slider_tab'][0]['stars'] ?? $stars)
|
|
: $stars;
|
|
echo esc_html($star_count);
|
|
|
|
// Функция для правильных окончаний
|
|
$last_digit = $star_count % 10;
|
|
$last_two_digits = $star_count % 100;
|
|
|
|
if ($last_two_digits >= 11 && $last_two_digits <= 19) {
|
|
echo ' оценок';
|
|
} elseif ($last_digit == 1) {
|
|
echo ' оценка';
|
|
} elseif ($last_digit >= 2 && $last_digit <= 4) {
|
|
echo ' оценки';
|
|
} else {
|
|
echo ' оценок';
|
|
}
|
|
?>
|
|
</span>
|
|
)
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<?php if ($slider_tabs && !empty($slider_tabs['slider_tab'])) : ?>
|
|
<?php foreach ($slider_tabs['slider_tab'] as $tab_index => $tab) : ?>
|
|
<div class="max-[768px]:mt-[24px] tab-content mt-[45px] <?php echo $tab_index === 0 ? 'block' : 'hidden'; ?>"
|
|
id="tab-<?php echo $tab_index; ?>">
|
|
|
|
<?php if (!empty($tab['slider_images'])) : ?>
|
|
<div class="swiper reviews-swiper" id="swiper-<?php echo $tab_index; ?>">
|
|
<div class="swiper-wrapper">
|
|
<?php foreach ($tab['slider_images'] as $img_index => $image) : ?>
|
|
<div class="swiper-slide max-w-[424px] cursor-pointer">
|
|
<a href="<?php echo esc_url($image['url']); ?>"
|
|
class="glightbox block w-full h-full relative group"
|
|
data-gallery="reviews-<?php echo $tab_index; ?>">
|
|
<img src="<?php echo esc_url($image['url']); ?>"
|
|
alt="<?php echo esc_attr($image['alt']); ?>"
|
|
class="w-full h-full object-contain rounded-[12px]">
|
|
<div class="absolute inset-0 bg-[rgba(51,51,51,0.52)] opacity-0 group-hover:opacity-[100%] transition-opacity ease-in-out z-10 flex items-center justify-center">
|
|
<div class="
|
|
min-w-[76px]
|
|
min-h-[76px]
|
|
w-[76px]
|
|
h-[76px]
|
|
rounded-full
|
|
relative
|
|
overflow-hidden
|
|
border-[0.76px]
|
|
border-white/[0.14]
|
|
mx-auto
|
|
before:content-['']
|
|
before:absolute
|
|
before:top-[-10px]
|
|
before:left-[-10px]
|
|
before:right-[-10px]
|
|
before:bottom-[-10px]
|
|
before:bg-gradient-to-r
|
|
before:from-[#2B2C35]
|
|
before:from-[39.4%]
|
|
before:to-[#6E7996]
|
|
before:to-[92.9%]
|
|
before:blur-[7px]
|
|
before:opacity-[0.62]
|
|
before:-z-10
|
|
before:w-[76px]
|
|
before:h-[76px]
|
|
scale-90 group-hover:scale-100
|
|
transition
|
|
grid place-content-center
|
|
relative
|
|
">
|
|
<svg class="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2" width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<path d="M27.2511 1.95288L27.2506 7.9773C27.2506 8.13545 27.2195 8.29204 27.1589 8.43814C27.0984 8.58425 27.0097 8.717 26.8978 8.82881C26.786 8.94063 26.6532 9.02933 26.5071 9.08983C26.361 9.15034 26.2044 9.18147 26.0462 9.18146C25.8881 9.18144 25.7315 9.15028 25.5854 9.08975C25.4393 9.02921 25.3065 8.94049 25.1947 8.82866C24.9689 8.60279 24.8421 8.29647 24.8421 7.97707V4.86345L17.8434 11.8682C17.7316 11.9803 17.5987 12.0693 17.4524 12.1298C17.306 12.1904 17.1492 12.2214 16.9908 12.2211C16.7526 12.2212 16.5197 12.1506 16.3216 12.0184C16.1235 11.8861 15.9691 11.698 15.8779 11.478C15.7866 11.2579 15.7628 11.0157 15.8092 10.7821C15.8557 10.5485 15.9704 10.3338 16.1388 10.1654L23.1397 3.15772H20.0268C19.7073 3.15772 19.4008 3.03078 19.1749 2.80483C18.9489 2.57888 18.822 2.27243 18.822 1.95288C18.822 1.63334 18.9489 1.32689 19.1749 1.10094C19.4008 0.874985 19.7073 0.748047 20.0268 0.748047H26.0462C26.366 0.748047 26.6721 0.875074 26.8982 1.10138C27.1241 1.32719 27.251 1.63349 27.2511 1.95288ZM26.0465 18.8175C25.727 18.8176 25.4206 18.9446 25.1947 19.1706C24.9689 19.3966 24.842 19.703 24.8421 20.0225V23.1361L17.9608 16.3135C17.4899 15.843 16.695 15.8426 16.2246 16.313C15.7539 16.7828 15.7377 17.5458 16.2076 18.016L23.0195 24.8421H19.9007C19.5811 24.842 19.2746 24.9689 19.0485 25.1948C18.8224 25.4207 18.6953 25.7271 18.6952 26.0467C18.6951 26.2048 18.7261 26.3614 18.7866 26.5076C18.847 26.6537 18.9357 26.7864 19.0475 26.8983C19.1593 27.0101 19.292 27.0989 19.4381 27.1594C19.5842 27.2199 19.7407 27.2511 19.8989 27.2511L25.9174 27.2518C26.2374 27.2518 26.6083 27.1247 26.8337 26.8989C27.0595 26.673 27.2513 26.3666 27.2513 26.0474V20.0223C27.2511 19.7028 27.1241 19.3965 26.8982 19.1705C26.6723 18.9446 26.366 18.8176 26.0465 18.8175ZM10.0382 16.2604L3.1575 23.1366V20.0223C3.1575 19.3569 2.62886 18.8188 1.96371 18.8188H1.96868C1.81069 18.8188 1.65425 18.8499 1.50829 18.9104C1.36234 18.9709 1.22975 19.0595 1.1181 19.1713C1.00645 19.2831 0.917928 19.4158 0.857605 19.5618C0.797283 19.7078 0.76634 19.8643 0.766548 20.0223L0.766999 26.0465C0.767059 26.2048 0.7983 26.3615 0.858941 26.5077C0.919581 26.654 1.00843 26.7868 1.12042 26.8987C1.23241 27.0106 1.36534 27.0993 1.51162 27.1598C1.6579 27.2203 1.81467 27.2514 1.97296 27.2513H7.99264C8.31218 27.2513 8.61864 27.1244 8.84459 26.8984C9.07054 26.6725 9.19748 26.366 9.19748 26.0465C9.19748 25.7269 9.07054 25.4205 8.84459 25.1945C8.61864 24.9686 8.31218 24.8416 7.99264 24.8416H4.88059L11.7527 17.9632C12.2236 17.493 12.2175 16.7293 11.747 16.2595C11.2766 15.7898 10.5088 15.7902 10.0382 16.2604ZM4.85939 3.26625H7.97188C8.28639 3.25879 8.58551 3.12862 8.80531 2.90354C9.02512 2.67847 9.14816 2.37635 9.14816 2.06175C9.14816 1.74715 9.02512 1.44503 8.80531 1.21996C8.58551 0.994881 8.28639 0.864706 7.97188 0.857249L1.95288 0.856798H1.95266C1.63321 0.856613 1.32676 0.983297 1.1007 1.209C0.874819 1.43507 0.747971 1.7416 0.748047 2.06118L0.748724 8.08582C0.748784 8.40525 0.875686 8.71158 1.10153 8.93747C1.32738 9.16336 1.63368 9.29032 1.95311 9.29044C2.27254 9.29032 2.57884 9.16336 2.80469 8.93747C3.03053 8.71158 3.15744 8.40525 3.1575 8.08582V4.97175L10.1013 11.9212C10.2131 12.0334 10.346 12.1224 10.4923 12.183C10.6385 12.2436 10.7954 12.2748 10.9537 12.2746C11.192 12.2746 11.425 12.2039 11.6231 12.0715C11.8213 11.9391 11.9757 11.7509 12.0669 11.5308C12.1581 11.3106 12.1819 11.0684 12.1355 10.8347C12.089 10.6009 11.9742 10.3863 11.8057 10.2178L4.85939 3.26625Z" fill="white" />
|
|
</svg>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</a>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
<div class="swiper-scrollbar !static !mx-auto !cursor-grab mt-[45px] !w-full !p-0"></div>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
<?php endif; ?>
|
|
|
|
<?php if ($slider_video_reviews) : ?>
|
|
<div class="tab-content mt-[45px] hidden" id="tab-video">
|
|
<div class="video-reviews-grid flex flex-wrap gap-[24px]">
|
|
<?php foreach ($slider_video_reviews as $video_index => $video) : ?>
|
|
<?php if (!empty($video['slider_video_review'])) : ?>
|
|
<div class="video-review-item max-w-[424px] h-[358px] w-full bg-white rounded-[12px]">
|
|
<a href="<?php echo esc_url($video['slider_video_review']['url']); ?>"
|
|
class="glightbox hover:[&_svg]:fill-[#e21e24] p-[24px] !no-underline block w-full h-full relative rounded-[12px] overflow-hidden"
|
|
data-gallery="reviews-video"
|
|
data-type="video">
|
|
<?php if (!empty($video['author']) || !empty($video['data_otzyva'])) : ?>
|
|
<div class="flex justify-between h-[46px] w-full items-center">
|
|
<?php if (!empty($video['author'])) : ?>
|
|
<div class="font-[600] text-[20px] leading-[115%]"><?php echo esc_html($video['author']); ?></div>
|
|
<?php endif; ?>
|
|
<?php if (!empty($video['data_otzyva'])) : ?>
|
|
<div class="font-[500] text-[14px] leading-[125%] text-[#6c6b6b]"><?php echo esc_html($video['data_otzyva']); ?></div>
|
|
<?php endif; ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
<div class="w-full h-[240px] mt-[24px] rounded-[12px] relative overflow-hidden">
|
|
<img src="<?php echo esc_url($video['slider_video_prereview']['url']); ?>"
|
|
alt="<?php echo esc_attr($video['slider_video_prereview']['alt'] ?: 'Превью видеоотзыва'); ?>"
|
|
class="w-full h-full object-cover">
|
|
|
|
<div class="absolute inset-0 flex items-center justify-center">
|
|
<svg class="transition-all" width="76" height="76" viewBox="0 0 76 76" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<path d="M0 38C0 17.0132 17.0132 0 38 0C58.9868 0 76 17.0132 76 38C76 58.9868 58.9868 76 38 76C17.0132 76 0 58.9868 0 38Z" fill="url(#paint0_linear_4086_3690)" fill-opacity="0.32" />
|
|
<path d="M38 0.379883C58.777 0.379883 75.6201 17.223 75.6201 38C75.6201 58.777 58.777 75.6201 38 75.6201C17.223 75.6201 0.379883 58.777 0.379883 38C0.379883 17.223 17.223 0.379883 38 0.379883Z" stroke="white" stroke-opacity="0.14" stroke-width="0.76" />
|
|
<path d="M49.5 35.4019C51.5 36.5566 51.5 39.4434 49.5 40.5981L34.5 49.2583C32.5 50.413 30 48.9697 30 46.6603L30 29.3397C30 27.0303 32.5 25.587 34.5 26.7417L49.5 35.4019Z" fill="white" />
|
|
<defs>
|
|
<linearGradient id="paint0_linear_4086_3690" x1="0" y1="38" x2="76" y2="38" gradientUnits="userSpaceOnUse">
|
|
<stop offset="0.394231" stop-color="#9D9994" />
|
|
<stop offset="0.929023" stop-color="#C5C5B9" />
|
|
</linearGradient>
|
|
</defs>
|
|
</svg>
|
|
</div>
|
|
</div>
|
|
</a>
|
|
|
|
</div>
|
|
<?php endif; ?>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|