Сайт 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.
239 lines
20 KiB
239 lines
20 KiB
<?php
|
|
|
|
$id = 'simple-gallery-' . $block['id'];
|
|
if (!empty($block['anchor'])) {
|
|
$id = $block['anchor'];
|
|
}
|
|
|
|
$classes = 'block-simple-gallery';
|
|
if (!empty($block['className'])) {
|
|
$classes .= ' ' . $block['className'];
|
|
}
|
|
if (!empty($block['align'])) {
|
|
$classes .= ' align' . $block['align'];
|
|
}
|
|
|
|
$heading = get_field('heading');
|
|
$description = get_field('description');
|
|
$gallery_images = get_field('gallery_images');
|
|
|
|
?>
|
|
|
|
<div class="max-[768px]:pt-[40px] simple-gallery-block pt-[90px]"
|
|
id="<?php echo esc_attr($id); ?>"
|
|
data-gallery-id="<?php echo esc_attr($id); ?>">
|
|
|
|
<div class="container mx-auto">
|
|
<div class="max-[1050px]:flex-col flex gap-[24px] justify-between items-start">
|
|
|
|
<div class="max-[1050px]:mx-auto gallery-section w-full max-w-[535px]">
|
|
<?php if ($gallery_images && is_array($gallery_images) && !empty($gallery_images)) : ?>
|
|
|
|
<?php if (count($gallery_images) === 1) : ?>
|
|
<?php
|
|
$image = $gallery_images[0];
|
|
if (isset($image['url']) && $image['url']) :
|
|
?>
|
|
<div class="max-[1050px]:max-w-full max-[1050px]:h-[360px] single-image max-w-[535px] h-[500px]">
|
|
<a href="<?php echo esc_url($image['url']); ?>"
|
|
class="glightbox block w-full h-full group"
|
|
data-gallery="simple-gallery-<?php echo esc_attr($id); ?>">
|
|
<img src="<?php echo esc_url($image['url']); ?>"
|
|
alt="<?php echo esc_attr($image['alt'] ?? $image['title'] ?? ''); ?>"
|
|
class="w-full h-full object-cover rounded-[24px]"
|
|
width="<?php echo esc_attr($image['width'] ?? ''); ?>"
|
|
height="<?php echo esc_attr($image['height'] ?? ''); ?>"
|
|
fetchpriority="high">
|
|
<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 endif; ?>
|
|
<?php else : ?>
|
|
|
|
<div class="max-[1050px]:!mx-auto swiper !m-0 max-w-[535px] gallery-swiper max-[1050px]:h-[326px] h-[500px] rounded-[24px] relative">
|
|
<div class="swiper-wrapper">
|
|
<?php foreach ($gallery_images as $img_index => $image) : ?>
|
|
<?php if (isset($image['url']) && $image['url']) : ?>
|
|
<div class="max-[1050px]:min-h-auto max-[1050px]:h-[326px] swiper-slide max-w-[648px] cursor-pointer min-h-[500px]">
|
|
<a href="<?php echo esc_url($image['url']); ?>"
|
|
class="glightbox block w-full h-full group"
|
|
data-gallery="simple-gallery-<?php echo esc_attr($id); ?>">
|
|
<?php if ($img_index === 0) : ?>
|
|
<img src="<?php echo esc_url($image['url']); ?>"
|
|
alt="<?php echo esc_attr($image['alt'] ?? $image['title'] ?? ''); ?>"
|
|
class="w-full h-full object-cover"
|
|
width="<?php echo esc_attr($image['width'] ?? ''); ?>"
|
|
height="<?php echo esc_attr($image['height'] ?? ''); ?>"
|
|
fetchpriority="high">
|
|
<?php else : ?>
|
|
<img data-src="<?php echo esc_url($image['url']); ?>"
|
|
alt="<?php echo esc_attr($image['alt'] ?? $image['title'] ?? ''); ?>"
|
|
class="w-full h-full object-cover swiper-lazy"
|
|
width="<?php echo esc_attr($image['width'] ?? ''); ?>"
|
|
height="<?php echo esc_attr($image['height'] ?? ''); ?>">
|
|
<div class="swiper-lazy-preloader"></div>
|
|
<?php endif; ?>
|
|
<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 endif; ?>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
|
|
|
|
<div class="simple-gallery-swiper-pagination absolute flex items-center justify-center left-1/2 z-[2]"></div>
|
|
</div>
|
|
|
|
<style>
|
|
.swiper-pagination-bullet {
|
|
width: 10px !important;
|
|
height: 10px !important;
|
|
background: #222 !important;
|
|
border-radius: 100% !important;
|
|
transform: none !important;
|
|
}
|
|
|
|
.swiper-pagination-bullet-active {
|
|
border-radius: 20px !important;
|
|
width: 17px !important;
|
|
height: 10px !important;
|
|
background: #fff !important;
|
|
}
|
|
</style>
|
|
|
|
<!-- Thumbnails -->
|
|
<div class="relative mt-[8px]">
|
|
<div class="swiper thumbnail-swiper">
|
|
<div class="swiper-wrapper">
|
|
<?php foreach ($gallery_images as $thumb_index => $image) : ?>
|
|
<?php if (isset($image['url']) && $image['url']) : ?>
|
|
<div class="max-[768px]:max-w-[60px] max-[768px]:!h-[40px] swiper-slide max-w-[102px] !h-[62px]">
|
|
<div class="thumbnail w-full h-full overflow-hidden cursor-pointer transition-opacity duration-[180ms] ease-in-out <?php echo $thumb_index === 0 ? 'active opacity-100' : 'opacity-50 hover:opacity-80'; ?>"
|
|
data-index="<?php echo $thumb_index; ?>">
|
|
<?php
|
|
// Используем thumbnail из sizes или fallback на основное изображение
|
|
$thumbnail_url = '';
|
|
if (isset($image['sizes']['thumbnail'])) {
|
|
$thumbnail_url = $image['sizes']['thumbnail'];
|
|
} elseif (isset($image['url'])) {
|
|
$thumbnail_url = $image['url'];
|
|
}
|
|
?>
|
|
<?php if ($thumbnail_url) : ?>
|
|
<img src="<?php echo esc_url($thumbnail_url); ?>"
|
|
alt="<?php echo esc_attr($image['alt'] ?? $image['title'] ?? ''); ?>"
|
|
class="w-full rounded-[6px] h-full object-cover"
|
|
width="102"
|
|
height="62">
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<?php else : ?>
|
|
<div class="max-w-[535px] h-[500px] bg-gray-100 rounded-[24px] flex items-center justify-center">
|
|
<p class="text-gray-500">Изображения не загружены</p>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
<div class="max-[1050px]:max-w-full max-[1050px]:mt-[32px] content-section w-full max-w-[725px]">
|
|
<div class="max-[1050px]:p-0 py-[48px] pr-[12px]">
|
|
<?php if ($heading) : ?>
|
|
<h2 class="max-[1050px]:text-[30px] max-[768px]:text-[24px] text-[48px] font-[700] leading-[110%] mb-[24px]"><?php echo esc_html($heading); ?></h2>
|
|
<?php endif; ?>
|
|
|
|
<?php if ($description) : ?>
|
|
<div class="max-[1050px]:text-[18px] max-[768px]:text-[16px] text-[18px] leading-[150%] text-gray-600">
|
|
<?php echo wp_kses_post($description); ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|