Compare commits

...

3 Commits

Author SHA1 Message Date
Боевой сайт - fakel
2ac2340779 Task 10121 | fix: поправили прайсы цен для карт, которые некорректно выводятся при заполнении из админки 2025-11-21 21:11:51 +03:00
GP_DEV
21562852ca full 2025-07-08 14:21:19 +03:00
GP_DEV
a6bb81cbe1 polished template 2025-06-19 14:18:56 +03:00
77 changed files with 12007 additions and 11282 deletions

52
404.php
View File

@@ -1,24 +1,30 @@
<!DOCTYPE html>
<html <?php language_attributes(); ?> class="no-js">
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width">
<link rel="profile" href="http://gmpg.org/xfn/11">
<?php
get_header();
?>
<section class="py-[90px] max-[768px]:pt-[40px] container mx-auto">
<div class="relative max-w-[640px] w-full mx-auto">
<div class="rounded-[20px] max-[640px]:rounded-[0] text-center flex flex-col">
<div class="font-bold text-[150px] max-[768px]:text-[100px] leading-[100%] tracking-[0.05em]">404</div>
<?php wp_head(); ?>
</head>
<body class="antialiased">
<div class="md:flex min-h-screen">
<div class="w-full md:w-1/2 flex items-center justify-center">
<div class="max-w-sm m-8">
<div class="text-5xl md:text-15xl text-gray-800 border-primary border-b">404</div>
<div class="w-16 h-1 bg-purple-light my-3 md:my-6"></div>
<p class="text-gray-800 text-2xl md:text-3xl font-light mb-8"><?php _e( 'Sorry, the page you are looking for could not be found.', 'tailpress' ); ?></p>
<a href="<?php echo get_bloginfo( 'url' ); ?>" class="bg-primary px-4 py-2 rounded-xs text-white">
<?php _e( 'Go Home', 'tailpress' ); ?>
</a>
</div>
</div>
</div>
</body>
</html>
<div class="w-16 h-1 bg-black mx-auto my-4"></div>
<div class="font-normal text-[24px] max-[768px]:text-[18px] leading-[141%] mb-[20px]">
Страница не найдена
</div>
<div class="mt-[20px] flex items-center mx-auto justify-center">
<a href="https://mylogistika2010.cp.good-production.xyz" class="!no-underline max-[768px]:px-[15px] max-[768px]:py-[10px] max-[768px]:text-[14px] inline-flex items-center justify-center px-[25px] py-[15px] rounded-[8px] text-white bg-[#f62a29] hover:bg-[#e01c1b] transition duration-300 font-medium text-[16px]">
Вернуться на главную
</a>
</div>
</div>
</div>
</section>
<?php
get_footer()
?>

236
archive-trainer.php Normal file
View File

@@ -0,0 +1,236 @@
<?php
get_header();
if (!function_exists('get_trainers_for_current_language')) {
function get_trainers_for_current_language()
{
$current_lang = pll_current_language();
$args = array(
'post_type' => 'trainer',
'posts_per_page' => -1,
'lang' => $current_lang,
'post_status' => 'publish',
'sort' => 'menu_order',
'order' => 'ASC',
);
return get_posts($args);
}
}
$trainers = get_trainers_for_current_language();
$trainers_data = array();
if ($trainers) {
foreach ($trainers as $trainer) {
$trainer_info = array(
'post' => $trainer,
'name' => '',
'exp' => '',
'short_desc' => ''
);
if (have_rows('short_info', $trainer->ID)) {
while (have_rows('short_info', $trainer->ID)) {
the_row();
$trainer_info['name'] = get_sub_field('name');
$trainer_info['exp'] = get_sub_field('exp');
$trainer_info['short_desc'] = get_sub_field('short_desc');
}
}
$trainers_data[] = $trainer_info;
}
}
?>
<section class="max-[768px]:py-[40px] max-[768px]:pb-[20px] py-[90px] pb-[45px]">
<div class="container mx-auto">
<?php if ($trainers_data): ?>
<div class="place-content-center max-[768px]:justify-center grid gap-[24px] grid-cols-[repeat(auto-fit,minmax(312px,312px))]">
<?php foreach ($trainers_data as $trainer_data):
if ($trainer_data['name']) {
$trainer = $trainer_data['post']; ?>
<a href="<?php echo get_permalink($trainer->ID); ?>" class="!no-underline group block">
<div class="flex flex-col gap-[12px]">
<div class="flex relative rounded-[20px] overflow-hidden shadow-[0_2px_32px_0_rgba(16,_15,_15,_0.03)]">
<?php $photo_images = get_field('photo', $trainer->ID); ?>
<?php if ($photo_images && !empty($photo_images[0])): ?>
<div class="overflow-hidden w-full h-[460px]">
<img src="<?php echo esc_url($photo_images[0]['url']); ?>"
alt="<?php echo esc_attr($photo_images[0]['alt']); ?>"
loading="lazy"
class="w-full h-full object-cover transition-transform"/>
</div>
<?php endif; ?>
<div class="flex gap-[4px] absolute left-[12px] bottom-[16px]">
<div class="text-[15px] leading-[110%] font-[600] text-[#fff] px-[12px] h-[29px] flex items-center justify-center rounded-[32px] backdrop-blur-[8px] bg-[linear-gradient(90deg,rgba(157,153,148,0.7)_39.42%,rgba(197,197,185,0.7)_92.9%)]">
<?php echo pll_current_language('name'); ?>
</div>
<?php $exp = $trainer_data['exp']; ?>
<?php if ($exp): ?>
<div class="text-[15px]leading-[110%] font-[600] text-[#fff] px-[12px] h-[29px] flex items-center justify-center rounded-[32px] backdrop-blur-[8px] bg-[linear-gradient(90deg,rgba(157,153,148,0.7)_39.42%,rgba(197,197,185,0.7)_92.9%)]">
<?php echo esc_html($exp); ?>
</div>
<?php endif; ?>
</div>
</div>
<div>
<?php $name = $trainer_data['name']; ?>
<?php if ($name): ?>
<div class="group-hover:text-[#e21e24] transition-colors text-[24px] leading-[125%] font-[600]">
<?php echo esc_html($name); ?>
</div>
<?php endif; ?>
<?php $short_desc = $trainer_data['short_desc']; ?>
<?php if ($short_desc): ?>
<div class="group-hover:text-[#e21e24] transition-colors text-[16px] leading-[145%] font-[500] mt-[4px] text-[#6c6b6b]">
<?php echo wp_kses_post($short_desc); ?>
</div>
<?php endif; ?>
</div>
</div>
</a>
<?php
}
?>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>
</section>
<section class=" mb-[-9px] py-[90px] pt-[45px] radial-gradient">
<div class="container mx-auto">
<?php $team_photo = get_archive_field('trainer', 'team_photo'); ?>
<?php if ($team_photo) : ?>
<img
class="max-[768px]:h-[240px] rounded-[20px] w-full h-[620px] object-cover"
src="<?php echo esc_url($team_photo['url']); ?>"
alt="<?php echo esc_attr($team_photo['alt']); ?>"/>
<?php endif; ?>
<?php
$blocks = [
[
'svg' => '<svg width="38" height="38" viewBox="0 0 38 38" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M19.7084 34.6648C19.4886 34.7747 19.2463 34.8318 19.0007 34.8318C18.755 34.8318 18.5127 34.7747 18.2929 34.6648L18.2866 34.6633L18.2739 34.6569L18.2343 34.6363C18.0057 34.5182 17.7787 34.3968 17.5535 34.2722C14.8741 32.7783 12.3564 31.0114 10.0406 28.9997C8.83735 27.9524 7.70983 26.8212 6.66648 25.6145C6.59119 25.5264 6.49773 25.4556 6.39251 25.4069C6.2873 25.3583 6.17282 25.333 6.0569 25.3327H3.16732C2.74739 25.3327 2.34466 25.1659 2.04773 24.8689C1.7508 24.572 1.58398 24.1693 1.58398 23.7493C1.58398 23.3294 1.7508 22.9267 2.04773 22.6298C2.34466 22.3328 2.74739 22.166 3.16732 22.166H9.50065C9.81704 22.1658 10.1261 22.0708 10.388 21.8933C10.6499 21.7158 10.8526 21.4639 10.97 21.1701L12.3728 17.6646C12.3962 17.6055 12.4367 17.5549 12.4892 17.5191C12.5418 17.4834 12.6038 17.4643 12.6673 17.4643C12.7308 17.4643 12.7929 17.4834 12.8454 17.5191C12.8979 17.5549 12.9385 17.6055 12.9618 17.6646L15.948 25.1284C16.0655 25.4223 16.2684 25.6741 16.5304 25.8516C16.7925 26.029 17.1017 26.1238 17.4181 26.1238C17.7346 26.1238 18.0438 26.029 18.3058 25.8516C18.5679 25.6741 18.7707 25.4223 18.8882 25.1284L20.6062 20.8313C20.6295 20.7722 20.6701 20.7215 20.7226 20.6858C20.7751 20.6501 20.8371 20.631 20.9007 20.631C20.9642 20.631 21.0262 20.6501 21.0787 20.6858C21.1312 20.7215 21.1718 20.7722 21.1952 20.8313L21.3313 21.1701C21.4487 21.4639 21.6514 21.7158 21.9133 21.8933C22.1752 22.0708 22.4843 22.1658 22.8007 22.166H25.334C25.7539 22.166 26.1566 21.9992 26.4536 21.7023C26.7505 21.4053 26.9173 21.0026 26.9173 20.5827C26.9173 20.1628 26.7505 19.76 26.4536 19.4631C26.1566 19.1662 25.7539 18.9993 25.334 18.9993H24.0863C24.0232 18.9991 23.9615 18.98 23.9093 18.9444C23.8571 18.9089 23.8168 18.8585 23.7934 18.7998L22.3716 15.2453C22.2541 14.9514 22.0512 14.6996 21.7891 14.5221C21.5271 14.3447 21.2179 14.2499 20.9014 14.2499C20.585 14.2499 20.2758 14.3447 20.0137 14.5221C19.7517 14.6996 19.5488 14.9514 19.4313 15.2453L17.7118 19.5424C17.6885 19.6015 17.6479 19.6522 17.5954 19.6879C17.5429 19.7236 17.4808 19.7427 17.4173 19.7427C17.3538 19.7427 17.2918 19.7236 17.2392 19.6879C17.1867 19.6522 17.1462 19.6015 17.1228 19.5424L14.1367 12.0802C14.0189 11.7868 13.816 11.5355 13.5541 11.3584C13.2923 11.1814 12.9834 11.0868 12.6673 11.0868C12.3512 11.0868 12.0424 11.1814 11.7805 11.3584C11.5186 11.5355 11.3158 11.7868 11.198 12.0802L8.42873 18.9993H3.16573C3.00493 19.0007 2.84774 18.9516 2.71625 18.8591C2.58477 18.7665 2.48559 18.635 2.43265 18.4832C1.87549 16.866 1.58875 15.1681 1.58398 13.4577C1.58398 11.1935 2.2569 8.66177 3.78957 6.65727C5.36182 4.6021 7.79699 3.16602 11.084 3.16602C14.3504 3.16602 16.6953 4.57677 18.1932 5.9606C18.4956 6.23927 18.7632 6.51635 19.0007 6.78393C19.2382 6.51635 19.5057 6.23927 19.8082 5.9606C21.3044 4.57677 23.6493 3.16602 26.9173 3.16602C30.2043 3.16602 32.6395 4.6021 34.2117 6.65727C35.7444 8.66177 36.4173 11.1935 36.4173 13.4577C36.4173 20.1013 32.0125 25.4514 27.9607 28.9981C25.491 31.1416 22.7925 33.0064 19.9142 34.5588L19.7686 34.6348L19.7274 34.6569L19.7147 34.6633L19.7084 34.6648Z" fill="url(#paint0_linear_2307_11127)" />
<path fill-rule="evenodd" clip-rule="evenodd" d="M26.75 23C25.7554 23 24.8016 23.3951 24.0983 24.0983C23.3951 24.8016 23 25.7554 23 26.75V34.25C23 35.2446 23.3951 36.1984 24.0983 36.9017C24.8016 37.6049 25.7554 38 26.75 38H34.25C35.2446 38 36.1984 37.6049 36.9017 36.9017C37.6049 36.1984 38 35.2446 38 34.25V26.75C38 25.7554 37.6049 24.8016 36.9017 24.0983C36.1984 23.3951 35.2446 23 34.25 23H26.75ZM33.98 27.674C34.1327 27.8013 34.2286 27.9841 34.2466 28.1821C34.2646 28.3801 34.2032 28.5772 34.076 28.73L30.326 33.23C30.2612 33.3077 30.1814 33.3714 30.0914 33.4174C30.0013 33.4635 29.9029 33.4908 29.802 33.4978C29.7011 33.5048 29.5998 33.4914 29.5043 33.4582C29.4087 33.4251 29.3209 33.373 29.246 33.305L26.996 31.2597C26.8515 31.1253 26.7659 30.9393 26.7577 30.7421C26.7494 30.5449 26.8193 30.3524 26.952 30.2064C27.0847 30.0603 27.2697 29.9725 27.4667 29.9619C27.6638 29.9513 27.8571 30.0188 28.0048 30.1497L29.675 31.6685L32.924 27.77C33.0513 27.6173 33.2341 27.5214 33.4321 27.5034C33.6301 27.4854 33.8272 27.5468 33.98 27.674Z" fill="#E21E24" />
<defs>
<linearGradient id="paint0_linear_2307_11127" x1="1.58398" y1="18.9989" x2="36.4173" y2="18.9989" gradientUnits="userSpaceOnUse">
<stop offset="0.673077" stop-color="#2B2C35" />
<stop offset="0.929023" stop-color="#4F5870" />
</linearGradient>
</defs>
</svg>',
'title' => 'Разные форматы — один подход',
'description' => 'Йога, пилатес, танцы, силовые, реабилитация — тренеры помогут найти тот формат, в котором телу и голове хорошо.'
],
[
'svg' => '<svg width="38" height="38" viewBox="0 0 38 38" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M6.69186 23.2314L15.0099 14.9134L16.9968 16.9025C17.9336 17.8441 19.1805 18.3628 20.5075 18.3628C21.8344 18.3628 23.0813 17.8441 24.0185 16.9021C25.9458 14.9651 25.9458 11.8135 24.0185 9.87645L20.9032 6.75288L22.4507 5.39193C26.3435 1.98061 32.2647 2.37093 35.676 6.2637C39.0873 10.1565 38.697 16.0776 34.8042 19.489L32.5808 21.5439L30.1124 19.0756C28.6763 17.6394 26.3395 17.6394 24.9034 19.0756C24.2185 19.7604 23.8374 20.6676 23.8257 21.6343C22.8983 21.6461 21.9747 22.0042 21.2687 22.7102C20.5624 23.4166 20.2042 24.3409 20.1928 25.2687C19.2649 25.2802 18.3406 25.6384 17.6342 26.3448C16.1981 27.7809 16.198 30.1177 17.6341 31.5538L19.611 33.5307L17.9391 35.0759C16.7985 36.0755 15.0635 35.9611 14.0639 34.8205C13.0644 33.6799 13.1787 31.9449 14.3194 30.9454C13.1788 31.9449 11.4438 31.8306 10.4443 30.6899C9.44471 29.5493 9.55908 27.8143 10.6997 26.8148L10.6996 26.8146C9.559 27.8142 7.82399 27.6999 6.82441 26.5592C5.96785 25.5817 6.01743 24.3477 6.69186 23.2314Z" fill="url(#paint0_linear_2307_11133)" />
<path d="M2.74495 4.98813C6.40498 1.32818 12.3389 1.32818 15.9989 4.98813L22.4407 11.4469C23.21 12.2201 23.4463 13.4103 23.0405 14.421C22.5991 15.5206 21.4621 16.2246 20.2806 16.1265C19.6291 16.0724 19.0153 15.7797 18.5577 15.314L15.0114 11.7636L5.63889 21.136L2.74503 18.242C-0.914996 14.5821 -0.914996 8.64808 2.74495 4.98813ZM29.6539 25.8855L26.4783 22.7099C26.3426 22.575 26.235 22.4144 26.1617 22.2376C26.0885 22.0608 26.0511 21.8712 26.0516 21.6798C26.0511 21.4885 26.0885 21.2989 26.1617 21.1221C26.235 20.9453 26.3426 20.7847 26.4783 20.6498C26.7622 20.3658 27.1354 20.2238 27.5083 20.2238C27.8814 20.2238 28.2544 20.3658 28.5384 20.6498L31.7139 23.8254C32.2797 24.3911 32.2815 25.3102 31.72 25.8788C31.7107 25.8879 31.7012 25.8966 31.6918 25.9056C31.4193 26.1674 31.063 26.3122 30.6839 26.3122C30.4925 26.3127 30.3029 26.2753 30.1261 26.202C29.9493 26.1288 29.7888 26.0212 29.6539 25.8855ZM26.0191 29.5202L22.8435 26.3446C22.7079 26.2097 22.6003 26.0491 22.5271 25.8723C22.4538 25.6955 22.4164 25.5059 22.4169 25.3146C22.4164 25.1232 22.4539 24.9336 22.5271 24.7568C22.6003 24.58 22.7079 24.4195 22.8435 24.2845C23.1187 24.0094 23.4845 23.8578 23.8736 23.8578C24.2627 23.8578 24.6286 24.0094 24.9037 24.2845L28.0793 27.4601C28.215 27.595 28.3226 27.7556 28.3958 27.9324C28.4691 28.1092 28.5065 28.2988 28.506 28.4902C28.5065 28.6804 28.4694 28.8689 28.3969 29.0449C28.3245 29.2208 28.218 29.3807 28.0837 29.5155C28.0777 29.5214 28.0714 29.527 28.0654 29.5329C27.4963 30.0874 26.5827 30.0837 26.0191 29.5202ZM22.3846 33.1548L19.209 29.9793C18.6411 29.4113 18.641 28.487 19.209 27.9191C19.4842 27.644 19.8499 27.4924 20.2391 27.4924C20.6282 27.4924 20.994 27.6439 21.2691 27.919L24.4447 31.0946C24.5804 31.2296 24.688 31.3901 24.7612 31.567C24.8345 31.7438 24.8719 31.9333 24.8714 32.1247C24.8719 32.3156 24.8347 32.5046 24.7618 32.681C24.6889 32.8574 24.5819 33.0176 24.4469 33.1524C24.4439 33.1554 24.4409 33.1581 24.4379 33.161C23.8693 33.7224 22.9504 33.7206 22.3846 33.1548Z" fill="url(#paint1_linear_2307_11133)" />
<path fill-rule="evenodd" clip-rule="evenodd" d="M26.75 23C25.7554 23 24.8016 23.3951 24.0983 24.0983C23.3951 24.8016 23 25.7554 23 26.75V34.25C23 35.2446 23.3951 36.1984 24.0983 36.9017C24.8016 37.6049 25.7554 38 26.75 38H34.25C35.2446 38 36.1984 37.6049 36.9017 36.9017C37.6049 36.1984 38 35.2446 38 34.25V26.75C38 25.7554 37.6049 24.8016 36.9017 24.0983C36.1984 23.3951 35.2446 23 34.25 23H26.75ZM33.98 27.674C34.1327 27.8013 34.2286 27.9841 34.2466 28.1821C34.2646 28.3801 34.2032 28.5772 34.076 28.73L30.326 33.23C30.2612 33.3077 30.1814 33.3714 30.0914 33.4174C30.0013 33.4635 29.9029 33.4908 29.802 33.4978C29.7011 33.5048 29.5998 33.4914 29.5043 33.4582C29.4087 33.4251 29.3209 33.373 29.246 33.305L26.996 31.2597C26.8515 31.1253 26.7659 30.9393 26.7577 30.7421C26.7494 30.5449 26.8193 30.3524 26.952 30.2064C27.0847 30.0603 27.2697 29.9725 27.4667 29.9619C27.6638 29.9513 27.8571 30.0188 28.0048 30.1497L29.675 31.6685L32.924 27.77C33.0513 27.6173 33.2341 27.5214 33.4321 27.5034C33.6301 27.4854 33.8272 27.5468 33.98 27.674Z" fill="#E21E24" />
<defs>
<linearGradient id="paint0_linear_2307_11133" x1="6.18359" y1="19.4126" x2="37.9996" y2="19.4126" gradientUnits="userSpaceOnUse">
<stop offset="0.673077" stop-color="#2B2C35" />
<stop offset="0.929023" stop-color="#4F5870" />
</linearGradient>
<linearGradient id="paint1_linear_2307_11133" x1="0" y1="17.9119" x2="32.1397" y2="17.9119" gradientUnits="userSpaceOnUse">
<stop offset="0.673077" stop-color="#2B2C35" />
<stop offset="0.929023" stop-color="#4F5870" />
</linearGradient>
</defs>
</svg>',
'title' => 'Вовлечение и забота',
'description' => 'Мы подстраиваемся под клиента. Здесь нет "неправильных тел" или "слишком поздно начинать".'
],
[
'svg' => '<svg width="38" height="38" viewBox="0 0 38 38" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2307_11139)">
<path d="M21.7141 21.7139H16.2856C14.7865 21.7139 13.5713 22.9291 13.5713 24.4282V35.2853C13.5713 36.7844 14.7865 37.9996 16.2856 37.9996H21.7141C23.2132 37.9996 24.4284 36.7844 24.4284 35.2853V24.4282C24.4284 22.9291 23.2132 21.7139 21.7141 21.7139Z" fill="url(#paint0_linear_2307_11139)" />
<path d="M8.14286 25.7861H2.71429C1.21523 25.7861 0 27.0014 0 28.5004V35.2861C0 36.7852 1.21523 38.0004 2.71429 38.0004H8.14286C9.64192 38.0004 10.8571 36.7852 10.8571 35.2861V28.5004C10.8571 27.0014 9.64192 25.7861 8.14286 25.7861Z" fill="url(#paint1_linear_2307_11139)" />
<path d="M35.2854 14.9287H29.8569C28.3578 14.9287 27.1426 16.1439 27.1426 17.643V35.2859C27.1426 36.7849 28.3578 38.0001 29.8569 38.0001H35.2854C36.7845 38.0001 37.9997 36.7849 37.9997 35.2859V17.643C37.9997 16.1439 36.7845 14.9287 35.2854 14.9287Z" fill="url(#paint2_linear_2307_11139)" />
<path d="M5.42857 20.3571C5.54162 20.357 5.65422 20.3429 5.76379 20.3151C10.6214 19.0776 15.2952 17.2068 19.665 14.7508C24.4222 12.0625 28.7687 8.70509 32.5714 4.78121V8.14286C32.5714 8.50279 32.7144 8.84799 32.9689 9.1025C33.2234 9.35702 33.5686 9.5 33.9286 9.5C34.2885 9.5 34.6337 9.35702 34.8882 9.1025C35.1427 8.84799 35.2857 8.50279 35.2857 8.14286V1.35714C35.2857 0.997206 35.1427 0.652012 34.8882 0.397498C34.6337 0.142984 34.2885 0 33.9286 0H27.1429C26.7829 0 26.4377 0.142984 26.1832 0.397498C25.9287 0.652012 25.7857 0.997206 25.7857 1.35714C25.7857 1.71708 25.9287 2.06227 26.1832 2.31679C26.4377 2.5713 26.7829 2.71429 27.1429 2.71429H30.7746C27.1203 6.52636 22.9297 9.78521 18.335 12.388C14.1723 14.7252 9.72021 16.5048 5.09336 17.6809C4.76906 17.7591 4.48497 17.9541 4.29532 18.2286C4.10567 18.5031 4.02375 18.8378 4.06521 19.1688C4.10667 19.4998 4.26861 19.804 4.52009 20.0232C4.77158 20.2424 5.09499 20.3613 5.42857 20.3571Z" fill="url(#paint3_linear_2307_11139)" />
<path d="M33 25.5L26 30V32.5L31 35.5L36 27.5L33 25.5Z" fill="white" />
<path fill-rule="evenodd" clip-rule="evenodd" d="M26.75 23C25.7554 23 24.8016 23.3951 24.0983 24.0983C23.3951 24.8016 23 25.7554 23 26.75V34.25C23 35.2446 23.3951 36.1984 24.0983 36.9017C24.8016 37.6049 25.7554 38 26.75 38H34.25C35.2446 38 36.1984 37.6049 36.9017 36.9017C37.6049 36.1984 38 35.2446 38 34.25V26.75C38 25.7554 37.6049 24.8016 36.9017 24.0983C36.1984 23.3951 35.2446 23 34.25 23H26.75ZM33.98 27.674C34.1327 27.8013 34.2286 27.9841 34.2466 28.1821C34.2646 28.3801 34.2032 28.5772 34.076 28.73L30.326 33.23C30.2612 33.3077 30.1814 33.3714 30.0914 33.4174C30.0013 33.4635 29.9029 33.4908 29.802 33.4978C29.7011 33.5048 29.5998 33.4914 29.5043 33.4582C29.4087 33.4251 29.3209 33.373 29.246 33.305L26.996 31.2597C26.8515 31.1253 26.7659 30.9393 26.7577 30.7421C26.7494 30.5449 26.8193 30.3524 26.952 30.2064C27.0847 30.0603 27.2697 29.9725 27.4667 29.9619C27.6638 29.9513 27.8571 30.0188 28.0048 30.1497L29.675 31.6685L32.924 27.77C33.0513 27.6173 33.2341 27.5214 33.4321 27.5034C33.6301 27.4854 33.8272 27.5468 33.98 27.674Z" fill="#E21E24" />
</g>
<defs>
<linearGradient id="paint0_linear_2307_11139" x1="13.5713" y1="29.8567" x2="24.4284" y2="29.8567" gradientUnits="userSpaceOnUse">
<stop offset="0.673077" stop-color="#2B2C35" />
<stop offset="0.929023" stop-color="#4F5870" />
</linearGradient>
<linearGradient id="paint1_linear_2307_11139" x1="0" y1="31.8933" x2="10.8571" y2="31.8933" gradientUnits="userSpaceOnUse">
<stop offset="0.673077" stop-color="#2B2C35" />
<stop offset="0.929023" stop-color="#4F5870" />
</linearGradient>
<linearGradient id="paint2_linear_2307_11139" x1="27.1426" y1="26.4644" x2="37.9997" y2="26.4644" gradientUnits="userSpaceOnUse">
<stop offset="0.673077" stop-color="#2B2C35" />
<stop offset="0.929023" stop-color="#4F5870" />
</linearGradient>
<linearGradient id="paint3_linear_2307_11139" x1="4.05469" y1="10.1786" x2="35.2857" y2="10.1786" gradientUnits="userSpaceOnUse">
<stop offset="0.673077" stop-color="#2B2C35" />
<stop offset="0.929023" stop-color="#4F5870" />
</linearGradient>
<clipPath id="clip0_2307_11139">
<rect width="38" height="38" fill="white" />
</clipPath>
</defs>
</svg>',
'title' => 'Постоянное развитие',
'description' => 'Наши специалисты обучаются каждый год: новые методики, индивидуальный подход, работа с возрастными клиентами.'
],
[
'svg' => '<svg width="38" height="38" viewBox="0 0 38 38" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2307_11145)">
<path d="M29.2866 25.327C27.148 21.7037 23.2066 19.4414 19.0001 19.4414C14.7936 19.4414 10.8699 21.6861 8.71361 25.327C7.81221 26.8647 7.79454 28.7205 8.67826 30.2582C9.54431 31.7958 11.135 32.6972 12.8848 32.6972H25.0978C26.8652 32.6972 28.4383 31.7782 29.3043 30.2582C30.188 28.7028 30.1703 26.8647 29.269 25.327H29.2866Z" fill="url(#paint0_linear_2307_11145)" />
<path d="M19 18.5576C22.6605 18.5576 25.6279 15.5902 25.6279 11.9297C25.6279 8.26917 22.6605 5.30176 19 5.30176C15.3395 5.30176 12.3721 8.26917 12.3721 11.9297C12.3721 15.5902 15.3395 18.5576 19 18.5576Z" fill="url(#paint1_linear_2307_11145)" />
<path d="M36.6744 15.0233C35.9498 15.0233 35.3488 14.4223 35.3488 13.6977V6.62791C35.3488 4.43628 33.5637 2.65116 31.3721 2.65116H24.3023C23.5777 2.65116 22.9767 2.05023 22.9767 1.32558C22.9767 0.60093 23.5777 0 24.3023 0H31.3721C35.0307 0 38 2.9693 38 6.62791V13.6977C38 14.4223 37.3991 15.0233 36.6744 15.0233ZM31.3721 38H24.3023C23.5777 38 22.9767 37.3991 22.9767 36.6744C22.9767 35.9498 23.5777 35.3488 24.3023 35.3488H31.3721C33.5637 35.3488 35.3488 33.5637 35.3488 31.3721V24.3023C35.3488 23.5777 35.9498 22.9767 36.6744 22.9767C37.3991 22.9767 38 23.5777 38 24.3023V31.3721C38 35.0307 35.0307 38 31.3721 38ZM1.32558 15.0233C0.60093 15.0233 0 14.4223 0 13.6977V6.62791C0 2.9693 2.9693 0 6.62791 0H13.6977C14.4223 0 15.0233 0.60093 15.0233 1.32558C15.0233 2.05023 14.4223 2.65116 13.6977 2.65116H6.62791C4.43628 2.65116 2.65116 4.43628 2.65116 6.62791V13.6977C2.65116 14.4223 2.05023 15.0233 1.32558 15.0233ZM13.6977 38H6.62791C2.9693 38 0 35.0307 0 31.3721V24.3023C0 23.5777 0.60093 22.9767 1.32558 22.9767C2.05023 22.9767 2.65116 23.5777 2.65116 24.3023V31.3721C2.65116 33.5637 4.43628 35.3488 6.62791 35.3488H13.6977C14.4223 35.3488 15.0233 35.9498 15.0233 36.6744C15.0233 37.3991 14.4223 38 13.6977 38Z" fill="url(#paint2_linear_2307_11145)" />
<path d="M33 25.5L26 30V32.5L31 35.5L36 27.5L33 25.5Z" fill="white" />
<path fill-rule="evenodd" clip-rule="evenodd" d="M26.75 23C25.7554 23 24.8016 23.3951 24.0983 24.0983C23.3951 24.8016 23 25.7554 23 26.75V34.25C23 35.2446 23.3951 36.1984 24.0983 36.9017C24.8016 37.6049 25.7554 38 26.75 38H34.25C35.2446 38 36.1984 37.6049 36.9017 36.9017C37.6049 36.1984 38 35.2446 38 34.25V26.75C38 25.7554 37.6049 24.8016 36.9017 24.0983C36.1984 23.3951 35.2446 23 34.25 23H26.75ZM33.98 27.674C34.1327 27.8013 34.2286 27.9841 34.2466 28.1821C34.2646 28.3801 34.2032 28.5772 34.076 28.73L30.326 33.23C30.2612 33.3077 30.1814 33.3714 30.0914 33.4174C30.0013 33.4635 29.9029 33.4908 29.802 33.4978C29.7011 33.5048 29.5998 33.4914 29.5043 33.4582C29.4087 33.4251 29.3209 33.373 29.246 33.305L26.996 31.2597C26.8515 31.1253 26.7659 30.9393 26.7577 30.7421C26.7494 30.5449 26.8193 30.3524 26.952 30.2064C27.0847 30.0603 27.2697 29.9725 27.4667 29.9619C27.6638 29.9513 27.8571 30.0188 28.0048 30.1497L29.675 31.6685L32.924 27.77C33.0513 27.6173 33.2341 27.5214 33.4321 27.5034C33.6301 27.4854 33.8272 27.5468 33.98 27.674Z" fill="#E21E24" />
</g>
<defs>
<linearGradient id="paint0_linear_2307_11145" x1="8.02637" y1="26.0693" x2="29.9562" y2="26.0693" gradientUnits="userSpaceOnUse">
<stop offset="0.673077" stop-color="#2B2C35" />
<stop offset="0.929023" stop-color="#4F5870" />
</linearGradient>
<linearGradient id="paint1_linear_2307_11145" x1="12.3721" y1="11.9297" x2="25.6279" y2="11.9297" gradientUnits="userSpaceOnUse">
<stop offset="0.673077" stop-color="#2B2C35" />
<stop offset="0.929023" stop-color="#4F5870" />
</linearGradient>
<linearGradient id="paint2_linear_2307_11145" x1="0" y1="19" x2="38" y2="19" gradientUnits="userSpaceOnUse">
<stop offset="0.673077" stop-color="#2B2C35" />
<stop offset="0.929023" stop-color="#4F5870" />
</linearGradient>
<clipPath id="clip0_2307_11145">
<rect width="38" height="38" fill="white" />
</clipPath>
</defs>
</svg>',
'title' => 'Про атмосферу, а не про давление',
'description' => 'Вы — в центре внимания. Тренировки без стресса, с ощущением заботы и прогресса.'
]
];
?>
<div class="max-[768px]:grid-cols-1 max-[1300px]:gap-[24px] max-[1300px]:divide-none max-[1300px]:grid-cols-2 mt-[40px] grid grid-cols-4 divide-x divide-[#e0e0e0]">
<?php foreach ($blocks as $index => $block): ?>
<div class="max-[1300px]:p-0 flex flex-col px-[24px] <?php echo $index === 0 ? 'pl-0' : ''; ?> <?php echo $index === 3 ? 'pr-0' : ''; ?>">
<div class="grid place-items-center w-[76px] h-[76px] rounded-[12px] small-shadow bg-[#f8f8f8]"> <?php echo $block['svg']; ?></div>
<p class="max-[1300px]:max-w-full mt-[24px] w-full max-w-[220px] font-[600] text-[24px] leading-[125%]">
<?php echo htmlspecialchars($block['title']); ?>
</p>
<p class="max-[1300px]:max-w-full mt-[12px] w-full max-w-[270px] font-[500] text-[16px] leading-[145%] text-[#6c6b6b]">
<?php echo htmlspecialchars($block['description']); ?>
</p>
</div>
<?php endforeach; ?>
</div>
</div>
</section>
<?php get_footer(); ?>

363
archive-training.php Normal file
View File

@@ -0,0 +1,363 @@
<?php
get_header();
if (!function_exists('get_trainings_for_current_language')) {
function get_trainings_for_current_language()
{
$current_lang = pll_current_language();
$args = array(
'post_type' => 'training',
'posts_per_page' => -1,
'lang' => $current_lang,
'post_status' => 'publish',
'sort' => 'menu_order',
'order' => 'ASC',
);
return get_posts($args);
}
}
function get_training_taxonomies()
{
$taxonomies = get_object_taxonomies('training', 'objects');
$result = array();
foreach ($taxonomies as $taxonomy) {
if (!in_array($taxonomy->name, array('language', 'post_translations'))) {
$terms = get_terms(array(
'taxonomy' => $taxonomy->name,
'hide_empty' => true,
));
if (!is_wp_error($terms) && !empty($terms)) {
$result[$taxonomy->name] = array(
'taxonomy' => $taxonomy,
'terms' => $terms
);
}
}
}
return $result;
}
$trainings = get_trainings_for_current_language();
$taxonomies_data = get_training_taxonomies();
$trainings_data = array();
if ($trainings) {
foreach ($trainings as $training) {
$training_info = array(
'post' => $training,
'name' => '',
'exp' => '',
'short_desc' => '',
'terms' => array()
);
if (have_rows('short_info', $training->ID)) {
while (have_rows('short_info', $training->ID)) {
the_row();
$training_info['name'] = get_sub_field('name');
$training_info['exp'] = get_sub_field('exp');
$training_info['short_desc'] = get_sub_field('short_desc');
$training_info['difficulty'] = get_sub_field('dificulty');
}
}
foreach ($taxonomies_data as $taxonomy_name => $taxonomy_info) {
$post_terms = wp_get_post_terms($training->ID, $taxonomy_name);
if (!is_wp_error($post_terms)) {
$training_info['terms'][$taxonomy_name] = $post_terms;
}
}
$trainings_data[] = $training_info;
}
}
function group_trainings_by_terms($trainings_data, $taxonomies_data)
{
$grouped = array();
foreach ($taxonomies_data as $taxonomy_name => $taxonomy_info) {
$grouped[$taxonomy_name] = array();
foreach ($taxonomy_info['terms'] as $term) {
$grouped[$taxonomy_name][$term->slug] = array(
'term' => $term,
'trainings' => array()
);
foreach ($trainings_data as $training_data) {
if (isset($training_data['terms'][$taxonomy_name])) {
foreach ($training_data['terms'][$taxonomy_name] as $training_term) {
if ($training_term->slug === $term->slug) {
$grouped[$taxonomy_name][$term->slug]['trainings'][] = $training_data;
break;
}
}
}
}
}
}
return $grouped;
}
$grouped_trainings = group_trainings_by_terms($trainings_data, $taxonomies_data);
if (have_rows('short_info')) {
while (have_rows('short_info')) {
the_row();
$training_name = get_sub_field('name');
$training_short_desc = get_sub_field('short_desc');
$training_difficulty = get_sub_field('dificulty');
}
}
?>
<section class="max-[768px]:py-[40px] py-[90px] container mx-auto">
<div>
<?php if (!empty($taxonomies_data)): ?>
<div class="filter-navigation">
<?php foreach ($taxonomies_data as $taxonomy_name => $taxonomy_info): ?>
<div>
<div class="max-[768px]:gap-[4px] flex flex-wrap gap-[8px]">
<?php foreach ($taxonomy_info['terms'] as $term): ?>
<button class="max-[768px]:!text-[15px] max-[768px]:!px-[14px]"
onclick="scrollToSection('<?php echo esc_attr($taxonomy_name . '-' . $term->slug); ?>')">
<?php echo esc_html($term->name); ?>
</button>
<?php endforeach; ?>
</div>
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>
<?php foreach ($grouped_trainings as $taxonomy_name => $terms_data): ?>
<?php foreach ($terms_data as $term_slug => $term_data): ?>
<?php if (!empty($term_data['trainings'])): ?>
<div id="<?php echo esc_attr($taxonomy_name . '-' . $term_slug); ?>"
class="max-[768px]:mt-[40px] mt-[64px]">
<h2 class="max-[1050px]:text-[28px] max-[768px]:text-[24px] font-[700] text-[32px] leading-[115%]"><?php echo esc_html($term_data['term']->name); ?></h2>
<div class="max-[768px]:!px-[24px] max-[768px]:!mx-[-24px] trainings-container mt-[24px]"
data-section="<?php echo esc_attr($taxonomy_name . '-' . $term_slug); ?>">
<div class="max-[1300px]:gap-0 trainings-wrapper flex flex-wrap gap-[24px]">
<?php foreach ($term_data['trainings'] as $training_data): ?>
<?php $training = $training_data['post']; ?>
<a href="<?php echo get_permalink($training->ID); ?>"
class="!no-underline training-item h-auto max-w-[312px] group block no-underline hover:no-underline transition-transform">
<div class=" max-[768px]:shadow-[0_4px_48px_0_rgba(16,_15,_15,_0.1)] flex flex-col bg-[#f8f8f8] relative h-auto rounded-[20px] overflow-hidden shadow-[0_2px_32px_0_rgba(16,_15,_15,_0.03)] group-hover:shadow-[0_4px_48px_0_rgba(16,_15,_15,_0.1)] transition-shadow">
<?php $photo_images = get_field('photo', $training->ID); ?>
<?php if ($photo_images && !empty($photo_images[0])): ?>
<div class="overflow-hidden min-h-[260px]">
<img src="<?php echo esc_url($photo_images[0]['url']); ?>"
alt="<?php echo esc_attr($photo_images[0]['alt']); ?>"
loading="lazy"
class="w-full h-[260px] object-cover transition-transform"/>
</div>
<?php endif; ?>
<div class="max-[768px]:gap-[12px] max-[768px]:p-[12px] flex flex-col gap-[24px] h-full p-[24px]">
<?php $name = $training_data['name']; ?>
<?php if ($name): ?>
<div class="text-[24px] leading-[125%] font-[600] group-hover:text-[#e21e24] transition-colors">
<?php echo esc_html($name); ?>
</div>
<?php endif; ?>
<?php $short_desc = $training_data['short_desc']; ?>
<?php if ($short_desc): ?>
<div class="text-[16px] leading-[145%] font-[500] text-[#222]">
<?php echo wp_kses_post($short_desc); ?>
</div>
<?php endif; ?>
<?php $difficulty = $training_data['difficulty']; ?>
<?php if ($difficulty):
$difficulty_value = (int)$difficulty;
$difficulty_texts = [
1 => 'лёгкая', 2 => 'лёгкая',
3 => 'средняя', 4 => 'средняя',
5 => 'тяжелая'
];
$red_color = '#E21E24';
$gray_color = '#E0E0E0';
?>
<div class="pt-[14px] border-t border-dashed w-full justify-center gap-[12px] flex items-center mx-auto">
<span class="max-[768px]:text-[14px] font-[600] text-[16px] leading-[115%] text-[#2b2c35]">Сложность:</span>
<div class="flex items-center gap-2">
<svg width="28" height="17" viewBox="0 0 28 17"
fill="none"
xmlns="http://www.w3.org/2000/svg">
<rect y="8" width="4" height="9" rx="1.33333"
fill="<?php echo ($difficulty_value >= 1) ? $red_color : $gray_color; ?>"/>
<rect x="6" y="5" width="4" height="12" rx="1.33333"
fill="<?php echo ($difficulty_value >= 2) ? $red_color : $gray_color; ?>"/>
<rect x="12" y="3" width="4" height="14"
rx="1.33333"
fill="<?php echo ($difficulty_value >= 3) ? $red_color : $gray_color; ?>"/>
<rect x="18" y="2" width="4" height="15"
rx="1.33333"
fill="<?php echo ($difficulty_value >= 4) ? $red_color : $gray_color; ?>"/>
<rect x="24" width="4" height="17" rx="1.33333"
fill="<?php echo ($difficulty_value >= 5) ? $red_color : $gray_color; ?>"/>
</svg>
<span class="font-[500] text-[16px] max-[768px]:text-[14px] leading-[140%]">
<?php echo esc_html($difficulty_texts[$difficulty_value] ?? 'неизвестная'); ?>
</span>
</div>
</div>
<?php endif; ?>
<div class="!hidden mt-auto h-[59px] flex grey-gradient-hover w-full rounded-[90px] px-[12px] text-[18px] font-[600] leading-[195%] text-[#f8f8f8] bg-[0_2px_32px_0_rgba(16,_15,_15,_0.03)] items-center justify-center group-hover:opacity-90 transition-opacity pointer-events-none">
Перейти
</div>
</div>
</div>
</a>
<?php endforeach; ?>
</div>
</div>
</div>
<?php endif; ?>
<?php endforeach; ?>
<?php endforeach; ?>
</div>
</section>
<script>
function scrollToSection(sectionId) {
document.getElementById(sectionId).scrollIntoView({
behavior: 'smooth',
block: 'start'
});
}
document.addEventListener('DOMContentLoaded', function () {
let swiperInstances = [];
function initSwiper() {
if (window.innerWidth < 1330) {
document.querySelectorAll('.trainings-container').forEach((container, index) => {
const wrapper = container.querySelector('.trainings-wrapper');
const items = container.querySelectorAll('.training-item');
if (items.length <= 1) return;
container.classList.add('swiper');
wrapper.classList.remove('flex', 'flex-wrap');
wrapper.classList.add('swiper-wrapper');
items.forEach(item => {
const slide = document.createElement('div');
slide.className = 'swiper-slide max-w-[312px]';
item.parentNode.insertBefore(slide, item);
slide.appendChild(item);
});
const scrollbar = document.createElement('div');
scrollbar.className = 'swiper-scrollbar !static !mx-auto !cursor-grab container mt-[44px] !w-full !p-0';
container.appendChild(scrollbar);
const swiper = new Swiper(container, {
slidesPerView: 'auto',
spaceBetween: 12,
grabCursor: true,
freeMode: true,
scrollbar: {
el: container.querySelector('.swiper-scrollbar'),
draggable: true,
},
keyboard: {
enabled: true,
},
});
swiperInstances.push(swiper);
});
} else {
destroySwipers();
}
}
function destroySwipers() {
swiperInstances.forEach(swiper => {
if (swiper && swiper.destroy) {
swiper.destroy(true, true);
}
});
swiperInstances = [];
document.querySelectorAll('.trainings-container').forEach(container => {
const wrapper = container.querySelector('.trainings-wrapper');
const slides = container.querySelectorAll('.swiper-slide');
container.classList.remove('swiper');
wrapper.classList.add('flex', 'flex-wrap');
wrapper.classList.remove('swiper-wrapper');
slides.forEach(slide => {
const item = slide.querySelector('.training-item');
if (item) {
wrapper.appendChild(item);
slide.remove();
}
});
container.querySelectorAll('.swiper-scrollbar').forEach(el => el.remove());
});
}
initSwiper();
let resizeTimeout;
window.addEventListener('resize', function () {
clearTimeout(resizeTimeout);
resizeTimeout = setTimeout(initSwiper, 250);
});
});
</script>
<style>
.filter-navigation button {
box-shadow: 0 2px 32px 0 rgba(16, 15, 15, 0.03);
background: #fff;
font-weight: 500;
font-size: 18px;
line-height: 195%;
color: #222;
border-radius: 90px;
padding: 8px 28px;
border: none;
cursor: pointer;
transition: all 180ms ease-in-out;
}
.filter-navigation button:hover {
font-size: 18px;
line-height: 195%;
color: #f8f8f8;
box-shadow: none;
background: linear-gradient(90deg, #9d9994 39.42%, #ccc9c4 92.9%);
}
.dark .filter-navigation button:hover {
background: linear-gradient(90deg, #2b2c35 39.42%, #6e7996 92.9%);
color: #f8f8f8;
}
</style>
<?php get_footer(); ?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 447 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
assets/images/header-bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
assets/images/hero-bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -11,6 +11,10 @@
<?php do_action( 'tailpress_footer' ); ?>
<?php get_template_part('template-parts/la-components/footer'); ?>
<script type="text/javascript" async="async" id="mobifitness_personal_widget_script_au1" src="//mobifitness.ru/personal-widget/js/code.js" data-div="mf_schedule_widget_cont_au1" data-test="0" data-debug="0" data-domain="mobifitness.ru" data-code="614482" data-version="v6" data-type="schedule" data-language="" data-club="1325"></script>
</footer>
</div>

View File

@@ -43,8 +43,8 @@ add_action( 'after_setup_theme', 'tailpress_setup' );
function tailpress_enqueue_scripts() {
$theme = wp_get_theme();
wp_enqueue_style( 'tailpress', tailpress_asset( 'css/app.css' ), array(), $theme->get( 'Version' ) );
wp_enqueue_script( 'tailpress', tailpress_asset( 'js/app.js' ), array(), $theme->get( 'Version' ) );
wp_enqueue_style( 'tailpress', tailpress_asset( 'css/app.css' ), array(), '0.3' );
wp_enqueue_script( 'tailpress', tailpress_asset( 'js/app.js' ), array(), '0.3' );
}
add_action( 'wp_enqueue_scripts', 'tailpress_enqueue_scripts' );
@@ -118,6 +118,11 @@ function get_current_room() {
$modal_file = get_template_directory() . '/template-parts/la-components/functions/modals.php';
$block_file = get_template_directory() . '/template-parts/la-components/functions/blocks.php';
$forms_file = get_template_directory() . '/template-parts/la-components/functions/forms.php';
$breadcrumbs_file = get_template_directory() . '/template-parts/la-components/functions/breadcrumbs.php';
if (file_exists($breadcrumbs_file)) {
require_once $breadcrumbs_file;
}
if (file_exists($block_file)) {
require_once $block_file;
}
@@ -168,4 +173,347 @@ function wider_language_cols() {
}
</style>';
}
add_action('admin_head', 'wider_language_cols');
add_action('admin_head', 'wider_language_cols');
function get_simple_menu_items($menu_name = 'Шапка сайта') {
$menu = wp_get_nav_menu_object($menu_name);
if (!$menu) {
return array();
}
$menu_items = wp_get_nav_menu_items($menu->term_id);
$current_lang = function_exists('pll_current_language') ? pll_current_language() : null;
if (!$menu_items) {
return array();
}
$clean_title = function($title) {
return trim(preg_replace('/\s*\([^)]*\)/', '', $title));
};
$simple_items = array();
foreach ($menu_items as $item) {
if ($current_lang === 'gym' && $item->type === 'post_type_archive' && $item->object === 'training') {
continue;
}
$url = $item->url;
$title = $clean_title($item->title);
if ($current_lang && $item->object == 'page' && function_exists('pll_get_post')) {
$translated_page_id = pll_get_post($item->object_id, $current_lang);
if ($translated_page_id) {
$url = get_permalink($translated_page_id);
$translated_title = get_the_title($translated_page_id);
if ($translated_title) {
$title = $clean_title($translated_title);
}
}
}
$simple_items[] = array(
'title' => $title,
'url' => $url,
'id' => $item->ID
);
}
return $simple_items;
}
function add_dark_class_to_editor() {
$screen = get_current_screen();
if (!$screen || !in_array($screen->base, ['post', 'page'])) {
return;
}
$current_lang = '';
if (isset($_GET['post'])) {
$current_lang = pll_get_post_language($_GET['post']);
} elseif (isset($_GET['lang'])) {
$current_lang = $_GET['lang'];
} else {
$current_lang = pll_current_language();
}
if ($current_lang === 'gym') {
?>
<script>
jQuery(document).ready(function($) {
$('#editor').addClass('dark');
});
</script>
<?php
}
}
add_action('admin_head', 'add_dark_class_to_editor');
function create_archive_acf_pages() {
if (!function_exists('acf_add_options_sub_page')) {
return;
}
// Получаем все кастомные типы записей с архивами
$post_types = get_post_types(array(
'public' => true,
'has_archive' => true,
'_builtin' => false
), 'objects');
foreach ($post_types as $post_type) {
acf_add_options_sub_page(array(
'page_title' => 'Настройки страницы ' . $post_type->labels->name,
'menu_title' => 'Настройки страницы',
'menu_slug' => $post_type->name . '-archive-settings',
'parent_slug' => 'edit.php?post_type=' . $post_type->name,
'capability' => 'edit_posts',
));
}
}
add_action('acf/init', 'create_archive_acf_pages');
function register_archive_acf_fields() {
if (!function_exists('acf_add_local_field_group')) {
return;
}
$languages = get_archive_languages();
$post_types = get_post_types(array(
'public' => true,
'has_archive' => true,
'_builtin' => false
), 'objects');
foreach ($post_types as $post_type) {
register_fields_for_archive($post_type, $languages);
}
}
add_action('acf/init', 'register_archive_acf_fields');
function get_archive_languages() {
if (function_exists('pll_languages_list')) {
$languages = array();
$pll_languages = pll_languages_list(array('fields' => array()));
foreach ($pll_languages as $lang) {
$languages[$lang->slug] = $lang->name;
}
return $languages;
}
return array(
'gym' => 'gym зал',
'fitness' => 'fitness зал'
);
}
function register_fields_for_archive($post_type, $languages) {
$post_type_name = $post_type->name;
$post_type_label = $post_type->labels->name;
$fields = array();
foreach ($languages as $lang_code => $lang_name) {
$fields[] = array(
'key' => 'field_tab_' . $post_type_name . '_' . $lang_code,
'label' => $lang_name,
'type' => 'tab',
'placement' => 'top',
);
// Поля для этого языка
$fields[] = array(
'key' => 'field_' . $post_type_name . '_h1_text_' . $lang_code,
'label' => 'Заголовок H1',
'name' => $post_type_name . '_h1_text_' . $lang_code,
'type' => 'wysiwyg',
'toolbar' => 'basic',
'media_upload' => 0,
'delay' => 0,
);
$fields[] = array(
'key' => 'field_' . $post_type_name . '_subtitle_' . $lang_code,
'label' => 'Подзаголовок',
'name' => $post_type_name . '_subtitle_' . $lang_code,
'type' => 'textarea',
'rows' => 3,
);
if ($post_type_name === 'trainer') {
$fields[] = array(
'key' => 'field_' . $post_type_name . '_team_photo_' . $lang_code,
'label' => 'Фото команды',
'name' => $post_type_name . '_team_photo_' . $lang_code,
'type' => 'image',
'return_format' => 'array',
'preview_size' => 'medium',
);
$fields[] = array(
'key' => 'field_' . $post_type_name . '_description_' . $lang_code,
'label' => 'Описание страницы',
'name' => $post_type_name . '_description_' . $lang_code,
'type' => 'textarea',
'rows' => 5,
);
}
}
acf_add_local_field_group(array(
'key' => 'group_' . $post_type_name . '_archive',
'title' => 'Настройки страницы ' . $post_type_label,
'fields' => $fields,
'location' => array(
array(
array(
'param' => 'options_page',
'operator' => '==',
'value' => $post_type_name . '-archive-settings',
),
),
),
));
}
function get_archive_field($post_type, $field_name, $default = '') {
if (!function_exists('get_field')) {
return $default;
}
$current_lang = function_exists('pll_current_language') ? pll_current_language() : 'ru';
$field_key = $post_type . '_' . $field_name . '_' . $current_lang;
$value = get_field($field_key, 'option');
return $value ? $value : $default;
}
function checkTelForSpam($phone_value)
{
$clean_phone = preg_replace('/\D/', '', $phone_value);
if (substr($clean_phone, 0, 1) === '8') {
$clean_phone = '7' . substr($clean_phone, 1);
}
if (strlen($clean_phone) !== 11 || substr($clean_phone, 0, 1) !== '7') {
return false;
}
return true;
}
function maspik_custom_validate_fluentforms_tel($errorMessage, $field, $formData, $fields, $form)
{
$fieldName = $field['name'];
if (empty($formData[$fieldName])) {
return $errorMessage;
}
$field_value = $formData[$fieldName];
$valid = checkTelForSpam($field_value);
if (!$valid) {
$errorMessage = "Введите корректный номер телефона";
}
return $errorMessage;
}
add_filter('fluentform/validate_input_item_phone', 'maspik_custom_validate_fluentforms_tel', 10, 5);
function cookie_popup_enqueue_scripts() {
wp_enqueue_script('jquery');
$custom_css = "
.page-block-shadow {
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08);
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(10px);
}
.red-button-shadow {
box-shadow: 0 4px 16px rgba(224, 30, 46, 0.25), 0 2px 4px rgba(224, 30, 46, 0.1);
transition: all 0.2s ease;
}
.red-button-shadow:hover {
box-shadow: 0 6px 20px rgba(224, 30, 46, 0.35), 0 3px 6px rgba(224, 30, 46, 0.15);
transform: translateY(-1px);
}
.red-button-shadow:active {
transform: translateY(0);
box-shadow: 0 2px 8px rgba(224, 30, 46, 0.3);
}
";
wp_add_inline_style('wp-block-library', $custom_css);
}
add_action('wp_enqueue_scripts', 'cookie_popup_enqueue_scripts');
function cookie_popup_html() {
?>
<div id="cookiePopup" class="fixed bottom-[16px] left-[16px] right-[16px] min-[768px]:left-auto min-[768px]:right-[16px] max-[480px]:left-[8px] max-[480px]:right-[8px] max-[480px]:bottom-[8px] p-[24px] max-[480px]:p-[16px] rounded-[1.6rem] page-block-shadow z-[9999] transform translate-y-[100%] opacity-[0] transition-all duration-[500ms] ease-out">
<div class="mb-[16px] text-[14px] leading-[1.5]">
Мы используем файлы cookie  чтобы сайт работал быстрее.
</div>
<button
id="acceptCookiesBtn"
class="!max-w-fit h-[40px] max-[768px]:text-[16px] cursor-pointer mx-auto px-[14px] !no-underline transition red-gradient-hover gap-[12px] w-full rounded-[90px] flex items-center justify-center "
>
<span class="max-[768px]:text-[16px] font-[600] text-[18px] leading-[195%] text-[#f8f8f8]">Хорошо</span>
</button>
</div>
<script>
jQuery(document).ready(function($) {
checkCookieConsent();
$('#acceptCookiesBtn').on('click', function() {
acceptCookies();
});
function checkCookieConsent() {
const consent = localStorage.getItem('cookieConsent');
if (!consent) {
setTimeout(showCookiePopup, 500);
}
}
function showCookiePopup() {
$('#cookiePopup').removeClass('translate-y-[100%] opacity-[0]').addClass('translate-y-[0] opacity-[100]');
}
function acceptCookies() {
$('#cookiePopup').addClass('translate-y-[100%] opacity-[0]').removeClass('translate-y-[0] opacity-[100]');
localStorage.setItem('cookieConsent', 'accepted');
enableAnalytics();
}
function enableAnalytics() {
}
});
</script>
<?php
}
add_action('wp_footer', 'cookie_popup_html');
?>

View File

@@ -9,190 +9,359 @@
<?php wp_head(); ?>
</head>
<body <?php body_class('bg-[#f9f9f9] text-[#222]'); ?>>
<?php
echo(get_field( 'yandex_metrics', 'option' ));
$room = get_current_room();
$base_classes = 'bg-[#f9f9f9] dark:bg-[#f4f4f4] text-[#222]';
if ($room === 'gym') {
$body_classes = $base_classes . ' dark';
} else {
$body_classes = $base_classes;
}
?>
<body <?php body_class($body_classes); ?>>
<?php do_action('tailpress_site_before'); ?>
<div id="page" class="min-h-screen flex flex-col">
<?php do_action('tailpress_header'); ?>
<header>
<div class="mx-auto container mt-[24px]">
<header class="container mx-auto absolute left-0 right-0 z-[49] <?php echo is_admin_bar_showing() ? 'top-[32px]' : 'top-0'; ?>"
id="site-header">
<div class="pt-[24px] max-[768px]:pb-[22px] dark:text-[#f8f8f8]">
<div>
<div class="flex justify-between items-center">
<div>
<?php if (has_custom_logo()) { ?>
<?php the_custom_logo(); ?>
<?php } else { ?>
<a href="<?php echo get_bloginfo('url'); ?>" class="font-extrabold text-lg uppercase">
<?php echo get_bloginfo('name'); ?>
</a>
<?php } ?>
<div class="max-[768px]:flex-wrap max-[768px]:gap-[16px] max-[1200px]:justify-start max-[1200px]:gap-[12px] flex justify-between items-center">
<a href="<?php echo esc_url(home_url('/')); ?>">
<?php display_icon(get_current_room() === 'gym' ? 'dark_logo' : 'light_logo'); ?>
</a>
<div class="max-[768px]:flex-col max-[768px]:items-start max-[768px]:gap-0 max-[768px]:w-full max-[768px]:order-1 flex items-center gap-[6px] dark:text-[#fff]">
<?php get_template_part('template-parts/la-components/language-switcher'); ?>
<span class="max-[768px]:mx-auto max-[768px]:max-w-full text-[12px] font-[500] max-[768px]:text-[14px] max-w-[60px] max-[768px]:[&>br]:hidden">Переключайте <br> формат</span>
</div>
<?php get_template_part('template-parts/la-components/language-switcher'); ?>
<div class="flex items-center gap-[12px]">
<div class="max-[1200px]:hidden flex items-center gap-[12px]">
<div class="w-[8px] h-[8px] rounded-full bg-[#e21e24]"></div>
<div class="leading-[125%] text-[14px] font-[600]">
<p>г. Томск, </p>
<p>ул. Красноармейская, 120</p>
</div>
</div>
<div class="flex items-center gap-[12px]">
<div class="max-[1200px]:hidden flex items-center gap-[12px]">
<div class="w-[8px] h-[8px] rounded-full bg-[#e21e24]"></div>
<div class="leading-[125%] text-[14px] font-[600]">
<p>Пн–Пт: 7:00 23:00</p>
<p>СбВс: 9:00 22:00</p>
</div>
</div>
<div class="flex gap-[4px]">
<a class="hover:[&>img]:brightness-150 transition" href="#">
<?php
display_icon('tg');
?>
<div class="max-[1200px]:ml-auto flex gap-[4px]">
<a class="max-[1250px]:w-[30px] max-[1250px]:h-[30px] dark:hover:[&>img]:brightness-90 hover:[&>img]:brightness-150 transition"
href="https://t.me/FakelGym_bot">
<?php display_icon(get_current_room() === 'gym' ? 'tg_dark' : 'tg'); ?>
</a>
<a class="hover:[&>img]:brightness-150 transition" href="#">
<?php
display_icon('whatsapp');
?>
<a class="max-[1250px]:w-[30px] max-[1250px]:h-[30px] dark:hover:[&>img]:brightness-90 hover:[&>img]:brightness-150 transition"
href="https://wa.me/79832321319">
<?php display_icon(get_current_room() === 'gym' ? 'whatsapp_dark' : 'whatsapp'); ?>
</a>
<a class="hidden max-[1250px]:block dark:hover:[&>img]:brightness-90 hover:[&>img]:brightness-150 transition"
href="tel:+783822990019">
<?php display_icon(get_current_room() === 'gym' ? 'phone_dark' : 'phone'); ?>
</a>
<a class="[&>img]:w-[36px] max-[1250px]:hidden dark:hover:text-[#c7c7c7] font-[700] text-[24px] !decoration-transparent hover:text-[#555] transition-colors dark:hover:[&>img]:brightness-90 hover:[&>img]:brightness-150"
href="tel:+783822990019">
<?php display_icon(get_current_room() === 'gym' ? 'phone_dark' : 'phone'); ?>
</a>
</div>
<a class="font-[700] text-[24px] !decoration-transparent hover:!decoration-inherit transition-colors" href="tel:+783822990019">
+7 (3822) 99-00-19
</a>
<div>
<button class="red-gradient-hover cursor-pointer flex text-[#f8f8f8] text-[16px] font-[600] justify-center h-[45px] w-[136px] rounded-[90px] flex items-center">Записаться</button>
<div class="max-[850px]:hidden">
<?php
$page = get_page_by_path('prices');
?>
<a href="
<?php
echo get_permalink(pll_get_post($page->ID, pll_current_language()) ?: $page->ID);
?>
"
class="max-[768px]:h-[36px] !no-underline items-center red-gradient-hover cursor-pointer flex text-[#f8f8f8] text-[16px] font-[600] justify-center h-[45px] w-[136px] rounded-[90px] flex items-center">
Записаться
</a>
</div>
<div id="burger"
class="hidden max-[1200px]:block cursor-pointer w-[36px] h-[36px] relative focus:outline-none bg-[linear-gradient(90deg,_#e21e24_39.42%,_#ff2f35_92.9%)] rounded-[90px] z-[20]">
<div class="flex items-center justify-center w-full h-full absolute left-[50%] top-[50%] transform -translate-x-[50%] -translate-y-[50%]">
<span class="line-1 block absolute h-[2px] w-[20px] bg-white transform transition -translate-y-[6px]"></span>
<span class="line-2 block absolute h-[2px] w-[20px] bg-white transform transition"></span>
<span class="line-3 block absolute h-[2px] w-[20px] bg-white transform transition translate-y-[6px]"></span>
</div>
</div>
</div>
<?php
/* wp_nav_menu(
array(
'container_id' => 'primary-menu',
'container_class' => 'hidden bg-gray-100 mt-4 p-4 lg:mt-0 lg:p-0 lg:bg-transparent lg:block',
'menu_class' => 'lg:flex lg:-mx-4',
'theme_location' => 'primary',
'li_class' => 'lg:mx-4',
'fallback_cb' => false,
)
);
*/ ?>
</div>
</div>
<div class="py-[24px] max-[768px]:hidden">
<div class="flex items-center justify-between gap-[6px]">
<div class="
group
dark:border dark:border-white/[0.05]
dark:text-[#f8f8f8]
dark:bg-inherit
dark:backdrop-blur-[20px]
dark:bg-[linear-gradient(90deg,rgba(248,248,248,0.04)_65.8%,rgba(255,255,255,0.12)_100%)]
dark:border-[rgba(248,_248,_248,_0.5)] bg-white text-[16px] text-[#222] font-[600] rounded-[90px] h-[44px] px-[28px] flex items-center">
<?php get_template_part('template-parts/la-components/navigation-menu'); ?>
</div>
<div class="max-[1200px]:hidden flex gap-[12px]">
<?php
$page = get_page_by_path('time');
?>
<a href="<?php
echo get_permalink(pll_get_post($page->ID, pll_current_language()) ?: $page->ID);
?>"
class="dark:hidden !no-underline dark:text-[#f8f8f8] dark:border-[rgba(248,_248,_248,_0.2)] font-[600] flex gap-[8px] h-[44px] px-[20px] items-center cursor-pointer border border-[#e0e0e0] rounded-[90px]"
>
<span class="dark:bg-[#f8f8f8] w-[8px] h-[8px] rounded-full bg-[#e21e24]"></span>
Расписание
</a>
<?php
$page = get_page_by_path('lk');
?>
<a href="
<?php
echo get_permalink(pll_get_post($page->ID, pll_current_language()) ?: $page->ID);
?>"
class="!no-underline font-[600] text-[#f8f8f8] dark-gradient-hover flex gap-[8px] h-[44px] px-[20px] items-center cursor-pointer rounded-[90px]"
>
<svg width="16" height="17" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8 0.5C9.06087 0.5 10.0783 0.921427 10.8284 1.67157C11.5786 2.42172 12 3.43913 12 4.5C12 5.56087 11.5786 6.57828 10.8284 7.32843C10.0783 8.07857 9.06087 8.5 8 8.5C6.93913 8.5 5.92172 8.07857 5.17157 7.32843C4.42143 6.57828 4 5.56087 4 4.5C4 3.43913 4.42143 2.42172 5.17157 1.67157C5.92172 0.921427 6.93913 0.5 8 0.5ZM8 10.5C12.42 10.5 16 12.29 16 14.5V16.5H0V14.5C0 12.29 3.58 10.5 8 10.5Z"
fill="#F8F8F8"/>
</svg>
Личный кабинет
</a>
</div>
</div>
</div>
<div id="menu-overlay"
class="max-[768px]:h-[calc(100vh-141px)] max-[768px]:top-[141px] fixed h-[calc(100vh-161px)] top-[161px] left-0 right-0 bg-[rgba(0,0,0,0.5)] backdrop-blur-sm z-[9999] opacity-[0] invisible transition-[opacity,visibility] ease-in-out">
<div id="menu-container"
class="fixed right-[0] top-[0] h-full w-[327px] bg-[#f9f9f9] dark:bg-[#151419] transform translate-x-full transition-[transform] flex flex-col">
<nav class="p-[20px] pr-[10px] flex-1 overflow-y-auto">
<ul class="flex flex-col gap-[4px]">
<?php
$menu_items = get_simple_menu_items();
foreach ($menu_items as $item):
?>
<li class="w-full h-[35px]">
<a class="!no-underline w-full h-full text-[#222] dark:text-[#f8f8f8] dark:hover:text-[#c7c7c7] hover:text-[#555] hover:text-[#555] font-[600] leading-[125%] text-[16px]"
href="<?php echo esc_url($item['url']); ?>">
<?php echo esc_html($item['title']); ?>
</a>
</li>
<?php endforeach; ?>
</ul>
<div class="max-[1200px]:flex hidden text-[14px] justify-between flex-wrap gap-[6px] mt-[16px]">
<?php
$page = get_page_by_path('time');
?>
<a href="<?php
echo get_permalink(pll_get_post($page->ID, pll_current_language()) ?: $page->ID);
?>"
class="dark:hidden !no-underline max-w-[135px] px-[12px] dark:text-[#f8f8f8] dark:border-[rgba(248,_248,_248,_0.2)] font-[600] flex gap-[6px] h-[41px] items-center cursor-pointer border border-[#e0e0e0] rounded-[90px]"
>
<span class="dark:bg-[#f8f8f8] w-[8px] h-[8px] rounded-full bg-[#e21e24]"></span>
Расписание
</a>
<?php
$page = get_page_by_path('lk');
?>
<a href="
<?php
echo get_permalink(pll_get_post($page->ID, pll_current_language()) ?: $page->ID);
?>"
class="!no-underline max-w-[176px] px-[12px] font-[600] text-[#f8f8f8] dark-gradient-hover flex gap-[6px] h-[41px] items-center cursor-pointer rounded-[90px]"
>
<svg class="min-w-fit" width="12" height="12" viewBox="0 0 16 17" fill="none"
xmlns="http://www.w3.org/2000/svg">
<path d="M8 0.5C9.06087 0.5 10.0783 0.921427 10.8284 1.67157C11.5786 2.42172 12 3.43913 12 4.5C12 5.56087 11.5786 6.57828 10.8284 7.32843C10.0783 8.07857 9.06087 8.5 8 8.5C6.93913 8.5 5.92172 8.07857 5.17157 7.32843C4.42143 6.57828 4 5.56087 4 4.5C4 3.43913 4.42143 2.42172 5.17157 1.67157C5.92172 0.921427 6.93913 0.5 8 0.5ZM8 10.5C12.42 10.5 16 12.29 16 14.5V16.5H0V14.5C0 12.29 3.58 10.5 8 10.5Z"
fill="#F8F8F8"/>
</svg>
Личный кабинет
</a>
</div>
<div class="pt-[16px] mt-[16px] border-t border-[#e0e0e0] text-[#222] dark:text-[#f8f8f8]">
<div class="text-[14px]">
<a class="dark:hover:text-[#c7c7c7] font-[700] text-[24px] !decoration-transparent hover:text-[#555] transition-colors"
href="tel:+783822990019">
<span>+7 (3822) 99-00-19</span>
</a>
<div class="mt-[16px] flex items-center gap-[12px]">
<div class="w-[8px] h-[8px] rounded-full bg-[#e21e24]"></div>
<div class="leading-[125%] text-[14px] font-[600]">
<p>г. Томск, </p>
<p>ул. Красноармейская, 120</p>
</div>
</div>
<div class="mt-[12px] flex items-center gap-[12px]">
<div class="w-[8px] h-[8px] rounded-full bg-[#e21e24]"></div>
<div class="leading-[125%] text-[14px] font-[600]">
<p>Пн–Пт: 7:00 23:00</p>
<p>СбВс: 9:00 22:00</p>
</div>
</div>
<div>
<?php
$page = get_page_by_path('prices');
?>
<a href="
<?php
echo get_permalink(pll_get_post($page->ID, pll_current_language()) ?: $page->ID);
?>
"
class="!no-underline w-full mt-[16px] items-center red-gradient-hover cursor-pointer flex text-[#f8f8f8] text-[16px] font-[600] justify-center h-[45px] w-[136px] rounded-[90px] flex items-center">
Записаться
</a>
</div>
</div>
</div>
</nav>
</div>
</div>
</header>
<div class="container mx-auto my-[24px]">
<div class="flex items-center justify-between gap-[32px]">
<div class="group bg-white text-[16px] text-[#222] font-[600] rounded-[90px] h-[44px] px-[28px] flex items-center">
<?php get_template_part('template-parts/la-components/navigation-menu'); ?>
</div>
<div class="flex gap-[12px]">
<button data-modal="time" class="font-[600] flex gap-[8px] h-[44px] px-[20px] items-center cursor-pointer border border-[#e0e0e0] rounded-[90px]"
>
<span class="w-[8px] h-[8px] rounded-full bg-[#e21e24]"></span>
Расписание
</button>
<button
class="font-[600] text-[#f8f8f8] dark-gradient-hover flex gap-[8px] h-[44px] px-[20px] items-center cursor-pointer rounded-[90px]"
>
<svg width="16" height="17" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8 0.5C9.06087 0.5 10.0783 0.921427 10.8284 1.67157C11.5786 2.42172 12 3.43913 12 4.5C12 5.56087 11.5786 6.57828 10.8284 7.32843C10.0783 8.07857 9.06087 8.5 8 8.5C6.93913 8.5 5.92172 8.07857 5.17157 7.32843C4.42143 6.57828 4 5.56087 4 4.5C4 3.43913 4.42143 2.42172 5.17157 1.67157C5.92172 0.921427 6.93913 0.5 8 0.5ZM8 10.5C12.42 10.5 16 12.29 16 14.5V16.5H0V14.5C0 12.29 3.58 10.5 8 10.5Z" fill="#F8F8F8" />
</svg>
Личный кабинет
</button>
<?php
if (!is_front_page()) {
?>
<?php
if ($room === 'fitness') {
$body_classes = 'header-gradient';
} else {
$base_classes = 'bg-cover bg-center bg-no-repeat';
$bg_image = 'data:image/webp;base64,UklGRlYGAABXRUJQVlA4IEoGAAAwhQCdASqgBY8BPpFIoU0lpCMiIAgAsBIJaW7hcROkzhv8UWwDwWUuse5nyAKzdrxcnIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ychwKadSWOI62mG14uTkPfbJyHvtk5D32ych77rmy6qWlQLJdrx7l/S7Xi7HKqlrtcaZUgu0qBZLteLk5D32ych77ZOQ9/QZ8cbzbm2DjOqxp3a8XZmOcK/p9PqmRfS7Xi5OQ99snIe+2TkPfbJyHvtrm2snpIfB+sLXnT1Q45Rp50VJesOEPOFrp7ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZORIZOs8o09I8i7HKaWyXa8XJyHvtk4/0MgPJyHvtk5D32ych77ZOQ99snLewor1HAnIe+78B0WPEnIe+2TkPfb2Yr0aUu14uTkPfbJyHvtk5D32ycslQu+a334IJdo309snIe+2TkPtVfbJyHwYqZae2TkPfbJyHvtk5D32yciQkvU+BRdt3mxzfgKEXJyHvtk5D32ych9uqUA99snIe+2TkPfbJyHvuwNb9PbJy5VNqlFbuJHCC7SGlQLJdrxcnIj+YIB77ZOQ99snIe+2TkPjIoK8PHsD6LrMpE7p3/T2ycKnBf/oPgP0u14xH55OQ99snIe+2TkPfbJyI+F3gw1SkZoS06U8ogWS5SKIgu0qBZQDJdpwfBOQ99snIe+2TkPfbJ6xHPFycjCQtdKRqjyiBZKSIVB77ZOQ99yPzyi4/PJyHvtk5D32ych77ZYGjT0lFmGvmS7YIgnIe+4j0RDnPrxcnIe+5H55O0rc2vFych77ZOQ99snIe+2TkPfbY5RAsl24UoiHOJ0pSCJYfA+IDKgsI4QXaVAsl2vFych8DnKZD32yYzQlp7ZOQ99snH8iifFZLxNQ7zfnXConQ8nIe+2TkPfbJyHv6B3F4uiOsm2XT2ych77ZOQ9YimhLT2yc9xrc6fVAjEfnk5D32ych77ZOQ99snIjve+2TkPfbJyG/9PbJ6VAsl2vEiIT22BikiAe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2T4aWlQLJdryBtMCCLTKkF2lQLJdrxcnIe+2TkPfbJyHvtk5D325l939GqIuTkPfbKijehS6ES5OQ99snIe+2TkPfbJyHvtk5D32ych8B+l2syntPbJyHvtmMyCLUA7SoFku14uTkPfbJyHvtk5D32ych77ZOQ99spqNubXi5OQ/ZwIItRSyHvtk5D32ych77ZOQ99snIe+2TkPfbMZae2TkPfbN/M9rxhUEI/PSCX0u14uTkPfbJyHvtk5D32ych77ZOQ3/p7ZOQ99q45O0rc36SZhqXDV2lQLJdrxcnIe+2TkPfbJyHvtk5D32zGWnuJvtk5D357T3JID7Z1HqyHvtk5D32ych76wAA/v3T9/VuLcLE/Y7G/ZbBl3Ewmhr1flZuAn3R9da7SCpE7umqw0pLouLgAHoOx2OMsGsRJefDaj2aMkv6AAQT05kxqLdMyToNfQ1nQuAAAfDjb2mxSBRuIvqTV+ehuwXpgyFSGym8AAAAG8jp2azhrweGCPKA2vAAABLQ1AV8XezdxCrUWql+rj0p9B3pFePQAQ1+KNqfpcRhJRMAoZpxwgA5j1nYLRusklBegBUKRzEIVy4/wsBY03xliWb+re0NO/aqmpZv6r6AALroFk4+y3tSh6PXFSZarBYdZp1gAAh8JcRnXXWCks10vTEaRo7Nzm9ae9KNPcgZOo305nAFLCYj0PskctdiboDQSSy41PkVM3rQ6B7U1oGZuA3+cgAQzy31FXiL9zk48QLKmifmggACQPgJzdAV7KlGbFrqW1VIBdVO16EAAABM8S5BkK8EzKIHagIdzgACK4lx3scuwdaZ8/Smpzy6ttIMbFegAazB8HiL9tj6ltosVbuzNZ2db1/GCzalijwEd+wX7DaTp9bSVPUvmw2kG18DKK3sie5M+gQAAQgICIt0lv0wndyBgHpcADwCAr3vyjSxyZ9AsK7WEJOAqAgJvh30TVGMIHG4CxCBKW8FlC1DRT4WXx4RTgLkIC0M4TNmUvrITfYAYoQHYTIXY0mpzl2AAMUIFrlaXLE7aaiMT3dcBchAzC5duPMegAAAAA==';
$style_attr = 'style="background-image: url(' . esc_attr($bg_image) . ')"';
}
?>
<div class="<?php echo $base_classes . ' ' . $body_classes . ' ' ?> pt-[161px] max-[768px]:pt-[141px]"
<?php echo $style_attr ?>
>
<div class="max-[768px]:pt-[20px] max-[768px]:pb-[32px] container mx-auto pt-[32px] pb-[60px]">
<?php display_yandex_breadcrumbs(); ?>
<?php if (!is_front_page()) : ?>
<?php
$current_post_type = get_post_type();
if (is_post_type_archive() || ($current_post_type !== 'training' && $current_post_type !== 'trainer')) : ?>
<div class="mt-[24px]">
<?php
$h1_text = '';
$subtitle = '';
$show_layout = false;
if (is_post_type_archive()) {
$post_type = get_queried_object()->name;
$h1_text = get_archive_field($post_type, 'h1_text');
$subtitle = get_archive_field($post_type, 'subtitle');
if ($h1_text) {
$show_layout = true;
}
} elseif (get_field('h1_text')) {
$h1_text = get_field('h1_text');
$show_layout = true;
}
if ($show_layout): ?>
<div class="max-[768px]:gap-[16px] max-[768px]:[&>_img]:hidden flex justify-between flex-wrap gap-[12px]">
<div class="flex flex-col">
<h1 class="dark:text-[#f8f8f8] max-w-[900px] w-full text-[222] leading-[110%] max-[1330px]:text-[36px] max-[768px]:text-[32px] text-[48px] font-[500]">
<?php echo $h1_text; ?>
</h1>
<?php if ($subtitle): ?>
<p class="font-[500] w-full max-w-[687px] text-[24px] leading-[125%] text-[#222] dark:text-[#f8f8f8] mt-[12px]">
<?php echo esc_html($subtitle); ?>
</p>
<?php endif; ?>
<?php
if (is_page('thank-you')) {
?>
<p class="font-[600] w-full max-w-[687px] text-[24px] leading-[125%] text-[#222] dark:text-[#f8f8f8] mt-[12px]">
Очень скоро с вами свяжется наш отдел заботы, чтобы ответить на все
интересующие
вопросы.</p>
<?php
}
?>
</div>
<?php
if (!is_page('policy')) {
if (is_post_type_archive('training')) {
?>
<div class="max-[768px]:flex-row max-[768px]:ml-0 ml-auto flex flex-col gap-[12px]">
<div class="max-[768px]:min-w-[144px] max-[768px]:ml-0 max-[768px]:text-[24px] ml-auto flex gap-[10px] items-center">
<div class="max-[768px]:text-[24px] font-[700] text-[48px] leading-[110%]"> 45+</div>
<img class="max-[768px]:h-[32px] max-[768px]:w-[93px]" alt="decoration"
src="<?php echo get_template_directory_uri() . '/assets/images/masonry-decor.png'; ?>">
</div>
<div class="max-[768px]:text-[14px] font-[500] text-[20px] leading-[140%]">
групповых и персональных тренировок
</div>
</div>
<?php
} else {
display_icon(get_current_room() === 'gym' ? 'dark_logo_name' : 'light_logo_name');
}
}
?>
</div>
<?php else:
$title = '';
if (is_post_type_archive()) {
$post_type = get_queried_object()->name;
$title = get_archive_field($post_type, 'h1_text');
if (!$title) {
$post_type_obj = get_queried_object();
$title = $post_type_obj->labels->name;
}
} else {
$title = trim(preg_replace('/\s*\([^)]*\)/', '', get_the_title()));
}
?>
<h1 class="dark:text-[#f8f8f8] text-[222] leading-[110%] max-[1330px]:text-[36px] max-[768px]:text-[24px] text-[48px] font-[700]">
<?php echo esc_html($title); ?>
</h1>
<?php endif; ?>
</div>
<?php endif; ?>
<?php endif; ?>
</div>
</div>
</div>
<?php
}
?>
<div id="content" class="site-content grow">
<?php do_action('tailpress_content_start'); ?>
<main>
<div class="container mx-auto">
<button class="cursor-pointer p-[10px] rounded border" data-modal="example">Пример модалки</button>
<button class="cursor-pointer p-[10px] rounded border" data-modal="room">Выбор зала</button>
<main id="main-content">
<div class="hidden">
<button class="cursor-pointer p-[10px] rounded border" data-modal="example">Пример модалки</button>
<button class="cursor-pointer p-[10px] rounded border" data-modal="room">Выбор зала</button>
<button class="cursor-pointer p-[10px] rounded border" data-modal="form">Форма</button>
</div>
<?php
$galleryData = [
'reception' => [
'title' => 'Зона ресепшен',
'images' => [
[
'src' => 'https://placehold.co/800x600/4a5568/ffffff?text=Ресепшен+1',
'thumb' => 'https://placehold.co/150x100/4a5568/ffffff?text=Р1',
'alt' => 'Ресепшен 1'
],
[
'src' => 'https://placehold.co/800x600/2d3748/ffffff?text=Ресепшен+2',
'thumb' => 'https://placehold.co/150x100/2d3748/ffffff?text=Р2',
'alt' => 'Ресепшен 2'
],
[
'src' => 'https://placehold.co/800x600/1a202c/ffffff?text=Ресепшен+3',
'thumb' => 'https://placehold.co/150x100/1a202c/ffffff?text=Р3',
'alt' => 'Ресепшен 3'
],
[
'src' => 'https://placehold.co/800x600/718096/ffffff?text=Ресепшен+4',
'thumb' => 'https://placehold.co/150x100/718096/ffffff?text=Р4',
'alt' => 'Ресепшен 4'
]
]
],
'gym' => [
'title' => 'Зона тренажерного зала',
'images' => [
[
'src' => 'https://placehold.co/800x600/dc2626/ffffff?text=Тренажёрный+1',
'thumb' => 'https://placehold.co/150x100/dc2626/ffffff?text=Т1',
'alt' => 'Тренажерный зал 1'
],
[
'src' => 'https://placehold.co/800x600/b91c1c/ffffff?text=Тренажёрный+2',
'thumb' => 'https://placehold.co/150x100/b91c1c/ffffff?text=Т2',
'alt' => 'Тренажерный зал 2'
],
[
'src' => 'https://placehold.co/800x600/991b1b/ffffff?text=Тренажёрный+3',
'thumb' => 'https://placehold.co/150x100/991b1b/ffffff?text=Т3',
'alt' => 'Тренажерный зал 3'
],
[
'src' => 'https://placehold.co/800x600/7f1d1d/ffffff?text=Тренажёрный+4',
'thumb' => 'https://placehold.co/150x100/7f1d1d/ffffff?text=Т4',
'alt' => 'Тренажерный зал 4'
],
[
'src' => 'https://placehold.co/800x600/ef4444/ffffff?text=Тренажёрный+5',
'thumb' => 'https://placehold.co/150x100/ef4444/ffffff?text=Т5',
'alt' => 'Тренажерный зал 5'
]
]
],
'group' => [
'title' => 'Залы для групповых тренировок',
'images' => [
[
'src' => 'https://placehold.co/800x600/059669/ffffff?text=Групповые+1',
'thumb' => 'https://placehold.co/150x100/059669/ffffff?text=Г1',
'alt' => 'Групповые тренировки 1'
],
[
'src' => 'https://placehold.co/800x600/047857/ffffff?text=Групповые+2',
'thumb' => 'https://placehold.co/150x100/047857/ffffff?text=Г2',
'alt' => 'Групповые тренировки 2'
],
[
'src' => 'https://placehold.co/800x600/065f46/ffffff?text=Групповые+3',
'thumb' => 'https://placehold.co/150x100/065f46/ffffff?text=Г3',
'alt' => 'Групповые тренировки 3'
]
]
]
];
?>
<?php

192
js/app.js

File diff suppressed because one or more lines are too long

View File

@@ -1,5 +1,5 @@
{
"/js/app.js": "/js/app.js?id=37f0a4a3aee430ac7ba337b53d7bdc4b",
"/css/editor-style.css": "/css/editor-style.css?id=b2b6dc9c2f83963566f9d157921f4d2e",
"/css/app.css": "/css/app.css?id=387c86ed6537155e6b0a08c0d9151235"
"/js/app.js": "/js/app.js?id=e407125adcc6aae967c27b40d45106cf",
"/css/editor-style.css": "/css/editor-style.css?id=969582528231d1131f1471fd134dc7c0",
"/css/app.css": "/css/app.css?id=276085105aadfad8906d02e869e0f185"
}

10399
package-lock.json generated

File diff suppressed because it is too large Load Diff

265
policy-template.php Normal file
View File

@@ -0,0 +1,265 @@
<?php
/*
* Template Name: Шаблон страницы конфиденциальности
*/
?>
<?php
get_header();
?>
<section class="container mx-auto py-[90px] max-[768px]:py-[40px]">
<div class="flex flex-col gap-[24px] max-[768px]:gap-[16px]">
<h2 class="font-[600] text-[24px] max-[768px]:text-[16px] leading-[125%] max-[768px]:text-[20px]">
1. Общие положения
</h2>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%]">
1.1. Настоящий документ определяет Политику оператора ИП Шишкин Дмитрий Александрович, Юридический адрес фирмы (в соответствии с Учредительными документами): 634021 г. Томск, пр-кт Комсомольский д.12 кв.6. Фактический адрес фирмы: 634034 г. Томск, ул.Красноармейская, д.120. ИНН / КПП: 701 727 001 209., ОГРН: 324 700 000 054 820. (далее Оператор) в отношении обработки персональных данных посетителей интернет-сайта по сетевому адресу <?php echo esc_url(home_url()); ?>, устанавливает цели, основные принципы и правила обработки персональных данных и определяет основные меры по обеспечению их безопасности (далее - Политика) в соответствии с требованиями ст. 18.1 Федерального закона от 27.07.2006 № 152-ФЗ «О персональных данных».
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%]">
1.2. Настоящая Политика разработана в дополнение к Политике обработки персональных данных ИП Шишкин Дмитрий Александрович.
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%]">
1.3. Оператор ставит своей важнейшей целью и условием осуществления своей деятельности соблюдение прав и свобод человека и гражданина при обработке его персональных данных, в том числе защиты прав на неприкосновенность частной жизни, личную и семейную тайну.
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%]">
1.4. Настоящая политика Оператора в отношении обработки персональных данных (далее — Политика) применяется ко всей информации, которую Оператор может получить о посетителях веб-сайта <?php echo esc_url(home_url()); ?>.
</p>
<h2 class="font-[600] text-[24px] max-[768px]:text-[16px] leading-[125%] max-[768px]:text-[20px]">
2. Основные понятия, используемые в Политике
</h2>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%]">
<strong>2.1. Автоматизированная обработка персональных данных</strong> — обработка персональных данных с помощью средств вычислительной техники.
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%]">
<strong>2.2. Блокирование персональных данных</strong> — временное прекращение обработки персональных данных (за исключением случаев, если обработка необходима для уточнения персональных данных).
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%]">
<strong>2.3. Веб-сайт</strong> — совокупность графических и информационных материалов, а также программ для ЭВМ и баз данных, обеспечивающих их доступность в сети интернет по сетевому адресу <?php echo esc_url(home_url()); ?>.
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%]">
<strong>2.4. Информационная система персональных данных</strong> — совокупность содержащихся в базах данных персональных данных и обеспечивающих их обработку информационных технологий и технических средств.
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%]">
<strong>2.5. Обезличивание персональных данных</strong> — действия, в результате которых невозможно определить без использования дополнительной информации принадлежность персональных данных конкретному Пользователю или иному субъекту персональных данных.
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%]">
<strong>2.6. Обработка персональных данных</strong> — любое действие (операция) или совокупность действий (операций), совершаемых с использованием средств автоматизации или без использования таких средств с персональными данными, включая сбор, запись, систематизацию, накопление, хранение, уточнение (обновление, изменение), извлечение, использование, передачу (распространение, предоставление, доступ), обезличивание, блокирование, удаление, уничтожение персональных данных.
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%]">
<strong>2.7. Оператор</strong> — государственный орган, муниципальный орган, юридическое или физическое лицо, самостоятельно или совместно с другими лицами организующие и/или осуществляющие обработку персональных данных, а также определяющие цели обработки персональных данных, состав персональных данных, подлежащих обработке, действия (операции), совершаемые с персональными данными.
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%]">
<strong>2.8. Персональные данные</strong> — любая информация, относящаяся прямо или косвенно к определенному или определяемому Пользователю веб-сайта <?php echo esc_url(home_url()); ?>.
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%]">
<strong>2.9. Пользователь</strong> — любой посетитель веб-сайта <?php echo esc_url(home_url()); ?>.
</p>
<h2 class="font-[600] text-[24px] max-[768px]:text-[16px] leading-[125%] max-[768px]:text-[20px]">
3. Основные права и обязанности Оператора
</h2>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%]">
<strong>3.1. Оператор имеет право:</strong>
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%] ml-[20px]">
— получать от субъекта персональных данных достоверные информацию и/или документы, содержащие персональные данные;
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%] ml-[20px]">
— в случае отзыва субъектом персональных данных согласия на обработку персональных данных, а также, направления обращения с требованием о прекращении обработки персональных данных, Оператор вправе продолжить обработку персональных данных без согласия субъекта персональных данных при наличии оснований, указанных в Законе о персональных данных;
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%] ml-[20px]">
— самостоятельно определять состав и перечень мер, необходимых и достаточных для обеспечения выполнения обязанностей, предусмотренных Законом о персональных данных и принятыми в соответствии с ним нормативными правовыми актами, если иное не предусмотрено Законом о персональных данных или другими федеральными законами.
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%]">
<strong>3.2. Оператор обязан:</strong>
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%] ml-[20px]">
— предоставлять субъекту персональных данных по его просьбе информацию, касающуюся обработки его персональных данных;
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%] ml-[20px]">
— организовывать обработку персональных данных в порядке, установленном действующим законодательством РФ;
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%] ml-[20px]">
— отвечать на обращения и запросы субъектов персональных данных и их законных представителей в соответствии с требованиями Закона о персональных данных;
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%] ml-[20px]">
— публиковать или иным образом обеспечивать неограниченный доступ к настоящей Политике в отношении обработки персональных данных;
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%] ml-[20px]">
— принимать правовые, организационные и технические меры для защиты персональных данных от неправомерного или случайного доступа к ним, уничтожения, изменения, блокирования, копирования, предоставления, распространения персональных данных, а также от иных неправомерных действий в отношении персональных данных;
</p>
<h2 class="font-[600] text-[24px] max-[768px]:text-[16px] leading-[125%] max-[768px]:text-[20px]">
4. Основные права и обязанности субъектов персональных данных
</h2>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%]">
<strong>4.1. Субъекты персональных данных имеют право:</strong>
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%] ml-[20px]">
— получать информацию, касающуюся обработки его персональных данных, за исключением случаев, предусмотренных федеральными законами;
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%] ml-[20px]">
— требовать от оператора уточнения его персональных данных, их блокирования или уничтожения в случае, если персональные данные являются неполными, устаревшими, неточными, незаконно полученными или не являются необходимыми для заявленной цели обработки;
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%] ml-[20px]">
— на отзыв согласия на обработку персональных данных, а также, на направление требования о прекращении обработки персональных данных;
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%] ml-[20px]">
— обжаловать в уполномоченный орган по защите прав субъектов персональных данных или в судебном порядке неправомерные действия или бездействие Оператора при обработке его персональных данных.
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%]">
<strong>4.2. Субъекты персональных данных обязаны:</strong>
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%] ml-[20px]">
— предоставлять Оператору достоверные данные о себе;
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%] ml-[20px]">
— сообщать Оператору об уточнении (обновлении, изменении) своих персональных данных.
</p>
<h2 class="font-[600] text-[24px] max-[768px]:text-[16px] leading-[125%] max-[768px]:text-[20px]">
5. Принципы обработки персональных данных
</h2>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%]">
5.1. Обработка персональных данных осуществляется на законной и справедливой основе.
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%]">
5.2. Обработка персональных данных ограничивается достижением конкретных, заранее определенных и законных целей. Не допускается обработка персональных данных, несовместимая с целями сбора персональных данных.
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%]">
5.3. Не допускается объединение баз данных, содержащих персональные данные, обработка которых осуществляется в целях, несовместимых между собой.
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%]">
5.4. Обработке подлежат только персональные данные, которые отвечают целям их обработки.
</p>
<h2 class="font-[600] text-[24px] max-[768px]:text-[16px] leading-[125%] max-[768px]:text-[20px]">
6. Цели обработки персональных данных
</h2>
<div class="overflow-x-auto">
<table class="w-full border-collapse border border-gray-300">
<thead>
<tr class="bg-gray-100">
<th class="border border-gray-300 p-3 text-left font-[600]">Цель обработки</th>
<th class="border border-gray-300 p-3 text-left font-[600]">Персональные данные</th>
<th class="border border-gray-300 p-3 text-left font-[600]">Правовые основания</th>
<th class="border border-gray-300 p-3 text-left font-[600]">Виды обработки</th>
</tr>
</thead>
<tbody>
<tr>
<td class="border border-gray-300 p-3">Информирование Пользователя посредством отправки электронных писем</td>
<td class="border border-gray-300 p-3">Фамилия, имя, отчество<br>Электронный адрес<br>Номера телефонов</td>
<td class="border border-gray-300 p-3">Уставные (учредительные) документы Оператора</td>
<td class="border border-gray-300 p-3">Отправка информационных писем на адрес электронной почты</td>
</tr>
</tbody>
</table>
</div>
<h2 class="font-[600] text-[24px] max-[768px]:text-[16px] leading-[125%] max-[768px]:text-[20px]">
7. Порядок сбора, хранения, передачи и других видов обработки персональных данных
</h2>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%]">
Безопасность персональных данных, которые обрабатываются Оператором, обеспечивается путем реализации правовых, организационных и технических мер, необходимых для выполнения в полном объеме требований действующего законодательства в области защиты персональных данных.
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%]">
7.1. Оператор обеспечивает сохранность персональных данных и принимает все возможные меры, исключающие доступ к персональным данным неуполномоченных лиц.
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%]">
7.2. Персональные данные Пользователя никогда, ни при каких условиях не будут переданы третьим лицам, за исключением случаев, связанных с исполнением действующего законодательства либо в случае, если субъектом персональных данных дано согласие Оператору на передачу данных третьему лицу для исполнения обязательств по гражданско-правовому договору.
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%]">
7.3. В случае выявления неточностей в персональных данных, Пользователь может актуализировать их самостоятельно, путем направления Оператору уведомления на адрес электронной почты Оператора с пометкой «Актуализация персональных данных».
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%]">
7.4. Срок обработки персональных данных определяется достижением целей, для которых были собраны персональные данные, если иной срок не предусмотрен договором или действующим законодательством.
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%]">
Пользователь может в любой момент отозвать свое согласие на обработку персональных данных, направив Оператору уведомление посредством электронной почты с пометкой «Отзыв согласия на обработку персональных данных».
</p>
<h2 class="font-[600] text-[24px] max-[768px]:text-[16px] leading-[125%] max-[768px]:text-[20px]">
8. Использование файлов cookie
</h2>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%]">
8.1. Сайт <?php echo esc_url(home_url()); ?> использует файлы cookie и аналогичные технологии для улучшения работы сайта, повышения удобства использования, а также в аналитических и маркетинговых целях.
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%]">
8.2. Файлы cookie — это небольшие текстовые файлы, которые сохраняются на устройстве Пользователя при посещении сайта. Они позволяют распознавать браузер Пользователя, сохранять его предпочтения и другую информацию для последующих посещений.
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%]">
8.3. Пользователь может в любое время изменить настройки браузера, чтобы блокировать файлы cookie или получать уведомления об их отправке. Однако в случае отключения cookie некоторые функции сайта могут работать некорректно.
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%]">
8.4. Продолжая использовать сайт без изменения настроек браузера, Пользователь дает согласие на использование файлов cookie в соответствии с настоящей Политикой конфиденциальности.
</p>
<h2 class="font-[600] text-[24px] max-[768px]:text-[16px] leading-[125%] max-[768px]:text-[20px]">
9. Заключительные положения
</h2>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%]">
9.1. Пользователь может получить любые разъяснения по интересующим вопросам, касающимся обработки его персональных данных, обратившись к Оператору с помощью электронной почты.
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%]">
9.2. В данном документе будут отражены любые изменения политики обработки персональных данных Оператором. Политика действует бессрочно до замены ее новой версией.
</p>
<p class="font-[500] text-[16px] max-[768px]:text-[14px]leading-[145%]">
9.3. Актуальная версия Политики в свободном доступе расположена в сети Интернет по адресу <?php echo esc_url(get_permalink()); ?>.
</p>
</div>
</section>
<?php
get_footer();
?>

View File

@@ -1,4 +1,5 @@
@import 'tailwindcss';
@custom-variant dark (&:where(.dark, .dark *));
@import './theme.css';
@import './fonts.css';
@import './utilities.css';

View File

@@ -1,4 +1,5 @@
@import 'tailwindcss';
@custom-variant dark (&:where(.dark, .dark *));
@import './theme.css';
/*

View File

@@ -47,14 +47,26 @@ html, body {
.grey-gradient-hover {
background: linear-gradient(90deg, #9d9994 39.42%, #c5c5b9 92.9%);
background-size: 177% 100%;
background-position: 0% 0;
transition: background-position 180ms cubic-bezier(0.4, 0.0, 0.2, 1);
transition: background 180ms ease-in-out;
background-size: 101%!important;
}
.grey-gradient-hover:hover {
background-position: 39.42% 0;
transition: background-position 180ms cubic-bezier(0.4, 0.0, 0.2, 1);
background: linear-gradient(90deg, #e21e24 39.42%, #ff2f35 92.9%);
}
.dark .grey-gradient-hover {
border: 1px solid rgba(248, 248, 248, 0.12);
backdrop-filter: blur(20px);
box-shadow: 0 2px 32px 0 rgba(16, 15, 15, 0.03);
background: linear-gradient(90deg, #2b2c35 39.42%, #6e7996 92.9%);
transition: background 180ms cubic-bezier(0.4, 0.0, 0.2, 1);
}
.dark .grey-gradient-hover:hover {
background:
linear-gradient(90deg, #e21e24 39.42%, #ff2f35 92.9%),
linear-gradient(90deg, #e21e24 39.42%, #ff2f35 92.9%);
}
.red-gradient-hover {
@@ -80,4 +92,149 @@ html, body {
.dark-gradient-hover:hover {
background-position: 39.42% 0;
transition: background-position 180ms cubic-bezier(0.4, 0.0, 0.2, 1);
}
.radial-gradient {
background: linear-gradient(180deg, #f2f2f2 69.59%, #ededed 100%);
}
.header-gradient{
background: linear-gradient(180deg, #f9f9f9 69.59%, #ededed 100%);
}
.small-shadow{
box-shadow: 0 2px 32px 0 rgba(16, 15, 15, 0.03);
}
.dark-gradient{
background: linear-gradient(90deg, #2b2c35 53.4%, #4f5870 100%);
}
#fluentform_4,
#fluentform_5 {
}
#fluentform_4 .ff-el-form-control,
#fluentform_5 .ff-el-form-control {
border: none;
box-shadow: 0 2px 32px 0 rgba(16, 15, 15, 0.03);
background: #fff;
border-radius: 90px;
height: 77px;
padding-left: 32px;
padding-right: 32px;
outline: 1px solid transparent;
font-weight: 500;
font-size: 16px;
line-height: 130%;
color: #6c6b6b;
}
#fluentform_4 .ff-btn-submit,
#fluentform_5 .ff-btn-submit {
height: 75px;
background: linear-gradient(90deg, #e21e24 39.42%, #ff2f35 92.9%);
border-radius: 90px;
font-weight: 600;
font-size: 18px;
line-height: 195%;
color: #f8f8f8;
display: grid;
place-content: center;
width: 100%;
cursor: pointer;
transition: 180ms ease-in;
}
@media (max-width: 1049px) {
#fluentform_4 .ff-el-form-control,
#fluentform_5 .ff-el-form-control {
font-size: 16px;
height: 69px;
}
#fluentform_4 .ff-btn-submit,
#fluentform_5 .ff-btn-submit {
font-size: 16px;
height: 69px;
}
}
#fluentform_4 .ff-btn-submit:hover,
#fluentform_5 .ff-btn-submit:hover {
font-weight: 700;
transition: 180ms ease-in;
}
#fluentform_4 .ff_submit_btn_wrapper,
#fluentform_5 .ff_submit_btn_wrapper {
margin-bottom: 0!important;
}
#fluentform_4 .error.text-danger,
#fluentform_5 .error.text-danger {
position: absolute;
margin-top: 0;
bottom: -18px;
left: 0;
width: 100%;
text-align: center;
}
#fluentform_4 .ff-el-group,
#fluentform_5 .ff-el-group {
position: relative;
margin-bottom: 18px;
}
#fluentform_4_success,
#fluentform_5_success {
display: none!important;
}
#fluentform_4 .ff-el-input--label,
#fluentform_5 .ff-el-input--label {
position: absolute;
top: 50%;
left: 32px;
transform: translateY(-50%);
pointer-events: none;
z-index: 2;
margin: 0;
transition: 180ms ease-in-out;
font-weight: 500;
font-size: 16px;
line-height: 130%;
color: #6c6b6b;
}
#fluentform_4 .ff-el-group.focused .ff-el-input--label,
#fluentform_4 .ff-el-group.has-value .ff-el-input--label,
#fluentform_5 .ff-el-group.focused .ff-el-input--label,
#fluentform_5 .ff-el-group.has-value .ff-el-input--label {
top: 6px;
transform: translateY(0);
transition: 180ms ease-in-out;
font-size: 14px;
}
#fluentform_4 .ff-el-tc,
#fluentform_5 .ff-el-tc {
margin-top: 32px!important;
font-weight: 500!important;
font-size: 16px!important;
line-height: 145%!important;
color: #6c6b6b!important;
margin-bottom: 0!important;
}
@media (max-width: 1047px) {
#fluentform_4 .ff-el-tc,
#fluentform_5 .ff-el-tc {
font-size: 12px!important;
margin-top: 16px!important;
}
}

View File

@@ -1,7 +1,26 @@
@utility container {
max-width: 1330px;
padding-left: 5px;
padding-right: 5px;
@layer utilities {
.container {
max-width: 1330px;
padding-left: 5px;
padding-right: 5px;
}
}
@media (max-width: 767px) {
@layer utilities {
.container {
padding-left: 24px;
padding-right: 24px;
}
}
}
@media (max-width: 349px) {
@layer utilities {
.container {
padding-left: 5px;
padding-right: 5px;
}
}
}
/*@utility alignfull {

View File

@@ -1,8 +1,272 @@
// Navigation toggle
window.addEventListener('load', function () {
let main_navigation = document.querySelector('#primary-menu');
document.querySelector('#primary-menu-toggle').addEventListener('click', function (e) {
e.preventDefault();
main_navigation.classList.toggle('hidden');
});
/*
document.addEventListener('DOMContentLoaded', function() {
const header = document.getElementById('site-header');
const main = document.getElementById('main-content');
function updateMainPadding() {
const headerHeight = header.offsetHeight;
main.style.paddingTop = headerHeight + 'px';
// Показываем контент с плавной анимацией
main.classList.remove('opacity-0');
}
updateMainPadding();
window.addEventListener('resize', updateMainPadding);
});*/
document.addEventListener('DOMContentLoaded', function() {
function smoothScrollTo(element, options = {}) {
const {
offset = 80,
behavior = 'smooth',
block = 'start'
} = options;
if (element) {
const elementPosition = element.offsetTop;
const offsetPosition = Math.max(0, elementPosition - offset);
window.scrollTo({
top: offsetPosition,
behavior: behavior
});
}
}
document.querySelectorAll('[data-scroll-to]').forEach(function(button) {
button.addEventListener('click', function() {
const scrollTarget = this.getAttribute('data-scroll-to');
if (scrollTarget) {
const targetSection = document.querySelector(`[data-scroll-section="${scrollTarget}"]`);
if (targetSection) {
const scrollOptions = {
offset: 80,
behavior: 'smooth'
};
smoothScrollTo(targetSection, scrollOptions);
document.querySelectorAll('[data-scroll-section]').forEach(section => {
section.classList.remove('scroll-active');
});
targetSection.classList.add('scroll-active');
} else {
console.warn(`Секция с data-scroll-section="${scrollTarget}" не найдена`);
}
}
});
});
function updateActiveSection() {
const sections = document.querySelectorAll('[data-scroll-section]');
const scrollPosition = window.scrollY + 100;
sections.forEach(section => {
const sectionTop = section.offsetTop;
const sectionBottom = sectionTop + section.offsetHeight;
if (scrollPosition >= sectionTop && scrollPosition < sectionBottom) {
sections.forEach(s => s.classList.remove('scroll-current'));
section.classList.add('scroll-current');
}
});
}
let scrollTimeout;
window.addEventListener('scroll', function() {
clearTimeout(scrollTimeout);
scrollTimeout = setTimeout(updateActiveSection, 100);
});
});
document.addEventListener('DOMContentLoaded', function() {
document.addEventListener('focus', function(e) {
if (e.target.matches('#fluentform_4 .ff-el-form-control')) {
const group = e.target.closest('.ff-el-group');
if (group) group.classList.add('focused');
}
}, true);
document.addEventListener('blur', function(e) {
if (e.target.matches('#fluentform_4 .ff-el-form-control')) {
const group = e.target.closest('.ff-el-group');
if (group) group.classList.remove('focused');
}
}, true);
document.addEventListener('input', function(e) {
if (e.target.matches('#fluentform_4 .ff-el-form-control')) {
const group = e.target.closest('.ff-el-group');
if (group) {
if (e.target.value.trim() !== '') {
group.classList.add('has-value');
} else {
group.classList.remove('has-value');
}
}
}
if (e.target.matches('#fluentform_4 .ff-el-phone')) {
formatPhoneNumber(e);
}
});
document.addEventListener('keydown', function(e) {
if (e.target.matches('#fluentform_4 .ff-el-phone')) {
handlePhoneKeydown(e);
}
});
function formatPhoneNumber(e) {
let value = e.target.value.replace(/\D/g, '');
if (value.startsWith('8')) {
value = '7' + value.slice(1);
}
if (!value.startsWith('7') && value.length > 0) {
value = '7' + value;
}
let formattedValue = '';
if (value.length > 0) {
formattedValue = '+7';
if (value.length > 1) {
formattedValue += ' (' + value.slice(1, 4);
if (value.length > 4) {
formattedValue += ') ' + value.slice(4, 7);
if (value.length > 7) {
formattedValue += '-' + value.slice(7, 9);
if (value.length > 9) {
formattedValue += '-' + value.slice(9, 11);
}
}
}
}
}
e.target.value = formattedValue;
}
function handlePhoneKeydown(e) {
if (e.key === 'Backspace' || e.key === 'Delete') {
const cursorPos = e.target.selectionStart;
const value = e.target.value;
if (cursorPos > 0 && [' ', '(', ')', '-'].includes(value[cursorPos - 1])) {
setTimeout(() => {
e.target.setSelectionRange(cursorPos - 1, cursorPos - 1);
}, 0);
}
}
}
});
document.addEventListener('DOMContentLoaded', function() {
const MenuSystem = {
burger: null,
overlay: null,
container: null,
isOpen: false,
init() {
this.burger = document.getElementById('burger');
this.overlay = document.getElementById('menu-overlay');
this.container = document.getElementById('menu-container');
if (!this.burger || !this.overlay || !this.container) {
return;
}
this.bindEvents();
},
bindEvents() {
this.burger.addEventListener('click', () => {
if (this.isOpen) {
this.close();
} else {
this.open();
}
});
this.overlay.addEventListener('click', (e) => {
if (e.target === this.overlay) {
this.close();
}
});
document.addEventListener('keydown', (e) => {
if (e.key === 'Escape' && this.isOpen) {
this.close();
}
});
},
open() {
if (this.isOpen) return;
this.isOpen = true;
this.animateBurger(true);
this.showMenu();
},
close() {
if (!this.isOpen) return;
this.isOpen = false;
this.animateBurger(false);
this.hideMenu();
},
animateBurger(toClose) {
const line1 = this.burger.querySelector('.line-1');
const line2 = this.burger.querySelector('.line-2');
const line3 = this.burger.querySelector('.line-3');
if (toClose) {
line1.classList.remove('-translate-y-[6px]');
line1.classList.add('rotate-[45deg]');
line2.classList.add('opacity-[0]');
line3.classList.remove('translate-y-[6px]');
line3.classList.add('-rotate-[45deg]');
} else {
line1.classList.add('-translate-y-[6px]');
line1.classList.remove('rotate-[45deg]');
line2.classList.remove('opacity-[0]');
line3.classList.add('translate-y-[6px]');
line3.classList.remove('-rotate-[45deg]');
}
},
showMenu() {
document.body.style.overflow = 'hidden';
this.overlay.classList.remove('opacity-[0]', 'invisible');
this.overlay.classList.add('opacity-[1]', 'visible');
this.container.classList.remove('translate-x-full');
this.container.classList.add('translate-x-[0]');
},
hideMenu() {
document.body.style.overflow = '';
this.container.classList.remove('translate-x-[0]');
this.container.classList.add('translate-x-full');
this.overlay.classList.remove('opacity-[1]', 'visible');
this.overlay.classList.add('opacity-[0]', 'invisible');
}
};
MenuSystem.init();
window.MenuSystem = MenuSystem;
});

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

BIN
screenshot.png.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

380
single-trainer.php Normal file
View File

@@ -0,0 +1,380 @@
<?php
get_header();
// Получаем данные о тренере
$trainer_name = '';
$trainer_exp = '';
$trainer_short_desc = '';
if (have_rows('short_info')) {
while (have_rows('short_info')) {
the_row();
$trainer_name = get_sub_field('name');
$trainer_exp = get_sub_field('exp');
$trainer_short_desc = get_sub_field('short_desc');
}
}
$trainer_full_desc = '';
$trainer_desc_list = array();
$trainer_documents = array();
$trainer_desc_points = array();
if (have_rows('full_info')) {
while (have_rows('full_info')) {
the_row();
$trainer_full_desc = get_sub_field('full_desc');
if (have_rows('desc_list')) {
while (have_rows('desc_list')) {
the_row();
$trainer_desc_list[] = get_sub_field('desc_list_item');
}
}
if (have_rows('desc_points')) {
while (have_rows('desc_points')) {
the_row();
$point = array(
'text' => get_sub_field('text'),
'icon' => get_sub_field('icon')
);
$trainer_desc_points[] = $point;
}
}
$documents = get_sub_field('documents');
if ($documents && is_array($documents)) {
$trainer_documents = $documents;
}
}
}
$trainer_photos = get_field('photo');
$trainer_trainings = get_field('trainings');
?>
<section class="max-[768px]:py-[40px] container mx-auto py-[90px]">
<div class="max-[1050px]:flex-col max-[1300px]:gap-[24px] flex gap-[60px] justify-between">
<div class="flex">
<?php if ($trainer_photos && !empty($trainer_photos)): ?>
<div class="max-[1050px]:h-[380px] max-[1050px]:min-h-auto max-[1050px]:!mx-auto trainer-photos-swiper rounded-[20px] swiper !m-0 w-[500px] min-h-[540px] relative">
<div class="swiper-wrapper">
<?php foreach ($trainer_photos as $photo): ?>
<div class="swiper-slide overflow-hidden shadow-[0_2px_32px_0_rgba(16,_15,_15,_0.03)]">
<img src="<?php echo esc_url($photo['url']); ?>"
alt="<?php echo esc_attr($photo['alt']); ?>"
class="max-[1050px]:h-[380px] max-[1050px]:min-h-auto w-full min-h-[540px] object-cover object-top"/>
</div>
<?php endforeach; ?>
</div>
<div class="trainer-swiper-pagination absolute flex items-center justify-center left-1/2 z-[2]"></div>
</div>
<?php endif; ?>
</div>
<div class="max-[1300px]:max-w-full flex flex-col w-full max-w-[760px] relative">
<svg class="absolute right-0 top-0 max-[768px]:hidden" width="51" height="30" viewBox="0 0 51 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2307_11639)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M50.9996 0.730469C41.5932 23.8872 21.1929 11.5514 5.21289 17.1783C9.85961 4.19316 18.2463 1.81256 27.653 1.70435C34.6796 1.59614 44.5398 2.35361 50.9996 0.730469Z" fill="#E21E24" />
<path fill-rule="evenodd" clip-rule="evenodd" d="M35.0202 17.5029C27.7669 35.2491 12.2401 25.4021 0 29.7305C6.3468 11.9843 20.8535 21.0738 35.0202 17.5029Z" fill="#E21E24" />
</g>
<defs>
<clipPath id="clip0_2307_11639">
<rect width="51" height="29" fill="white" transform="translate(0 0.730469)" />
</clipPath>
</defs>
</svg>
<div class="max-[768px]:mx-0 max-[1300px]:mx-auto flex gap-[12px] mb-[16px]">
<div class="text-[15px] leading-[110%] font-[600] px-[12px] h-[29px] flex items-center justify-center rounded-[32px] border border-[#e0e0e0]">
<span class="mr-[8px] w-[8px] h-[8px] rounded-full bg-[#e21e24]"></span>
<?php echo pll_current_language('name'); ?>
</div>
<?php if ($trainer_exp): ?>
<div class="text-[15px] leading-[110%] font-[600] px-[12px] h-[29px] flex items-center justify-center rounded-[32px] border border-[#e0e0e0]">
<?php echo esc_html($trainer_exp); ?>
</div>
<?php endif; ?>
</div>
<?php if ($trainer_name): ?>
<h1 class="max-[768px]:text-[24px] max-[1050px]:text-[30px] font-[700] text-[40px] leading-[120%]">
<?php echo esc_html($trainer_name); ?>
</h1>
<?php endif; ?>
<?php if ($trainer_short_desc): ?>
<div class="max-[768px]:text-[16px] font-[500] text-[20px] leading-[140%] mt-[16px]">
<?php echo wp_kses_post($trainer_short_desc); ?>
</div>
<?php endif; ?>
<?php if ($trainer_full_desc): ?>
<div class="flex flex-col w-full pt-[24px] mt-[24px] border-t border-dashed border-[#e0e0e0]">
<h3 class="max-[768px]:text-[20px] font-[700] text-[24px] leading-[125%]">О тренере</h3>
<div class="max-[768px]:text-[16px] text-[20px] font-[500] leading-[140%] mt-[16px]">
<?php echo wp_kses_post($trainer_full_desc); ?>
</div>
</div>
<?php endif; ?>
<?php if ($trainer_full_desc): ?>
<h3 class="max-[768px]:text-[20px] font-[700] text-[24px] leading-[125%] mt-[24px] ">Опыт и подход</h3>
<div class="max-[768px]:text-[16px] text-[20px] font-[500] leading-[140%] mt-[16px]">
<ul class="max-[768px]:text-[16px] mt-[16px] font-[500] text-[20px] leading-[140%] flex flex-col gap-[8px]">
<?php
foreach ($trainer_desc_list as $desc_item): ?>
<?php if ($desc_item): ?>
<li class="flex items-center gap-[12px]">
<svg class="min-w-fit" width="16" height="16" viewBox="0 0 16 16" fill="none"
xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_4123_4601)">
<path fill-rule="evenodd" clip-rule="evenodd"
d="M4 0C2.93913 0 1.92172 0.421427 1.17157 1.17157C0.421427 1.92172 0 2.93913 0 4V12C0 13.0609 0.421427 14.0783 1.17157 14.8284C1.92172 15.5786 2.93913 16 4 16H12C13.0609 16 14.0783 15.5786 14.8284 14.8284C15.5786 14.0783 16 13.0609 16 12V4C16 2.93913 15.5786 1.92172 14.8284 1.17157C14.0783 0.421427 13.0609 0 12 0H4ZM11.712 4.9856C11.8749 5.12143 11.9772 5.31638 11.9964 5.5276C12.0156 5.73882 11.9501 5.94903 11.8144 6.112L7.8144 10.912C7.74531 10.9948 7.66017 11.0629 7.56412 11.1119C7.46806 11.161 7.36307 11.1902 7.25546 11.1977C7.14785 11.2051 7.03983 11.1908 6.93792 11.1554C6.836 11.1201 6.74228 11.0645 6.6624 10.992L4.2624 8.8104C4.10832 8.66696 4.01698 8.46857 4.0082 8.25825C3.99941 8.04792 4.07388 7.8426 4.21546 7.68681C4.35704 7.53102 4.55431 7.43731 4.76452 7.42601C4.97473 7.4147 5.18092 7.4867 5.3384 7.6264L7.12 9.2464L10.5856 5.088C10.7214 4.9251 10.9164 4.82281 11.1276 4.80361C11.3388 4.78441 11.549 4.84987 11.712 4.9856Z"
fill="#E21E24"/>
</g>
<defs>
<clipPath id="clip0_4123_4601">
<rect width="16" height="16" fill="white"/>
</clipPath>
</defs>
</svg>
<?php echo wp_kses_post($desc_item); ?>
</li>
<?php $counter++; ?>
<?php endif; ?>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
</div>
</div>
<?php if (!empty($trainer_desc_points) || ($trainer_documents && !empty($trainer_documents))): ?>
<div class="max-[768px]:flex-col max-[768px]:mt-[24px] mt-[64px] flex gap-[24px] justify-between flex-wrap">
<?php if (!empty($trainer_desc_points)): ?>
<div class="flex flex-col w-full max-w-[760px] p-[24px] bg-[#fff] rounded-[12px]">
<h3 class="font-[700] text-[24px] leading-[125%]">Цели, с которыми работаю</h3>
<ul class="max-[768px]:grid-cols-1 grid grid-cols-2 gap-y-[24px] gap-x-[16px] mt-[24px]">
<?php foreach ($trainer_desc_points as $point): ?>
<li class="flex items-center font-[600] text-[16px] leading-[145%] gap-[16px]">
<div class="[&>svg]:min-w-fit grid place-items-center min-w-[55px] w-[55px] h-[55px] rounded-[9px] shadow-[0_1px_23px_0_rgba(16,_15,_15,_0.03)] bg-[linear-gradient(180deg,_#f2f2f2_69.59%,_#ededed_100%)]">
<?php if ($point['icon']): ?>
<img src="<?php echo esc_url($point['icon']['url']); ?>"
alt="<?php echo esc_attr($point['icon']['alt']); ?>"
class="w-[27px] h-[27px] object-contain">
<?php else: ?>
<!-- Fallback icon если изображение не загружено -->
<svg width="27" height="27" viewBox="0 0 27 27" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="13.5" cy="13.5" r="13.5" fill="#E21E24"/>
</svg>
<?php endif; ?>
</div>
<p class="max-[768px]:max-w-full max-w-[240px] flex w-full">
<?php echo esc_html($point['text']); ?>
</p>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
<?php if ($trainer_documents && !empty($trainer_documents)): ?>
<div class="flex flex-col w-full max-w-[536px] h-fit p-[24px] rounded-[12px] border border-[#e0e0e0]">
<h3 class="font-[700] text-[24px] leading-[125%]">Сертификаты и квалификация</h3>
<ul class="mt-[26px] flex flex-col gap-[12px]">
<?php $counter = 1; ?>
<?php foreach ($trainer_documents as $document): ?>
<li class="flex items-center gap-[12px] flex w-full rounded-[12px] px-[16px] h-[48px]
shadow-[0_2px_32px_0_rgba(16,_15,_15,_0.03)]
bg-[#fff]
transition hover:shadow-none">
<span class="rounded-[24px] flex items-center justify-center w-[32px] h-[24px] bg-[linear-gradient(90deg,_#9d9994_39.42%,_#bbb7b1_92.9%)] text-white text-[14px] font-[600]">
<?php echo sprintf('%02d', $counter); ?>
</span>
<a href="<?php echo esc_url($document['document']['url']); ?>" target="_blank"
class="!no-underline font-[600] text-[16px] leading-[145%] w-full h-full flex items-center">
<?php echo esc_html($document['document_name']); ?>
</a>
</li>
<?php $counter++; ?>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
</section>
<?php if ($trainer_trainings): ?>
<?php
$trainings_section_id = 'trainings-section-' . uniqid();
$trainings_data = array();
foreach ($trainer_trainings as $training) {
$training_info = array(
'post' => $training,
'name' => '',
'short_desc' => ''
);
if (have_rows('short_info', $training->ID)) {
while (have_rows('short_info', $training->ID)) {
the_row();
$training_info['name'] = get_sub_field('name');
$training_info['short_desc'] = get_sub_field('short_desc');
}
}
$trainings_data[] = $training_info;
}
?>
<section class="max-[768px]:pb-[40px] mx-auto pb-[90px]">
<div class="container mx-auto">
<div class="flex items-center gap-[16px] ">
<h2 class="max-[1050px]:text-[36px] max-[768px]:max-[768px]:text-[24px] text-[40px] leading-[120%] font-[500]">
<strong>Тренировки</strong> с <?php echo esc_html($trainer_name ?: 'тренером'); ?>
</h2>
<div class="max-[1100px]:flex hidden gap-[6px] ml-auto">
<button class="group training-custom-prev cursor-pointer">
<?php display_icon('slider-prev') ?>
</button>
<button class="group training-custom-next cursor-pointer">
<?php display_icon('slider-next') ?>
</button>
</div>
</div>
<div class="flex flex-col mt-[24px]">
<div class="swiper !m-0 rounded-[20px] rounded-b-[0]"
id="<?php echo esc_attr($trainings_section_id); ?>-swiper">
<div class="swiper-wrapper">
<?php foreach ($trainings_data as $training_data): ?>
<?php $training = $training_data['post']; ?>
<div class="max-w-[312px] swiper-slide">
<div class="flex flex-col bg-[#f8f8f8] relative rounded-[20px] overflow-hidden shadow-[0_2px_32px_0_rgba(16,_15,_15,_0.03)]">
<?php $photo_images = get_field('photo', $training->ID); ?>
<?php if ($photo_images && !empty($photo_images[0])): ?>
<div class="overflow-hidden">
<img src="<?php echo esc_url($photo_images[0]['url']); ?>"
alt="<?php echo esc_attr($photo_images[0]['alt']); ?>"
loading="lazy"
class="w-full h-full object-cover"/>
</div>
<?php endif; ?>
<div class="flex flex-col gap-[24px] h-full p-[24px]">
<?php $name = $training_data['name']; ?>
<?php if ($name): ?>
<div class="text-[24px] leading-[125%] font-[600]">
<?php echo esc_html($name); ?>
</div>
<?php endif; ?>
<?php $short_desc = $training_data['short_desc']; ?>
<?php if ($short_desc): ?>
<div class="text-[16px] leading-[145%] font-[500] text-[#222]">
<?php echo wp_kses_post($short_desc); ?>
</div>
<?php endif; ?>
<a href="<?php echo get_permalink($training->ID); ?>"
class="!no-underline mt-auto h-[59px] flex grey-gradient-hover w-full rounded-[90px] px-[12px] text-[18px] font-[600] leading-[195%] text-[#f8f8f8] bg-[0_2px_32px_0_rgba(16,_15,_15,_0.03)] items-center justify-center">
Перейти
</a>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
<div class="swiper-scrollbar [&_.swiper-scrollbar-drag]:dark:!bg-[#989597] !static !mx-auto !cursor-grab container mt-[44px] !w-full !p-0"
id="swiper-scrollbar-<?php echo esc_attr($trainings_section_id); ?>"></div>
<a class="hidden max-[768px]:flex !no-underline dark:text-[#F8F8F8] dark:max-w-[860px] dark:border-[#574348] flex mt-[44px] gap-[8px] border border-[#E0E0E0] hover:[&>svg]:translate-x-[6px] rounded-[90px] px-[32px] h-[59px] flex items-center justify-center text-[18px] font-[600] leading-[195%] text-[#222]"
href="<?php echo get_post_type_archive_link('training'); ?>">
Все тренировки
<svg class="transition fill-[#222222] dark:fill-[#F8F8F8]" width="12" height="13" viewBox="0 0 12 13" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M6.4876 2.17896C6.73011 1.94034 7.12396 1.94035 7.36649 2.17896L11.3181 6.06809C11.5606 6.30671 11.5606 6.69329 11.3181 6.93191L7.36649 10.821C7.12396 11.0596 6.73011 11.0597 6.4876 10.821C6.24512 10.5824 6.24511 10.1949 6.4876 9.95626L9.38032 7.11093H1.1209C0.777923 7.11093 0.5 6.83747 0.5 6.5C0.5 6.16253 0.777923 5.88907 1.1209 5.88907H9.38032L6.4876 3.04374C6.24511 2.80512 6.24512 2.41758 6.4876 2.17896Z"
/>
</svg>
</a>
</div>
</div>
</section>
<script>
document.addEventListener('DOMContentLoaded', function () {
const swiperContainer = document.querySelector('#<?php echo esc_attr($trainings_section_id); ?>-swiper');
if (swiperContainer && typeof Swiper !== 'undefined') {
new Swiper('#<?php echo esc_attr($trainings_section_id); ?>-swiper', {
slidesPerView: 'auto',
spaceBetween: 24,
grabCursor: true,
freeMode: true,
scrollbar: {
el: `#swiper-scrollbar-<?php echo esc_attr($trainings_section_id); ?>`,
draggable: true,
},
navigation: {
nextEl: '.training-custom-next',
prevEl: '.training-custom-prev',
}
});
}
});
</script>
<?php endif; ?>
<script>
document.addEventListener('DOMContentLoaded', function () {
const trainerPhotosSwiper = document.querySelector('.trainer-photos-swiper');
if (trainerPhotosSwiper) {
const swiper = new Swiper('.trainer-photos-swiper', {
loop: true,
slidesPerView: 1,
spaceBetween: 0,
grabCursor: true,
pagination: {
el: '.trainer-swiper-pagination',
type: 'bullets',
clickable: true,
bulletClass: 'swiper-pagination-bullet',
},
});
const slides = trainerPhotosSwiper.querySelectorAll('.swiper-slide');
if (slides.length <= 1) {
const pagination = trainerPhotosSwiper.querySelector('.trainer-swiper-pagination');
if (pagination) pagination.style.display = 'none';
swiper.autoplay.stop();
}
}
});
</script>
<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>
<?php get_footer(); ?>

711
single-training.php Normal file
View File

@@ -0,0 +1,711 @@
<?php
wp_enqueue_style(
'glightbox-css',
'https://cdnjs.cloudflare.com/ajax/libs/glightbox/3.2.0/css/glightbox.min.css',
[],
'3.2.0'
);
wp_enqueue_script(
'glightbox-js',
'https://cdnjs.cloudflare.com/ajax/libs/glightbox/3.2.0/js/glightbox.min.js',
[],
'3.2.0',
true
);
get_header();
$training_name = '';
$training_short_desc = '';
$training_difficulty = '';
if (have_rows('short_info')) {
while (have_rows('short_info')) {
the_row();
$training_name = get_sub_field('name');
$training_short_desc = get_sub_field('short_desc');
$training_difficulty = get_sub_field('dificulty');
}
}
$training_full_desc = '';
$training_duration = '';
$what_happens_list = array();
$for_who_list = array();
if (have_rows('full_info')) {
while (have_rows('full_info')) {
the_row();
$training_full_desc = get_sub_field('full_desc');
$training_duration = get_sub_field('duration');
if (have_rows('what_happens')) {
while (have_rows('what_happens')) {
the_row();
$what_happens_list[] = get_sub_field('list_element');
}
}
if (have_rows('for_who')) {
while (have_rows('for_who')) {
the_row();
$for_who_list[] = get_sub_field('list_element');
}
}
}
}
$training_photos = get_field('photo');
$training_trainers = get_field('trainers');
// Генерируем уникальный ID для галереи
$gallery_id = 'training-gallery-' . get_the_ID();
?>
<section class="max-[768px]:pt-[40px] container mx-auto pt-[90px]">
<div class="flex gap-[24px] flex-wrap justify-between">
<div class="flex max-[1300px]:!mx-auto" id="<?php echo esc_attr($gallery_id); ?>" data-gallery-id="<?php echo esc_attr($gallery_id); ?>">
<?php if ($training_photos && !empty($training_photos)): ?>
<div class="gallery-container">
<div class="max-[768px]:w-[327px] max-[1300px]:h-[360px] max-[1300px]:!mx-auto training-photos-swiper rounded-[20px] swiper !m-0 w-[500px] h-[500px] relative">
<div class="swiper-wrapper">
<?php foreach ($training_photos as $img_index => $photo): ?>
<div class="swiper-slide overflow-hidden shadow-[0_2px_32px_0_rgba(16,_15,_15,_0.03)]">
<a href="<?php echo esc_url($photo['url']); ?>"
class="glightbox block w-full h-full"
data-gallery="training-gallery-<?php echo esc_attr(get_the_ID()); ?>">
<?php if ($img_index === 0) : ?>
<img src="<?php echo esc_url($photo['url']); ?>"
alt="<?php echo esc_attr($photo['alt']); ?>"
class="max-[1300px]:h-[360px] w-full h-[500px] object-cover"
fetchpriority="high"/>
<?php else : ?>
<img data-src="<?php echo esc_url($photo['url']); ?>"
alt="<?php echo esc_attr($photo['alt']); ?>"
class="max-[1300px]:h-[360px] w-full h-[500px] object-cover swiper-lazy"/>
<div class="swiper-lazy-preloader"></div>
<?php endif; ?>
</a>
</div>
<?php endforeach; ?>
</div>
<div class="training-swiper-pagination absolute flex items-center justify-center left-1/2 z-[2]"></div>
</div>
<div class="relative mt-[8px]">
<div class="max-[768px]:w-[327px] w-[500px] swiper thumbnail-swiper">
<div class="swiper-wrapper">
<?php foreach ($training_photos as $thumb_index => $photo): ?>
<?php if (isset($photo['url']) && $photo['url']) : ?>
<div class="max-[768px]:max-w-[60px] max-[768px]:!h-[40px] swiper-slide max-w-[95px] !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_url = '';
if (isset($photo['sizes']['thumbnail'])) {
$thumbnail_url = $photo['sizes']['thumbnail'];
} elseif (isset($photo['url'])) {
$thumbnail_url = $photo['url'];
}
?>
<?php if ($thumbnail_url) : ?>
<img src="<?php echo esc_url($thumbnail_url); ?>"
alt="<?php echo esc_attr($photo['alt'] ?? ''); ?>"
class="w-full rounded-[6px] h-full object-cover"
width="102"
height="62">
<?php endif; ?>
</div>
</div>
<?php endif; ?>
<?php endforeach; ?>
</div>
</div>
</div>
</div>
<?php else: ?>
<div class="max-[768px]:w-[327px] max-[1300px]:h-[360px] max-[1300px]:!mx-auto w-[500px] h-[500px] bg-gray-100 rounded-[20px] flex items-center justify-center">
<p class="text-gray-500">Изображения не загружены</p>
</div>
<?php endif; ?>
</div>
<div class="relative max-[1300px]:max-w-full flex flex-col w-full max-w-[760px]">
<svg class="absolute right-0 top-0 max-[768px]:hidden" width="51" height="30" viewBox="0 0 51 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2307_11639)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M50.9996 0.730469C41.5932 23.8872 21.1929 11.5514 5.21289 17.1783C9.85961 4.19316 18.2463 1.81256 27.653 1.70435C34.6796 1.59614 44.5398 2.35361 50.9996 0.730469Z" fill="#E21E24" />
<path fill-rule="evenodd" clip-rule="evenodd" d="M35.0202 17.5029C27.7669 35.2491 12.2401 25.4021 0 29.7305C6.3468 11.9843 20.8535 21.0738 35.0202 17.5029Z" fill="#E21E24" />
</g>
<defs>
<clipPath id="clip0_2307_11639">
<rect width="51" height="29" fill="white" transform="translate(0 0.730469)" />
</clipPath>
</defs>
</svg>
<?php if ($training_name): ?>
<h1 class="max-[768px]:text-[24px] max-[1050px]:text-[30px] font-[700] text-[40px] leading-[120%]">
<?php echo esc_html($training_name); ?>
</h1>
<?php endif; ?>
<?php if ($training_short_desc): ?>
<div class="max-[768px]:text-[16px] font-[500] text-[20px] leading-[140%] mt-[16px]">
<?php echo wp_kses_post($training_short_desc); ?>
</div>
<?php endif; ?>
<div class="max-[768px]:items-start max-[768px]:max-w-full max-[768px]:flex-col flex gap-[12px] max-w-fit border-dashed border-t border-b border-[#e0e0e0] py-[14px] items-center mt-[24px]">
<?php if ($training_difficulty):
$difficulty_value = (int)$training_difficulty;
$difficulty_texts = [
1 => 'лёгкая', 2 => 'лёгкая',
3 => 'средняя', 4 => 'средняя',
5 => 'тяжелая'
];
$red_color = '#E21E24';
$gray_color = '#E0E0E0';
?>
<div class="gap-[12px] flex items-center">
<span class="max-[768px]:text-[16px] font-[600] text-[20px] leading-[115%] text-[#2b2c35]">Сложность:</span>
<div class="flex items-center gap-2">
<svg width="28" height="17" viewBox="0 0 28 17" fill="none"
xmlns="http://www.w3.org/2000/svg">
<rect y="8" width="4" height="9" rx="1.33333"
fill="<?php echo ($difficulty_value >= 1) ? $red_color : $gray_color; ?>"/>
<rect x="6" y="5" width="4" height="12" rx="1.33333"
fill="<?php echo ($difficulty_value >= 2) ? $red_color : $gray_color; ?>"/>
<rect x="12" y="3" width="4" height="14" rx="1.33333"
fill="<?php echo ($difficulty_value >= 3) ? $red_color : $gray_color; ?>"/>
<rect x="18" y="2" width="4" height="15" rx="1.33333"
fill="<?php echo ($difficulty_value >= 4) ? $red_color : $gray_color; ?>"/>
<rect x="24" width="4" height="17" rx="1.33333"
fill="<?php echo ($difficulty_value >= 5) ? $red_color : $gray_color; ?>"/>
</svg>
<span class="max-[768px]:text-[16px] font-[500] text-[20px] leading-[140%]">
<?php echo esc_html($difficulty_texts[$difficulty_value] ?? 'неизвестная'); ?>
</span>
</div>
</div>
<?php endif; ?>
<svg class="max-[768px]:hidden" width="7" height="14" viewBox="0 0 7 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 13.872L4.976 0H6.352L1.36 13.872H0Z" fill="#E0E0E0"/>
</svg>
<?php if ($training_duration): ?>
<div class="max-[768px]:text-[16px] font-[500] text-[20px] leading-[140%]">
<span class="max-[768px]:text-[16px] font-[600] text-[20px] leading-[115%] text-[#2b2c35]">Длительность:</span>
<?php echo esc_html($training_duration); ?>
</div>
<?php endif; ?>
</div>
<?php if ($training_full_desc): ?>
<h3 class="max-[768px]:text-[20px] font-[700] text-[24px] leading-[125%] mt-[24px]">Описание</h3>
<div class="max-[768px]:text-[16px] text-[20px] font-[500] leading-[140%] mt-[16px]">
<?php echo wp_kses_post($training_full_desc); ?>
</div>
<?php endif; ?>
<div class="mt-[24px]">
<button data-modal="test-training" class="max-[768px]:text-[16px] max-[768px]:max-w-full max-[768px]:h-[59px] cursor-pointer max-w-[410px] !no-underline transition red-gradient-hover gap-[12px] w-full rounded-[90px] flex items-center justify-center h-[75px]">
<span class="max-[768px]:text-[16px] font-[600] text-[18px] leading-[195%] text-[#f8f8f8]">Записаться на тренировку</span>
<svg class="max-[768px]:hidden" width="35" height="35" viewBox="0 0 35 35" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 17.5C0 7.83502 7.83502 0 17.5 0C27.165 0 35 7.83502 35 17.5C35 27.165 27.165 35 17.5 35C7.83502 35 0 27.165 0 17.5Z"
fill="url(#paint0_linear_4064_4274)"></path>
<path d="M22.3612 11.7656C22.8445 11.7656 23.2366 12.1578 23.2366 12.641V20.5156C23.2366 20.9989 22.8445 21.391 22.3612 21.391C21.878 21.391 21.4858 20.9989 21.4858 20.5156V14.7544L13.258 22.9823C12.9163 23.324 12.3617 23.324 12.02 22.9823C11.6782 22.6406 11.6782 22.0859 12.02 21.7442L20.2478 13.5164H14.4866C14.0033 13.5164 13.6112 13.1243 13.6112 12.641C13.6112 12.1578 14.0033 11.7656 14.4866 11.7656H22.3612Z"
fill="#F8F8F8"></path>
<defs>
<linearGradient id="paint0_linear_4064_4274" x1="0" y1="17.5" x2="35" y2="17.5"
gradientUnits="userSpaceOnUse">
<stop offset="0.443137" stop-color="#F8F8F8" stop-opacity="0.34"></stop>
<stop offset="0.929023" stop-color="white" stop-opacity="0.72"></stop>
</linearGradient>
</defs>
</svg>
</button>
</div>
</div>
</div>
<div class="max-[768px]:mt-[ mt-[64px] flex gap-[24px] justify-between flex-wrap">
<?php if (!empty($what_happens_list)): ?>
<div class="flex flex-col w-full max-w-[760px] p-[24px] bg-[#fff] rounded-[12px]">
<h3 class="font-[700] text-[24px] leading-[125%]">Что происходит на
тренировке</h3>
<ul class="mt-[24px] font-[600] text-[16px] leading-[145%] flex flex-col gap-[12px]">
<?php $counter = 1;
foreach ($what_happens_list as $what_happens_item): ?>
<?php if ($what_happens_item): ?>
<li class="flex items-center gap-[16px] text-[16px] font-[600] leading-[145%]">
<span class="rounded-[24px] inline-flex items-center justify-center min-w-[32px] w-[32px] h-[24px] bg-[linear-gradient(90deg,_#9d9994_39.42%,_#bbb7b1_92.9%)] text-white text-[12px]">
<?php echo sprintf('%02d', $counter); ?>
</span>
<?php echo wp_kses_post($what_happens_item); ?>
</li>
<?php $counter++; ?>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<div class="max-[768px]:h-auto max-[768px]:py-[14px] mt-[24px] flex gap-[12px] items-center px-[20px] h-[51px] rounded-[12px] w-full bg-[linear-gradient(90deg,_rgba(255,_214,_90,_0.24)_39.42%,_rgba(255,_229,_149,_0.24)_92.9%)]">
<svg class="min-w-fit" width="16" height="17" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd"
d="M4 0.5C2.93913 0.5 1.92172 0.921427 1.17157 1.67157C0.421427 2.42172 0 3.43913 0 4.5V12.5C0 13.5609 0.421427 14.5783 1.17157 15.3284C1.92172 16.0786 2.93913 16.5 4 16.5H12C13.0609 16.5 14.0783 16.0786 14.8284 15.3284C15.5786 14.5783 16 13.5609 16 12.5V4.5C16 3.43913 15.5786 2.42172 14.8284 1.67157C14.0783 0.921427 13.0609 0.5 12 0.5H4ZM11.712 5.4856C11.8749 5.62143 11.9772 5.81638 11.9964 6.0276C12.0156 6.23882 11.9501 6.44903 11.8144 6.612L7.8144 11.412C7.74531 11.4948 7.66017 11.5629 7.56412 11.6119C7.46806 11.661 7.36307 11.6902 7.25546 11.6977C7.14785 11.7051 7.03983 11.6908 6.93792 11.6554C6.836 11.6201 6.74228 11.5645 6.6624 11.492L4.2624 9.3104C4.10832 9.16696 4.01698 8.96857 4.0082 8.75825C3.99941 8.54792 4.07388 8.3426 4.21546 8.18681C4.35704 8.03102 4.55431 7.93731 4.76452 7.92601C4.97473 7.9147 5.18092 7.9867 5.3384 8.1264L7.12 9.7464L10.5856 5.588C10.7214 5.4251 10.9164 5.32281 11.1276 5.30361C11.3388 5.28441 11.549 5.34987 11.712 5.4856Z"
fill="#E21E24"/>
</svg>
<span class="text-[16px] font-[600] leading-[145%]"> Всё проходит под руководством тренера, с демонстрацией и поддержкой.</span>
</div>
</div>
<?php endif; ?>
<?php if (!empty($for_who_list)): ?>
<div class="flex flex-col w-full max-w-[536px] h-fit p-[24px] rounded-[12px] border border-[#e0e0e0] rounded-[12px]">
<h3 class="font-[700] text-[24px] leading-[125%]">Кому подойдёт</h3>
<ul class="mt-[26px] flex flex-col gap-[12px]">
<?php foreach ($for_who_list as $for_who_item): ?>
<?php if ($for_who_item): ?>
<li class="flex items-center gap-[16px] font-[600] text-[16px] leading-[145%]">
<svg class="min-w-fit" width="20" height="21" viewBox="0 0 20 21" fill="none"
xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2382_13653)">
<path d="M19.5654 9.60355C19.7579 9.41732 19.894 9.18064 19.9582 8.92062C20.0224 8.66061 20.012 8.38778 19.9283 8.13339C19.8465 7.87826 19.6944 7.65135 19.4896 7.47866C19.2847 7.30597 19.0354 7.1945 18.7701 7.15702L13.9275 6.45337C13.8259 6.43862 13.7294 6.39937 13.6464 6.33902C13.5634 6.27867 13.4963 6.19902 13.4509 6.10696L11.2859 1.71929C11.1682 1.47867 10.9852 1.27606 10.7577 1.13469C10.5302 0.993312 10.2674 0.918884 9.99957 0.919933C9.73178 0.918959 9.46914 0.993422 9.24171 1.13479C9.01429 1.27617 8.83127 1.47873 8.71363 1.71929L6.54823 6.10736C6.45612 6.29438 6.2775 6.42374 6.07126 6.45377L1.22864 7.15742C0.963355 7.1949 0.713995 7.30637 0.509148 7.47906C0.304302 7.65175 0.152261 7.87866 0.0704546 8.13379C-0.0132531 8.38819 -0.0236151 8.66101 0.0405555 8.92103C0.104726 9.18104 0.240834 9.41772 0.43329 9.60395L3.93709 13.0193C4.08647 13.165 4.15496 13.3749 4.11971 13.5799L3.29312 18.4025C3.25573 18.6074 3.26439 18.8181 3.31849 19.0192C3.37259 19.2204 3.47076 19.407 3.6059 19.5655C4.03281 20.0729 4.7781 20.2275 5.37402 19.9143L9.70482 17.6372C9.79609 17.5906 9.8971 17.5663 9.99957 17.5663C10.102 17.5663 10.2031 17.5906 10.2943 17.6372L14.6255 19.9143C14.8309 20.0239 15.06 20.0812 15.2927 20.0813C15.716 20.0813 16.1173 19.8931 16.3932 19.5655C16.5284 19.407 16.6266 19.2204 16.6807 19.0193C16.7348 18.8181 16.7434 18.6074 16.706 18.4025L15.879 13.5799C15.8617 13.4787 15.8693 13.3747 15.9011 13.277C15.9329 13.1794 15.988 13.0909 16.0616 13.0193L19.5654 9.60355Z"
fill="url(#paint0_linear_2382_13653)"/>
</g>
<defs>
<linearGradient id="paint0_linear_2382_13653" x1="-0.000976562" y1="10.5006"
x2="19.9997" y2="10.5006" gradientUnits="userSpaceOnUse">
<stop offset="0.394231" stop-color="#FFD65A"/>
<stop offset="0.929023" stop-color="#FFE595"/>
</linearGradient>
<clipPath id="clip0_2382_13653">
<rect width="20" height="20" fill="white" transform="translate(0 0.5)"/>
</clipPath>
</defs>
</svg>
<?php echo wp_kses_post($for_who_item); ?>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
</div>
</section>
<section class="max-[768px]:pt-[40px] mx-auto pt-[90px]">
<h2 class="max-[1050px]:text-[30px] max-[750px]:text-[24px] font-[500] text-[40px] leading-[120%] container mx-auto"><strong>Расписание</strong>
тренировок
</h2>
<div id="mf_schedule_widget_cont_au1"></div>
</section>
<?php
$section_id = 'trainers-section-' . uniqid();
$trainers_data = array();
if ($training_trainers) {
foreach ($training_trainers as $trainer) {
$trainer_info = array(
'post' => $trainer,
'name' => '',
'exp' => '',
'short_desc' => ''
);
if (have_rows('short_info', $trainer->ID)) {
while (have_rows('short_info', $trainer->ID)) {
the_row();
$trainer_info['name'] = get_sub_field('name');
$trainer_info['exp'] = get_sub_field('exp');
$trainer_info['short_desc'] = get_sub_field('short_desc');
}
}
$trainers_data[] = $trainer_info;
}
}
$room = get_current_room();
if ($room === 'fitness') {
$section_classes = 'radial-gradient';
$style_attr = '';
} else {
$section_classes = '';
}
?>
<section id="<?php echo esc_attr($section_id); ?>" class="max-[768px]:py-[40px] py-[90px] <?php echo esc_attr($section_classes); ?>" <?php echo $style_attr; ?>>
<div class="container mx-auto">
<?php if ($trainers_data): ?>
<h2 class="max-[1050px]:text-[30px] max-[768px]:text-[24px] text-[40px] leading-[120%] font-[500] mb-[40px]">
<strong>Наши</strong> тренеры по <?php echo get_the_title(); ?>
</h2>
<div class="max-[768px]:items-center max-[768px]:justify-center max-[768px]:flex-wrap flex gap-[24px]">
<div class="swiper !m-0 rounded-[20px] rounded-b-[0]" id="<?php echo esc_attr($section_id); ?>-swiper">
<div class="swiper-wrapper">
<?php foreach ($trainers_data as $trainer_data): ?>
<?php $trainer = $trainer_data['post']; ?>
<div class="max-w-[312px] swiper-slide">
<div class="flex flex-col gap-[12px]">
<div class="flex relative rounded-[20px] overflow-hidden shadow-[0_2px_32px_0_rgba(16,_15,_15,_0.03)]">
<?php $photo_images = get_field('photo', $trainer->ID); ?>
<?php if ($photo_images && !empty($photo_images[0])): ?>
<div class="max-[768px]:h-[440px] overflow-hidden w-full h-[460px]">
<img src="<?php echo esc_url($photo_images[0]['url']); ?>"
alt="<?php echo esc_attr($photo_images[0]['alt']); ?>"
loading="lazy"
class="w-full h-full object-cover"/>
</div>
<?php endif; ?>
<div class="flex gap-[4px] absolute left-[12px] bottom-[16px]">
<div class="text-[15px] leading-[110%] font-[600] text-[#fff] px-[12px] h-[29px] flex items-center justify-center rounded-[32px] backdrop-blur-[8px] bg-[linear-gradient(90deg,rgba(157,153,148,0.7)_39.42%,rgba(197,197,185,0.7)_92.9%)]">
<?php echo pll_current_language('name'); ?>
</div>
<?php $exp = $trainer_data['exp']; ?>
<?php if ($exp): ?>
<div class="text-[15px] leading-[110%] font-[600] text-[#fff] px-[12px] h-[29px] flex items-center justify-center rounded-[32px] backdrop-blur-[8px] bg-[linear-gradient(90deg,rgba(157,153,148,0.7)_39.42%,rgba(197,197,185,0.7)_92.9%)]">
<?php echo esc_html($exp); ?>
</div>
<?php endif; ?>
</div>
</div>
<div>
<?php $name = $trainer_data['name']; ?>
<?php if ($name): ?>
<div class="text-[24px] leading-[125%] font-[600]">
<?php echo esc_html($name); ?>
</div>
<?php endif; ?>
<?php $short_desc = $trainer_data['short_desc']; ?>
<?php if ($short_desc): ?>
<div class="text-[16px] leading-[145%] font-[500] mt-[4px] text-[#6c6b6b]">
<?php echo wp_kses_post($short_desc); ?>
</div>
<?php endif; ?>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
<div class="max-[768px]:hidden flex ml-auto flex-col justify-between w-full max-w-[312px]">
<div class="max-[768px]:h-[440px] p-[24px] flex flex-col bg-cover bg-center bg-no-repeat rounded-[20px] h-[460px]"
<?php if (get_current_room() === 'fitness') : ?>
style="background-image: url('<?php echo get_template_directory_uri() . '/assets/images/trainer-bg-dark.png'; ?>')"
<?php else : ?>
style="background-image: url('<?php echo get_template_directory_uri() . '/assets/images/trainer-bg-light.png'; ?>')"
<?php endif; ?>
>
<?php
if (get_current_room() === 'fitness') :
?>
<svg width="138" height="14" viewBox="0 0 138 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2190_3090)">
<mask id="mask0_2190_3090" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="84" height="14">
<path d="M83.731 0.046875H0V13.9305H83.731V0.046875Z" fill="white" />
</mask>
<g mask="url(#mask0_2190_3090)">
<path d="M48.2909 13.931C48.2909 13.931 48.349 13.7557 48.4943 13.4341C48.6397 13.0834 48.8142 12.645 49.0177 12.0896C49.2503 11.5343 49.4829 10.9205 49.7736 10.219C50.0643 9.51752 50.3551 8.78682 50.6458 8.05605C50.9365 7.32535 51.2273 6.59464 51.518 5.89315C51.8087 5.19166 52.0413 4.57786 52.2739 4.02251C52.5065 3.46718 52.6809 3.02874 52.8263 2.678C52.9717 2.32726 53.0298 2.18111 53.0298 2.18111C53.2914 1.59654 53.6985 1.15811 54.2218 0.807368C54.7451 0.456622 55.3266 0.310479 55.9371 0.310479H68.3514L67.5664 2.21034C67.3048 2.82414 66.9268 3.32103 66.3745 3.67177C65.822 4.05174 65.2115 4.22712 64.5719 4.22712H56.8384C56.4895 4.22712 56.2278 4.40249 56.0825 4.72401L55.7627 5.51318H62.3624L61.432 7.79303C61.3157 8.08533 61.1413 8.31913 60.8796 8.49453C60.618 8.66985 60.3563 8.75754 60.0365 8.75754H54.9777C54.6288 8.75754 54.3672 8.93293 54.2218 9.25443L53.902 10.0436H64.3393L63.5834 11.9142C63.3218 12.528 62.9438 13.0249 62.3914 13.4049C61.839 13.7849 61.2285 13.9603 60.5888 13.9603H48.2909V13.931ZM38.1443 1.21657C38.2606 0.924278 38.435 0.71968 38.6676 0.544308C38.9002 0.368935 39.1909 0.28125 39.4817 0.28125H42.6506L40.5573 5.51318L40.5865 5.54241L45.7615 0.631993C46.0231 0.398164 46.2848 0.28125 46.6046 0.28125H51.7215L43.4356 8.17295C43.4647 8.23144 43.6392 8.46525 43.9589 8.90372C44.0753 9.07904 44.2497 9.31292 44.4532 9.60522C44.6567 9.86823 44.8893 10.219 45.18 10.6282C45.4708 11.0374 45.7905 11.505 46.1976 12.0604C46.5755 12.6157 47.0407 13.2295 47.5349 13.9603H42.8542L39.22 8.81603L37.5628 12.9665C37.4465 13.2588 37.2721 13.4926 37.0104 13.668C36.7488 13.8433 36.4871 13.931 36.1673 13.931H32.9983L38.1443 1.21657ZM29.9165 5.51318C30.091 5.51318 30.2364 5.42549 30.2945 5.25012L30.7015 4.22712H24.7415C24.5671 4.22712 24.4217 4.3148 24.3636 4.49018L23.9565 5.51318H29.9165ZM16.3975 13.931L21.1073 2.29803C21.369 1.68422 21.747 1.18734 22.2703 0.836597C22.7936 0.48585 23.4042 0.28125 24.0728 0.28125H36.458L31.7773 11.8558C31.5156 12.4696 31.1376 12.9665 30.5852 13.3465C30.0329 13.7264 29.4223 13.9018 28.7827 13.9018H26.8057L28.899 8.69912H22.6482L20.9038 12.9665C20.7876 13.2588 20.6131 13.4634 20.3515 13.6387C20.0898 13.8141 19.8282 13.9018 19.5083 13.9018H16.3975V13.931Z" fill="white" />
<path d="M3.60508 5.01441L4.6808 2.32537C4.94246 1.71157 5.32041 1.21468 5.8728 0.86394C6.42519 0.483965 7.03575 0.308594 7.67534 0.308594H9.65234L8.14049 4.04986L6.22168 8.84336C6.16353 8.96026 6.10538 9.07717 6.04724 9.19407L4.97153 11.8831C4.70987 12.4969 4.33192 12.9938 3.77952 13.3738C3.22713 13.7538 2.61659 13.9291 1.97698 13.9291H0L1.51181 10.1879L3.43064 5.39438C3.48879 5.24824 3.54694 5.13132 3.60508 5.01441Z" fill="white" />
<path fill-rule="evenodd" clip-rule="evenodd" d="M20.0601 0.046875C17.647 6.3018 12.4138 2.96974 8.31445 4.48963C9.50648 0.982194 11.6579 0.339161 14.071 0.309933C15.8735 0.280704 18.4029 0.485305 20.0601 0.046875Z" fill="white" />
<path d="M83.7313 0.337822L79.0798 11.8831C78.8181 12.4969 78.4399 12.9938 77.8877 13.3738C77.3354 13.7537 76.725 13.9291 76.085 13.9291H74.1084L78.0041 4.25446H77.4224C77.1607 4.25446 76.899 4.31292 76.6379 4.42984C76.3762 4.54675 76.1727 4.72212 75.998 4.92672L68.6422 13.9291H63.6709L73.6719 1.5362C73.9631 1.15622 74.3406 0.863936 74.7771 0.630109C75.2128 0.425508 75.678 0.308594 76.1727 0.308594H83.7313V0.337822Z" fill="white" />
<path fill-rule="evenodd" clip-rule="evenodd" d="M15.9612 4.57812C14.1005 9.37161 10.1175 6.71181 6.97754 7.88093C8.60566 3.08746 12.3271 5.54267 15.9612 4.57812Z" fill="white" />
</g>
<mask id="mask1_2190_3090" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="84" height="14">
<path d="M83.731 0.046875H0V13.9305H83.731V0.046875Z" fill="white" />
</mask>
<g mask="url(#mask1_2190_3090)">
<path d="M48.2909 13.931C48.2909 13.931 48.349 13.7557 48.4943 13.4341C48.6397 13.0834 48.8142 12.645 49.0177 12.0896C49.2503 11.5343 49.4829 10.9205 49.7736 10.219C50.0643 9.51752 50.3551 8.78682 50.6458 8.05605C50.9365 7.32535 51.2273 6.59464 51.518 5.89315C51.8087 5.19166 52.0413 4.57786 52.2739 4.02251C52.5065 3.46718 52.6809 3.02874 52.8263 2.678C52.9717 2.32726 53.0298 2.18111 53.0298 2.18111C53.2914 1.59654 53.6985 1.15811 54.2218 0.807368C54.7451 0.456622 55.3266 0.310479 55.9371 0.310479H68.3514L67.5664 2.21034C67.3048 2.82414 66.9268 3.32103 66.3745 3.67177C65.822 4.05174 65.2115 4.22712 64.5719 4.22712H56.8384C56.4895 4.22712 56.2278 4.40249 56.0825 4.72401L55.7627 5.51318H62.3624L61.432 7.79303C61.3157 8.08533 61.1413 8.31913 60.8796 8.49453C60.618 8.66985 60.3563 8.75754 60.0365 8.75754H54.9777C54.6288 8.75754 54.3672 8.93293 54.2218 9.25443L53.902 10.0436H64.3393L63.5834 11.9142C63.3218 12.528 62.9438 13.0249 62.3914 13.4049C61.839 13.7849 61.2285 13.9603 60.5888 13.9603H48.2909V13.931ZM38.1443 1.21657C38.2606 0.924278 38.435 0.71968 38.6676 0.544308C38.9002 0.368935 39.1909 0.28125 39.4817 0.28125H42.6506L40.5573 5.51318L40.5865 5.54241L45.7615 0.631993C46.0231 0.398164 46.2848 0.28125 46.6046 0.28125H51.7215L43.4356 8.17295C43.4647 8.23144 43.6392 8.46525 43.9589 8.90372C44.0753 9.07904 44.2497 9.31292 44.4532 9.60522C44.6567 9.86823 44.8893 10.219 45.18 10.6282C45.4708 11.0374 45.7905 11.505 46.1976 12.0604C46.5755 12.6157 47.0407 13.2295 47.5349 13.9603H42.8542L39.22 8.81603L37.5628 12.9665C37.4465 13.2588 37.2721 13.4926 37.0104 13.668C36.7488 13.8433 36.4871 13.931 36.1673 13.931H32.9983L38.1443 1.21657ZM29.9165 5.51318C30.091 5.51318 30.2364 5.42549 30.2945 5.25012L30.7015 4.22712H24.7415C24.5671 4.22712 24.4217 4.3148 24.3636 4.49018L23.9565 5.51318H29.9165ZM16.3975 13.931L21.1073 2.29803C21.369 1.68422 21.747 1.18734 22.2703 0.836597C22.7936 0.48585 23.4042 0.28125 24.0728 0.28125H36.458L31.7773 11.8558C31.5156 12.4696 31.1376 12.9665 30.5852 13.3465C30.0329 13.7264 29.4223 13.9018 28.7827 13.9018H26.8057L28.899 8.69912H22.6482L20.9038 12.9665C20.7876 13.2588 20.6131 13.4634 20.3515 13.6387C20.0898 13.8141 19.8282 13.9018 19.5083 13.9018H16.3975V13.931Z" fill="white" />
<path d="M3.60508 5.01441L4.6808 2.32537C4.94246 1.71157 5.32041 1.21468 5.8728 0.86394C6.42519 0.483965 7.03575 0.308594 7.67534 0.308594H9.65234L8.14049 4.04986L6.22168 8.84336C6.16353 8.96026 6.10538 9.07717 6.04724 9.19407L4.97153 11.8831C4.70987 12.4969 4.33192 12.9938 3.77952 13.3738C3.22713 13.7538 2.61659 13.9291 1.97698 13.9291H0L1.51181 10.1879L3.43064 5.39438C3.48879 5.24824 3.54694 5.13132 3.60508 5.01441Z" fill="white" />
<path fill-rule="evenodd" clip-rule="evenodd" d="M20.0601 0.046875C17.647 6.3018 12.4138 2.96974 8.31445 4.48963C9.50648 0.982194 11.6579 0.339161 14.071 0.309933C15.8735 0.280704 18.4029 0.485305 20.0601 0.046875Z" fill="white" />
<path d="M83.7313 0.337822L79.0798 11.8831C78.8181 12.4969 78.4399 12.9938 77.8877 13.3738C77.3354 13.7537 76.725 13.9291 76.085 13.9291H74.1084L78.0041 4.25446H77.4224C77.1607 4.25446 76.899 4.31292 76.6379 4.42984C76.3762 4.54675 76.1727 4.72212 75.998 4.92672L68.6422 13.9291H63.6709L73.6719 1.5362C73.9631 1.15622 74.3406 0.863936 74.7771 0.630109C75.2128 0.425508 75.678 0.308594 76.1727 0.308594H83.7313V0.337822Z" fill="white" />
<path fill-rule="evenodd" clip-rule="evenodd" d="M15.9612 4.57812C14.1005 9.37161 10.1175 6.71181 6.97754 7.88093C8.60566 3.08746 12.3271 5.54267 15.9612 4.57812Z" fill="white" />
</g>
<path d="M87.531 2.59082C88.0887 1.22398 89.3809 0.335938 90.8122 0.335938H137.01L132.516 11.6376C131.966 13.0212 130.665 13.924 129.222 13.924H82.9062L87.531 2.59082Z" fill="white" />
<path d="M96.3045 4.77025H93.4138L93.113 6.55436H95.9317L95.683 7.97304H92.8643L92.3772 10.8749H90.9473L92.2216 3.35156H96.5532L96.3045 4.77025Z" fill="#ADAAA4" />
<path d="M97.5957 3.35156H99.0256L97.7512 10.8749H96.3213L97.5957 3.35156Z" fill="#ADAAA4" />
<path d="M105.166 3.35156L104.927 4.77025H102.969L101.933 10.8749H100.503L101.539 4.77025H99.5908L99.8293 3.35156H105.166Z" fill="#ADAAA4" />
<path d="M104.689 10.8749L105.964 3.35156H107.042L109.372 8.0483L110.16 3.35156H111.59L110.316 10.8749H109.238L106.917 6.17819L106.119 10.8749H104.689Z" fill="#ADAAA4" />
<path d="M117.133 4.77025H114.128L113.847 6.38239H116.604L116.355 7.76887H113.62L113.329 9.45619H116.387L116.148 10.8749H111.661L112.936 3.35156H117.371L117.133 4.77025Z" fill="#ADAAA4" />
<path d="M119.726 11.0235C118.994 11.0235 118.393 10.8587 117.923 10.5291C117.46 10.1923 117.163 9.73737 117.032 9.16415L118.327 8.4763C118.507 9.2215 119.011 9.59403 119.84 9.59403C120.22 9.59403 120.517 9.52239 120.731 9.37912C120.952 9.23578 121.084 9.0459 121.125 8.80946C121.18 8.53721 121.104 8.32586 120.897 8.17534C120.696 8.02489 120.344 7.86371 119.84 7.69173C119.163 7.4553 118.652 7.15796 118.307 6.79968C117.968 6.43426 117.854 5.92195 117.965 5.26276C118.082 4.58208 118.39 4.06978 118.887 3.72585C119.391 3.37476 119.964 3.19922 120.607 3.19922C121.201 3.19922 121.708 3.34611 122.13 3.63987C122.551 3.93364 122.855 4.34563 123.042 4.87585L121.788 5.5637C121.532 4.94034 121.101 4.62865 120.493 4.62865C120.202 4.62865 119.961 4.69314 119.767 4.82211C119.581 4.95108 119.463 5.12663 119.415 5.34874C119.36 5.61385 119.432 5.82522 119.633 5.98285C119.833 6.13332 120.172 6.29812 120.648 6.47724C120.772 6.5274 120.876 6.56681 120.959 6.59547C121.042 6.62413 121.146 6.66712 121.27 6.72444C121.395 6.7746 121.495 6.82475 121.571 6.87491C121.654 6.9179 121.747 6.97522 121.85 7.04687C121.954 7.11134 122.04 7.17942 122.109 7.25105C122.178 7.31558 122.248 7.39439 122.316 7.48749C122.392 7.57348 122.448 7.66665 122.482 7.76699C122.524 7.86727 122.558 7.97834 122.586 8.10015C122.613 8.21478 122.627 8.34376 122.627 8.48703C122.627 8.63037 122.613 8.78082 122.586 8.93844C122.468 9.61194 122.151 10.1279 121.632 10.4861C121.121 10.8444 120.486 11.0235 119.726 11.0235Z" fill="#ADAAA4" />
<path d="M125.797 11.0235C125.064 11.0235 124.463 10.8587 123.994 10.5291C123.531 10.1923 123.233 9.73737 123.103 9.16415L124.397 8.4763C124.577 9.2215 125.082 9.59403 125.91 9.59403C126.291 9.59403 126.587 9.52239 126.802 9.37912C127.023 9.23578 127.154 9.0459 127.196 8.80946C127.25 8.53721 127.174 8.32586 126.967 8.17534C126.767 8.02489 126.415 7.86371 125.91 7.69173C125.233 7.4553 124.722 7.15796 124.377 6.79968C124.038 6.43426 123.925 5.92195 124.035 5.26276C124.152 4.58208 124.46 4.06978 124.957 3.72585C125.462 3.37476 126.035 3.19922 126.678 3.19922C127.272 3.19922 127.779 3.34611 128.201 3.63987C128.622 3.93364 128.926 4.34563 129.113 4.87585L127.859 5.5637C127.603 4.94034 127.171 4.62865 126.563 4.62865C126.273 4.62865 126.032 4.69314 125.838 4.82211C125.651 4.95108 125.534 5.12663 125.485 5.34874C125.431 5.61385 125.503 5.82522 125.703 5.98285C125.903 6.13332 126.242 6.29812 126.719 6.47724C126.843 6.5274 126.947 6.56681 127.03 6.59547C127.113 6.62413 127.216 6.66712 127.34 6.72444C127.465 6.7746 127.565 6.82475 127.641 6.87491C127.724 6.9179 127.817 6.97522 127.921 7.04687C128.025 7.11134 128.111 7.17942 128.18 7.25105C128.249 7.31558 128.318 7.39439 128.387 7.48749C128.463 7.57348 128.518 7.66665 128.553 7.76699C128.594 7.86727 128.629 7.97834 128.656 8.10015C128.684 8.21478 128.698 8.34376 128.698 8.48703C128.698 8.63037 128.684 8.78082 128.656 8.93844C128.539 9.61194 128.221 10.1279 127.703 10.4861C127.192 10.8444 126.556 11.0235 125.797 11.0235Z" fill="#ADAAA4" />
</g>
<defs>
<clipPath id="clip0_2190_3090">
<rect width="137.03" height="14" fill="white" />
</clipPath>
</defs>
</svg>
<?php
else :
?>
<svg width="127" height="14" viewBox="0 0 127 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_4006_20975)">
<mask id="mask0_4006_20975" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="88" height="14">
<path d="M87.4168 0H0V13.9745H87.4168V0Z" fill="white" />
</mask>
<g mask="url(#mask0_4006_20975)">
<path d="M50.4164 13.9735C50.4164 13.9735 50.4771 13.797 50.6289 13.4733C50.7806 13.1203 50.9627 12.679 51.1752 12.12C51.4181 11.5611 51.6609 10.9432 51.9644 10.2372C52.268 9.53106 52.5715 8.79555 52.875 8.06005C53.1785 7.32461 53.4821 6.5891 53.7856 5.883C54.0891 5.17692 54.332 4.5591 54.5747 4.00012C54.8176 3.44115 54.9997 2.99985 55.1515 2.64681C55.3033 2.29377 55.3639 2.14667 55.3639 2.14667C55.6371 1.55827 56.0621 1.11698 56.6084 0.763936C57.1548 0.410894 57.7618 0.263795 58.3993 0.263795H71.3603L70.5405 2.17609C70.2674 2.79391 69.8726 3.29404 69.2963 3.64708C68.7192 4.02954 68.0817 4.20606 67.4138 4.20606H59.3402C58.976 4.20606 58.7028 4.38258 58.551 4.7062L58.2171 5.50055H65.107L64.1358 7.79531C64.0147 8.0895 63.8325 8.32485 63.5594 8.50136C63.2863 8.67788 63.0129 8.76617 62.679 8.76617H57.3976C57.0334 8.76617 56.7602 8.94268 56.6084 9.26632L56.2746 10.0607H67.171L66.3821 11.9435C66.109 12.5613 65.7143 13.0615 65.1379 13.4439C64.5609 13.8264 63.9233 14.0029 63.2554 14.0029H50.4164V13.9735ZM39.8232 1.17581C39.9446 0.881611 40.1268 0.675673 40.3695 0.499154C40.6124 0.322635 40.9159 0.234375 41.2194 0.234375H44.5279L42.3425 5.50055L42.3729 5.52996L47.7757 0.587414C48.0489 0.352054 48.322 0.234375 48.6559 0.234375H53.998L45.3474 8.17779C45.3778 8.23663 45.5599 8.47198 45.8938 8.91323C46.0152 9.08974 46.1973 9.32516 46.4098 9.61935C46.6223 9.88408 46.8651 10.2372 47.1686 10.649C47.4721 11.0609 47.8061 11.5316 48.231 12.0906C48.6256 12.6496 49.1112 13.2674 49.6272 14.0029H44.7404L40.9463 8.825L39.2161 13.0026C39.0947 13.2968 38.9126 13.5322 38.6394 13.7087C38.3663 13.8852 38.0931 13.9735 37.7592 13.9735H34.4507L39.8232 1.17581ZM31.2333 5.50055C31.4154 5.50055 31.5672 5.41228 31.6279 5.23576L32.0529 4.20606H25.8305C25.6484 4.20606 25.4966 4.29433 25.4359 4.47085L25.0109 5.50055H31.2333ZM17.1191 13.9735L22.0364 2.26435C22.3095 1.64653 22.7041 1.14639 23.2504 0.793355C23.7968 0.440314 24.4342 0.234375 25.1323 0.234375H38.0627L33.1759 11.8847C32.9027 12.5025 32.5081 13.0026 31.9314 13.3851C31.3547 13.7676 30.7173 13.9441 30.0495 13.9441H27.9855L30.1709 8.70733H23.645L21.8238 13.0026C21.7024 13.2968 21.5203 13.5028 21.2471 13.6793C20.974 13.8558 20.7008 13.9441 20.3669 13.9441H17.1191V13.9735Z" fill="#202020" />
<path d="M3.76377 5.00224L4.88684 2.2956C5.16002 1.67778 5.5546 1.17764 6.13131 0.824605C6.70802 0.442144 7.34546 0.265625 8.01317 0.265625H10.0772L8.49882 4.03137L6.49556 8.85627C6.43483 8.97395 6.37416 9.09162 6.31343 9.2093L5.19037 11.9159C4.91719 12.5337 4.5226 13.0339 3.94589 13.4164C3.36919 13.7988 2.73177 13.9753 2.064 13.9753H0L1.57835 10.2095L3.58165 5.3847C3.64236 5.23759 3.70307 5.11991 3.76377 5.00224Z" fill="#202020" />
<path fill-rule="evenodd" clip-rule="evenodd" d="M20.9433 0C18.424 6.29586 12.9604 2.94199 8.68066 4.47183C9.92515 0.941437 12.1713 0.294199 14.6906 0.264779C16.5724 0.23536 19.2132 0.441299 20.9433 0Z" fill="#202020" />
<path d="M87.4169 0.295045L82.5604 11.9159C82.2873 12.5338 81.8926 13.0339 81.3162 13.4163C80.7391 13.7988 80.1022 13.9753 79.4344 13.9753H77.3703L81.4372 4.23732H80.8306C80.5575 4.23732 80.2838 4.29615 80.0108 4.41384C79.7377 4.53152 79.5252 4.70804 79.3429 4.91398L71.6637 13.9753H66.4736L76.915 1.50126C77.2183 1.1188 77.6131 0.824601 78.0684 0.589244C78.5237 0.383304 79.0093 0.265625 79.5252 0.265625H87.4169V0.295045Z" fill="#202020" />
<path fill-rule="evenodd" clip-rule="evenodd" d="M16.6633 4.55859C14.7207 9.38344 10.5623 6.70622 7.28418 7.88304C8.98398 3.05818 12.8692 5.52945 16.6633 4.55859Z" fill="#202020" />
</g>
<mask id="mask1_4006_20975" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="88" height="14">
<path d="M87.4168 0H0V13.9745H87.4168V0Z" fill="white" />
</mask>
<g mask="url(#mask1_4006_20975)">
<path d="M50.4164 13.9735C50.4164 13.9735 50.4771 13.797 50.6289 13.4733C50.7806 13.1203 50.9627 12.679 51.1752 12.12C51.4181 11.5611 51.6609 10.9432 51.9644 10.2372C52.268 9.53106 52.5715 8.79555 52.875 8.06005C53.1785 7.32461 53.4821 6.5891 53.7856 5.883C54.0891 5.17692 54.332 4.5591 54.5747 4.00012C54.8176 3.44115 54.9997 2.99985 55.1515 2.64681C55.3033 2.29377 55.3639 2.14667 55.3639 2.14667C55.6371 1.55827 56.0621 1.11698 56.6084 0.763936C57.1548 0.410894 57.7618 0.263795 58.3993 0.263795H71.3603L70.5405 2.17609C70.2674 2.79391 69.8726 3.29404 69.2963 3.64708C68.7192 4.02954 68.0817 4.20606 67.4138 4.20606H59.3402C58.976 4.20606 58.7028 4.38258 58.551 4.7062L58.2171 5.50055H65.107L64.1358 7.79531C64.0147 8.0895 63.8325 8.32485 63.5594 8.50136C63.2863 8.67788 63.0129 8.76617 62.679 8.76617H57.3976C57.0334 8.76617 56.7602 8.94268 56.6084 9.26632L56.2746 10.0607H67.171L66.3821 11.9435C66.109 12.5613 65.7143 13.0615 65.1379 13.4439C64.5609 13.8264 63.9233 14.0029 63.2554 14.0029H50.4164V13.9735ZM39.8232 1.17581C39.9446 0.881611 40.1268 0.675673 40.3695 0.499154C40.6124 0.322635 40.9159 0.234375 41.2194 0.234375H44.5279L42.3425 5.50055L42.3729 5.52996L47.7757 0.587414C48.0489 0.352054 48.322 0.234375 48.6559 0.234375H53.998L45.3474 8.17779C45.3778 8.23663 45.5599 8.47198 45.8938 8.91323C46.0152 9.08974 46.1973 9.32516 46.4098 9.61935C46.6223 9.88408 46.8651 10.2372 47.1686 10.649C47.4721 11.0609 47.8061 11.5316 48.231 12.0906C48.6256 12.6496 49.1112 13.2674 49.6272 14.0029H44.7404L40.9463 8.825L39.2161 13.0026C39.0947 13.2968 38.9126 13.5322 38.6394 13.7087C38.3663 13.8852 38.0931 13.9735 37.7592 13.9735H34.4507L39.8232 1.17581ZM31.2333 5.50055C31.4154 5.50055 31.5672 5.41228 31.6279 5.23576L32.0529 4.20606H25.8305C25.6484 4.20606 25.4966 4.29433 25.4359 4.47085L25.0109 5.50055H31.2333ZM17.1191 13.9735L22.0364 2.26435C22.3095 1.64653 22.7041 1.14639 23.2504 0.793355C23.7968 0.440314 24.4342 0.234375 25.1323 0.234375H38.0627L33.1759 11.8847C32.9027 12.5025 32.5081 13.0026 31.9314 13.3851C31.3547 13.7676 30.7173 13.9441 30.0495 13.9441H27.9855L30.1709 8.70733H23.645L21.8238 13.0026C21.7024 13.2968 21.5203 13.5028 21.2471 13.6793C20.974 13.8558 20.7008 13.9441 20.3669 13.9441H17.1191V13.9735Z" fill="white" />
<path d="M3.76377 5.00224L4.88684 2.2956C5.16002 1.67778 5.5546 1.17764 6.13131 0.824605C6.70802 0.442144 7.34546 0.265625 8.01317 0.265625H10.0772L8.49882 4.03137L6.49556 8.85627C6.43483 8.97395 6.37416 9.09162 6.31343 9.2093L5.19037 11.9159C4.91719 12.5337 4.5226 13.0339 3.94589 13.4164C3.36919 13.7988 2.73177 13.9753 2.064 13.9753H0L1.57835 10.2095L3.58165 5.3847C3.64236 5.23759 3.70307 5.11991 3.76377 5.00224Z" fill="white" />
<path fill-rule="evenodd" clip-rule="evenodd" d="M20.9433 0C18.424 6.29586 12.9604 2.94199 8.68066 4.47183C9.92515 0.941437 12.1713 0.294199 14.6906 0.264779C16.5724 0.23536 19.2132 0.441299 20.9433 0Z" fill="white" />
<path d="M87.4169 0.295045L82.5604 11.9159C82.2873 12.5338 81.8926 13.0339 81.3162 13.4163C80.7391 13.7988 80.1022 13.9753 79.4344 13.9753H77.3703L81.4372 4.23732H80.8306C80.5575 4.23732 80.2838 4.29615 80.0108 4.41384C79.7377 4.53152 79.5252 4.70804 79.3429 4.91398L71.6637 13.9753H66.4736L76.915 1.50126C77.2183 1.1188 77.6131 0.824601 78.0684 0.589244C78.5237 0.383304 79.0093 0.265625 79.5252 0.265625H87.4169V0.295045Z" fill="white" />
<path fill-rule="evenodd" clip-rule="evenodd" d="M16.6633 4.55859C14.7207 9.38344 10.5623 6.70622 7.28418 7.88304C8.98398 3.05818 12.8692 5.52945 16.6633 4.55859Z" fill="white" />
</g>
<path d="M91.6425 2.55319C92.2265 1.17364 93.5792 0.277344 95.0776 0.277344H126.127L121.454 11.6066C120.878 13.0031 119.517 13.9143 118.006 13.9143H86.834L91.6425 2.55319Z" fill="white" />
<path d="M102.747 6.79809L102.65 7.3806C102.463 8.4808 101.974 9.36167 101.183 10.0232C100.392 10.6776 99.4394 11.0048 98.325 11.0048C97.1596 11.0048 96.2572 10.6129 95.6177 9.82909C94.9777 9.03809 94.7544 8.08167 94.9486 6.95991C95.1359 5.85971 95.6499 4.95006 96.4912 4.23097C97.3324 3.51189 98.3105 3.15234 99.4249 3.15234C100.173 3.15234 100.813 3.31414 101.345 3.63773C101.884 3.95413 102.294 4.40356 102.575 4.98602L101.216 5.69792C100.834 4.96445 100.191 4.59771 99.2849 4.59771C98.5584 4.59771 97.9296 4.82782 97.3974 5.28804C96.8721 5.74106 96.5486 6.33432 96.4262 7.06775C96.2969 7.80123 96.4155 8.39806 96.7825 8.8583C97.1565 9.31853 97.7171 9.54865 98.465 9.54865C99.7017 9.54865 100.529 9.07044 100.946 8.11403H98.735L98.9613 6.79809H102.747Z" fill="#2B2C35" />
<path d="M110.181 3.30078L106.966 7.50743L106.373 10.8512H104.895L105.489 7.48587L103.752 3.30078H105.338L106.395 6.08365L108.412 3.30078H110.181Z" fill="#2B2C35" />
<path d="M118.288 3.30078L116.961 10.8512H115.483L116.347 5.94343L113.564 9.45974H113.391L111.935 5.90028L111.061 10.8512H109.572L110.899 3.30078H112.42L113.844 6.9142L116.649 3.30078H118.288Z" fill="#2B2C35" />
</g>
<defs>
<clipPath id="clip0_4006_20975">
<rect width="126.126" height="14" fill="white" />
</clipPath>
</defs>
</svg>
<?php
endif;
?>
<div class="mt-auto text-[24px] font-[600] leading-[125%] text-[#f8f8f8]">
Другие профессионалы нашего клуба
</div>
<a class="!no-underline hover:[&>svg]:translate-x-[6px] mt-[40px] bg-[#f8f8f8] max-w-[179px] rounded-[90px] px-[24px] h-[59px] flex items-center justify-center gap-[8px] font-[600] text-[18px] leading-[195%] text-[#222]" href="<?php echo get_post_type_archive_link('trainer'); ?>">
Все тренеры
<svg class="transition" width="12" height="13" viewBox="0 0 12 13" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M6.4876 2.17896C6.73011 1.94034 7.12396 1.94035 7.36649 2.17896L11.3181 6.06809C11.5606 6.30671 11.5606 6.69329 11.3181 6.93191L7.36649 10.821C7.12396 11.0596 6.73011 11.0597 6.4876 10.821C6.24512 10.5824 6.24511 10.1949 6.4876 9.95626L9.38032 7.11093H1.1209C0.777923 7.11093 0.5 6.83747 0.5 6.5C0.5 6.16253 0.777923 5.88907 1.1209 5.88907H9.38032L6.4876 3.04374C6.24511 2.80512 6.24512 2.41758 6.4876 2.17896Z" fill="#222222" />
</svg>
</a>
</div>
<div>
<button class="group custom-prev-<?php echo esc_attr($section_id); ?> cursor-pointer">
<?php display_icon('slider-prev') ?>
</button>
<button class="group custom-next-<?php echo esc_attr($section_id); ?> cursor-pointer">
<?php display_icon('slider-next') ?>
</button>
</div>
</div>
</div>
<?php endif; ?>
</div>
</section>
<script>
document.addEventListener('DOMContentLoaded', function () {
const swiperContainer = document.querySelector('#<?php echo esc_attr($section_id); ?>-swiper');
if (swiperContainer && typeof Swiper !== 'undefined') {
new Swiper('#<?php echo esc_attr($section_id); ?>-swiper', {
slidesPerView: 'auto',
spaceBetween: 24,
grabCursor: true,
freeMode: true,
navigation: {
nextEl: '.custom-next-<?php echo esc_attr($section_id); ?>',
prevEl: '.custom-prev-<?php echo esc_attr($section_id); ?>',
}
});
}
});
</script>
<script>
document.addEventListener('DOMContentLoaded', function () {
const trainingPhotosSwiper = document.querySelector('.training-photos-swiper');
if (trainingPhotosSwiper) {
let mainSwiper;
let thumbnailSwiper;
let lightbox;
const slides = trainingPhotosSwiper.querySelectorAll('.swiper-slide');
const isSingleSlide = slides.length <= 1;
const thumbnailContainer = trainingPhotosSwiper.parentElement.querySelector('.thumbnail-swiper');
function initLightbox() {
if (typeof GLightbox === 'undefined') {
console.warn('GLightbox is not loaded');
return;
}
const galleryContainer = trainingPhotosSwiper.closest('[data-gallery-id]');
const selector = galleryContainer ? `#${galleryContainer.id} .glightbox` : '.glightbox';
if (lightbox) {
lightbox.destroy();
}
lightbox = GLightbox({
selector: selector,
preload: false,
touchNavigation: true,
loop: true
});
}
function updateThumbnails(activeIndex) {
if (!thumbnailContainer) return;
const thumbnails = thumbnailContainer.querySelectorAll('.thumbnail');
thumbnails.forEach((thumb, index) => {
if (index === activeIndex) {
thumb.classList.remove('opacity-50', 'hover:opacity-80');
thumb.classList.add('opacity-100', 'active');
} else {
thumb.classList.remove('opacity-100', 'active');
thumb.classList.add('opacity-50', 'hover:opacity-80');
}
});
}
function centerThumbnail(activeIndex) {
if (thumbnailSwiper) {
thumbnailSwiper.slideTo(activeIndex);
}
}
// Инициализируем основной свайпер
mainSwiper = new Swiper('.training-photos-swiper', {
loop: true,
slidesPerView: 1,
spaceBetween: 0,
grabCursor: true,
lazy: {
loadPrevNext: true,
loadOnTransitionStart: true,
},
pagination: {
el: '.training-swiper-pagination',
type: 'bullets',
clickable: true,
bulletClass: 'swiper-pagination-bullet',
},
on: {
slideChange: function () {
if (thumbnailContainer && !isSingleSlide) {
updateThumbnails(this.realIndex);
centerThumbnail(this.realIndex);
}
}
}
});
// Инициализируем свайпер для миниатюр (только если есть контейнер и больше одного слайда)
if (thumbnailContainer && !isSingleSlide) {
thumbnailSwiper = new Swiper(thumbnailContainer, {
slidesPerView: 'auto',
spaceBetween: 6,
freeMode: true,
grabCursor: true,
watchSlidesProgress: true,
});
// Обработчик кликов по миниатюрам
thumbnailContainer.addEventListener('click', (e) => {
const thumbnail = e.target.closest('.thumbnail');
if (!thumbnail) return;
const index = parseInt(thumbnail.getAttribute('data-index'));
if (mainSwiper) {
mainSwiper.slideToLoop(index);
}
updateThumbnails(index);
centerThumbnail(index);
});
}
// Скрываем элементы навигации при одном слайде
if (isSingleSlide) {
const nextBtn = trainingPhotosSwiper.querySelector('.training-swiper-button-next');
const prevBtn = trainingPhotosSwiper.querySelector('.training-swiper-button-prev');
const pagination = trainingPhotosSwiper.querySelector('.training-swiper-pagination');
if (nextBtn) nextBtn.style.display = 'none';
if (prevBtn) prevBtn.style.display = 'none';
if (pagination) pagination.style.display = 'none';
if (mainSwiper.autoplay) {
mainSwiper.autoplay.stop();
}
// Скрываем миниатюры при одном слайде
if (thumbnailContainer) {
thumbnailContainer.style.display = 'none';
}
}
// Инициализируем лайтбокс
initLightbox();
// Очистка ресурсов при выгрузке страницы
window.addEventListener('beforeunload', () => {
if (mainSwiper) mainSwiper.destroy();
if (thumbnailSwiper) thumbnailSwiper.destroy();
if (lightbox) lightbox.destroy();
});
}
// Инициализация для одиночных изображений (если есть)
document.querySelectorAll('.single-image .glightbox').forEach(() => {
if (typeof GLightbox !== 'undefined') {
GLightbox({
selector: '.single-image .glightbox',
preload: false,
touchNavigation: true,
loop: true
});
}
});
});
</script>
<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>
<?php get_footer(); ?>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,14 @@
<?php
/**
* Template Name: Шаблон страницы галерии
*
* Шаблон страницы с галереей с главной страницы
*/
get_header(); ?>
<?php
get_footer();
?>

View File

@@ -1,91 +1,214 @@
<?php
/**
* Блок с клубными картами
*/
// Получение полей ACF
$block_id = 'club-cards-' . $block['id'];
$class_name = 'club-cards-block';
if (!empty($block['className'])) {
$class_name .= ' ' . $block['className'];
}
if (!empty($block['align'])) {
$class_name .= ' align' . $block['align'];
}
if (!function_exists('get_club_cards_for_current_language')) {
function get_club_cards_for_current_language() {
$current_lang = pll_current_language();
$args = array(
'post_type' => 'club-card',
'posts_per_page' => -1,
'lang' => $current_lang,
'post_status' => 'publish'
);
return get_posts($args);
}
}
$cards = get_club_cards_for_current_language();
$heading = get_field('heading', $block['id']);
?>
<section id="<?php echo esc_attr($block_id); ?>" class="<?php echo esc_attr($class_name); ?>">
<div class="container mx-auto mt-[24px]">
<?php if ($heading) : ?>
<h2 class="text-[32px] font-bold mt-[24px]"><?php echo esc_html($heading); ?></h2>
<?php endif; ?>
<?php if ($cards): ?>
<div class="mt-[24px] grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-[30px] max-[768px]:gap-[20px]">
<?php foreach ($cards as $card): ?>
<div class="bg-[#ffffff] border-[1px] border-[#e5e7eb] rounded-[16px] overflow-hidden shadow-lg hover:shadow-xl transition-shadow ">
<?php
$card_image = get_field('image', $card->ID);
if ($card_image): ?>
<div class="overflow-hidden max-w-[60px] max-h-[60px] mx-auto mt-[22px] rounded-full">
<img src="<?php echo esc_url($card_image['url']); ?>"
alt="<?php echo esc_attr($card_image['alt']); ?>"
class="w-full h-full object-cover" />
</div>
<?php endif; ?>
<div class="p-[30px] max-[768px]:p-[20px]">
<?php $card_heading = get_field('heading', $card->ID); ?>
<?php if ($card_heading): ?>
<h3 class="text-[24px] max-[768px]:text-[20px] font-semibold text-[#1f2937] mb-[16px] text-center">
<?php echo esc_html($card_heading); ?>
</h3>
<?php endif; ?>
<?php $card_description = get_field('description', $card->ID); ?>
<?php if ($card_description): ?>
<div class="text-[16px] max-[768px]:text-[14px] text-[#6b7280] leading-[150%] text-center mb-[16px]">
<?php echo wp_kses_post($card_description); ?>
</div>
<?php endif; ?>
<?php $card_price = get_field('price', $card->ID); ?>
<?php if ($card_price): ?>
<div class="text-[20px] max-[768px]:text-[18px] font-bold text-[#1f2937] text-center mb-[24px]">
<span>От</span> <?php echo esc_html($card_price); ?> Р.
</div>
<?php endif; ?>
<div class="text-center mt-auto">
<?php $popup_button = get_field('popup_button', $card->ID); ?>
<button data-modal="club-card"
data-card-id="<?php echo $card->ID; ?>"
class="inline-block cursor-pointer px-[24px] py-[12px] bg-[#3b82f6] text-white rounded-[8px] hover:bg-[#2563eb] transition-colors ">
<?php echo $popup_button ? esc_html($popup_button) : 'Подробнее'; ?>
</button>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>
</section>
<?php
/**
* Блок с клубными картами
*/
$block_id = 'club-cards-' . $block['id'];
$class_name = 'club-cards-block';
if (!empty($block['className'])) {
$class_name .= ' ' . $block['className'];
}
if (!empty($block['align'])) {
$class_name .= ' align' . $block['align'];
}
if (!function_exists('get_club_cards_for_current_language')) {
function get_club_cards_for_current_language()
{
$current_lang = pll_current_language();
$args = array(
'post_type' => 'club-card',
'posts_per_page' => -1,
'lang' => $current_lang,
'post_status' => 'publish',
'sort' => 'menu_order',
'order' => 'ASC',
);
return get_posts($args);
}
}
$cards = get_club_cards_for_current_language();
$heading = get_field('heading', $block['id']);
$room = get_current_room();
if ($room === 'fitness') {
} else {
$section_classes = 'bg-cover bg-center bg-no-repeat';
$bg_image = get_template_directory_uri() . '/assets/images/hero-bg.png';
$style_attr = 'style="background-image: url(' . esc_url($bg_image) . ')"';
}
if (!function_exists('render_club_card')){
function render_club_card($card) {
$card_attribute = get_field('attr', $card->ID);
$card_image = get_field('image', $card->ID);
$card_heading = get_field('heading', $card->ID);
$card_description = get_field('description', $card->ID);
$card_price = get_field('price', $card->ID);
$card_prices = [];
if (have_rows('card_prices', $card->ID)) {
while (have_rows('card_prices', $card->ID)) {
the_row();
$periods = ['1_month', '3_month', '6_month', '12_month'];
foreach ($periods as $period) {
if (have_rows($period)) {
while (have_rows($period)) {
the_row();
$card_prices[$period] = [
'full' => get_sub_field('full'),
'day' => get_sub_field('day')
];
}
}
}
}
}
$card_time = [];
if (have_rows('time', $card->ID)) {
while (have_rows('time', $card->ID)) {
the_row();
$card_time[] = [
'normal_days' => get_sub_field('normal_days'),
'vacation_days' => get_sub_field('vacation_days')
];
}
}
?>
<div class="border border-transparent hover:border-[#e21e24] transition max-[1300px]:h-auto max-[1050px]:p-[20px] bg-[#ffffff] rounded-[12px] p-[28px] pb-[16px] h-[258px] shadow-[0_2px_32px_0_rgba(16,_15,_15,_0.03)]">
<div class="flex flex-col h-full relative">
<?php if ($card_attribute): ?>
<div class="max-[768px]:top-[-29px] absolute top-[-14px] right-[-14px] px-[12px] py-[4px] rounded-[32px] bg-[linear-gradient(90deg,_#ffd65a_39.42%,_#ffe595_92.9%)]">
<span class="font-[600] text-[14px] leading-[125%]">
<?php echo($card_attribute); ?>
</span>
</div>
<?php endif; ?>
<div class="flex gap-[16px] items-center">
<?php if ($card_image): ?>
<div class="overflow-hidden w-[32px] h-[32px]">
<img src="<?php echo esc_url($card_image['url']); ?>"
alt="<?php echo esc_attr($card_image['alt']); ?>"
class="w-full h-full object-cover"/>
</div>
<?php endif; ?>
<?php if ($card_heading): ?>
<h3 class="max-[768px]:text-[20px] text-[24px] font-[600] leading-[125%]">
<?php echo esc_html($card_heading); ?>
</h3>
<?php endif; ?>
</div>
<?php if ($card_description): ?>
<div class="max-[768px]:min-h-[70px] min-h-[47px] text-[16px] leading-[145%] font-[500] mt-[16px]">
<?php echo wp_kses_post($card_description); ?>
</div>
<?php endif; ?>
<div class="justify-end flex-row-reverse max-[1100px]:mt-[16px] flex mt-auto pt-[16px] border-t border-t-[#f1f1f1] items-center gap-[16px] flex-wrap">
<?php if ($card_price): ?>
<div class="flex items-center text-[20px] font-[600] leading-[125%]">
от 
<div class="rounded-[32px] px-[12px] h-[36px] flex items-center bg-[linear-gradient(90deg,_rgba(43,_44,_53,_0.06)_39.42%,_rgba(110,_121,_150,_0.06)_92.9%)]">
<span class="max-[768px]:text-[20px] bg-[linear-gradient(90deg,_#2b2c35_67.31%,_#4f5870_92.9%)] text-[24px] flex items-center justify-center font-[600] bg-clip-text text-transparent">
<?php echo esc_html($card_price); ?> ₽
</span>
</div>
 в день
</div>
<?php endif; ?>
<div class="max-[1300px]:w-full">
<button
data-modal="club-card"
data-card-id="<?php echo $card->ID; ?>"
data-card-title="<?php echo esc_attr($card_heading); ?>"
data-card-prices='<?php echo esc_attr(json_encode($card_prices)); ?>'
data-card-time='<?php echo esc_attr(json_encode($card_time));?>'
data-card-attr='<?php echo esc_attr($card_attribute); ?>'
class="max-[1300px]:w-full max-[768px]:h-[53px] max-[768px]:text-[16px] red-gradient-hover cursor-pointer flex text-[#f8f8f8] text-[18px] text-[#fff] font-[600] justify-center h-[59px] w-[160px] rounded-[90px] flex items-center">
<?php echo 'Оформить' ?>
</button>
</div>
</div>
</div>
</div>
<?php
}
}
?>
<section data-scroll-section="prices" id="<?php echo esc_attr($block_id); ?>"
class="max-[768px]:py-[45px] py-[90px] <?php echo esc_attr($section_classes); ?>" <?php echo $style_attr; ?>>
<div class="container mx-auto">
<?php if ($cards): ?>
<!-- Заголовок для главной страницы -->
<?php if (is_front_page() && $heading): ?>
<div class="max-[1100px]:mt-0 flex flex-col gap-[16px] max-[768px]:[&>img]:w-[196px] mt-[28px] ">
<h2 class="max-[1050px]:text-[36px] max-[768px]:text-[24px] dark:text-[#fff] text-[40px] leading-[120%] font-[500]">
<?php echo esc_html($heading); ?>
</h2>
<?php display_icon(get_current_room() === 'gym' ? 'dark_logo_name' : 'light_logo_name'); ?>
</div>
<?php endif; ?>
<div class="min-[768px]:block hidden mt-[24px]">
<div class="max-[1100px]:grid-cols-2 grid grid-cols-3 gap-[24px]">
<?php foreach ($cards as $card): ?>
<?php render_club_card($card); ?>
<?php endforeach; ?>
</div>
</div>
<div class="max-[767px]:block hidden mt-[24px] px-[24px] mx-[-24px]">
<div class="!mx-[-24px] !px-[24px] swiper club-cards-swiper max-[768px]:!pt-[8px] max-[768px]:!mt-[-8px]">
<div class="swiper-wrapper">
<?php foreach ($cards as $card): ?>
<div class="swiper-slide">
<?php render_club_card($card); ?>
</div>
<?php endforeach; ?>
</div>
<div class="swiper-scrollbar [&_.swiper-scrollbar-drag]:dark:!bg-[#989597] !static !mx-auto !cursor-grab container mt-[24px] !w-full !p-0"></div>
</div>
</div>
<?php endif; ?>
</div>
</section>
<script>
document.addEventListener('DOMContentLoaded', function () {
const clubCardsSwiper = new Swiper('.club-cards-swiper', {
slidesPerView: 1.2,
spaceBetween: 16,
grabCursor: true,
breakpoints: {
480: {
slidesPerView: 1.3,
},
640: {
slidesPerView: 1.5,
}
},
scrollbar: {
el: '.swiper-scrollbar',
draggable: true,
},
});
});
</script>

View File

@@ -1,110 +1,74 @@
ymaps.ready(function () {
ymaps.ready(function () {
var buildingCoordinates = [55.832659, 37.576118];
var buildingCoordinates = [56.462317, 84.969289];
//Смещение карты, чтобы иконка была визуально по центру
// Смещение карты, чтобы иконка была визуально по центру
var offsetCoefficient = 0.001;
var mapCenter = [
buildingCoordinates[0],
buildingCoordinates[1] - offsetCoefficient
buildingCoordinates[0],
buildingCoordinates[1] - offsetCoefficient
];
var myMap = new ymaps.Map('map', {
center: mapCenter,
zoom: 17,
controls: []
});
center: mapCenter,
zoom: 17,
controls: []
});
// Отключаем все взаимодействия с картой
myMap.behaviors.disable(['scrollZoom', 'drag', 'multiTouch', 'dblClickZoom']);
var svgIcon = '<svg width="146" height="175" viewBox="0 0 146 175" fill="none" xmlns="http://www.w3.org/2000/svg">' +
'<path d="M73 174.328L48.4669 131.836H97.5331L73 174.328Z" fill="#FA4241" />' +
'<circle cx="71.9104" cy="73" r="73" fill="url(#paint0_linear_150_2453)" />' +
'<path d="M58.0581 42.549C50.1523 47.1076 43.6824 50.8665 43.6985 50.9305C43.7469 51.0424 52.3304 56.0169 52.4756 56.0169C52.524 56.0169 57.0094 53.4577 62.4628 50.3386C67.9162 47.2196 72.4339 44.6444 72.5145 44.6284C72.5952 44.5964 77.1612 47.1556 82.6631 50.3067L92.6825 56.0429L96.942 53.6117C99.2656 52.2841 101.266 51.1004 101.379 51.0044C101.525 50.8765 98.0553 48.8131 87.2614 42.639C79.3878 38.1444 72.8372 34.4175 72.7081 34.3855C72.5791 34.3375 65.9801 38.0164 58.0581 42.549Z" fill="white" />' +
'<path d="M38.5032 73.2768V92.7908L42.0043 90.7755C43.9405 89.6718 45.9734 88.5201 46.5381 88.2002L47.5384 87.6244V78.2993C47.5384 73.1648 47.5707 68.9741 47.603 68.9741C47.6352 68.9741 53.2661 72.1891 60.1232 76.1079C66.9642 80.0267 72.6597 83.1938 72.7565 83.1458C72.8694 83.0978 78.5003 79.8828 85.2929 75.98L97.6357 68.8941L97.7164 78.3153L97.7971 87.7204L102.234 90.2636L106.67 92.8068L106.719 73.2408C106.735 62.54 106.719 53.7587 106.687 53.7267C106.655 53.6947 98.9746 58.0614 89.6008 63.4358L72.5629 73.2088L55.896 63.6757C46.7317 58.4133 39.0679 54.0306 38.8743 53.9027L38.5032 53.6787V73.2768Z" fill="white" />' +
'<path d="M47.9893 93.0937C45.6014 94.4692 43.6653 95.6209 43.6653 95.6849C43.6653 95.8288 72.449 112.24 72.6588 112.224C72.9008 112.192 101.587 95.7968 101.587 95.6849C101.587 95.6369 99.5867 94.4692 97.1508 93.0777L92.6977 90.5344L82.6782 96.2767C77.1603 99.4277 72.5781 101.987 72.5136 101.955C72.4329 101.939 67.8991 99.3637 62.4618 96.2447C57.0084 93.1256 52.4908 90.5664 52.4262 90.5824C52.3456 90.5984 50.361 91.7181 47.9893 93.0937Z" fill="white" />' +
'<defs>' +
'<linearGradient id="paint0_linear_150_2453" x1="2.4683" y1="6.137" x2="115.196" y2="71.48" gradientUnits="userSpaceOnUse">' +
'<stop stop-color="#F41C1B" />' +
'<stop offset="0.435" stop-color="#F72D2C" />' +
'<stop offset="1" stop-color="#FA4242" />' +
'</linearGradient>' +
'</defs>' +
'</svg>';
var iconSize;
var iconOffset;
if (window.innerWidth <= 768) {
iconSize = [73, 88];
iconOffset = [-36, -87];
} else {
iconSize = [146, 175];
iconOffset = [-73, -174];
}
// Создаем метку с серой дефолтной иконкой
var myPlacemark = new ymaps.Placemark(
buildingCoordinates,
{hintContent: '', balloonContent: ''},
{
iconLayout: 'default#imageWithContent',
iconImageHref: 'data:image/svg+xml;charset=UTF-8,' + encodeURIComponent(svgIcon),
iconImageSize: iconSize,
iconImageOffset: iconOffset,
hideIconOnBalloonOpen: false
}
buildingCoordinates,
{hintContent: '', balloonContent: ''},
{
preset: 'islands#greyIcon'
}
);
// Делаем карту черно-белой
myMap.panes.get('ground').getElement().style.filter = 'grayscale(100%)';
// Добавляем метку на карту
myMap.geoObjects.add(myPlacemark);
// Логика интерактивности карты остается без изменений
var isMapInteractive = false;
var mapElement = document.getElementById('map');
function activateMap(e) {
if (!isMapInteractive) {
myMap.behaviors.enable(['scrollZoom', 'drag', 'multiTouch', 'dblClickZoom']);
isMapInteractive = true;
if (!isMapInteractive) {
myMap.behaviors.enable(['scrollZoom', 'drag', 'multiTouch', 'dblClickZoom']);
isMapInteractive = true;
setTimeout(function () {
document.addEventListener('click', deactivateMap);
document.addEventListener('touchend', deactivateMap);
}, 100);
setTimeout(function () {
document.addEventListener('click', deactivateMap);
document.addEventListener('touchend', deactivateMap);
}, 100);
e.stopPropagation();
}
}
e.stopPropagation();
}
}
function deactivateMap(e) {
var target = e.target;
var target = e.target;
if (e.type === 'touchend' || e.changedTouches || e.changedTouches[0]) {
var touch = e.changedTouches[0];
target = document.elementFromPoint(touch.clientX, touch.clientY);
}
if (e.type === 'touchend' || e.changedTouches || e.changedTouches[0]) {
var touch = e.changedTouches[0];
target = document.elementFromPoint(touch.clientX, touch.clientY);
}
if (!mapElement.contains(target)) {
if (!mapElement.contains(target)) {
myMap.behaviors.disable(['scrollZoom', 'drag', 'multiTouch', 'dblClickZoom']);
isMapInteractive = false;
myMap.behaviors.disable(['scrollZoom', 'drag', 'multiTouch', 'dblClickZoom']);
isMapInteractive = false;
document.removeEventListener('click', deactivateMap);
document.removeEventListener('touchend', deactivateMap);
}
}
document.removeEventListener('click', deactivateMap);
document.removeEventListener('touchend', deactivateMap);
}
}
mapElement.addEventListener('click', activateMap);
mapElement.addEventListener('touchstart', activateMap);
});
});

View File

@@ -25,7 +25,7 @@ if (!empty($blocks) && isset($blocks[0]['blockName']) && $blocks[0]['blockName']
$is_first_block = true;
}
$section_padding = $is_first_block ? "pt-[64px] max-[768px]:pt-[40px]" : "pt-[80px] max-[768px]:pt-[64px]";
$section_padding = $is_first_block ? "!pt-[0]" : "!pt-[0px]";
?>
@@ -48,36 +48,194 @@ $section_padding = $is_first_block ? "pt-[64px] max-[768px]:pt-[40px]" : "pt-[80
</style>
<section id="<?php echo esc_attr( $id ); ?>" class="<?php echo esc_attr( $classes ); ?> <?php echo $section_padding ?>">
<div class="w-full relative">
<div id="map" class="w-full h-[500px] min-[1024px]:h-[700px] bg-[#f3f4f6]"></div>
<div class="w-full max-[1050px]:flex max-[1050px]:flex-col relative">
<div class="absolute inset-0 pointer-events-none">
<div class="container mx-auto px-[16px] h-full flex items-start pt-[40px]">
<div class="bg-[#ffffff] border-[1px] border-[#e5e7eb] rounded-[12px] p-[30px] w-full max-w-[380px] shadow-lg pointer-events-auto">
<!-- Плашка на мобильных (отдельно сверху) -->
<div class="hidden max-[1050px]:block container mx-auto py-[24px]">
<div class="bg-[#ffffff] rounded-[24px] p-[24px] w-full max-w-[327px] mx-auto">
<?php if ($heading) : ?>
<h2 class="text-[36px] max-[768px]:text-[28px] font-bold mb-[30px] text-[#1f2937]">
<?php echo esc_html($heading); ?>
</h2>
<?php else : ?>
<h2 class="text-[36px] max-[768px]:text-[28px] font-bold mb-[30px] text-[#1f2937]">Контакты</h2>
<?php if ($heading) : ?>
<h2 class="max-[1050px]:text-[24px] max-[1050px]:font-[500] text-[32px] font-bold leading-[115%]">
<?php echo esc_html($heading); ?>
</h2>
<?php
endif; ?>
<div class="max-[1050px]:mt-[16px] mt-[24px]">
<?php if ($address) : ?>
<div class="flex flex-col gap-[12px]">
<?php if (!empty($address['heading'])) : ?>
<div class="flex gap-[12px] items-center">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none"
xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2190_3176)">
<path d="M10.001 0.445312C5.68804 0.445312 2.17879 3.95456 2.17879 8.26265C2.15044 14.5644 9.70377 19.7897 10.001 20.0009C10.001 20.0009 17.8516 14.5644 17.8232 8.26754C17.8232 3.95456 14.314 0.445312 10.001 0.445312ZM10.001 12.1786C7.84012 12.1786 6.0899 10.4284 6.0899 8.26754C6.0899 6.10665 7.84012 4.35642 10.001 4.35642C12.1619 4.35642 13.9121 6.10665 13.9121 8.26754C13.9121 10.4284 12.1619 12.1786 10.001 12.1786Z"
fill="#E21E24"/>
</g>
<defs>
<clipPath id="clip0_2190_3176">
<rect width="19.5556" height="19.5556" fill="white"
transform="translate(0 0.222656)"/>
</clipPath>
</defs>
</svg>
<p class="max-[1050px]:text-[20px] text-[24px] font-[600] leading-[125%]"><?php echo esc_html($address['heading']); ?></p>
</div>
<?php endif; ?>
<?php if (!empty($address['address_repeater'])) : ?>
<div class="flex flex-col gap-[4px]">
<?php foreach ($address['address_repeater'] as $addr_item) : ?>
<div class=" text-[16px] leading-[145%]">
<?php if (!empty($addr_item['address_title'])) : ?>
<div class="font-[600]"><?php echo esc_html($addr_item['address_title']); ?></div>
<?php endif; ?>
<?php if (!empty($addr_item['address_extra'])) : ?>
<div class="text-[16px] leading-[145%] text-[#6c6b6b]"><?php echo esc_html($addr_item['address_extra']); ?></div>
<?php endif; ?>
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<div class="flex flex-col gap-[20px]">
<?php if ($work_time) : ?>
<div class="max-[1050px]:mt-[16px] flex mt-[28px] flex-col gap-[12px]">
<?php if (!empty($work_time['heading'])) : ?>
<div class="flex gap-[12px] items-center">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2190_3183)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.4796 19.63C10.9266 19.7273 10.3581 19.7782 9.77778 19.7782C4.38135 19.7782 0 15.3969 0 10.0004C0 4.60401 4.38135 0.222656 9.77778 0.222656C15.1742 0.222656 19.5556 4.60401 19.5556 10.0004C19.5556 10.5807 19.5046 11.1492 19.4073 11.7022C18.882 10.9647 18.1879 10.3636 17.3831 9.94888C16.5782 9.53418 15.6858 9.31796 14.7804 9.31826C13.273 9.31923 11.8276 9.91847 10.7617 10.9844C9.69581 12.0502 9.09657 13.4956 9.09561 15.003C9.0953 15.9085 9.31152 16.8008 9.72622 17.6057C10.1409 18.4106 10.7421 19.1046 11.4796 19.63ZM10.9147 4.99785V9.54565C10.9147 9.72666 10.8429 9.90038 10.7146 10.0277L7.07638 13.666C7.01308 13.7293 6.93792 13.7795 6.85521 13.8137C6.7725 13.848 6.68384 13.8656 6.59432 13.8656C6.50479 13.8656 6.41614 13.848 6.33342 13.8137C6.25071 13.7795 6.17555 13.7293 6.11225 13.666C6.04894 13.6027 5.99873 13.5275 5.96446 13.4448C5.9302 13.3621 5.91257 13.2734 5.91257 13.1839C5.91257 13.0944 5.9302 13.0057 5.96446 12.923C5.99873 12.8403 6.04894 12.7651 6.11225 12.7018L9.55039 9.26278V4.99785C9.55039 4.81693 9.62226 4.64341 9.75019 4.51548C9.87812 4.38755 10.0516 4.31568 10.2326 4.31568C10.4135 4.31568 10.587 4.38755 10.7149 4.51548C10.8429 4.64341 10.9147 4.81693 10.9147 4.99785Z" fill="#E21E24" />
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.7801 10.2266C12.1442 10.2266 10.0049 12.3658 10.0049 15.0018C10.0049 17.6377 12.1442 19.777 14.7801 19.777C17.416 19.777 19.5553 17.6377 19.5553 15.0018C19.5553 12.3658 17.416 10.2266 14.7801 10.2266ZM12.4789 15.2564L13.8432 16.6208C13.9065 16.6841 13.9816 16.7344 14.0644 16.7687C14.1471 16.803 14.2358 16.8207 14.3253 16.8207C14.4148 16.8207 14.5035 16.803 14.5862 16.7687C14.6689 16.7344 14.7441 16.6841 14.8074 16.6208L17.0813 14.3469C17.1446 14.2836 17.1948 14.2084 17.2291 14.1257C17.2633 14.043 17.2809 13.9543 17.2809 13.8648C17.2809 13.7753 17.2633 13.6866 17.2291 13.6039C17.1948 13.5212 17.1446 13.446 17.0813 13.3827C17.018 13.3194 16.9428 13.2692 16.8601 13.235C16.7774 13.2007 16.6887 13.1831 16.5992 13.1831C16.5097 13.1831 16.421 13.2007 16.3383 13.235C16.2556 13.2692 16.1804 13.3194 16.1171 13.3827L14.3253 15.1737L13.443 14.2923C13.3797 14.229 13.3046 14.1788 13.2218 14.1445C13.1391 14.1103 13.0505 14.0926 12.961 14.0926C12.8714 14.0926 12.7828 14.1103 12.7001 14.1445C12.6173 14.1788 12.5422 14.229 12.4789 14.2923C12.4156 14.3556 12.3654 14.4308 12.3311 14.5135C12.2968 14.5962 12.2792 14.6848 12.2792 14.7744C12.2792 14.8639 12.2968 14.9525 12.3311 15.0353C12.3654 15.118 12.4156 15.1931 12.4789 15.2564Z" fill="#E21E24" />
</g>
<defs>
<clipPath id="clip0_2190_3183">
<rect width="19.5556" height="19.5556" fill="white" transform="translate(0 0.222656)" />
</clipPath>
</defs>
</svg>
<p class="max-[1050px]:text-[20px] text-[24px] font-[600] leading-[125%]"><?php echo esc_html($work_time['heading']); ?></p>
</div>
<?php endif; ?>
<?php if ($work_time) : ?>
<div>
<?php if (!empty($work_time['heading'])) : ?>
<p class="text-[14px] text-[#6b7280] mb-[8px]"><?php echo esc_html($work_time['heading']); ?></p>
<?php if (!empty($work_time['work_time_repeater'])) : ?>
<div class="flex flex-col gap-[4px]">
<?php foreach ($work_time['work_time_repeater'] as $time_item) : ?>
<div class="flex text-[16px] leading-[145%] font-[600]">
<span><?php echo esc_html($time_item['title']); ?></span>
<span class="font-[500]"><?php echo esc_html($time_item['time']); ?></span>
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if ($contacts) : ?>
<div class="mt-[16px]">
<?php if (!empty($contacts['phone'])) : ?>
<div>
<a href="tel:<?php echo esc_attr($contacts['phone']); ?>"
class="max-[1050px]:text-[20px] !decoration-transparent hover:!decoration-inherit text-[32px] font-[700]">
<?php echo esc_html($contacts['phone']); ?>
</a>
</div>
<?php endif; ?>
<?php if (!empty($contacts['social_repeater'])) : ?>
<div class="mt-[14px]">
<div class="flex gap-[12px]">
<?php foreach ($contacts['social_repeater'] as $social_item) : ?>
<?php if (!empty($social_item['url'])) : ?>
<a href="<?php echo esc_url($social_item['url']); ?>"
target="_blank"
class="hover:[&>img]:brightness-150 transition">
<?php if (!empty($social_item['icon'])) : ?>
<img src="<?php echo esc_url($social_item['icon']['url']); ?>"
alt="<?php echo esc_attr($social_item['icon']['alt']); ?>"
class="object-contain max-[1050px]:w-[30px] w-[42px]" />
<?php endif; ?>
</a>
<?php endif; ?>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if(!is_front_page()):
?>
<div class="mt-[14px]">
<a href="mailto:powerhousegymtomsk@gmail.com"
class="!decoration-transparent hover:!decoration-inherit text-[20px] font-[600]">
Написать на e-mail
</a>
</div>
<?php
endif; ?>
</div>
</div>
</div>
<!-- Карта -->
<div id="map" class="max-[1050px]:h-[320px] w-full h-[608px] <?php if ($is_first_block): ?>h-[828px]<?php endif; ?>"></div>
<!-- Плашка на десктопе (поверх карты) -->
<div class="max-[1050px]:hidden absolute inset-0 pointer-events-none">
<div class="container mx-auto h-full flex items-center">
<div class="bg-[#ffffff] rounded-[24px] px-[32px] py-[30px] w-full max-w-[424px] pointer-events-auto">
<?php if ($heading) : ?>
<h2 class="text-[32px] font-bold leading-[115%]">
<?php echo esc_html($heading); ?>
</h2>
<?php
endif; ?>
<div class=" mt-[24px]">
<?php if ($address) : ?>
<div class="flex flex-col gap-[12px]">
<?php if (!empty($address['heading'])) : ?>
<div class="flex gap-[12px] items-center">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none"
xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2190_3176_2)">
<path d="M10.001 0.445312C5.68804 0.445312 2.17879 3.95456 2.17879 8.26265C2.15044 14.5644 9.70377 19.7897 10.001 20.0009C10.001 20.0009 17.8516 14.5644 17.8232 8.26754C17.8232 3.95456 14.314 0.445312 10.001 0.445312ZM10.001 12.1786C7.84012 12.1786 6.0899 10.4284 6.0899 8.26754C6.0899 6.10665 7.84012 4.35642 10.001 4.35642C12.1619 4.35642 13.9121 6.10665 13.9121 8.26754C13.9121 10.4284 12.1619 12.1786 10.001 12.1786Z"
fill="#E21E24"/>
</g>
<defs>
<clipPath id="clip0_2190_3176_2">
<rect width="19.5556" height="19.5556" fill="white"
transform="translate(0 0.222656)"/>
</clipPath>
</defs>
</svg>
<p class="text-[24px] font-[600] leading-[125%]"><?php echo esc_html($address['heading']); ?></p>
</div>
<?php endif; ?>
<?php if (!empty($work_time['work_time_repeater'])) : ?>
<div class="flex flex-col gap-[4px] mb-[12px]">
<?php foreach ($work_time['work_time_repeater'] as $time_item) : ?>
<div class="flex text-[16px] text-[#1f2937]">
<span><?php echo esc_html($time_item['title']); ?></span>
 
<span><?php echo esc_html($time_item['time']); ?></span>
<?php if (!empty($address['address_repeater'])) : ?>
<div class="flex flex-col gap-[4px]">
<?php foreach ($address['address_repeater'] as $addr_item) : ?>
<div class="text-[16px] leading-[145%]">
<?php if (!empty($addr_item['address_title'])) : ?>
<div class="font-[600]"><?php echo esc_html($addr_item['address_title']); ?></div>
<?php endif; ?>
<?php if (!empty($addr_item['address_extra'])) : ?>
<div class="text-[16px] leading-[145%] text-[#6c6b6b]"><?php echo esc_html($addr_item['address_extra']); ?></div>
<?php endif; ?>
</div>
<?php endforeach; ?>
</div>
@@ -85,22 +243,32 @@ $section_padding = $is_first_block ? "pt-[64px] max-[768px]:pt-[40px]" : "pt-[80
</div>
<?php endif; ?>
<?php if ($address) : ?>
<div>
<?php if (!empty($address['heading'])) : ?>
<p class="text-[14px] text-[#6b7280] mb-[8px]"><?php echo esc_html($address['heading']); ?></p>
<?php if ($work_time) : ?>
<div class="flex mt-[28px] flex-col gap-[12px]">
<?php if (!empty($work_time['heading'])) : ?>
<div class="flex gap-[12px] items-center">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2190_3183_2)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.4796 19.63C10.9266 19.7273 10.3581 19.7782 9.77778 19.7782C4.38135 19.7782 0 15.3969 0 10.0004C0 4.60401 4.38135 0.222656 9.77778 0.222656C15.1742 0.222656 19.5556 4.60401 19.5556 10.0004C19.5556 10.5807 19.5046 11.1492 19.4073 11.7022C18.882 10.9647 18.1879 10.3636 17.3831 9.94888C16.5782 9.53418 15.6858 9.31796 14.7804 9.31826C13.273 9.31923 11.8276 9.91847 10.7617 10.9844C9.69581 12.0502 9.09657 13.4956 9.09561 15.003C9.0953 15.9085 9.31152 16.8008 9.72622 17.6057C10.1409 18.4106 10.7421 19.1046 11.4796 19.63ZM10.9147 4.99785V9.54565C10.9147 9.72666 10.8429 9.90038 10.7146 10.0277L7.07638 13.666C7.01308 13.7293 6.93792 13.7795 6.85521 13.8137C6.7725 13.848 6.68384 13.8656 6.59432 13.8656C6.50479 13.8656 6.41614 13.848 6.33342 13.8137C6.25071 13.7795 6.17555 13.7293 6.11225 13.666C6.04894 13.6027 5.99873 13.5275 5.96446 13.4448C5.9302 13.3621 5.91257 13.2734 5.91257 13.1839C5.91257 13.0944 5.9302 13.0057 5.96446 12.923C5.99873 12.8403 6.04894 12.7651 6.11225 12.7018L9.55039 9.26278V4.99785C9.55039 4.81693 9.62226 4.64341 9.75019 4.51548C9.87812 4.38755 10.0516 4.31568 10.2326 4.31568C10.4135 4.31568 10.587 4.38755 10.7149 4.51548C10.8429 4.64341 10.9147 4.81693 10.9147 4.99785Z" fill="#E21E24" />
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.7801 10.2266C12.1442 10.2266 10.0049 12.3658 10.0049 15.0018C10.0049 17.6377 12.1442 19.777 14.7801 19.777C17.416 19.777 19.5553 17.6377 19.5553 15.0018C19.5553 12.3658 17.416 10.2266 14.7801 10.2266ZM12.4789 15.2564L13.8432 16.6208C13.9065 16.6841 13.9816 16.7344 14.0644 16.7687C14.1471 16.803 14.2358 16.8207 14.3253 16.8207C14.4148 16.8207 14.5035 16.803 14.5862 16.7687C14.6689 16.7344 14.7441 16.6841 14.8074 16.6208L17.0813 14.3469C17.1446 14.2836 17.1948 14.2084 17.2291 14.1257C17.2633 14.043 17.2809 13.9543 17.2809 13.8648C17.2809 13.7753 17.2633 13.6866 17.2291 13.6039C17.1948 13.5212 17.1446 13.446 17.0813 13.3827C17.018 13.3194 16.9428 13.2692 16.8601 13.235C16.7774 13.2007 16.6887 13.1831 16.5992 13.1831C16.5097 13.1831 16.421 13.2007 16.3383 13.235C16.2556 13.2692 16.1804 13.3194 16.1171 13.3827L14.3253 15.1737L13.443 14.2923C13.3797 14.229 13.3046 14.1788 13.2218 14.1445C13.1391 14.1103 13.0505 14.0926 12.961 14.0926C12.8714 14.0926 12.7828 14.1103 12.7001 14.1445C12.6173 14.1788 12.5422 14.229 12.4789 14.2923C12.4156 14.3556 12.3654 14.4308 12.3311 14.5135C12.2968 14.5962 12.2792 14.6848 12.2792 14.7744C12.2792 14.8639 12.2968 14.9525 12.3311 15.0353C12.3654 15.118 12.4156 15.1931 12.4789 15.2564Z" fill="#E21E24" />
</g>
<defs>
<clipPath id="clip0_2190_3183_2">
<rect width="19.5556" height="19.5556" fill="white" transform="translate(0 0.222656)" />
</clipPath>
</defs>
</svg>
<p class="text-[24px] font-[600] leading-[125%]"><?php echo esc_html($work_time['heading']); ?></p>
</div>
<?php endif; ?>
<?php if (!empty($address['address_repeater'])) : ?>
<div class="flex flex-col gap-[8px] mb-[12px]">
<?php foreach ($address['address_repeater'] as $addr_item) : ?>
<div class="text-[16px] text-[#1f2937] leading-[140%]">
<?php if (!empty($addr_item['address_title'])) : ?>
<div class="font-semibold"><?php echo esc_html($addr_item['address_title']); ?></div>
<?php endif; ?>
<?php if (!empty($addr_item['address_extra'])) : ?>
<div><?php echo esc_html($addr_item['address_extra']); ?></div>
<?php endif; ?>
<?php if (!empty($work_time['work_time_repeater'])) : ?>
<div class="flex flex-col gap-[4px]">
<?php foreach ($work_time['work_time_repeater'] as $time_item) : ?>
<div class="flex text-[16px] leading-[145%] font-[600]">
<span><?php echo esc_html($time_item['title']); ?></span>
<span class="font-[500]"><?php echo esc_html($time_item['time']); ?></span>
</div>
<?php endforeach; ?>
</div>
@@ -109,18 +277,18 @@ $section_padding = $is_first_block ? "pt-[64px] max-[768px]:pt-[40px]" : "pt-[80
<?php endif; ?>
<?php if ($contacts) : ?>
<div>
<div class="mt-[16px]">
<?php if (!empty($contacts['phone'])) : ?>
<div class="mb-[16px]">
<div>
<a href="tel:<?php echo esc_attr($contacts['phone']); ?>"
class="!decoration-transparent hover:!decoration-inherit text-[20px] max-[768px]:text-[18px] font-semibold transition-colors">
class="!decoration-transparent hover:!decoration-inherit text-[32px] font-[700]">
<?php echo esc_html($contacts['phone']); ?>
</a>
</div>
<?php endif; ?>
<?php if (!empty($contacts['social_repeater'])) : ?>
<div>
<div class="mt-[14px]">
<div class="flex gap-[12px]">
<?php foreach ($contacts['social_repeater'] as $social_item) : ?>
<?php if (!empty($social_item['url'])) : ?>
@@ -130,7 +298,7 @@ $section_padding = $is_first_block ? "pt-[64px] max-[768px]:pt-[40px]" : "pt-[80
<?php if (!empty($social_item['icon'])) : ?>
<img src="<?php echo esc_url($social_item['icon']['url']); ?>"
alt="<?php echo esc_attr($social_item['icon']['alt']); ?>"
class="object-contain" />
class="object-contain w-[42px]" />
<?php endif; ?>
</a>
<?php endif; ?>
@@ -138,6 +306,18 @@ $section_padding = $is_first_block ? "pt-[64px] max-[768px]:pt-[40px]" : "pt-[80
</div>
</div>
<?php endif; ?>
<?php if(!is_front_page()):
?>
<div class="mt-[14px]">
<a href="mailto:powerhousegymtomsk@gmail.com"
class="!decoration-transparent hover:!decoration-inherit text-[24px] font-[600]">
Написать на e-mail
</a>
</div>
<?php
endif; ?>
</div>
<?php endif; ?>

View File

@@ -1,91 +1,103 @@
.form-block-wrapper .ff-el-group {
margin-bottom: 24px;
#fluentform_3 {
}
.form-block-wrapper .ff-el-input--label label {
display: block;
margin-bottom: 8px;
font-weight: 600;
color: #374151;
font-size: 14px;
}
.form-block-wrapper .ff-el-form-control {
width: 100%;
padding: 12px 16px;
border: 2px solid #e5e7eb;
border-radius: 8px;
font-size: 16px;
transition: all 0.2s ease;
background: #ffffff;
box-sizing: border-box;
}
.form-block-wrapper .ff-el-form-control:focus {
outline: none;
border-color: #3b82f6;
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.form-block-wrapper .ff-btn-submit {
width: 100%;
padding: 14px 24px;
background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
color: white;
#fluentform_3 .ff-el-form-control {
border: none;
border-radius: 8px;
box-shadow: 0 2px 32px 0 rgba(16, 15, 15, 0.03);
background: #fff;
border-radius: 90px;
height: 77px;
padding-left: 32px;
padding-right: 32px;
outline: 1px solid transparent;
font-weight: 500;
font-size: 16px;
line-height: 130%;
color: #6c6b6b;
}
@media (max-width: 767px) {
#fluentform_3 .ff-el-form-control {
font-size: 15px;
height: 60px;
}
}
#fluentform_3 .ff-btn-submit {
height: 75px;
background: linear-gradient(90deg, #e21e24 39.42%, #ff2f35 92.9%);
border-radius: 90px;
font-weight: 600;
font-size: 18px;
line-height: 195%;
color: #f8f8f8;
display: grid;
place-content: center;
width: 100%;
cursor: pointer;
transition: all 0.3s ease;
text-transform: none;
transition: 180ms ease-in;
}
.form-block-wrapper .ff-btn-submit:hover {
transform: translateY(-1px);
box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
@media (max-width: 767px) {
#fluentform_3 .ff-btn-submit {
font-size: 16px;
height: 53px;
}
}
.form-block-wrapper .ff-btn-submit:active {
transform: translateY(0);
#fluentform_3 .ff-btn-submit:hover {
font-weight: 700;
transition: 180ms ease-in;
}
.form-block-wrapper .asterisk-right label::after {
content: ' *';
color: #ef4444;
font-weight: bold;
#fluentform_3 .ff_submit_btn_wrapper {
margin-bottom: 0!important;
}
.form-block-wrapper .ff-message-success,
.form-block-wrapper .ff-message-container {
display: none !important;
#fluentform_3 .error.text-danger {
position: absolute;
margin-top: 0;
bottom: -18px;
left: 0;
width: 100%;
text-align: center;
}
.form-block-wrapper.form-loading .ff-btn-submit {
opacity: 0.7;
#fluentform_3 .ff-el-group {
position: relative;
margin-bottom: 18px;
}
#fluentform_3_success {
display: none!important;
}
#fluentform_3 .ff-el-input--label {
position: absolute;
top: 50%;
left: 32px;
transform: translateY(-50%);
pointer-events: none;
z-index: 2;
margin: 0;
transition: 180ms ease-in-out;
font-weight: 500;
font-size: 16px;
line-height: 130%;
color: #6c6b6b;
}
@media (max-width: 768px) {
.form-block-wrapper {
margin: 20px;
padding: 20px;
}
.form-block-wrapper .ff-el-form-control {
font-size: 16px;
padding: 10px 14px;
}
.form-block-wrapper .ff-btn-submit {
font-size: 16px;
padding: 12px 20px;
}
}
@media (max-width: 1024px) and (min-width: 769px) {
.form-block-wrapper {
padding: 25px;
}
#fluentform_3 .ff-el-group.focused .ff-el-input--label,
#fluentform_3 .ff-el-group.has-value .ff-el-input--label {
top: 6px;
transform: translateY(0);
transition: 180ms ease-in-out;
font-size: 14px;
}

View File

@@ -0,0 +1,82 @@
document.addEventListener('DOMContentLoaded', function() {
const inputs = document.querySelectorAll('#fluentform_3 .ff-el-form-control');
const phoneInput = document.querySelector('#fluentform_3 .ff-el-phone');
inputs.forEach(input => {
// Добавляем класс при фокусе
input.addEventListener('focus', function() {
this.closest('.ff-el-group').classList.add('focused');
});
// Убираем класс при потере фокуса
input.addEventListener('blur', function() {
this.closest('.ff-el-group').classList.remove('focused');
});
// Добавляем/убираем класс при вводе
input.addEventListener('input', function() {
const group = this.closest('.ff-el-group');
if (this.value.trim() !== '') {
group.classList.add('has-value');
} else {
group.classList.remove('has-value');
}
});
});
// Маска для телефона +7 (___) ___-__-__
if (phoneInput) {
phoneInput.addEventListener('input', function(e) {
let value = e.target.value.replace(/\D/g, ''); // Убираем все кроме цифр
// Если начинается с 8, заменяем на 7
if (value.startsWith('8')) {
value = '7' + value.slice(1);
}
// Если не начинается с 7, добавляем 7
if (!value.startsWith('7') && value.length > 0) {
value = '7' + value;
}
let formattedValue = '';
if (value.length > 0) {
formattedValue = '+7';
if (value.length > 1) {
formattedValue += ' (' + value.slice(1, 4);
if (value.length > 4) {
formattedValue += ') ' + value.slice(4, 7);
if (value.length > 7) {
formattedValue += '-' + value.slice(7, 9);
if (value.length > 9) {
formattedValue += '-' + value.slice(9, 11);
}
}
}
}
}
e.target.value = formattedValue;
});
// Обработка клавиш для корректного удаления
phoneInput.addEventListener('keydown', function(e) {
if (e.key === 'Backspace' || e.key === 'Delete') {
const cursorPos = e.target.selectionStart;
const value = e.target.value;
// Если курсор на служебном символе, сдвигаем его
if (cursorPos > 0 && [' ', '(', ')', '-'].includes(value[cursorPos - 1])) {
setTimeout(() => {
e.target.setSelectionRange(cursorPos - 1, cursorPos - 1);
}, 0);
}
}
});
}
});

View File

@@ -10,24 +10,70 @@ $current_url = home_url($_SERVER['REQUEST_URI']);
$page_title = get_the_title() ?: 'Главная страница';
$form_name = $form_title;
$room = get_current_room();
if ($room === 'gym') {
$section_classes = 'bg-cover bg-center bg-no-repeat';
$bg_image = get_template_directory_uri() . '/assets/images/form-bg-dark.png.webp';
$style_attr = 'style="background-image: url(' . esc_url($bg_image) . ')"';
} else {
$section_classes = 'bg-cover bg-center bg-no-repeat';
$bg_image = get_template_directory_uri() . '/assets/images/form-bg-light.png.webp';
$style_attr = 'style="background-image: url(' . esc_url($bg_image) . ')"';
}
$hidden_value = "Форма: {$form_name} | Страница: {$page_title} | URL: {$current_url}";
?>
<section class="container mx-auto mt-[22px]" id="<?php echo esc_attr($unique_id); ?>">
<div class="text-[24px] font-[700] mb-[20px] text-[#374151]">
<?php echo esc_html($form_title); ?>
</div>
<section data-scroll-section="trial-training" class="bg-[100%_8px] bg-no-repeat max-[1050px]:!bg-none bg-[linear-gradient(180deg,_#f2f2f2_69.59%,_#ededed_100%)] bg-cover"
id="<?php echo esc_attr($unique_id); ?> "
<?php echo $style_attr; ?>
>
<div class="form-block-wrapper bg-white p-[30px] rounded-[12px] max-w-[300px]"
data-form-id="<?php echo esc_attr($form_id); ?>"
data-submit-text="<?php echo esc_attr($submit_button_text); ?>"
data-hidden-value="<?php echo esc_attr($hidden_value); ?>">
<?php echo do_shortcode('[fluentform id="' . esc_attr($form_id) . '"]'); ?>
<div class="mt-[-9px] max-[1050px]:py-[0] max-[1050px]:flex-col-reverse max-[1050px]:items-center max-[1050px]:justify-center max-[1050px]:gap-[20px] container mx-auto py-[48px] flex relative">
<div class="max-[1050px]:w-[calc(100%+20px)] max-[768px]:w-[calc(100%+48px)] bg-[100%_8px] bg-no-repeat max-[1050px]:flex max-[1050px]:items-center max-[1050px]:justify-center bg-cover bg-no-repeat absolute right-0 bottom-0 max-[1050px]:static"
data-bg-image="<?php echo esc_url($bg_image); ?>">
<img class="max-[1050px]:max-h-[274px] pointer-events-none z-0"
src="<?php echo esc_url(get_template_directory_uri() . '/assets/images/form-image-trainer.png'); ?>"
alt="Изображение тренера">
</div>
<script>
function setResponsiveBackground() {
const elements = document.querySelectorAll('[data-bg-image]');
elements.forEach(el => {
if (window.innerWidth <= 1050) {
el.style.backgroundImage = `url(${el.dataset.bgImage})`;
} else {
el.style.backgroundImage = 'none';
}
});
}
window.addEventListener('resize', setResponsiveBackground);
setResponsiveBackground();
</script>
<div class="max-[768px]:p-[20px] form-block-wrapper relative z-[1] border border-[2px] border-[#fff] p-[48px] bg-[#f8f8f8] rounded-[32px] w-full max-w-[590px]"
data-form-id="<?php echo esc_attr($form_id); ?>"
data-submit-text="<?php echo esc_attr($submit_button_text); ?>"
data-hidden-value="<?php echo esc_attr($hidden_value); ?>">
<h3 class="max-[1050px]:text-[30px] max-[768px]:text-[24px] font-[500] text-[40px] leading-[120%] text-[#222]">Пробная <strong class="font-[700]">персональная
тренировка</strong>
<span class="max-[768px]:text-[20px] max-[768px]:mt-[10px] max-[768px]:h-[29px] bg-[linear-gradient(90deg,_#9d9994_39.42%,_#ccc9c4_92.9%)] rounded-[32px] h-[43px] inline-flex items-center pr-[16px] pl-[16px] font-[600] text-[32px] leading-[115%] text-[#fff]">за 1200 ₽</span>
</h3>
<p class="max-[1050px]:text-[18px] max-[768px]:text-[16px] mt-[16px] mb-[24px] font-[500] text-[20px] leading-[140%] text-[#222]">Познакомимся, покажем зал и
<strong class="font-[600]">подберём
оптимальные для вас тренировки!</strong></p>
<?php echo do_shortcode('[fluentform id="' . esc_attr($form_id) . '"]'); ?>
</div>
</div>
</section>
<script>
document.addEventListener('DOMContentLoaded', function() {
document.addEventListener('DOMContentLoaded', function () {
const section = document.getElementById('<?php echo esc_js($unique_id); ?>');
if (!section) return;
@@ -68,6 +114,6 @@ $hidden_value = "Форма: {$form_name} | Страница: {$page_title} | UR
}, 150);
}
block.addEventListener('focusin', updateForm, { once: true });
block.addEventListener('focusin', updateForm, {once: true});
});
</script>

View File

@@ -0,0 +1,60 @@
.gallery-block .thumbnail {
opacity: 0.5;
transition: 180ms ease-in-out;
}
.gallery-block .thumbnail.active {
opacity: 1;
transition: 180ms ease-in-out;
}
.gallery-block .tab-button {
box-shadow: 0 2px 32px 0 rgba(16, 15, 15, 0.03);
background: #fff;
font-weight: 500;
font-size: 18px;
line-height: 195%;
color: #222;
}
.gallery-block .tab-button.active {
font-size: 18px;
line-height: 195%;
color: #f8f8f8;
box-shadow: none;
background: linear-gradient(90deg, #9d9994 39.42%, #ccc9c4 92.9%);
}
@media (max-width: 767px) {
.gallery-block .tab-button{
font-size: 15px!important;
}
}
.dark .gallery-block .tab-button.active {
background: linear-gradient(90deg, #2b2c35 39.42%, #6e7996 92.9%);
color: #f8f8f8;
}
.gallery-block .swiper-slide img {
transition: opacity 180ms ease-in-out;
}
.gallery-block .swiper-slide img[loading="lazy"] {
opacity: 0;
}
.gallery-block .swiper-slide img[loading="lazy"].loaded,
.gallery-block .swiper-slide img:not([loading="lazy"]) {
opacity: 1;
}
.gallery-block .thumbnail:not(.active) {
opacity: 0.6;
transition: opacity 180ms ease-in-out;
}
.gallery-block .thumbnail.active {
opacity: 1;
}

View File

@@ -1,5 +1,5 @@
document.addEventListener('DOMContentLoaded', function() {
document.querySelectorAll('.gallery-block').forEach(function(block) {
document.addEventListener('DOMContentLoaded', function () {
document.querySelectorAll('.gallery-block').forEach(function (block) {
const blockId = block.getAttribute('data-gallery-id');
initGalleryBlock(blockId);
});
@@ -10,99 +10,136 @@ function initGalleryBlock(blockId) {
if (!container) return;
const swipers = {};
const thumbnailSwipers = {};
const initializedTabs = new Set();
let lightbox;
function initAllSwipers() {
const tabs = container.querySelectorAll('.tab-button');
function initTabSwiper(tabId) {
if (initializedTabs.has(tabId)) return;
tabs.forEach(button => {
const tabId = button.getAttribute('data-tab');
const tabContent = container.querySelector(`#tab-${tabId}`);
const tabContent = container.querySelector(`#tab-${tabId}`);
if (!tabContent?.querySelector('.gallery-swiper')) return;
if (tabContent && tabContent.querySelector('.swiper')) {
const wasHidden = tabContent.classList.contains('hidden');
if (wasHidden) {
tabContent.style.visibility = 'hidden';
tabContent.style.position = 'absolute';
tabContent.classList.remove('hidden');
tabContent.classList.add('block');
}
if (swipers[tabId]) {
swipers[tabId].destroy(true, true);
}
swipers[tabId] = new Swiper(`#${blockId} #swiper-${tabId}`, {
slidesPerView: 1.5,
spaceBetween: 20,
loop: true,
centeredSlides: true,
grabCursor: true,
observer: true,
observeParents: true,
watchSlidesProgress: true,
navigation: {
nextEl: `#${blockId} #swiper-${tabId} .swiper-button-next`,
prevEl: `#${blockId} #swiper-${tabId} .swiper-button-prev`,
},
on: {
slideChange: function() {
updateThumbnails(tabId, this.realIndex);
}
}
});
if (wasHidden) {
tabContent.style.visibility = '';
tabContent.style.position = '';
tabContent.classList.add('hidden');
tabContent.classList.remove('block');
thumbnailSwipers[tabId] = new Swiper(`#${blockId} #thumbnail-swiper-${tabId}`, {
slidesPerView: 'auto',
spaceBetween: 5,
freeMode: true,
grabCursor: true,
watchSlidesProgress: true,
breakpoints: {
768: {
spaceBetween: 24
}
}
});
swipers[tabId] = new Swiper(`#${blockId} #swiper-${tabId}`, {
slidesPerView: 'auto',
spaceBetween: 12,
centeredSlides: false,
initialSlide: 0,
scrollbar: {
el: `#swiper-scrollbar-${tabId}`,
draggable: true,
},
grabCursor: true,
watchSlidesProgress: true,
lazy: {
loadPrevNext: true,
loadOnTransitionStart: true,
},
on: {
slideChange: function () {
updateThumbnails(tabId, this.realIndex);
centerThumbnail(tabId, this.realIndex);
}
},
breakpoints: {
768: {
spaceBetween: 24
}
}
});
initializedTabs.add(tabId);
}
function initLightbox(tabId) {
if (lightbox) {
lightbox.destroy();
}
const currentSelector = `#${blockId} #tab-${tabId} .glightbox`;
lightbox = GLightbox({
selector: `#${blockId} #tab-${tabId} .glightbox`
});
if (lightbox?.settings?.selector !== currentSelector) {
if (lightbox) {
lightbox.destroy();
}
lightbox = GLightbox({
selector: currentSelector,
preload: false,
touchNavigation: true,
loop: true
});
}
}
function updateThumbnails(tabId, activeIndex) {
const thumbnails = container.querySelectorAll(`#tab-${tabId} .thumbnail`);
thumbnails.forEach((thumb, index) => {
if (index === activeIndex) {
thumb.classList.add('active', '!border-blue-500');
thumb.classList.remove('border-transparent');
thumb.classList.remove('opacity-50', 'hover:opacity-80');
thumb.classList.add('opacity-100', 'active');
} else {
thumb.classList.remove('active', '!border-blue-500');
thumb.classList.add('border-transparent');
thumb.classList.remove('opacity-100', 'active');
thumb.classList.add('opacity-50', 'hover:opacity-80');
}
});
}
initAllSwipers();
function centerThumbnail(tabId, activeIndex) {
if (thumbnailSwipers[tabId]) {
thumbnailSwipers[tabId].slideTo(activeIndex);
}
}
function preloadHeroImage() {
const activeTab = container.querySelector('.tab-button.active');
if (!activeTab) return;
const tabId = activeTab.getAttribute('data-tab');
const firstImage = container.querySelector(`#tab-${tabId} .swiper-slide:first-child img`);
if (firstImage && firstImage.src) {
const link = document.createElement('link');
link.rel = 'preload';
link.as = 'image';
link.href = firstImage.src;
document.head.appendChild(link);
}
}
function debounce(func, wait) {
let timeout;
return (...args) => {
clearTimeout(timeout);
timeout = setTimeout(() => func.apply(this, args), wait);
};
}
preloadHeroImage();
const activeTab = container.querySelector('.tab-button.active');
if (activeTab) {
const tabId = activeTab.getAttribute('data-tab');
initTabSwiper(tabId);
initLightbox(tabId);
}
container.querySelectorAll('.tab-button').forEach(button => {
button.addEventListener('click', () => {
button.addEventListener('click', debounce(() => {
const tabId = button.getAttribute('data-tab');
container.querySelectorAll('.tab-button').forEach(btn => {
btn.classList.remove('active', 'underline');
btn.classList.add('bg-gray-100');
});
button.classList.add('active', 'underline');
button.classList.remove('bg-gray-100');
container.querySelectorAll('.tab-button').forEach(btn =>
btn.classList.remove('active'));
button.classList.add('active');
container.querySelectorAll('.tab-content').forEach(content => {
content.classList.remove('block');
@@ -113,28 +150,41 @@ function initGalleryBlock(blockId) {
targetTab.classList.remove('hidden');
targetTab.classList.add('block');
if (swipers[tabId]) {
requestAnimationFrame(() => {
initTabSwiper(tabId);
requestAnimationFrame(() => {
if (swipers[tabId]) {
swipers[tabId].update();
});
}
}
if (thumbnailSwipers[tabId]) {
thumbnailSwipers[tabId].update();
}
});
initLightbox(tabId);
});
}, 100));
});
container.addEventListener('click', (e) => {
if (e.target.closest('.thumbnail')) {
const thumbnail = e.target.closest('.thumbnail');
const index = parseInt(thumbnail.getAttribute('data-index'));
const activeTab = container.querySelector('.tab-content.block');
const tabId = activeTab.id.replace('tab-', '');
const thumbnail = e.target.closest('.thumbnail');
if (!thumbnail) return;
if (swipers[tabId]) {
swipers[tabId].slideToLoop(index);
}
const index = parseInt(thumbnail.getAttribute('data-index'));
const activeTabContent = container.querySelector('.tab-content.block');
const tabId = activeTabContent.id.replace('tab-', '');
updateThumbnails(tabId, index);
if (swipers[tabId]) {
swipers[tabId].slideTo(index);
}
updateThumbnails(tabId, index);
centerThumbnail(tabId, index);
});
window.addEventListener('beforeunload', () => {
Object.values(swipers).forEach(swiper => swiper?.destroy());
Object.values(thumbnailSwipers).forEach(swiper => swiper?.destroy());
if (lightbox) lightbox.destroy();
});
}

View File

@@ -1,85 +1,164 @@
<?php
$id = 'gallery-tabs-' . $block['id'];
if ( ! empty($block['anchor'] ) ) {
if (!empty($block['anchor'])) {
$id = $block['anchor'];
}
$classes = 'block-gallery-tabs';
if ( ! empty( $block['className'] ) ) {
if (!empty($block['className'])) {
$classes .= ' ' . $block['className'];
}
if ( ! empty( $block['align'] ) ) {
if (!empty($block['align'])) {
$classes .= ' align' . $block['align'];
}
$use_homepage_content = get_field('use_homepage_content');
if ($use_homepage_content) {
$homepage_id = get_option('page_on_front');
if ($homepage_id) {
$page_content = get_post_field('post_content', $homepage_id);
$blocks = parse_blocks($page_content);
foreach ($blocks as $homepage_block) {
if ($homepage_block['blockName'] === 'acf/gallery-tabs') {
echo render_block($homepage_block);
return;
}
}
}
}
$heading = get_field('heading');
$slider_tabs = get_field('slider_tabs');
?>
<div class="gallery-block mt-[24px]"
id="<?php echo esc_attr( $id ); ?>"
data-gallery-id="<?php echo esc_attr( $id ); ?>">
<div class="container mx-auto">
<div class="container mx-auto gallery-block max-[768px]:pb-[45px] pb-[90px] <?php if (!is_front_page()): echo 'pb-0 max-[768px]:py-[40px] py-[90px] mt-0'; endif ?>"
id="<?php echo esc_attr($id); ?>"
data-gallery-id="<?php echo esc_attr($id); ?>">
<?php if ($heading) : ?>
<h2 class="text-[32px] font-bold"><?php echo esc_html($heading); ?></h2>
<?php endif; ?>
<div>
<div class="flex justify-between flex-wrap max-[1050px]:flex-col gap-[16px]">
<?php if ($heading) : ?>
<h2 class="font-[700] leading-[110%] max-[1330px]:text-[36px] max-[768px]:text-[24px] text-[48px]"><?php echo esc_html($heading); ?></h2>
<?php endif; ?>
<?php if ($slider_tabs && !empty($slider_tabs['slider_tab'])) : ?>
<div class="flex gap-[10px] mt-[24px]">
<?php foreach ($slider_tabs['slider_tab'] as $tab_index => $tab) : ?>
<?php if (!empty($tab['tab_name'])) : ?>
<button class="tab-button px-[24px] py-[12px] border rounded-[25px] cursor-pointer transition-all <?php echo $tab_index === 0 ? 'active underline' : ''; ?>"
data-tab="<?php echo $tab_index; ?>">
<?php echo esc_html($tab['tab_name']); ?>
</button>
<?php endif; ?>
<?php endforeach; ?>
</div>
<?php endif; ?>
<?php if ($slider_tabs && !empty($slider_tabs['slider_tab'])) : ?>
<div class="max-[1050px]:max-w-full max-[1050px]:flex-nowrap overflow-x-auto overflow-y-hidden flex max-w-[872px] flex-wrap gap-[8px]">
<?php foreach ($slider_tabs['slider_tab'] as $tab_index => $tab) : ?>
<?php if (!empty($tab['tab_name'])) : ?>
<button class="max-[768px]:h-[41px] max-[768px]:flex max-[768px]:px-[16px] max-[768px]:items-center max-[768px]:justify-center max-[768px]:py-0 max-[768px]:text-[15px] tab-button max-[1050px]:whitespace-nowrap h-[51px] 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; ?>">
<?php echo esc_html($tab['tab_name']); ?>
</button>
<?php endif; ?>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>
</div>
<?php if ($slider_tabs && !empty($slider_tabs['slider_tab'])) : ?>
<?php foreach ($slider_tabs['slider_tab'] as $tab_index => $tab) : ?>
<div class="tab-content <?php echo $tab_index === 0 ? 'block' : 'hidden'; ?>"
<div class=" tab-content relative <?php echo $tab_index === 0 ? 'block' : 'hidden'; ?>"
id="tab-<?php echo $tab_index; ?>">
<?php if (!empty($tab['slider_images'])) : ?>
<div class="swiper mt-[24px] gallery-swiper h-[440px]" id="swiper-<?php echo $tab_index; ?>">
<div class="max-[768px]:!px-[24px] max-[768px]:!mx-[-24px] max-[768px]:mt-[24px] swiper max-[768px]:h-[220px] max-w-[2000px] mt-[45px] gallery-swiper h-[440px]"
id="swiper-<?php echo $tab_index; ?>">
<div class="swiper-wrapper">
<?php foreach ($tab['slider_images'] as $image) : ?>
<div class="swiper-slide cursor-pointer min-h-[440px]">
<?php foreach ($tab['slider_images'] as $img_index => $image) : ?>
<div class="max-[768px]:max-w-[327px] max-[768px]:min-h-[220px] swiper-slide max-w-[648px] cursor-pointer min-h-[440px]">
<a href="<?php echo esc_url($image['url']); ?>"
class="glightbox block w-full h-full"
class="glightbox block w-full h-full relative group overflow-hidden rounded-[24px]"
data-gallery="gallery-<?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-cover">
<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>
<?php if ($img_index === 0) : ?>
<img src="<?php echo esc_url($image['url']); ?>"
alt="<?php echo esc_attr($image['alt']); ?>"
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">
<?php else : ?>
<img data-src="<?php echo esc_url($image['url']); ?>"
alt="<?php echo esc_attr($image['alt']); ?>"
class="w-full h-full object-cover rounded-[24px] swiper-lazy"
width="<?php echo esc_attr($image['width']); ?>"
height="<?php echo esc_attr($image['height']); ?>">
<div class="swiper-lazy-preloader"></div>
<?php endif; ?>
</a>
</div>
<?php endforeach; ?>
</div>
<div class="swiper-button-next"></div>
<div class="swiper-button-prev"></div>
</div>
<div class="flex mt-[24px] gap-[8px] overflow-x-auto">
<?php foreach ($tab['slider_images'] as $thumb_index => $image) : ?>
<div class="thumbnail flex-shrink-0 w-[80px] h-[60px] rounded-[5px] overflow-hidden cursor-pointer border-2 border-transparent <?php echo $thumb_index === 0 ? 'active !border-blue-500' : ''; ?>"
data-index="<?php echo $thumb_index; ?>">
<img src="<?php echo esc_url($image['sizes']['thumbnail']); ?>"
alt="<?php echo esc_attr($image['alt']); ?>"
class="w-full h-full object-cover">
<div class="relative mt-[24px]">
<div class="swiper thumbnail-swiper max-[768px]:!px-[24px] max-[768px]:!mx-[-24px]"
id="thumbnail-swiper-<?php echo $tab_index; ?>">
<div class="swiper-wrapper">
<?php foreach ($tab['slider_images'] as $thumb_index => $image) : ?>
<div class="max-[768px]:max-w-[105px] max-[768px]:!h-[60px] swiper-slide max-w-[160px] !h-[100px]">
<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; ?>">
<img src="<?php echo esc_url($image['sizes']['thumbnail']); ?>"
alt="<?php echo esc_attr($image['alt']); ?>"
class="w-full rounded-[12px] h-full object-cover"
width="160"
height="100">
</div>
</div>
<?php endforeach; ?>
</div>
<?php endforeach; ?>
</div>
</div>
<?php if (!empty($image['caption'])) : ?>
<p><?php echo esc_html($image['caption']); ?></p>
<?php endif; ?>
<?php endif; ?>
<div class="swiper-scrollbar !static !mx-auto !cursor-grab mt-[44px] !w-full !p-0" id="swiper-scrollbar-<?php echo $tab_index; ?>"></div>
</div>
<?php endforeach; ?>
<?php endif; ?>

View File

@@ -1,26 +1,45 @@
.inverted-radius-wrapper:before {
content: '';
display: block;
width: 40px;
height: 25px;
background-color: transparent;
border-radius: 0 0 0 25px;
box-shadow: calc(15px * -0.5) calc(15px * 0.5) 0 0 #f9f9f9;
position: absolute;
z-index: -1;
left: -1px;
bottom: 100%;
.pagination-item[data-active="true"] {
flex: 2;
}
.inverted-radius-wrapper:after {
content: '';
display: block;
width: 40px;
height: 25px;
background-color: transparent;
border-radius: 0 0 0 25px;
box-shadow: calc(15px * -0.5) calc(15px * 0.5) 0 0 #f9f9f9;
position: absolute;
z-index: -1;
left: calc(100% - 1px);
bottom: 0;
.pagination-item[data-active="false"] .pagination-line {
background: #e0e0e0;
}
.pagination-item[data-active="true"] .pagination-line {
background: #222;
}
.dark .pagination-item[data-active="false"] .pagination-line {
background: rgba(248, 248, 248, 0.15);
}
.dark .pagination-item[data-active="true"] .pagination-line {
background: linear-gradient(90deg, rgba(250, 248, 245, 0.7) 0%, rgba(250, 248, 245, 0.7) 100%);
}
.pagination-item[data-active="true"] .slide-text {
opacity: 1;
}
.inverted-radius {
-webkit-mask: url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20648%20575%22%3E%3Cpath%20d%3D%22M0%2C0H648A0%2C0%200%2C0%2C1%20648%2C0V575A0%2C0%200%2C0%2C1%20648%2C575H130A20%2C20%200%2C0%2C1%20110%2C555L110%2C535A20%2C20%200%2C0%2C0%2090%2C515L20%2C515A20%2C20%200%2C0%2C1%200%2C495V0A0%2C0%200%2C0%2C1%200%2C0Z%22%20fill%3D%22%23fff%22%20%2F%3E%3C%2Fsvg%3E') no-repeat center / contain;
mask: url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20648%20575%22%3E%3Cpath%20d%3D%22M0%2C0H648A0%2C0%200%2C0%2C1%20648%2C0V575A0%2C0%200%2C0%2C1%20648%2C575H130A20%2C20%200%2C0%2C1%20110%2C555L110%2C535A20%2C20%200%2C0%2C0%2090%2C515L20%2C515A20%2C20%200%2C0%2C1%200%2C495V0A0%2C0%200%2C0%2C1%200%2C0Z%22%20fill%3D%22%23fff%22%20%2F%3E%3C%2Fsvg%3E') no-repeat center / contain;
width: 648px;
background-color: #ffffff;
aspect-ratio: 648 / 575;
}
@media (max-width: 767px) {
.inverted-radius {
mask: none;
-webkit-mask: none;
aspect-ratio: auto;
width: auto;
}
}
.radient-bg {
background: linear-gradient(180deg, #f9f9f9 69.59%, #ededed 100%);
}

View File

@@ -3,43 +3,115 @@ document.addEventListener('DOMContentLoaded', function() {
heroBlocks.forEach(function(block) {
const swiperContainer = block.querySelector('.swiper');
if (!swiperContainer) return;
let progressAnimation = null;
const autoplayDelay = 4000;
const swiper = new Swiper(swiperContainer, {
slidesPerView: 1,
loop: true,
grabCursor: true,
loop: true,
effect: 'fade',
fadeEffect: {
crossFade: true
},
autoplay: {
delay: autoplayDelay,
disableOnInteraction: false
},
on: {
slideChange: function () {
const realIndex = this.realIndex;
const paginationItems = block.querySelectorAll('.pagination-item');
paginationItems.forEach((item, index) => {
const line = item.querySelector('.pagination-line');
const text = item.querySelector('.slide-text');
if (index === realIndex) {
item.className = 'pagination-item flex-[2] cursor-pointer transition-all ';
line.className = 'pagination-line bg-[#222] h-[2px] rounded-[30px] transition-colors ';
text.className = 'slide-text mt-[10px] text-[14px] text-[#222] font-[600] opacity-100 transition-opacity ';
} else {
item.className = 'pagination-item flex-1 cursor-pointer transition-all ';
line.className = 'pagination-line bg-[#e0e0e0] h-[2px] rounded-[30px] transition-colors ';
text.className = 'slide-text mt-[10px] text-[14px] text-[#222] font-[600] opacity-0 transition-opacity ';
}
});
updatePagination(block, this.realIndex);
startProgressAnimation(block, this.realIndex);
},
autoplayStart: function() {
startProgressAnimation(block, this.realIndex);
},
autoplayStop: function() {
stopProgressAnimation();
}
}
});
// Навигация
block.querySelector('.custom-prev')?.addEventListener('click', () => swiper.slidePrev());
block.querySelector('.custom-next')?.addEventListener('click', () => swiper.slideNext());
function updatePagination(block, activeIndex) {
const paginationItems = block.querySelectorAll('.pagination-item');
paginationItems.forEach((item, index) => {
const isActive = index === activeIndex;
item.setAttribute('data-active', isActive ? 'true' : 'false');
const line = item.querySelector('.pagination-line');
if (line && !isActive) {
line.style.background = '';
line.style.backgroundImage = '';
}
});
}
function startProgressAnimation(block, activeIndex) {
stopProgressAnimation();
const paginationItems = block.querySelectorAll('.pagination-item');
const activeItem = paginationItems[activeIndex];
if (!activeItem) return;
const line = activeItem.querySelector('.pagination-line');
if (!line) return;
line.style.backgroundImage = 'linear-gradient(to right, rgba(255, 255, 255, 0.8) 0%, transparent 0%)';
let progress = 0;
const startTime = Date.now();
function animate() {
const elapsed = Date.now() - startTime;
progress = Math.min(elapsed / autoplayDelay, 1);
const percentage = progress * 100;
line.style.backgroundImage = `linear-gradient(to right, rgba(255, 255, 255, 0.8) ${percentage}%, transparent ${percentage}%)`;
if (progress < 1) {
progressAnimation = requestAnimationFrame(animate);
}
}
progressAnimation = requestAnimationFrame(animate);
}
function stopProgressAnimation() {
if (progressAnimation) {
cancelAnimationFrame(progressAnimation);
progressAnimation = null;
}
}
const prevBtn = block.querySelector('.custom-prev');
const nextBtn = block.querySelector('.custom-next');
if (prevBtn) {
prevBtn.addEventListener('click', () => {
swiper.slidePrev();
stopProgressAnimation();
});
}
if (nextBtn) {
nextBtn.addEventListener('click', () => {
swiper.slideNext();
stopProgressAnimation();
});
}
// Пагинация
block.querySelectorAll('.pagination-item').forEach((item, index) => {
item.addEventListener('click', () => swiper.slideToLoop(index));
item.addEventListener('click', () => {
swiper.slideToLoop(index);
stopProgressAnimation();
});
});
updatePagination(block, 0);
startProgressAnimation(block, 0);
});
});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,216 @@
<?php
$id = 'masonry-tiles-block-' . $block['id'];
if (!empty($block['anchor'])) {
$id = $block['anchor'];
}
$classes = 'block-masonry-tiles-block';
if (!empty($block['className'])) {
$classes .= ' ' . $block['className'];
}
if (!empty($block['align'])) {
$classes .= ' align' . $block['align'];
}
$third_tile_bg_url = '';
if (have_rows('tiles_group')) :
while (have_rows('tiles_group')) : the_row();
if (have_rows('third_tile')) :
while (have_rows('third_tile')) : the_row();
$bg = get_sub_field('bg');
if ($bg && !empty($bg['url'])) {
$third_tile_bg_url = esc_url($bg['url']);
}
endwhile;
endif;
endwhile;
endif;
?>
<?php if (!empty($third_tile_bg_url)) : ?>
<style>
@media (max-width: 767px) {
.fourth-tile-mobile-bg {
background-image: url('<?php echo $third_tile_bg_url; ?>') !important;
background-size: cover !important;
background-position: center !important;
}
.dark .fourth-tile-mobile-bg {
background-image: url('<?php echo $third_tile_bg_url; ?>') !important;
}
}
</style>
<?php endif; ?>
<section id="<?php echo esc_attr($id); ?>" class="<?php echo esc_attr($classes); ?>">
<div class="container mx-auto py-[90px] max-[768px]:py-[45px]">
<?php if (get_field('heading')) : ?>
<h2 class="font-[500] leading-[110%] max-[1330px]:text-[36px] max-[768px]:text-[24px] text-[48px]">
<?php echo get_field('heading'); ?>
</h2>
<?php endif; ?>
<?php if (have_rows('tiles_group')) : ?>
<?php while (have_rows('tiles_group')) :
the_row(); ?>
<div class="max-[768px]:grid-cols-1 max-[1050px]:grid-cols-2 grid grid-cols-3 max-[1050px]:gap-[12px] gap-[24px] mt-[40px]">
<div>
<?php if (have_rows('first_tile')) : ?>
<?php while (have_rows('first_tile')) :
the_row(); ?>
<div class="relative max-[768px]:h-[290px] h-[512px] rounded-[12px] p-[24px] overflow-hidden"
<?php
$image = get_sub_field('image');
if ($image) : ?>
style="background-image: url('<?php echo esc_url($image['url']); ?>'); background-size: cover; background-position: center;"
<?php endif; ?>>
<!-- Градиент оверлей -->
<div class="absolute inset-0 bg-gradient-to-t from-black/50 to-transparent"></div>
<div class="relative flex flex-col gap-[12px] h-full justify-end z-10">
<?php if (get_sub_field('heading')) : ?>
<h3 class="max-[768px]:text-[24px] text-[32px] font-[600] leading-[115%] text-[#f8f8f8]"><?php echo esc_html(get_sub_field('heading')); ?></h3>
<?php endif; ?>
<?php if (get_sub_field('text')) : ?>
<div class="max-[768px]:text-[14px] text-[16px] font-[500] leading-[145%] text-[#e0e0e0]"><?php echo wp_kses_post(get_sub_field('text')); ?></div>
<?php endif; ?>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>
</div>
<div class="flex max-[1050px]:justify-between flex-col max-[1050px]:gap-[12px] gap-[24px]">
<?php if (have_rows('second_tile')) : ?>
<?php while (have_rows('second_tile')) :
the_row(); ?>
<div class=" h-[244px] max-[768px]:h-auto relative border border-[#e0e0e0] dark:border-transparent bg-transparent dark:bg-white rounded-[12px] p-[24px] overflow-hidden">
<?php
if (get_current_room() === 'fitness') {
?>
<div class="absolute right-[24px] top-[24px]">
<img class="max-[768px]:h-[36px] max-[768px]:w-[107px]" alt="decoration"
src="<?php echo get_template_directory_uri() . '/assets/images/masonry-decor.png'; ?>">
</div>
<?php
}
?>
<div class="flex flex-col h-full justify-end">
<?php if (get_sub_field('heading')) : ?>
<h3 class="max-[768px]:text-[42px] font-[600] text-[62px] max-[768px]:dark:text-[24px] dark:text-[42px] leading-[115%]">
<span class="bg-[linear-gradient(90deg,#2b2c35_67.31%,#4f5870_92.9%)] bg-clip-text text-transparent">
<?php echo esc_html(get_sub_field('heading')); ?>
</span>
</h3>
<?php endif; ?>
<?php if (get_sub_field('underheading')) : ?>
<p class="max-[768px]:font-[600] max-[768px]:text-[16px] text-[20px] leading-[140%] text-[#222]"><?php echo esc_html(get_sub_field('underheading')); ?></p>
<?php endif; ?>
<?php if (get_sub_field('text')) : ?>
<div class="max-[768px]:mt-[8px] mt-[12px] max-[768px]:text-[14px] text-[16px] leading-[145%] text-[#6c6b6b]"
><?php echo wp_kses_post(get_sub_field('text')); ?></div>
<?php endif; ?>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>
<?php if (have_rows('third_tile')) : ?>
<?php while (have_rows('third_tile')) : the_row(); ?>
<div class="max-[768px]:hidden h-[244px] max-[768px]:h-auto rounded-[12px] p-[24px] overflow-hidden"
<?php
$bg = get_sub_field('bg');
if ($bg) : ?>
style="background-image: url('<?php echo esc_url($bg['url']); ?>'); background-size: cover; background-position: center;"
<?php endif; ?>>
</div>
<?php endwhile; ?>
<?php endif; ?>
</div>
<div class="max-[1050px]:col-span-2 max-[768px]:col-span-1 max-[768px]:flex-col max-[1050px]:flex-row flex flex-col max-[1050px]:gap-[12px] gap-[24px]">
<?php if (have_rows('fourth_tile')) : ?>
<?php while (have_rows('fourth_tile')) : the_row(); ?>
<div class="relative max-[768px]:w-full fourth-tile-mobile-bg max-[1050px]:w-[calc(50%-6px)] h-[244px] max-[768px]:h-auto relative rounded-[12px] p-[24px] overflow-hidden dark:bg-[linear-gradient(90deg,_#2b2c35_53.4%,_#4f5870_100%)] bg-[linear-gradient(90deg,_#9d9994_39.42%,_#bbb7b1_92.9%)]">
<div class="max-[768px]:hidden absolute right-[24px] top-[24px]">
<svg width="87" height="50" viewBox="0 0 87 50" fill="none"
xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_4015_3641)">
<path fill-rule="evenodd" clip-rule="evenodd"
d="M87.0003 0C70.954 39.9255 36.1536 18.6568 8.89355 28.3583C16.8203 5.97016 31.127 1.86568 47.1737 1.67911C59.1603 1.49254 75.9806 2.79851 87.0003 0Z"
fill="#F8F8F8"/>
<path fill-rule="evenodd" clip-rule="evenodd"
d="M59.7404 28.918C47.367 59.5149 20.8802 42.5372 0 50.0001C10.8269 19.403 35.5736 35.0747 59.7404 28.918Z"
fill="#F8F8F8"/>
</g>
<defs>
<clipPath id="clip0_4015_3641">
<rect width="87" height="50" fill="white"/>
</clipPath>
</defs>
</svg>
</div>
<div class="max-[768px]:block hidden absolute inset-0 bg-gradient-to-t from-black/50 to-transparent"></div>
<div class="max-[768px]:text-[#fff] flex h-full justify-end flex-col text-[#f8f8f8]">
<?php if (get_sub_field('heading')) : ?>
<h3 class="max-[768px]:font-[600] relative z-[1] max-[768px]:text-[24px] text-[42px] leading-[115%]"><?php echo esc_html(get_sub_field('heading')); ?></h3>
<?php endif; ?>
<?php if (get_sub_field('underheading')) : ?>
<p class="relative z-[1] max-[768px]:font-[600] max-[768px]:text-[16px] text-[20px] leading-[140%]"><?php echo esc_html(get_sub_field('underheading')); ?></p>
<?php endif; ?>
<?php if (get_sub_field('text')) : ?>
<div class="relative z-[1] max-[768px]:text-[#fff] max-[768px]:mt-[8px] mt-[12px] max-[768px]:text-[14px] text-[16px] leading-[145%] text-[#e0e0e0]">
<?php echo wp_kses_post(get_sub_field('text')); ?>
</div>
<?php endif; ?>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>
<?php if (have_rows('fifth_tile')) : ?>
<?php while (have_rows('fifth_tile')) : the_row(); ?>
<div class="max-[768px]:w-full max-[1050px]:w-[calc(50%-6px)] h-[244px] max-[768px]:h-auto border border-[#e0e0e0] dark:border-transparent bg-transparent dark:bg-white rounded-[12px] p-[24px] overflow-hidden">
<div class="max-[768px]:justify-center flex flex-col h-full justify-end">
<?php if (get_sub_field('heading')) : ?>
<h3 class="font-[600] max-[768px]:text-[24px] text-[42px] leading-[115%]">
<span class="bg-[linear-gradient(90deg,#2b2c35_67.31%,#4f5870_92.9%)] bg-clip-text text-transparent">
<?php echo esc_html(get_sub_field('heading')); ?>
</span>
</h3>
<?php endif; ?>
<?php if (get_sub_field('underheading')) : ?>
<p class="max-[768px]:font-[600] max-[768px]:text-[16px] text-[20px] leading-[140%] text-[#222]"><?php echo esc_html(get_sub_field('underheading')); ?></p>
<?php endif; ?>
<?php if (get_sub_field('text')) : ?>
<div class="max-[768px]:mt-[8px] mt-[12px] max-[768px]:text-[14px] text-[16px] leading-[145%] text-[#6c6b6b]"
"><?php echo wp_kses_post(get_sub_field('text')); ?></div>
<?php endif; ?>
</div>
<?php endwhile; ?>
<?php endif; ?>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>
</div>
</section>

View File

@@ -0,0 +1,262 @@
<?php
$id = 'masonry-tiles-block-' . $block['id'];
if (!empty($block['anchor'])) {
$id = $block['anchor'];
}
$classes = 'block-masonry-tiles-block';
if (!empty($block['className'])) {
$classes .= ' ' . $block['className'];
}
if (!empty($block['align'])) {
$classes .= ' align' . $block['align'];
}
?>
<section id="<?php echo esc_attr($id); ?>" class="<?php echo esc_attr($classes); ?>">
<div class="max-[768px]:py-[40px] container mx-auto py-[90px] <?php if (!is_front_page()) echo 'p-0 pt-[90px] max-[768px]:pt-[40px]' ?>">
<?php if (get_field('heading')) : ?>
<h2 class="max-[768px]:mb-[24px] max-[1050px]:text-[36px] max-[768px]:max-[768px]:text-[24px] text-[48px] font-[500] text-[#1f2937] mb-[40px]">
<?php echo get_field('heading'); ?>
</h2>
<?php endif; ?>
<?php if (have_rows('tiles_group')) : ?>
<?php while (have_rows('tiles_group')) :
the_row(); ?>
<div class="max-[768px]:flex-col max-[768px]:gap-[12px] flex max-[768px]:gap-[12px] gap-[24px]">
<!-- Первая колонка -->
<div class="max-[768px]:max-w-full flex flex-col max-[768px]:gap-[12px] gap-[24px] w-full max-w-[424px]">
<!-- First Tile - Текстовый блок -->
<?php if (have_rows('first_tile')) : ?>
<?php while (have_rows('first_tile')) : the_row(); ?>
<div class="max-[768px]:pt-0 max-[768px]:mb-[12px] <?php echo is_front_page() ? 'max-[768px]:h-auto h-[298px]' : 'max-[768px]:h-auto h-[383px]'; ?> pt-[24px] overflow-hidden">
<div class="flex <?php echo is_front_page() ? 'flex-col justify-start' : 'flex-col-reverse justify-end'; ?> max-[768px]:[&_img]:w-[196px] gap-[16px] h-full [&_img]:w-[294px]">
<?php if (get_sub_field('heading')) : ?>
<?php display_icon(get_current_room() === 'gym' ? 'dark_logo_name_gym' : 'light_logo_name'); ?>
<h3 class="max-[768px]:text-[24px] text-[32px] font-[500] text-[#222] leading-[115%]">
<span>
<?php echo esc_html(get_sub_field('heading')); ?>
</span>
</h3>
<?php endif; ?>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>
<!-- Second Tile - Блок с картинкой -->
<?php if (have_rows('second_tile')) : ?>
<?php while (have_rows('second_tile')) : the_row(); ?>
<div class="max-[768px]:w-full relative <?php echo is_front_page() ? 'max-[768px]:h-[180px] h-[298px]' : 'max-[768px]:h-auto h-[383px]'; ?> rounded-[12px] p-[24px] overflow-hidden bg-[linear-gradient(90deg,_#9d9994_39.42%,_#ccc9c4_92.9%)] dark:bg-[linear-gradient(90deg,_#2b2c35_53.4%,_#4f5870_100%)]
">
<?php $background = get_sub_field('background'); ?>
<?php if ($background) : ?>
<img class="max-[550px]:max-w-[240px] max-[768px]:max-w-[240px] absolute right-0 top-0 w-full h-full" alt="Фон блока"
src="<?php echo esc_url($background['url']); ?>">
<?php else :{
?>
<div class="absolute flex justify-end dark:bg-[linear-gradient(90deg,_#2b2c35_53.4%,_#4f5870_100%)] bg-[linear-gradient(90deg,_#9d9994_39.42%,_#ccc9c4_92.9%)] right-0 top-0 w-full h-full">
<svg width="169" height="136" viewBox="0 0 169 136" fill="none"
xmlns="http://www.w3.org/2000/svg">
<g opacity="0.2" clip-path="url(#clip0_2281_7020)">
<path fill-rule="evenodd" clip-rule="evenodd"
d="M293 -31C238.959 102.351 121.758 31.3136 29.9512 63.7166C56.6471 -11.0597 104.829 -24.7686 158.872 -25.3918C199.24 -26.0149 255.888 -21.653 293 -31Z"
fill="#F9F9F9"/>
<path fill-rule="evenodd" clip-rule="evenodd"
d="M201.195 65.5859C159.523 167.78 70.3205 111.074 0 136C36.463 33.806 119.805 86.1494 201.195 65.5859Z"
fill="#F9F9F9"/>
</g>
<defs>
<clipPath id="clip0_2281_7020">
<rect width="293" height="167" fill="white"
transform="translate(0 -31)"/>
</clipPath>
</defs>
</svg>
</div>
<?php
} ?>
<?php endif; ?>
<div class="relative flex flex-col <?php echo is_front_page() ? 'justify-start' : 'justify-end'; ?> h-full z-10">
<?php if (get_sub_field('text')) : ?>
<?php if (get_sub_field('heading')) : ?>
<h3 class="max-[768px]:text-[20px] font-[600] text-[42px] text-[#fff] leading-[115%]">
<?php echo esc_html(get_sub_field('heading')); ?>
</h3>
<?php endif; ?>
<?php if (get_sub_field('underheading')) : ?>
<p class="max-[768px]:font-[600] max-[768px]:text-[20px] text-[24px] font-[700] leading-[140%] text-[#fff]"><?php echo esc_html(get_sub_field('underheading')); ?></p>
<?php endif; ?>
<div class="<?php echo is_front_page() ? 'max-[768px]:max-w-[180px] max-w-[245px]' : 'max-w-full'; ?> max-[768px]:mt-0 max-[768px]:font-[500] w-full max-[1100px]:text-[16px] text-[20px] font-[600] leading-[115%] text-[#fff] mt-[24px]">
<?php echo wp_kses_post(get_sub_field('text')); ?>
</div>
<?php endif; ?>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>
</div>
<!-- Вторая колонка -->
<div class="flex flex-col max-[768px]:gap-[12px] gap-[24px] w-full max-w-[872px]">
<!-- Два обычных блока сверху -->
<div class="max-[550px]:grid-cols-1 grid grid-cols-2 max-[768px]:gap-[12px] gap-[24px]">
<!-- Third Tile -->
<?php if (have_rows('third_tile')) : ?>
<?php while (have_rows('third_tile')) : the_row(); ?>
<div class="relative <?php echo is_front_page() ? 'max-[768px]:h-[180px] h-[298px]' : 'max-[768px]:h-auto h-[383px]'; ?> rounded-[12px] p-[24px] overflow-hidden"
<?php
$background = get_sub_field('background');
if ($background) : ?>
style="background-image: url('<?php echo esc_url($background['url']); ?>'); background-size: cover; background-position: center;"
<?php endif; ?>>
<div class="absolute inset-0 bg-gradient-to-t from-black/50 to-transparent"></div>
<div class="relative flex flex-col h-full justify-end z-10">
<?php if (get_sub_field('heading')) : ?>
<h3 class="max-[768px]:font-[600] max-[768px]:text-[20px] font-[700] text-[24px] text-[#fff] leading-[125%]">
<?php echo esc_html(get_sub_field('heading')); ?>
</h3>
<?php endif; ?>
<?php if (get_sub_field('text')) : ?>
<div class="max-[1100px]:text-[16px] text-[20px] font-[600] leading-[115%] text-[#fff] mt-[24px] w-full <?php echo is_front_page() ? 'max-w-[330px]' : 'max-w-full' ?>"><?php echo wp_kses_post(get_sub_field('text')); ?></div>
<?php endif; ?>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>
<!-- Fourth Tile -->
<?php if (have_rows('fourth_tile')) : ?>
<?php while (have_rows('fourth_tile')) : the_row(); ?>
<div class="relative <?php echo is_front_page() ? 'max-[768px]:h-[180px] h-[298px]' : 'max-[768px]:h-auto h-[383px]'; ?> rounded-[12px] p-[24px] overflow-hidden"
<?php
$background = get_sub_field('background');
if ($background) : ?>
style="background-image: url('<?php echo esc_url($background['url']); ?>'); background-size: cover; background-position: center;"
<?php endif; ?>>
<div class="absolute inset-0 bg-gradient-to-t from-black/50 to-transparent"></div>
<div class="relative flex flex-col h-full justify-end z-10">
<?php if (get_sub_field('heading')) : ?>
<h3 class="max-[768px]:font-[600] max-[768px]:text-[20px] font-[700] text-[24px] text-[#fff] leading-[125%]">
<?php echo esc_html(get_sub_field('heading')); ?>
</h3>
<?php endif; ?>
<?php if (get_sub_field('underheading')) : ?>
<p class="max-[768px]:font-[600] max-[768px]:text-[20px] text-[24px] font-[700] leading-[140%] text-[#fff]"><?php echo esc_html(get_sub_field('underheading')); ?></p>
<?php endif; ?>
<?php if (get_sub_field('text')) : ?>
<div class="max-[1100px]:text-[16px] text-[20px] font-[600] leading-[115%] text-[#fff] mt-[24px] w-full <?php echo is_front_page() ? 'max-w-[330px]' : 'max-w-full' ?>"><?php echo wp_kses_post(get_sub_field('text')); ?></div>
<?php endif; ?>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>
</div>
<!-- Fifth Tile - Широкий блок снизу -->
<?php if (have_rows('fifth_tile')) : ?>
<?php while (have_rows('fifth_tile')) : the_row(); ?>
<div class="relative <?php echo is_front_page() ? 'max-[768px]:h-[180px] h-[298px]' : 'max-[768px]:h-auto h-[383px]'; ?> rounded-[12px] p-[24px] overflow-hidden"
<?php
$background = get_sub_field('background');
if ($background) : ?>
style="background-image: url('<?php echo esc_url($background['url']); ?>'); background-size: cover; background-position: center;"
<?php endif; ?>>
<div class="absolute inset-0 bg-gradient-to-t from-black/50 to-transparent"></div>
<div class="relative flex flex-col h-full justify-end z-10">
<?php if (get_sub_field('heading')) : ?>
<h3 class="max-[768px]:font-[600] max-[768px]:text-[20px] font-[600] text-[42px] text-[#fff] leading-[115%]">
<?php echo esc_html(get_sub_field('heading')); ?>
</h3>
<?php endif; ?>
<?php if (get_sub_field('underheading')) : ?>
<p class="max-[768px]:font-[600] max-[768px]:text-[20px] text-[24px] font-[700] leading-[140%] text-[#fff]"><?php echo esc_html(get_sub_field('underheading')); ?></p>
<?php endif; ?>
<?php if (get_sub_field('text')) : ?>
<div class="max-[1100px]:text-[16px] text-[20px] font-[600] leading-[115%] text-[#fff] mt-[24px] w-full <?php echo is_front_page() ? 'max-w-[330px]' : 'max-w-[400px]' ?>"><?php echo wp_kses_post(get_sub_field('text')); ?></div>
<?php endif; ?>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>
</div>
</section>
<script>
function reorderSecondTile() {
if (window.innerWidth <= 767) {
const tilesGroups = document.querySelectorAll('.block-masonry-tiles-block .flex.max-\\[768px\\]\\:flex-col');
tilesGroups.forEach(group => {
const firstColumn = group.querySelector('.max-w-\\[424px\\]');
const secondColumn = group.querySelector('.max-w-\\[872px\\]');
if (firstColumn && secondColumn) {
const secondTile = firstColumn.children[1];
if (secondTile) {
secondColumn.appendChild(secondTile);
}
}
});
} else {
restoreOriginalOrder();
}
}
function restoreOriginalOrder() {
const tilesGroups = document.querySelectorAll('.block-masonry-tiles-block .flex.max-\\[768px\\]\\:flex-col');
tilesGroups.forEach(group => {
const firstColumn = group.querySelector('.max-w-\\[424px\\]');
const secondColumn = group.querySelector('.max-w-\\[872px\\]');
if (firstColumn && secondColumn) {
const secondTileInSecondColumn = secondColumn.querySelector('[class*="bg-\\[linear-gradient"]');
if (secondTileInSecondColumn && firstColumn.children.length === 1) {
firstColumn.appendChild(secondTileInSecondColumn);
}
}
});
}
document.addEventListener('DOMContentLoaded', reorderSecondTile);
window.addEventListener('resize', reorderSecondTile);
if (window.ResizeObserver) {
const resizeObserver = new ResizeObserver(() => {
reorderSecondTile();
});
resizeObserver.observe(document.body);
}
</script>

View File

@@ -0,0 +1,23 @@
.reviews-block .tab-button {
box-shadow: 0 2px 32px 0 rgba(16, 15, 15, 0.03);
background: #fff;
font-weight: 500;
font-size: 18px;
line-height: 195%;
color: #222;
}
.reviews-block .tab-button.active {
font-size: 18px;
line-height: 195%;
color: #f8f8f8;
box-shadow: none;
background: linear-gradient(90deg, #9d9994 39.42%, #ccc9c4 92.9%);
}
.dark .reviews-block .tab-button.active {
background: linear-gradient(90deg, #2b2c35 39.42%, #6e7996 92.9%);
color: #f8f8f8;
}

View File

@@ -13,102 +13,139 @@ function initReviewsBlock(blockId) {
let lightbox;
function initAllSwipers() {
const tabs = container.querySelectorAll('.tab-button');
container.querySelectorAll('.reviews-swiper').forEach(swiperEl => {
const tabId = swiperEl.id.replace('swiper-', '');
tabs.forEach(button => {
const tabId = button.getAttribute('data-tab');
const tabContent = container.querySelector(`#tab-${tabId}`);
if (tabContent && tabContent.querySelector('.swiper')) {
const wasHidden = tabContent.classList.contains('hidden');
if (wasHidden) {
tabContent.style.visibility = 'hidden';
tabContent.style.position = 'absolute';
tabContent.classList.remove('hidden');
tabContent.classList.add('block');
}
if (swipers[tabId]) {
swipers[tabId].destroy(true, true);
}
swipers[tabId] = new Swiper(`#${blockId} #swiper-${tabId}`, {
slidesPerView: 'auto',
spaceBetween: 20,
loop: true,
centeredSlides: true,
observer: true,
observeParents: true,
watchSlidesProgress: true,
});
if (wasHidden) {
tabContent.style.visibility = '';
tabContent.style.position = '';
tabContent.classList.add('hidden');
tabContent.classList.remove('block');
}
}
swipers[tabId] = new Swiper(`#${blockId} #swiper-${tabId}`, {
slidesPerView: 'auto',
spaceBetween: 24,
grabCursor: true,
watchSlidesProgress: true,
scrollbar: {
el: `#${blockId} #swiper-${tabId} .swiper-scrollbar`,
draggable: true,
},
});
});
}
function initLightbox(tabId) {
if (lightbox) {
lightbox.destroy();
}
const currentSelector = `#${blockId} #tab-${tabId} .glightbox`;
lightbox = GLightbox({
selector: `#${blockId} #tab-${tabId} .glightbox`,
touchNavigation: true,
loop: true,
autoplayVideos: false,
videosWidth: '90vw',
videosHeight: '80vh',
plyr: {
css: 'https://cdn.plyr.io/3.7.8/plyr.css',
js: 'https://cdn.plyr.io/3.7.8/plyr.js',
config: {
ratio: '16:9',
fullscreen: { enabled: true, fallback: true, iosNative: true },
controls: [
'play-large',
'play',
'progress',
'current-time',
'duration',
'mute',
'volume',
'fullscreen'
]
}
},
onOpen: () => {
console.log('видео открыли');
},
onClose: () => {
console.log('видео закрыли');
if (lightbox?.settings?.selector !== currentSelector) {
if (lightbox) {
lightbox.destroy();
}
});
const isVideo = tabId === 'video';
lightbox = GLightbox({
selector: currentSelector,
touchNavigation: true,
loop: true,
autoplayVideos: false,
videosWidth: isVideo ? '90vw' : 'auto',
videosHeight: isVideo ? '80vh' : 'auto',
plyr: isVideo ? {
css: 'https://cdn.plyr.io/3.7.8/plyr.css',
js: 'https://cdn.plyr.io/3.7.8/plyr.js',
config: {
ratio: '16:9',
fullscreen: { enabled: true, fallback: true, iosNative: true },
controls: [
'play-large',
'play',
'progress',
'current-time',
'duration',
'mute',
'volume',
'fullscreen'
]
}
} : undefined,
});
}
}
function toggleRatingSection(show) {
const ratingSection = container.querySelector('.rating-section');
if (ratingSection) {
if (show) {
ratingSection.classList.remove('hidden');
ratingSection.classList.add('flex');
} else {
ratingSection.classList.remove('flex');
ratingSection.classList.add('hidden');
}
}
}
function updateRatingAndStars(rating, stars) {
if (stars) {
const starsElement = container.querySelector('[data-reviews="stars"]');
if (starsElement) {
const starCount = parseInt(stars);
const lastDigit = starCount % 10;
const lastTwoDigits = starCount % 100;
let ending;
if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
ending = ' оценок';
} else if (lastDigit == 1) {
ending = ' оценка';
} else if (lastDigit >= 2 && lastDigit <= 4) {
ending = ' оценки';
} else {
ending = ' оценок';
}
starsElement.textContent = starCount + ending;
}
}
}
function debounce(func, wait) {
let timeout;
return (...args) => {
clearTimeout(timeout);
timeout = setTimeout(() => func.apply(this, args), wait);
};
}
initAllSwipers();
const activeTab = container.querySelector('.tab-button.active');
if (activeTab) {
const tabId = activeTab.getAttribute('data-tab');
initLightbox(tabId);
}
container.querySelectorAll('.tab-button').forEach(button => {
button.addEventListener('click', () => {
button.addEventListener('click', debounce(() => {
const tabId = button.getAttribute('data-tab');
const rating = button.getAttribute('data-rating');
const stars = button.getAttribute('data-stars');
const isVideoTab = tabId === 'video';
container.querySelectorAll('.tab-button').forEach(btn => {
btn.classList.remove('active', 'underline');
btn.classList.add('bg-gray-100');
btn.classList.remove('active');
});
button.classList.add('active', 'underline');
button.classList.remove('bg-gray-100');
button.classList.add('active');
toggleRatingSection(!isVideoTab);
if (!isVideoTab) {
updateRatingAndStars(rating, stars);
}
container.querySelectorAll('.tab-content').forEach(content => {
content.classList.remove('block');
@@ -119,13 +156,22 @@ function initReviewsBlock(blockId) {
targetTab.classList.remove('hidden');
targetTab.classList.add('block');
if (swipers[tabId]) {
initLightbox(tabId);
if (!isVideoTab && swipers[tabId]) {
requestAnimationFrame(() => {
swipers[tabId].update();
});
}
initLightbox(tabId);
});
}, 100));
});
window.addEventListener('beforeunload', () => {
Object.values(swipers).forEach(swiper => swiper?.destroy());
if (lightbox) lightbox.destroy();
});
}

View File

@@ -1,38 +1,41 @@
<?php
$id = 'reviews-block-' . $block['id'];
if ( ! empty($block['anchor'] ) ) {
if (!empty($block['anchor'])) {
$id = $block['anchor'];
}
$classes = 'block-reviews-block';
if ( ! empty( $block['className'] ) ) {
if (!empty($block['className'])) {
$classes .= ' ' . $block['className'];
}
if ( ! empty( $block['align'] ) ) {
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="reviews-block container mx-auto mt-[24px]"
id="<?php echo esc_attr( $id ); ?>"
data-reviews-id="<?php echo esc_attr( $id ); ?>">
<div>
<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="flex gap-[10px] mt-[24px]">
<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="tab-button px-[24px] py-[12px] border rounded-[25px] cursor-pointer transition-all <?php echo $tab_index === 0 ? 'active underline' : ''; ?>"
data-tab="<?php echo $tab_index; ?>">
<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; ?>
@@ -40,62 +43,135 @@ $stars = get_field('stars');
<?php endif; ?>
<?php if ($slider_video_reviews) : ?>
<button class="tab-button px-[24px] py-[12px] border rounded-[25px] cursor-pointer transition-all"
<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="mt-[24px] flex gap-[20px]">
<div class="flex gap-[5px] w-full items-center justify-center">
<svg width="39" height="38" viewBox="0 0 39 38" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M19.5 0L25.7658 11.8759L38.9967 14.1652L29.6383 23.7941L31.5496 37.0848L19.5 31.16L7.4504 37.0848L9.36174 23.7941L0.00334167 14.1652L13.2342 11.8759L19.5 0Z" fill="#565656"/>
</svg>
<svg width="39" height="38" viewBox="0 0 39 38" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M19.5 0L25.7658 11.8759L38.9967 14.1652L29.6383 23.7941L31.5496 37.0848L19.5 31.16L7.4504 37.0848L9.36174 23.7941L0.00334167 14.1652L13.2342 11.8759L19.5 0Z" fill="#565656"/>
</svg>
<svg width="39" height="38" viewBox="0 0 39 38" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M19.5 0L25.7658 11.8759L38.9967 14.1652L29.6383 23.7941L31.5496 37.0848L19.5 31.16L7.4504 37.0848L9.36174 23.7941L0.00334167 14.1652L13.2342 11.8759L19.5 0Z" fill="#565656"/>
</svg>
<svg width="39" height="38" viewBox="0 0 39 38" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M19.5 0L25.7658 11.8759L38.9967 14.1652L29.6383 23.7941L31.5496 37.0848L19.5 31.16L7.4504 37.0848L9.36174 23.7941L0.00334167 14.1652L13.2342 11.8759L19.5 0Z" fill="#565656"/>
</svg>
<svg width="39" height="38" viewBox="0 0 39 38" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M19.5 0L25.7658 11.8759L38.9967 14.1652L29.6383 23.7941L31.5496 37.0848L19.5 31.16L7.4504 37.0848L9.36174 23.7941L0.00334167 14.1652L13.2342 11.8759L19.5 0Z" fill="#565656"/>
</svg>
<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
echo $stars;
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="tab-content mt-[24px] <?php echo $tab_index === 0 ? 'block' : 'hidden'; ?>"
<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 $image) : ?>
<div class="swiper-slide max-w-[449px] cursor-pointer">
<?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"
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">
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>
@@ -103,50 +179,49 @@ $stars = get_field('stars');
<?php endif; ?>
<?php if ($slider_video_reviews) : ?>
<div class="tab-content mt-[24px] hidden" id="tab-video">
<div class="swiper reviews-swiper" id="swiper-video">
<div class="swiper-wrapper">
<?php foreach ($slider_video_reviews as $video) : ?>
<?php if (!empty($video['slider_video_review'])) : ?>
<div class="swiper-slide max-w-[449px] cursor-pointer">
<a href="<?php echo esc_url($video['slider_video_review']['url']); ?>"
class="glightbox block w-full h-full relative"
data-gallery="reviews-video"
data-type="video">
<div class="w-full h-[200px] relative overflow-hidden rounded-lg">
<?php if (!empty($video['slider_video_prereview'])) : ?>
<div class="w-full h-full bg-[#f3f4f6] flex items-center justify-center">
<div class="text-center">
<div class="absolute left-1/2 top-1/2 translate-x-[-50%] translate-y-[-50%] w-[60px] h-[60px] bg-white bg-opacity-90 rounded-full flex items-center justify-center mx-auto mb-[8px]">
<svg class="w-[24px] h-[24px]" fill="currentColor" viewBox="0 0 20 20">
<path d="M8 5v10l8-5-8-5z"/>
</svg>
</div>
<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>
</div>
<?php else : ?>
<div class="w-full h-full bg-[#f3f4f6] flex justify-center">
<div class="text-center">
<div class="absolute left-1/2 top-1/2 translate-x-[-50%] translate-y-[-50%] w-[60px] h-[60px] bg-white bg-opacity-90 rounded-full flex items-center justify-center mx-auto mb-[8px]">
<svg class="w-[24px] h-[24px]" fill="currentColor" viewBox="0 0 20 20">
<path d="M8 5v10l8-5-8-5z"/>
</svg>
</div>
<p class="text-[14px] text-[#6b7280]">Видеоотзыв</p>
</div>
</div>
<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>
</a>
</div>
<?php endif; ?>
<?php endforeach; ?>
</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; ?>

View File

@@ -0,0 +1,152 @@
document.addEventListener('DOMContentLoaded', function () {
setTimeout(() => {
document.querySelectorAll('.simple-gallery-block').forEach(function (block) {
const blockId = block.getAttribute('data-gallery-id');
initSimpleGallery(blockId);
});
}, 100);
});
function initSimpleGallery(blockId) {
const container = document.getElementById(blockId);
if (!container) return;
let mainSwiper;
let thumbnailSwiper;
let lightbox;
const isSingleImage = container.querySelector('.single-image');
const hasMultipleImages = container.querySelector('.gallery-swiper');
function initLightbox() {
// Ждем загрузки GLightbox
const checkGLightbox = () => {
if (typeof GLightbox !== 'undefined') {
const selector = `#${blockId} .glightbox`;
if (lightbox) {
lightbox.destroy();
}
lightbox = GLightbox({
selector: selector,
preload: false,
touchNavigation: true,
loop: true
});
} else {
// Пробуем еще раз через 100мс
setTimeout(checkGLightbox, 100);
}
};
checkGLightbox();
}
function updateThumbnails(activeIndex) {
const thumbnails = container.querySelectorAll('.thumbnail');
thumbnails.forEach((thumb, index) => {
if (index === activeIndex) {
thumb.classList.remove('opacity-50', 'hover:opacity-80');
thumb.classList.add('opacity-100', 'active');
} else {
thumb.classList.remove('opacity-100', 'active');
thumb.classList.add('opacity-50', 'hover:opacity-80');
}
});
}
function centerThumbnail(activeIndex) {
if (thumbnailSwiper) {
thumbnailSwiper.slideTo(activeIndex);
}
}
// Если одно изображение
if (isSingleImage) {
initLightbox();
window.addEventListener('beforeunload', () => {
if (lightbox) lightbox.destroy();
});
return;
}
// Если несколько изображений
if (hasMultipleImages) {
const slides = hasMultipleImages.querySelectorAll('.swiper-slide');
const isSingleSlide = slides.length <= 1;
// Инициализируем свайпер для миниатюр
thumbnailSwiper = new Swiper(`#${blockId} .thumbnail-swiper`, {
slidesPerView: 'auto',
spaceBetween: 6,
freeMode: true,
grabCursor: true,
watchSlidesProgress: true,
});
// Инициализируем основной свайпер
mainSwiper = new Swiper(`#${blockId} .gallery-swiper`, {
loop: true,
slidesPerView: 'auto',
spaceBetween: 0,
grabCursor: true,
watchSlidesProgress: true,
lazy: {
loadPrevNext: true,
loadOnTransitionStart: true,
},
pagination: {
el: `#${blockId} .simple-gallery-swiper-pagination`,
type: 'bullets',
clickable: true,
bulletClass: 'swiper-pagination-bullet',
},
on: {
slideChange: function () {
updateThumbnails(this.realIndex);
centerThumbnail(this.realIndex);
}
}
});
// Скрываем элементы навигации при одном слайде
if (isSingleSlide) {
const pagination = container.querySelector('.simple-gallery-swiper-pagination');
const thumbnailContainer = container.querySelector('.thumbnail-swiper').parentElement;
if (pagination) pagination.style.display = 'none';
if (thumbnailContainer) thumbnailContainer.style.display = 'none';
if (mainSwiper.autoplay) {
mainSwiper.autoplay.stop();
}
}
// Инициализируем лайтбокс
initLightbox();
// Обработчик кликов по миниатюрам
container.addEventListener('click', (e) => {
const thumbnail = e.target.closest('.thumbnail');
if (!thumbnail) return;
const index = parseInt(thumbnail.getAttribute('data-index'));
if (mainSwiper) {
mainSwiper.slideToLoop(index);
}
updateThumbnails(index);
centerThumbnail(index);
});
// Очистка ресурсов при выгрузке страницы
window.addEventListener('beforeunload', () => {
if (mainSwiper) mainSwiper.destroy();
if (thumbnailSwiper) thumbnailSwiper.destroy();
if (lightbox) lightbox.destroy();
});
}
}

View File

@@ -0,0 +1,239 @@
<?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>

View File

@@ -0,0 +1,353 @@
<?php
/**
* Блок с тренерами
*/
// Получение полей ACF
$block_id = 'trainer-block-' . $block['id'];
$class_name = 'trainer-block';
if (!empty($block['className'])) {
$class_name .= ' ' . $block['className'];
}
if (!empty($block['align'])) {
$class_name .= ' align' . $block['align'];
}
if (!function_exists('get_trainers_for_current_language')) {
function get_trainers_for_current_language()
{
$current_lang = pll_current_language();
$args = array(
'post_type' => 'trainer',
'posts_per_page' => -1,
'lang' => $current_lang,
'post_status' => 'publish',
'sort' => 'menu_order',
'order' => 'ASC',
);
return get_posts($args);
}
}
$trainers = get_trainers_for_current_language();
$trainers_data = array();
if ($trainers) {
foreach ($trainers as $trainer) {
$trainer_info = array(
'post' => $trainer,
'name' => '',
'exp' => '',
'short_desc' => ''
);
if (have_rows('short_info', $trainer->ID)) {
while (have_rows('short_info', $trainer->ID)) {
the_row();
$trainer_info['name'] = get_sub_field('name');
$trainer_info['exp'] = get_sub_field('exp');
$trainer_info['short_desc'] = get_sub_field('short_desc');
}
}
$trainers_data[] = $trainer_info;
}
}
$heading = get_field('heading', $block['id']);
$room = get_current_room();
if ($room === 'fitness') {
$section_classes = 'radial-gradient';
$style_attr = '';
} else {
$section_classes = '';
}
?>
<section id="<?php echo esc_attr($block_id); ?>"
class="max-[768px]:py-[45px] py-[90px] <?php echo esc_attr($section_classes); ?>" <?php echo $style_attr; ?>>
<div class="container mx-auto">
<?php if ($trainers_data): ?>
<?php if (is_front_page()): ?>
<div class="flex items-center gap-[16px] ">
<h2 class="max-[1050px]:text-[36px] max-[768px]:max-[768px]:text-[24px] text-[40px] leading-[120%] font-[500]">
<?php
echo $heading;
?>
</h2>
<div class="max-[1100px]:flex hidden gap-[6px] ml-auto">
<button class="group trainer-custom-prev cursor-pointer">
<?php display_icon('slider-prev') ?>
</button>
<button class="group trainer-custom-next cursor-pointer">
<?php display_icon('slider-next') ?>
</button>
</div>
</div>
<?php endif; ?>
<div class="max-[1100px]:flex-col max-[768px]:mt-[24px] mt-[40px] flex gap-[24px]">
<div class="swiper w-full rounded-[20px] rounded-b-[0]" id="<?php echo esc_attr($block_id); ?>-swiper">
<div class="swiper-wrapper">
<?php foreach ($trainers_data as $trainer_data): ?>
<?php $trainer = $trainer_data['post'];
if (get_field('photo', $trainer->ID)) {
?>
<a href="<?php echo get_the_permalink($trainer->ID); ?>"
class="max-w-[312px] swiper-slide !no-underline group">
<div class="flex flex-col gap-[12px]">
<div class="flex relative rounded-[20px] overflow-hidden shadow-[0_2px_32px_0_rgba(16,_15,_15,_0.03)]">
<?php $photo_images = get_field('photo', $trainer->ID); ?>
<?php if ($photo_images && !empty($photo_images[0])): ?>
<div class="overflow-hidden w-full max-[768px]:h-[440px] h-[460px]">
<img src="<?php echo esc_url($photo_images[0]['url']); ?>"
alt="<?php echo esc_attr($photo_images[0]['alt']); ?>"
loading="lazy"
class="w-full h-full object-cover"/>
</div>
<?php endif; ?>
<div class="flex gap-[4px] absolute left-[12px] bottom-[16px]">
<div class="text-[15px] leading-[110%] font-[600] text-[#fff] px-[12px] h-[29px] flex items-center justify-center rounded-[32px] backdrop-blur-[8px] bg-[linear-gradient(90deg,rgba(157,153,148,0.7)_39.42%,rgba(197,197,185,0.7)_92.9%)]">
<?php
echo
pll_current_language('name');
?>
</div>
<?php $exp = $trainer_data['exp']; ?>
<?php if ($exp): ?>
<div class="text-[15px] leading-[110%] font-[600] text-[#fff] px-[12px] h-[29px] flex items-center justify-center rounded-[32px] backdrop-blur-[8px] bg-[linear-gradient(90deg,rgba(157,153,148,0.7)_39.42%,rgba(197,197,185,0.7)_92.9%)]">
<?php echo esc_html($exp); ?>
</div>
<?php endif; ?>
</div>
</div>
<div>
<?php $name = $trainer_data['name']; ?>
<?php if ($name): ?>
<div class="group-hover:text-[#e21e24] transition-colors text-[24px] leading-[125%] font-[600]">
<?php echo esc_html($name); ?>
</div>
<?php endif; ?>
<?php $short_desc = $trainer_data['short_desc']; ?>
<?php if ($short_desc): ?>
<div class="group-hover:text-[#e21e24] transition-colors text-[16px] leading-[145%] font-[500] mt-[4px] text-[#6c6b6b]">
<?php echo wp_kses_post($short_desc); ?>
</div>
<?php endif; ?>
</div>
</div>
</a>
<?php
}
?>
<?php endforeach; ?>
</div>
</div>
<div class="hidden max-[1100px]:flex mx-auto w-full">
<a class="!no-underline mx-auto hover:[&>svg]:translate-x-[6px] bg-transparent border border-[#e0e0e0] max-w-[327px] w-full rounded-[90px] px-[24px] h-[59px] flex items-center justify-center gap-[8px] font-[600] text-[18px] leading-[195%] text-[#222] "
href="<?php echo get_post_type_archive_link('trainer'); ?>">
Все тренеры
<svg class="transition" width="12" height="13" viewBox="0 0 12 13" fill="none"
xmlns="http://www.w3.org/2000/svg">
<path d="M6.4876 2.17896C6.73011 1.94034 7.12396 1.94035 7.36649 2.17896L11.3181 6.06809C11.5606 6.30671 11.5606 6.69329 11.3181 6.93191L7.36649 10.821C7.12396 11.0596 6.73011 11.0597 6.4876 10.821C6.24512 10.5824 6.24511 10.1949 6.4876 9.95626L9.38032 7.11093H1.1209C0.777923 7.11093 0.5 6.83747 0.5 6.5C0.5 6.16253 0.777923 5.88907 1.1209 5.88907H9.38032L6.4876 3.04374C6.24511 2.80512 6.24512 2.41758 6.4876 2.17896Z"
fill="#222222"/>
</svg>
</a>
</div>
<div class="max-[1100px]:hidden flex flex-col justify-between w-full max-w-[312px]">
<div
class="p-[24px] flex flex-col bg-cover bg-center bg-no-repeat rounded-[20px] max-[768px]:h-[440px] h-[460px]"
<?php
if (get_current_room() === 'fitness') : ?>
style="background-image: url('<?php echo get_template_directory_uri() . '/assets/images/trainer-bg-dark.png'; ?>')"
<?php else : ?>
style="background-image: url('<?php echo get_template_directory_uri() . '/assets/images/trainer-bg-light.png'; ?>')"
<?php endif;
?>
>
<?php
if (get_current_room() === 'fitness') :
?>
<svg width="138" height="14" viewBox="0 0 138 14" fill="none"
xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2190_3090)">
<mask id="mask0_2190_3090" style="mask-type:luminance" maskUnits="userSpaceOnUse"
x="0" y="0" width="84" height="14">
<path d="M83.731 0.046875H0V13.9305H83.731V0.046875Z" fill="white"/>
</mask>
<g mask="url(#mask0_2190_3090)">
<path d="M48.2909 13.931C48.2909 13.931 48.349 13.7557 48.4943 13.4341C48.6397 13.0834 48.8142 12.645 49.0177 12.0896C49.2503 11.5343 49.4829 10.9205 49.7736 10.219C50.0643 9.51752 50.3551 8.78682 50.6458 8.05605C50.9365 7.32535 51.2273 6.59464 51.518 5.89315C51.8087 5.19166 52.0413 4.57786 52.2739 4.02251C52.5065 3.46718 52.6809 3.02874 52.8263 2.678C52.9717 2.32726 53.0298 2.18111 53.0298 2.18111C53.2914 1.59654 53.6985 1.15811 54.2218 0.807368C54.7451 0.456622 55.3266 0.310479 55.9371 0.310479H68.3514L67.5664 2.21034C67.3048 2.82414 66.9268 3.32103 66.3745 3.67177C65.822 4.05174 65.2115 4.22712 64.5719 4.22712H56.8384C56.4895 4.22712 56.2278 4.40249 56.0825 4.72401L55.7627 5.51318H62.3624L61.432 7.79303C61.3157 8.08533 61.1413 8.31913 60.8796 8.49453C60.618 8.66985 60.3563 8.75754 60.0365 8.75754H54.9777C54.6288 8.75754 54.3672 8.93293 54.2218 9.25443L53.902 10.0436H64.3393L63.5834 11.9142C63.3218 12.528 62.9438 13.0249 62.3914 13.4049C61.839 13.7849 61.2285 13.9603 60.5888 13.9603H48.2909V13.931ZM38.1443 1.21657C38.2606 0.924278 38.435 0.71968 38.6676 0.544308C38.9002 0.368935 39.1909 0.28125 39.4817 0.28125H42.6506L40.5573 5.51318L40.5865 5.54241L45.7615 0.631993C46.0231 0.398164 46.2848 0.28125 46.6046 0.28125H51.7215L43.4356 8.17295C43.4647 8.23144 43.6392 8.46525 43.9589 8.90372C44.0753 9.07904 44.2497 9.31292 44.4532 9.60522C44.6567 9.86823 44.8893 10.219 45.18 10.6282C45.4708 11.0374 45.7905 11.505 46.1976 12.0604C46.5755 12.6157 47.0407 13.2295 47.5349 13.9603H42.8542L39.22 8.81603L37.5628 12.9665C37.4465 13.2588 37.2721 13.4926 37.0104 13.668C36.7488 13.8433 36.4871 13.931 36.1673 13.931H32.9983L38.1443 1.21657ZM29.9165 5.51318C30.091 5.51318 30.2364 5.42549 30.2945 5.25012L30.7015 4.22712H24.7415C24.5671 4.22712 24.4217 4.3148 24.3636 4.49018L23.9565 5.51318H29.9165ZM16.3975 13.931L21.1073 2.29803C21.369 1.68422 21.747 1.18734 22.2703 0.836597C22.7936 0.48585 23.4042 0.28125 24.0728 0.28125H36.458L31.7773 11.8558C31.5156 12.4696 31.1376 12.9665 30.5852 13.3465C30.0329 13.7264 29.4223 13.9018 28.7827 13.9018H26.8057L28.899 8.69912H22.6482L20.9038 12.9665C20.7876 13.2588 20.6131 13.4634 20.3515 13.6387C20.0898 13.8141 19.8282 13.9018 19.5083 13.9018H16.3975V13.931Z"
fill="white"/>
<path d="M3.60508 5.01441L4.6808 2.32537C4.94246 1.71157 5.32041 1.21468 5.8728 0.86394C6.42519 0.483965 7.03575 0.308594 7.67534 0.308594H9.65234L8.14049 4.04986L6.22168 8.84336C6.16353 8.96026 6.10538 9.07717 6.04724 9.19407L4.97153 11.8831C4.70987 12.4969 4.33192 12.9938 3.77952 13.3738C3.22713 13.7538 2.61659 13.9291 1.97698 13.9291H0L1.51181 10.1879L3.43064 5.39438C3.48879 5.24824 3.54694 5.13132 3.60508 5.01441Z"
fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd"
d="M20.0601 0.046875C17.647 6.3018 12.4138 2.96974 8.31445 4.48963C9.50648 0.982194 11.6579 0.339161 14.071 0.309933C15.8735 0.280704 18.4029 0.485305 20.0601 0.046875Z"
fill="white"/>
<path d="M83.7313 0.337822L79.0798 11.8831C78.8181 12.4969 78.4399 12.9938 77.8877 13.3738C77.3354 13.7537 76.725 13.9291 76.085 13.9291H74.1084L78.0041 4.25446H77.4224C77.1607 4.25446 76.899 4.31292 76.6379 4.42984C76.3762 4.54675 76.1727 4.72212 75.998 4.92672L68.6422 13.9291H63.6709L73.6719 1.5362C73.9631 1.15622 74.3406 0.863936 74.7771 0.630109C75.2128 0.425508 75.678 0.308594 76.1727 0.308594H83.7313V0.337822Z"
fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd"
d="M15.9612 4.57812C14.1005 9.37161 10.1175 6.71181 6.97754 7.88093C8.60566 3.08746 12.3271 5.54267 15.9612 4.57812Z"
fill="white"/>
</g>
<mask id="mask1_2190_3090" style="mask-type:luminance" maskUnits="userSpaceOnUse"
x="0" y="0" width="84" height="14">
<path d="M83.731 0.046875H0V13.9305H83.731V0.046875Z" fill="white"/>
</mask>
<g mask="url(#mask1_2190_3090)">
<path d="M48.2909 13.931C48.2909 13.931 48.349 13.7557 48.4943 13.4341C48.6397 13.0834 48.8142 12.645 49.0177 12.0896C49.2503 11.5343 49.4829 10.9205 49.7736 10.219C50.0643 9.51752 50.3551 8.78682 50.6458 8.05605C50.9365 7.32535 51.2273 6.59464 51.518 5.89315C51.8087 5.19166 52.0413 4.57786 52.2739 4.02251C52.5065 3.46718 52.6809 3.02874 52.8263 2.678C52.9717 2.32726 53.0298 2.18111 53.0298 2.18111C53.2914 1.59654 53.6985 1.15811 54.2218 0.807368C54.7451 0.456622 55.3266 0.310479 55.9371 0.310479H68.3514L67.5664 2.21034C67.3048 2.82414 66.9268 3.32103 66.3745 3.67177C65.822 4.05174 65.2115 4.22712 64.5719 4.22712H56.8384C56.4895 4.22712 56.2278 4.40249 56.0825 4.72401L55.7627 5.51318H62.3624L61.432 7.79303C61.3157 8.08533 61.1413 8.31913 60.8796 8.49453C60.618 8.66985 60.3563 8.75754 60.0365 8.75754H54.9777C54.6288 8.75754 54.3672 8.93293 54.2218 9.25443L53.902 10.0436H64.3393L63.5834 11.9142C63.3218 12.528 62.9438 13.0249 62.3914 13.4049C61.839 13.7849 61.2285 13.9603 60.5888 13.9603H48.2909V13.931ZM38.1443 1.21657C38.2606 0.924278 38.435 0.71968 38.6676 0.544308C38.9002 0.368935 39.1909 0.28125 39.4817 0.28125H42.6506L40.5573 5.51318L40.5865 5.54241L45.7615 0.631993C46.0231 0.398164 46.2848 0.28125 46.6046 0.28125H51.7215L43.4356 8.17295C43.4647 8.23144 43.6392 8.46525 43.9589 8.90372C44.0753 9.07904 44.2497 9.31292 44.4532 9.60522C44.6567 9.86823 44.8893 10.219 45.18 10.6282C45.4708 11.0374 45.7905 11.505 46.1976 12.0604C46.5755 12.6157 47.0407 13.2295 47.5349 13.9603H42.8542L39.22 8.81603L37.5628 12.9665C37.4465 13.2588 37.2721 13.4926 37.0104 13.668C36.7488 13.8433 36.4871 13.931 36.1673 13.931H32.9983L38.1443 1.21657ZM29.9165 5.51318C30.091 5.51318 30.2364 5.42549 30.2945 5.25012L30.7015 4.22712H24.7415C24.5671 4.22712 24.4217 4.3148 24.3636 4.49018L23.9565 5.51318H29.9165ZM16.3975 13.931L21.1073 2.29803C21.369 1.68422 21.747 1.18734 22.2703 0.836597C22.7936 0.48585 23.4042 0.28125 24.0728 0.28125H36.458L31.7773 11.8558C31.5156 12.4696 31.1376 12.9665 30.5852 13.3465C30.0329 13.7264 29.4223 13.9018 28.7827 13.9018H26.8057L28.899 8.69912H22.6482L20.9038 12.9665C20.7876 13.2588 20.6131 13.4634 20.3515 13.6387C20.0898 13.8141 19.8282 13.9018 19.5083 13.9018H16.3975V13.931Z"
fill="white"/>
<path d="M3.60508 5.01441L4.6808 2.32537C4.94246 1.71157 5.32041 1.21468 5.8728 0.86394C6.42519 0.483965 7.03575 0.308594 7.67534 0.308594H9.65234L8.14049 4.04986L6.22168 8.84336C6.16353 8.96026 6.10538 9.07717 6.04724 9.19407L4.97153 11.8831C4.70987 12.4969 4.33192 12.9938 3.77952 13.3738C3.22713 13.7538 2.61659 13.9291 1.97698 13.9291H0L1.51181 10.1879L3.43064 5.39438C3.48879 5.24824 3.54694 5.13132 3.60508 5.01441Z"
fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd"
d="M20.0601 0.046875C17.647 6.3018 12.4138 2.96974 8.31445 4.48963C9.50648 0.982194 11.6579 0.339161 14.071 0.309933C15.8735 0.280704 18.4029 0.485305 20.0601 0.046875Z"
fill="white"/>
<path d="M83.7313 0.337822L79.0798 11.8831C78.8181 12.4969 78.4399 12.9938 77.8877 13.3738C77.3354 13.7537 76.725 13.9291 76.085 13.9291H74.1084L78.0041 4.25446H77.4224C77.1607 4.25446 76.899 4.31292 76.6379 4.42984C76.3762 4.54675 76.1727 4.72212 75.998 4.92672L68.6422 13.9291H63.6709L73.6719 1.5362C73.9631 1.15622 74.3406 0.863936 74.7771 0.630109C75.2128 0.425508 75.678 0.308594 76.1727 0.308594H83.7313V0.337822Z"
fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd"
d="M15.9612 4.57812C14.1005 9.37161 10.1175 6.71181 6.97754 7.88093C8.60566 3.08746 12.3271 5.54267 15.9612 4.57812Z"
fill="white"/>
</g>
<path d="M87.531 2.59082C88.0887 1.22398 89.3809 0.335938 90.8122 0.335938H137.01L132.516 11.6376C131.966 13.0212 130.665 13.924 129.222 13.924H82.9062L87.531 2.59082Z"
fill="white"/>
<path d="M96.3045 4.77025H93.4138L93.113 6.55436H95.9317L95.683 7.97304H92.8643L92.3772 10.8749H90.9473L92.2216 3.35156H96.5532L96.3045 4.77025Z"
fill="#ADAAA4"/>
<path d="M97.5957 3.35156H99.0256L97.7512 10.8749H96.3213L97.5957 3.35156Z"
fill="#ADAAA4"/>
<path d="M105.166 3.35156L104.927 4.77025H102.969L101.933 10.8749H100.503L101.539 4.77025H99.5908L99.8293 3.35156H105.166Z"
fill="#ADAAA4"/>
<path d="M104.689 10.8749L105.964 3.35156H107.042L109.372 8.0483L110.16 3.35156H111.59L110.316 10.8749H109.238L106.917 6.17819L106.119 10.8749H104.689Z"
fill="#ADAAA4"/>
<path d="M117.133 4.77025H114.128L113.847 6.38239H116.604L116.355 7.76887H113.62L113.329 9.45619H116.387L116.148 10.8749H111.661L112.936 3.35156H117.371L117.133 4.77025Z"
fill="#ADAAA4"/>
<path d="M119.726 11.0235C118.994 11.0235 118.393 10.8587 117.923 10.5291C117.46 10.1923 117.163 9.73737 117.032 9.16415L118.327 8.4763C118.507 9.2215 119.011 9.59403 119.84 9.59403C120.22 9.59403 120.517 9.52239 120.731 9.37912C120.952 9.23578 121.084 9.0459 121.125 8.80946C121.18 8.53721 121.104 8.32586 120.897 8.17534C120.696 8.02489 120.344 7.86371 119.84 7.69173C119.163 7.4553 118.652 7.15796 118.307 6.79968C117.968 6.43426 117.854 5.92195 117.965 5.26276C118.082 4.58208 118.39 4.06978 118.887 3.72585C119.391 3.37476 119.964 3.19922 120.607 3.19922C121.201 3.19922 121.708 3.34611 122.13 3.63987C122.551 3.93364 122.855 4.34563 123.042 4.87585L121.788 5.5637C121.532 4.94034 121.101 4.62865 120.493 4.62865C120.202 4.62865 119.961 4.69314 119.767 4.82211C119.581 4.95108 119.463 5.12663 119.415 5.34874C119.36 5.61385 119.432 5.82522 119.633 5.98285C119.833 6.13332 120.172 6.29812 120.648 6.47724C120.772 6.5274 120.876 6.56681 120.959 6.59547C121.042 6.62413 121.146 6.66712 121.27 6.72444C121.395 6.7746 121.495 6.82475 121.571 6.87491C121.654 6.9179 121.747 6.97522 121.85 7.04687C121.954 7.11134 122.04 7.17942 122.109 7.25105C122.178 7.31558 122.248 7.39439 122.316 7.48749C122.392 7.57348 122.448 7.66665 122.482 7.76699C122.524 7.86727 122.558 7.97834 122.586 8.10015C122.613 8.21478 122.627 8.34376 122.627 8.48703C122.627 8.63037 122.613 8.78082 122.586 8.93844C122.468 9.61194 122.151 10.1279 121.632 10.4861C121.121 10.8444 120.486 11.0235 119.726 11.0235Z"
fill="#ADAAA4"/>
<path d="M125.797 11.0235C125.064 11.0235 124.463 10.8587 123.994 10.5291C123.531 10.1923 123.233 9.73737 123.103 9.16415L124.397 8.4763C124.577 9.2215 125.082 9.59403 125.91 9.59403C126.291 9.59403 126.587 9.52239 126.802 9.37912C127.023 9.23578 127.154 9.0459 127.196 8.80946C127.25 8.53721 127.174 8.32586 126.967 8.17534C126.767 8.02489 126.415 7.86371 125.91 7.69173C125.233 7.4553 124.722 7.15796 124.377 6.79968C124.038 6.43426 123.925 5.92195 124.035 5.26276C124.152 4.58208 124.46 4.06978 124.957 3.72585C125.462 3.37476 126.035 3.19922 126.678 3.19922C127.272 3.19922 127.779 3.34611 128.201 3.63987C128.622 3.93364 128.926 4.34563 129.113 4.87585L127.859 5.5637C127.603 4.94034 127.171 4.62865 126.563 4.62865C126.273 4.62865 126.032 4.69314 125.838 4.82211C125.651 4.95108 125.534 5.12663 125.485 5.34874C125.431 5.61385 125.503 5.82522 125.703 5.98285C125.903 6.13332 126.242 6.29812 126.719 6.47724C126.843 6.5274 126.947 6.56681 127.03 6.59547C127.113 6.62413 127.216 6.66712 127.34 6.72444C127.465 6.7746 127.565 6.82475 127.641 6.87491C127.724 6.9179 127.817 6.97522 127.921 7.04687C128.025 7.11134 128.111 7.17942 128.18 7.25105C128.249 7.31558 128.318 7.39439 128.387 7.48749C128.463 7.57348 128.518 7.66665 128.553 7.76699C128.594 7.86727 128.629 7.97834 128.656 8.10015C128.684 8.21478 128.698 8.34376 128.698 8.48703C128.698 8.63037 128.684 8.78082 128.656 8.93844C128.539 9.61194 128.221 10.1279 127.703 10.4861C127.192 10.8444 126.556 11.0235 125.797 11.0235Z"
fill="#ADAAA4"/>
</g>
<defs>
<clipPath id="clip0_2190_3090">
<rect width="137.03" height="14" fill="white"/>
</clipPath>
</defs>
</svg>
<?php
else :
?>
<svg width="127" height="14" viewBox="0 0 127 14" fill="none"
xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_4006_20975)">
<mask id="mask0_4006_20975" style="mask-type:luminance" maskUnits="userSpaceOnUse"
x="0" y="0" width="88" height="14">
<path d="M87.4168 0H0V13.9745H87.4168V0Z" fill="white"/>
</mask>
<g mask="url(#mask0_4006_20975)">
<path d="M50.4164 13.9735C50.4164 13.9735 50.4771 13.797 50.6289 13.4733C50.7806 13.1203 50.9627 12.679 51.1752 12.12C51.4181 11.5611 51.6609 10.9432 51.9644 10.2372C52.268 9.53106 52.5715 8.79555 52.875 8.06005C53.1785 7.32461 53.4821 6.5891 53.7856 5.883C54.0891 5.17692 54.332 4.5591 54.5747 4.00012C54.8176 3.44115 54.9997 2.99985 55.1515 2.64681C55.3033 2.29377 55.3639 2.14667 55.3639 2.14667C55.6371 1.55827 56.0621 1.11698 56.6084 0.763936C57.1548 0.410894 57.7618 0.263795 58.3993 0.263795H71.3603L70.5405 2.17609C70.2674 2.79391 69.8726 3.29404 69.2963 3.64708C68.7192 4.02954 68.0817 4.20606 67.4138 4.20606H59.3402C58.976 4.20606 58.7028 4.38258 58.551 4.7062L58.2171 5.50055H65.107L64.1358 7.79531C64.0147 8.0895 63.8325 8.32485 63.5594 8.50136C63.2863 8.67788 63.0129 8.76617 62.679 8.76617H57.3976C57.0334 8.76617 56.7602 8.94268 56.6084 9.26632L56.2746 10.0607H67.171L66.3821 11.9435C66.109 12.5613 65.7143 13.0615 65.1379 13.4439C64.5609 13.8264 63.9233 14.0029 63.2554 14.0029H50.4164V13.9735ZM39.8232 1.17581C39.9446 0.881611 40.1268 0.675673 40.3695 0.499154C40.6124 0.322635 40.9159 0.234375 41.2194 0.234375H44.5279L42.3425 5.50055L42.3729 5.52996L47.7757 0.587414C48.0489 0.352054 48.322 0.234375 48.6559 0.234375H53.998L45.3474 8.17779C45.3778 8.23663 45.5599 8.47198 45.8938 8.91323C46.0152 9.08974 46.1973 9.32516 46.4098 9.61935C46.6223 9.88408 46.8651 10.2372 47.1686 10.649C47.4721 11.0609 47.8061 11.5316 48.231 12.0906C48.6256 12.6496 49.1112 13.2674 49.6272 14.0029H44.7404L40.9463 8.825L39.2161 13.0026C39.0947 13.2968 38.9126 13.5322 38.6394 13.7087C38.3663 13.8852 38.0931 13.9735 37.7592 13.9735H34.4507L39.8232 1.17581ZM31.2333 5.50055C31.4154 5.50055 31.5672 5.41228 31.6279 5.23576L32.0529 4.20606H25.8305C25.6484 4.20606 25.4966 4.29433 25.4359 4.47085L25.0109 5.50055H31.2333ZM17.1191 13.9735L22.0364 2.26435C22.3095 1.64653 22.7041 1.14639 23.2504 0.793355C23.7968 0.440314 24.4342 0.234375 25.1323 0.234375H38.0627L33.1759 11.8847C32.9027 12.5025 32.5081 13.0026 31.9314 13.3851C31.3547 13.7676 30.7173 13.9441 30.0495 13.9441H27.9855L30.1709 8.70733H23.645L21.8238 13.0026C21.7024 13.2968 21.5203 13.5028 21.2471 13.6793C20.974 13.8558 20.7008 13.9441 20.3669 13.9441H17.1191V13.9735Z"
fill="#202020"/>
<path d="M3.76377 5.00224L4.88684 2.2956C5.16002 1.67778 5.5546 1.17764 6.13131 0.824605C6.70802 0.442144 7.34546 0.265625 8.01317 0.265625H10.0772L8.49882 4.03137L6.49556 8.85627C6.43483 8.97395 6.37416 9.09162 6.31343 9.2093L5.19037 11.9159C4.91719 12.5337 4.5226 13.0339 3.94589 13.4164C3.36919 13.7988 2.73177 13.9753 2.064 13.9753H0L1.57835 10.2095L3.58165 5.3847C3.64236 5.23759 3.70307 5.11991 3.76377 5.00224Z"
fill="#202020"/>
<path fill-rule="evenodd" clip-rule="evenodd"
d="M20.9433 0C18.424 6.29586 12.9604 2.94199 8.68066 4.47183C9.92515 0.941437 12.1713 0.294199 14.6906 0.264779C16.5724 0.23536 19.2132 0.441299 20.9433 0Z"
fill="#202020"/>
<path d="M87.4169 0.295045L82.5604 11.9159C82.2873 12.5338 81.8926 13.0339 81.3162 13.4163C80.7391 13.7988 80.1022 13.9753 79.4344 13.9753H77.3703L81.4372 4.23732H80.8306C80.5575 4.23732 80.2838 4.29615 80.0108 4.41384C79.7377 4.53152 79.5252 4.70804 79.3429 4.91398L71.6637 13.9753H66.4736L76.915 1.50126C77.2183 1.1188 77.6131 0.824601 78.0684 0.589244C78.5237 0.383304 79.0093 0.265625 79.5252 0.265625H87.4169V0.295045Z"
fill="#202020"/>
<path fill-rule="evenodd" clip-rule="evenodd"
d="M16.6633 4.55859C14.7207 9.38344 10.5623 6.70622 7.28418 7.88304C8.98398 3.05818 12.8692 5.52945 16.6633 4.55859Z"
fill="#202020"/>
</g>
<mask id="mask1_4006_20975" style="mask-type:luminance" maskUnits="userSpaceOnUse"
x="0" y="0" width="88" height="14">
<path d="M87.4168 0H0V13.9745H87.4168V0Z" fill="white"/>
</mask>
<g mask="url(#mask1_4006_20975)">
<path d="M50.4164 13.9735C50.4164 13.9735 50.4771 13.797 50.6289 13.4733C50.7806 13.1203 50.9627 12.679 51.1752 12.12C51.4181 11.5611 51.6609 10.9432 51.9644 10.2372C52.268 9.53106 52.5715 8.79555 52.875 8.06005C53.1785 7.32461 53.4821 6.5891 53.7856 5.883C54.0891 5.17692 54.332 4.5591 54.5747 4.00012C54.8176 3.44115 54.9997 2.99985 55.1515 2.64681C55.3033 2.29377 55.3639 2.14667 55.3639 2.14667C55.6371 1.55827 56.0621 1.11698 56.6084 0.763936C57.1548 0.410894 57.7618 0.263795 58.3993 0.263795H71.3603L70.5405 2.17609C70.2674 2.79391 69.8726 3.29404 69.2963 3.64708C68.7192 4.02954 68.0817 4.20606 67.4138 4.20606H59.3402C58.976 4.20606 58.7028 4.38258 58.551 4.7062L58.2171 5.50055H65.107L64.1358 7.79531C64.0147 8.0895 63.8325 8.32485 63.5594 8.50136C63.2863 8.67788 63.0129 8.76617 62.679 8.76617H57.3976C57.0334 8.76617 56.7602 8.94268 56.6084 9.26632L56.2746 10.0607H67.171L66.3821 11.9435C66.109 12.5613 65.7143 13.0615 65.1379 13.4439C64.5609 13.8264 63.9233 14.0029 63.2554 14.0029H50.4164V13.9735ZM39.8232 1.17581C39.9446 0.881611 40.1268 0.675673 40.3695 0.499154C40.6124 0.322635 40.9159 0.234375 41.2194 0.234375H44.5279L42.3425 5.50055L42.3729 5.52996L47.7757 0.587414C48.0489 0.352054 48.322 0.234375 48.6559 0.234375H53.998L45.3474 8.17779C45.3778 8.23663 45.5599 8.47198 45.8938 8.91323C46.0152 9.08974 46.1973 9.32516 46.4098 9.61935C46.6223 9.88408 46.8651 10.2372 47.1686 10.649C47.4721 11.0609 47.8061 11.5316 48.231 12.0906C48.6256 12.6496 49.1112 13.2674 49.6272 14.0029H44.7404L40.9463 8.825L39.2161 13.0026C39.0947 13.2968 38.9126 13.5322 38.6394 13.7087C38.3663 13.8852 38.0931 13.9735 37.7592 13.9735H34.4507L39.8232 1.17581ZM31.2333 5.50055C31.4154 5.50055 31.5672 5.41228 31.6279 5.23576L32.0529 4.20606H25.8305C25.6484 4.20606 25.4966 4.29433 25.4359 4.47085L25.0109 5.50055H31.2333ZM17.1191 13.9735L22.0364 2.26435C22.3095 1.64653 22.7041 1.14639 23.2504 0.793355C23.7968 0.440314 24.4342 0.234375 25.1323 0.234375H38.0627L33.1759 11.8847C32.9027 12.5025 32.5081 13.0026 31.9314 13.3851C31.3547 13.7676 30.7173 13.9441 30.0495 13.9441H27.9855L30.1709 8.70733H23.645L21.8238 13.0026C21.7024 13.2968 21.5203 13.5028 21.2471 13.6793C20.974 13.8558 20.7008 13.9441 20.3669 13.9441H17.1191V13.9735Z"
fill="white"/>
<path d="M3.76377 5.00224L4.88684 2.2956C5.16002 1.67778 5.5546 1.17764 6.13131 0.824605C6.70802 0.442144 7.34546 0.265625 8.01317 0.265625H10.0772L8.49882 4.03137L6.49556 8.85627C6.43483 8.97395 6.37416 9.09162 6.31343 9.2093L5.19037 11.9159C4.91719 12.5337 4.5226 13.0339 3.94589 13.4164C3.36919 13.7988 2.73177 13.9753 2.064 13.9753H0L1.57835 10.2095L3.58165 5.3847C3.64236 5.23759 3.70307 5.11991 3.76377 5.00224Z"
fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd"
d="M20.9433 0C18.424 6.29586 12.9604 2.94199 8.68066 4.47183C9.92515 0.941437 12.1713 0.294199 14.6906 0.264779C16.5724 0.23536 19.2132 0.441299 20.9433 0Z"
fill="white"/>
<path d="M87.4169 0.295045L82.5604 11.9159C82.2873 12.5338 81.8926 13.0339 81.3162 13.4163C80.7391 13.7988 80.1022 13.9753 79.4344 13.9753H77.3703L81.4372 4.23732H80.8306C80.5575 4.23732 80.2838 4.29615 80.0108 4.41384C79.7377 4.53152 79.5252 4.70804 79.3429 4.91398L71.6637 13.9753H66.4736L76.915 1.50126C77.2183 1.1188 77.6131 0.824601 78.0684 0.589244C78.5237 0.383304 79.0093 0.265625 79.5252 0.265625H87.4169V0.295045Z"
fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd"
d="M16.6633 4.55859C14.7207 9.38344 10.5623 6.70622 7.28418 7.88304C8.98398 3.05818 12.8692 5.52945 16.6633 4.55859Z"
fill="white"/>
</g>
<path d="M91.6425 2.55319C92.2265 1.17364 93.5792 0.277344 95.0776 0.277344H126.127L121.454 11.6066C120.878 13.0031 119.517 13.9143 118.006 13.9143H86.834L91.6425 2.55319Z"
fill="white"/>
<path d="M102.747 6.79809L102.65 7.3806C102.463 8.4808 101.974 9.36167 101.183 10.0232C100.392 10.6776 99.4394 11.0048 98.325 11.0048C97.1596 11.0048 96.2572 10.6129 95.6177 9.82909C94.9777 9.03809 94.7544 8.08167 94.9486 6.95991C95.1359 5.85971 95.6499 4.95006 96.4912 4.23097C97.3324 3.51189 98.3105 3.15234 99.4249 3.15234C100.173 3.15234 100.813 3.31414 101.345 3.63773C101.884 3.95413 102.294 4.40356 102.575 4.98602L101.216 5.69792C100.834 4.96445 100.191 4.59771 99.2849 4.59771C98.5584 4.59771 97.9296 4.82782 97.3974 5.28804C96.8721 5.74106 96.5486 6.33432 96.4262 7.06775C96.2969 7.80123 96.4155 8.39806 96.7825 8.8583C97.1565 9.31853 97.7171 9.54865 98.465 9.54865C99.7017 9.54865 100.529 9.07044 100.946 8.11403H98.735L98.9613 6.79809H102.747Z"
fill="#2B2C35"/>
<path d="M110.181 3.30078L106.966 7.50743L106.373 10.8512H104.895L105.489 7.48587L103.752 3.30078H105.338L106.395 6.08365L108.412 3.30078H110.181Z"
fill="#2B2C35"/>
<path d="M118.288 3.30078L116.961 10.8512H115.483L116.347 5.94343L113.564 9.45974H113.391L111.935 5.90028L111.061 10.8512H109.572L110.899 3.30078H112.42L113.844 6.9142L116.649 3.30078H118.288Z"
fill="#2B2C35"/>
</g>
<defs>
<clipPath id="clip0_4006_20975">
<rect width="126.126" height="14" fill="white"/>
</clipPath>
</defs>
</svg>
<?php
endif;
?>
<div class=" mt-auto text-[24px] font-[600] leading-[125%] text-[#f8f8f8]">
Другие профессионалы нашего клуба
</div>
<a class="!no-underline hover:[&>svg]:translate-x-[6px] mt-[40px] bg-[#f8f8f8] max-w-[179px] rounded-[90px] px-[24px] h-[59px] flex items-center justify-center gap-[8px] font-[600] text-[18px] leading-[195%] text-[#222] "
href="<?php echo get_post_type_archive_link('trainer'); ?>">
Все тренеры
<svg class="transition" width="12" height="13" viewBox="0 0 12 13" fill="none"
xmlns="http://www.w3.org/2000/svg">
<path d="M6.4876 2.17896C6.73011 1.94034 7.12396 1.94035 7.36649 2.17896L11.3181 6.06809C11.5606 6.30671 11.5606 6.69329 11.3181 6.93191L7.36649 10.821C7.12396 11.0596 6.73011 11.0597 6.4876 10.821C6.24512 10.5824 6.24511 10.1949 6.4876 9.95626L9.38032 7.11093H1.1209C0.777923 7.11093 0.5 6.83747 0.5 6.5C0.5 6.16253 0.777923 5.88907 1.1209 5.88907H9.38032L6.4876 3.04374C6.24511 2.80512 6.24512 2.41758 6.4876 2.17896Z"
fill="#222222"/>
</svg>
</a>
</div>
<div>
<button class="group trainer-custom-prev cursor-pointer">
<?php display_icon('slider-prev') ?>
</button>
<button class="group trainer-custom-next cursor-pointer">
<?php display_icon('slider-next') ?>
</button>
</div>
</div>
</div>
<?php endif; ?>
</div>
</section>
<script>
document.addEventListener('DOMContentLoaded', function () {
const swiperContainer = document.querySelector('#<?php echo esc_attr($block_id); ?>-swiper');
if (swiperContainer && typeof Swiper !== 'undefined') {
new Swiper('#<?php echo esc_attr($block_id); ?>-swiper', {
slidesPerView: 'auto',
spaceBetween: 24,
grabCursor: true,
freeMode: true,
navigation: {
nextEl: '.trainer-custom-next',
prevEl: '.trainer-custom-prev',
}
});
}
});
</script>

View File

@@ -0,0 +1,179 @@
<?php
/**
* Блок с тренерами
*/
// Получение полей ACF
$block_id = 'training-block-' . $block['id'];
$class_name = 'training-block';
if (!empty($block['className'])) {
$class_name .= ' ' . $block['className'];
}
if (!empty($block['align'])) {
$class_name .= ' align' . $block['align'];
}
if (!function_exists('get_trainings_for_current_language')) {
function get_trainings_for_current_language()
{
$current_lang = pll_current_language();
$args = array(
'post_type' => 'training',
'posts_per_page' => -1,
'lang' => $current_lang,
'post_status' => 'publish',
'sort' => 'menu_order',
'order' => 'ASC',
);
return get_posts($args);
}
}
$trainings = get_trainings_for_current_language();
$trainings_data = array();
if ($trainings) {
foreach ($trainings as $training) {
$training_info = array(
'post' => $training,
'name' => '',
'exp' => '',
'short_desc' => ''
);
if (have_rows('short_info', $training->ID)) {
while (have_rows('short_info', $training->ID)) {
the_row();
$training_info['name'] = get_sub_field('name');
$training_info['exp'] = get_sub_field('exp');
$training_info['short_desc'] = get_sub_field('short_desc');
}
}
$trainings_data[] = $training_info;
}
}
$heading = get_field('heading', $block['id']);
$room = get_current_room();
if ($room === 'fitness') {
$section_classes = 'radial-gradient';
$style_attr = '';
} else {
$section_classes = 'bg-cover bg-center bg-no-repeat';
$bg_image = get_template_directory_uri() . '/assets/images/hero-bg.png';
$style_attr = 'style="background-image: url(' . esc_url($bg_image) . ')"';
}
?>
<section id="<?php echo esc_attr($block_id); ?>"
class="max-[768px]:py-[45px] py-[96px] <?php echo esc_attr($section_classes); ?>" <?php echo $style_attr; ?>>
<div class="container mx-auto">
<?php if ($trainings_data): ?>
<?php if (is_front_page()): ?>
<div class="flex gap-[16px] justify-between">
<h2 class="dark:max-w-[860px] max-[1050px]:text-[36px] max-[768px]:max-[768px]:text-[24px] dark:text-[#F8F8F8] text-[40px] leading-[120%] font-[500] max-w-[760px] w-full">
<?php
echo $heading;
?>
</h2>
<a class="max-[1050px]:hidden !no-underline dark:text-[#F8F8F8] dark:max-w-[860px] dark:border-[#574348] flex mt-auto gap-[8px] border border-[#E0E0E0] hover:[&>svg]:translate-x-[6px] rounded-[90px] px-[32px] h-[59px] flex items-center justify-center text-[18px] font-[600] leading-[195%] text-[#222]"
href="<?php echo get_post_type_archive_link('training'); ?>">
Все тренировки
<svg class="transition fill-[#222222] dark:fill-[#F8F8F8]" width="12" height="13" viewBox="0 0 12 13" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M6.4876 2.17896C6.73011 1.94034 7.12396 1.94035 7.36649 2.17896L11.3181 6.06809C11.5606 6.30671 11.5606 6.69329 11.3181 6.93191L7.36649 10.821C7.12396 11.0596 6.73011 11.0597 6.4876 10.821C6.24512 10.5824 6.24511 10.1949 6.4876 9.95626L9.38032 7.11093H1.1209C0.777923 7.11093 0.5 6.83747 0.5 6.5C0.5 6.16253 0.777923 5.88907 1.1209 5.88907H9.38032L6.4876 3.04374C6.24511 2.80512 6.24512 2.41758 6.4876 2.17896Z"
/>
</svg>
</a>
</div>
<?php endif; ?>
<div class="max-[768px]:mt-[24px] mt-[40px] flex flex-col">
<div class="swiper max-w-full rounded-[20px] rounded-b-[0]" id="<?php echo esc_attr($block_id); ?>-swiper">
<div class="swiper-wrapper">
<?php foreach ($trainings_data as $training_data): ?>
<?php $training = $training_data['post']; ?>
<div class="max-[768px]:h-[510px] h-[540px] max-w-[312px] swiper-slide">
<div class="flex flex-col bg-[#f8f8f8] relative max-[768px]:h-[510px] h-[540px] rounded-[20px] overflow-hidden shadow-[0_2px_32px_0_rgba(16,_15,_15,_0.03)]">
<?php $photo_images = get_field('photo', $training->ID); ?>
<?php if ($photo_images && !empty($photo_images[0])): ?>
<div class="overflow-hidden min-h-[260px]">
<img src="<?php echo esc_url($photo_images[0]['url']); ?>"
alt="<?php echo esc_attr($photo_images[0]['alt']); ?>"
loading="lazy"
class="w-full h-full object-cover"/>
</div>
<?php endif; ?>
<div class="max-[768px]:gap-[12px] flex flex-col gap-[24px] h-full p-[24px]">
<?php $name = $training_data['name']; ?>
<?php if ($name): ?>
<div class="max-[768px]:text-[20px] text-[24px] leading-[125%] font-[600]">
<?php echo esc_html($name); ?>
</div>
<?php endif; ?>
<?php $short_desc = $training_data['short_desc']; ?>
<?php if ($short_desc): ?>
<div class="text-[16px] leading-[145%] font-[500] text-[#222]">
<?php echo wp_kses_post($short_desc); ?>
</div>
<?php endif; ?>
<a href="<?php echo get_permalink($training->ID); ?>" class="max-[768px]:h-[59px] !no-underline mt-auto h-[59px] flex grey-gradient-hover w-full rounded-[90px] px-[12px] text-[18px] font-[600] leading-[195%] text-[#f8f8f8] items-center justify-center">
Перейти
</a>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
<div class="swiper-scrollbar [&_.swiper-scrollbar-drag]:dark:!bg-[#989597] !static !mx-auto !cursor-grab container mt-[44px] !w-full !p-0" id="swiper-scrollbar-<?php echo esc_attr($block_id); ?>"></div>
</div>
<?php endif; ?>
<a class="hidden max-[768px]:flex !no-underline dark:text-[#F8F8F8] dark:max-w-[860px] dark:border-[#574348] flex mt-[24px] gap-[8px] border border-[#E0E0E0] hover:[&>svg]:translate-x-[6px] rounded-[90px] px-[32px] h-[59px] flex items-center justify-center text-[18px] font-[600] leading-[195%] text-[#222]"
href="<?php echo get_post_type_archive_link('training'); ?>">
Все тренировки
<svg class="transition fill-[#222222] dark:fill-[#F8F8F8]" width="12" height="13" viewBox="0 0 12 13" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M6.4876 2.17896C6.73011 1.94034 7.12396 1.94035 7.36649 2.17896L11.3181 6.06809C11.5606 6.30671 11.5606 6.69329 11.3181 6.93191L7.36649 10.821C7.12396 11.0596 6.73011 11.0597 6.4876 10.821C6.24512 10.5824 6.24511 10.1949 6.4876 9.95626L9.38032 7.11093H1.1209C0.777923 7.11093 0.5 6.83747 0.5 6.5C0.5 6.16253 0.777923 5.88907 1.1209 5.88907H9.38032L6.4876 3.04374C6.24511 2.80512 6.24512 2.41758 6.4876 2.17896Z"
/>
</svg>
</a>
</div>
</section>
<script>
document.addEventListener('DOMContentLoaded', function () {
const swiperContainer = document.querySelector('#<?php echo esc_attr($block_id); ?>-swiper');
if (swiperContainer && typeof Swiper !== 'undefined') {
new Swiper('#<?php echo esc_attr($block_id); ?>-swiper', {
slidesPerView: 'auto',
spaceBetween: 24,
grabCursor: true,
freeMode: true,
navigation: {
nextEl: '.custom-next-<?php echo esc_attr($block_id); ?>',
prevEl: '.custom-prev-<?php echo esc_attr($block_id); ?>',
},
scrollbar: {
el: `#swiper-scrollbar-<?php echo esc_attr($block_id); ?>`,
draggable: true,
},
});
}
});
</script>

View File

@@ -1,27 +1,294 @@
<?php
//test
?>
<div class="bg-black text-white mt-[24px]">
<div class="mx-auto container">
<div>
Время работы:
<?php
$work_time = get_field('work_time', 'option');
echo $work_time[get_current_room()];
?>
</div>
<div class="flex w-full justify-between">
<div>© 2025 fakelgym.ru. Все права защищены.</div>
<div><a href="#">Политика Конфиденциальности</a></div>
<div>
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="13" viewBox="0 0 22 13" fill="none">
<path
d="M20.504 12.3814H18.222C17.359 12.3814 17.099 11.6824 15.552 10.1344C14.2 8.83144 13.629 8.66943 13.287 8.66943C12.814 8.66943 12.685 8.79943 12.685 9.45043V11.5024C12.685 12.0574 12.505 12.3824 11.055 12.3824C9.64829 12.2879 8.28416 11.8606 7.07497 11.1356C5.86578 10.4106 4.84612 9.4087 4.1 8.21243C2.32901 6.00706 1.09641 3.41928 0.5 0.654435C0.5 0.312435 0.63 0.00243485 1.282 0.00243485H3.562C4.148 0.00243485 4.359 0.263435 4.589 0.866435C5.696 4.12443 7.585 6.95844 8.352 6.95844C8.646 6.95844 8.774 6.82843 8.774 6.09544V2.73944C8.677 1.20844 7.864 1.07944 7.864 0.525435C7.87428 0.379276 7.94114 0.242883 8.05037 0.145228C8.15961 0.0475726 8.30261 -0.00365196 8.449 0.00243485H12.033C12.523 0.00243485 12.685 0.246435 12.685 0.832435V5.36244C12.685 5.85144 12.895 6.01343 13.043 6.01343C13.337 6.01343 13.563 5.85143 14.102 5.31343C15.2569 3.90409 16.2008 2.33435 16.904 0.653435C16.9756 0.451399 17.1116 0.278427 17.2909 0.161024C17.4703 0.0436209 17.6832 -0.0117363 17.897 0.00343477H20.178C20.862 0.00343477 21.007 0.345435 20.862 0.833435C20.0321 2.69173 19.0056 4.45579 17.8 6.09544C17.554 6.47044 17.456 6.66543 17.8 7.10543C18.026 7.44743 18.826 8.11543 19.363 8.75043C20.145 9.53043 20.794 10.4324 21.285 11.4204C21.481 12.0564 21.155 12.3814 20.504 12.3814Z"
fill="white"/>
</svg>
$excluded_page_ids = array(763, 724, 732, 585, 582);
if (!is_front_page() &&
!is_404() &&
!in_array(get_the_ID(), $excluded_page_ids)) {
$front_page_id = get_option('page_on_front');
if ($front_page_id) {
$page_content = get_post_field('post_content', $front_page_id);
$blocks = parse_blocks($page_content);
foreach ($blocks as $block) {
if ($block['blockName'] === 'acf/form-block') {
echo render_block($block);
break;
}
}
}
}
?>
<div class="text-white relative min-h-[330px] bg-[linear-gradient(180deg,_#f9f9f9_69.59%,_#ededed_100%)] dark:bg-none dark:bg-[#141419]">
<?php if (get_current_room() === 'gym'): ?>
<svg class="absolute right-0 top-0 z-[0] pointer-events-none" width="621" height="330" viewBox="0 0 621 330"
fill="none" xmlns="http://www.w3.org/2000/svg">
<g opacity="0.04" clip-path="url(#clip0_4018_16537)">
<path fill-rule="evenodd" clip-rule="evenodd"
d="M621 -0.00390625C506.463 285.064 258.06 133.205 63.4795 202.474C120.06 42.623 222.18 13.317 336.721 11.9849C422.28 10.6528 542.342 19.9775 621 -0.00390625Z"
fill="#F8F8F8"/>
<path fill-rule="evenodd" clip-rule="evenodd"
d="M426.423 206.469C338.102 424.931 149.041 303.71 0 356.995C77.2817 138.532 253.922 250.428 426.423 206.469Z"
fill="#F8F8F8"/>
</g>
<defs>
<clipPath id="clip0_4018_16537">
<rect width="621" height="357" fill="white"/>
</clipPath>
</defs>
</svg>
<?php else: ?>
<svg class="absolute right-0 top-0 z-[0] pointer-events-none" width="621" height="330" viewBox="0 0 621 330"
fill="none" xmlns="http://www.w3.org/2000/svg">
<g opacity="0.02" clip-path="url(#clip0_2190_3228)">
<path fill-rule="evenodd" clip-rule="evenodd"
d="M621 -13.0039C506.463 272.064 258.06 120.205 63.4795 189.474C120.06 29.623 222.18 0.317019 336.721 -1.01508C422.28 -2.34716 542.342 6.97748 621 -13.0039Z"
fill="#222222"/>
<path fill-rule="evenodd" clip-rule="evenodd"
d="M426.423 193.469C338.102 411.931 149.041 290.71 0 343.995C77.2817 125.532 253.922 237.428 426.423 193.469Z"
fill="#222222"/>
</g>
<defs>
<clipPath id="clip0_2190_3228">
<rect width="621" height="357" fill="white" transform="translate(0 -13)"/>
</clipPath>
</defs>
</svg>
<?php endif; ?>
<div class="mx-auto container">
<div class="flex pt-[48px] pb-[24px] justify-between">
<div>
<a href="<?php echo esc_url(home_url('/')); ?>">
<?php display_icon(get_current_room() === 'gym' ? 'dark_logo' : 'light_logo'); ?>
</a>
<div class="mt-[12px]"> <?php get_template_part('template-parts/la-components/language-switcher'); ?></div>
<div class="hidden max-[800px]:block mt-[24px]">
<div class="flex w-full flex-wrap gap-y-[16px] gap-x-[40px]"> <?php
$menu_items = get_simple_menu_items();
foreach ($menu_items as $item):
?>
<a class="!no-underline text-[#222] dark:text-[#f8f8f8] dark:hover:text-[#c7c7c7] hover:text-[#555] hover:text-[#555] font-[600] leading-[125%] text-[16px]"
href="<?php echo esc_url($item['url']); ?>">
<?php echo esc_html($item['title']); ?>
</a>
<?php endforeach; ?></div>
</div>
<div class="hidden max-[1000px]:flex mt-[24px] flex items-center gap-[12px] text-[#222] dark:text-[#f8f8f8]">
<div class="leading-[145%] inline-flex text-[16px] font-[600]">
<p>г. Томск, </p>
<p>ул. Красноармейская, 120</p>
</div>
</div>
<div class="max-[1000px]:block hidden mt-[12px] text-[#222] dark:text-[#f8f8f8] text-[14px] leading-[125%] font-[600]">
<?php
$work_time = get_field('work_time', 'option');
echo $work_time[get_current_room()];
?>
</div>
<div class="hidden max-[1000px]:flex mt-[12px] justify-between flex-wrap items-center gap-[6px]">
<a class="font-[700] dark:hover:text-[#c7c7c7] hover:text-[#555] text-[24px] leading-[125%] !decoration-transparent text-[#222] dark:text-[#f8f8f8] transition-colors"
href="tel:+783822990019">
+7 (3822) 99-00-19
</a>
<div class="flex gap-[4px]">
<a class="[&>img]:w-[30px] dark:hover:[&>img]:brightness-90 hover:[&>img]:brightness-150 transition" href="https://t.me/FakelGym_bot">
<?php display_icon(get_current_room() === 'gym' ? 'tg_dark' : 'tg'); ?>
</a>
<a class="[&>img]:w-[30px] dark:hover:[&>img]:brightness-90 hover:[&>img]:brightness-150 transition" href="https://wa.me/79832321319">
<?php display_icon(get_current_room() === 'gym' ? 'whatsapp_dark' : 'whatsapp'); ?>
</a>
</div>
</div>
<div class="flex gap-[12px] items-center mt-[24px] ">
<?php
$page = get_page_by_path('lk');
?>
<a href="
<?php
echo get_permalink(pll_get_post($page->ID, pll_current_language()) ?: $page->ID);
?>
"
class="max-[768px]:px-[14px] max-[768px]:text-[14px] !no-underline max-[1000px]:flex hidden font-[600] dark:text-[#222] text-[#f8f8f8] dark-gradient-hover dark:!bg-none dark:!bg-[#f8f8f8] gap-[8px] h-[44px] px-[20px] items-center cursor-pointer rounded-[90px]"
>
<svg class="min-w-fit" width="16" height="17" viewBox="0 0 16 17" fill="none"
xmlns="http://www.w3.org/2000/svg">
<path class="dark:fill-[#222222] fill-[#f8f8f8]"
d="M8 0.5C9.06087 0.5 10.0783 0.921427 10.8284 1.67157C11.5786 2.42172 12 3.43913 12 4.5C12 5.56087 11.5786 6.57828 10.8284 7.32843C10.0783 8.07857 9.06087 8.5 8 8.5C6.93913 8.5 5.92172 8.07857 5.17157 7.32843C4.42143 6.57828 4 5.56087 4 4.5C4 3.43913 4.42143 2.42172 5.17157 1.67157C5.92172 0.921427 6.93913 0.5 8 0.5ZM8 10.5C12.42 10.5 16 12.29 16 14.5V16.5H0V14.5C0 12.29 3.58 10.5 8 10.5Z"
/>
</svg>
Личный кабинет
</a>
<button data-modal="time"
class="dark:hidden max-[768px]:px-[14px] max-[768px]:text-[14px] text-[#222] dark:text-[#f8f8f8] dark:border-[rgba(248,_248,_248,_0.2)] font-[600] flex gap-[8px] h-[44px] px-[20px] items-center cursor-pointer border border-[#e0e0e0] rounded-[90px]"
>
<span class="dark:bg-[#f8f8f8] w-[8px] h-[8px] rounded-full bg-[#e21e24]"></span>
Расписание
</button>
</div>
<div class="max-[1000px]:hidden mt-[24px] text-[#222] dark:text-[#f8f8f8] text-[14px] leading-[125%] font-[600]">
<?php
$work_time = get_field('work_time', 'option');
echo $work_time[get_current_room()];
?>
</div>
</div>
<div class="max-[800px]:hidden">
<div class="flex w-full max-w-[424px] flex-wrap gap-y-[16px] gap-x-[40px]"> <?php
$menu_items = get_simple_menu_items();
foreach ($menu_items as $item):
?>
<a class="!no-underline text-[#222] dark:text-[#f8f8f8] dark:hover:text-[#c7c7c7] hover:text-[#555] hover:text-[#555] font-[600] leading-[125%] text-[16px]"
href="<?php echo esc_url($item['url']); ?>">
<?php echo esc_html($item['title']); ?>
</a>
<?php endforeach; ?></div>
</div>
<div class="max-[1000px]:hidden flex flex-col items-end">
<?php
$page = get_page_by_path('lk');
?>
<a href="
<?php
echo get_permalink(pll_get_post($page->ID, pll_current_language()) ?: $page->ID);
?>
"
class="!no-underline font-[600] dark:text-[#222] text-[#f8f8f8] dark-gradient-hover dark:!bg-none dark:!bg-[#f8f8f8] flex gap-[8px] h-[44px] px-[20px] items-center cursor-pointer rounded-[90px]"
>
<svg width="16" height="17" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg">
<path class="dark:fill-[#222222] fill-[#f8f8f8]"
d="M8 0.5C9.06087 0.5 10.0783 0.921427 10.8284 1.67157C11.5786 2.42172 12 3.43913 12 4.5C12 5.56087 11.5786 6.57828 10.8284 7.32843C10.0783 8.07857 9.06087 8.5 8 8.5C6.93913 8.5 5.92172 8.07857 5.17157 7.32843C4.42143 6.57828 4 5.56087 4 4.5C4 3.43913 4.42143 2.42172 5.17157 1.67157C5.92172 0.921427 6.93913 0.5 8 0.5ZM8 10.5C12.42 10.5 16 12.29 16 14.5V16.5H0V14.5C0 12.29 3.58 10.5 8 10.5Z"
/>
</svg>
Личный кабинет
</a>
<div class="mt-[24px] flex items-center gap-[12px] text-[#222] dark:text-[#f8f8f8]">
<div class="leading-[145%] inline-flex text-[16px] font-[600]">
<p>г. Томск, </p>
<p>ул. Красноармейская, 120</p>
</div>
</div>
<div class="mt-[12px]">
<a class="font-[700] dark:hover:text-[#c7c7c7] hover:text-[#555] text-[24px] leading-[125%] !decoration-transparent text-[#222] dark:text-[#f8f8f8] transition-colors"
href="tel:+783822990019">
+7 (3822) 99-00-19
</a>
</div>
<div class="mt-[12px] flex gap-[4px]">
<a class="dark:hover:[&>img]:brightness-90 hover:[&>img]:brightness-150 transition" href="https://t.me/FakelGym_bot">
<?php display_icon(get_current_room() === 'gym' ? 'tg_dark' : 'tg'); ?>
</a>
<a class="dark:hover:[&>img]:brightness-90 hover:[&>img]:brightness-150 transition" href="https://wa.me/79832321319">
<?php display_icon(get_current_room() === 'gym' ? 'whatsapp_dark' : 'whatsapp'); ?>
</a>
</div>
</div>
</div>
<div class="max-[768px]:grid-cols-1 max-[768px]:gap-[12px] max-[768px]:items-start max-[768px]:justify-start text-[#222] dark:text-[#f8f8f8] font-[500] text-[14px] leading-[125%] grid grid-cols-3 pt-[16px] pb-[16px] border-t border-[#e0e0e0]">
<div class="flex items-center">© 2025 fakelgym.ru. Все права защищены.</div>
<div class="flex items-center justify-center max-[768px]:justify-start">
<a class="hover:!no-underline skip-ink" href="/policy" target="_blank">
Политика Конфиденциальности
</a>
</div>
<div class="flex items-center justify-end max-[768px]:justify-start">
<a href="https://vk.ru/fakelgym" target="_blank">
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 18C0 8.05888 8.05888 0 18 0C27.9411 0 36 8.05888 36 18C36 27.9411 27.9411 36 18 36C8.05888 36 0 27.9411 0 18Z"
fill="white"/>
<g clip-path="url(#clip0_2190_3227)">
<path d="M27.1299 24.0993H24.9401C24.1119 24.0993 23.8624 23.4286 22.3779 21.9431C21.0805 20.6927 20.5325 20.5372 20.2043 20.5372C19.7504 20.5372 19.6266 20.662 19.6266 21.2867V23.2558C19.6266 23.7884 19.4539 24.1003 18.0624 24.1003C16.7125 24.0096 15.4035 23.5995 14.2431 22.9038C13.0827 22.2081 12.1042 21.2466 11.3882 20.0987C9.68876 17.9823 8.50592 15.499 7.93359 12.8458C7.93359 12.5176 8.05835 12.2201 8.68402 12.2201H10.872C11.4343 12.2201 11.6368 12.4706 11.8575 13.0493C12.9198 16.1757 14.7325 18.8953 15.4686 18.8953C15.7507 18.8953 15.8735 18.7705 15.8735 18.0671V14.8466C15.7804 13.3775 15.0003 13.2537 15.0003 12.722C15.0101 12.5818 15.0743 12.4509 15.1791 12.3572C15.2839 12.2635 15.4212 12.2143 15.5617 12.2201H19.0009C19.4712 12.2201 19.6266 12.4543 19.6266 13.0166V17.3637C19.6266 17.833 19.8281 17.9885 19.9702 17.9885C20.2523 17.9885 20.4692 17.833 20.9864 17.3167C22.0947 15.9643 23.0004 14.4579 23.6753 12.8449C23.744 12.651 23.8745 12.485 24.0466 12.3723C24.2187 12.2597 24.423 12.2066 24.6282 12.2211H26.8171C27.4735 12.2211 27.6126 12.5493 27.4735 13.0176C26.6771 14.8009 25.692 16.4937 24.5351 18.0671C24.299 18.427 24.205 18.6141 24.5351 19.0364C24.752 19.3646 25.5197 20.0056 26.035 20.6149C26.7854 21.3635 27.4082 22.229 27.8794 23.1771C28.0675 23.7875 27.7546 24.0993 27.1299 24.0993Z"
fill="#222222"/>
</g>
<defs>
<clipPath id="clip0_2190_3227">
<rect width="20" height="20" fill="white" transform="translate(8 8)"/>
</clipPath>
</defs>
</svg>
</a>
</div>
</div>
</div>
</div>
</div>
<div class="container mx-auto">
<div class="min-h-[48px] flex items-center justify-center">
<a class="!no-underline flex items-center gap-[12px]" href="https://ledoffsky.agency/"
target="_blank">
<span class="text-[14px] leading-[125%] text-[#6c6b6b]">Разработка и продвижение</span>
<svg width="145" height="24" viewBox="0 0 145 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2190_3233)">
<mask id="mask0_2190_3233" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0"
width="145" height="24">
<path d="M144.603 0H0.5V23.8984H144.603V0Z" fill="white"/>
</mask>
<g mask="url(#mask0_2190_3233)">
<path d="M3.95039 5.97656H10.8478L7.39741 11.9504L10.8478 17.9241H3.95039L0.5 11.9504L3.95039 5.97656Z"
fill="black"/>
<path d="M7.39648 0H14.2972L21.1947 11.9509L14.2972 23.8984H7.39648L14.2972 11.9509L7.39648 0Z"
fill="black"/>
<path d="M17.7483 5.97266L21.1954 11.9498H14.2979L17.7483 5.97266Z" fill="black"/>
<path d="M14.2976 11.9498L10.8477 5.97266H17.748L14.2976 11.9498Z" fill="black"/>
<path d="M3.95039 5.97266L7.39741 11.9499H0.5L3.95039 5.97266Z" fill="black"/>
<path d="M14.2976 11.9492L17.7485 17.9229L10.8477 17.923L14.2976 11.9492Z" fill="black"/>
<path d="M7.39722 11.9492L10.8476 17.9229H3.9502L7.39722 11.9492Z" fill="black"/>
<path d="M14.2976 0L10.8477 5.97371H17.748L14.2976 0Z" fill="black"/>
<path d="M10.8473 5.97371L7.39648 0H14.2972L10.8473 5.97371Z" fill="black"/>
<path d="M17.7488 17.9229L21.1954 11.9492H14.2979L17.7488 17.9229Z" fill="black"/>
<path d="M7.39722 11.9504L10.8476 5.97656H3.9502L7.39722 11.9504Z" fill="black"/>
<path d="M3.95039 17.9229L7.39741 11.9492H0.5L3.95039 17.9229Z" fill="black"/>
<path d="M14.2976 23.8996L10.8477 17.9259L17.7485 17.9258L14.2976 23.8996Z" fill="black"/>
<path d="M10.8473 17.9258L7.39648 23.8995H14.2972L10.8473 17.9258Z" fill="black"/>
<path d="M138.663 17.9567H137.853V16.5917H138.528C139.308 16.5917 139.638 16.5317 139.998 15.4817L140.088 15.2867L137.163 7.26172H139.113L140.943 13.0517L142.773 7.26172H144.603L141.768 15.3167C141.003 17.4017 140.478 17.9567 138.663 17.9567Z"
fill="black"/>
<path d="M133.253 7.08203C135.023 7.08203 136.553 8.23703 136.868 10.0221H135.128C134.963 9.16703 134.228 8.56703 133.253 8.56703C132.128 8.56703 131.138 9.39203 131.138 11.2971C131.138 13.2171 132.158 14.0421 133.208 14.0421C134.093 14.0421 134.948 13.6521 135.188 12.5721H136.928C136.568 14.4621 134.903 15.5271 133.178 15.5271C130.838 15.5271 129.293 13.7121 129.293 11.3121C129.293 8.91203 130.838 7.08203 133.253 7.08203Z"
fill="black"/>
<path d="M122.8 7.26203V8.38703C123.265 7.54703 124.105 7.08203 125.245 7.08203C127.195 7.08203 127.99 8.34203 127.99 10.2621V15.3321H126.205V10.6971C126.205 9.60203 126.055 8.53703 124.675 8.53703C123.295 8.53703 122.8 9.58703 122.8 11.0421V15.3321H121.015V7.26203H122.8Z"
fill="black"/>
<path d="M119.545 11.8071H113.53C113.65 13.3071 114.7 14.0421 115.72 14.0421C116.665 14.0421 117.385 13.6821 117.7 12.9171H119.455C119.095 14.2071 117.865 15.5271 115.795 15.5271C113.2 15.5271 111.715 13.5621 111.715 11.2371C111.715 8.80703 113.38 7.08203 115.675 7.08203C118.15 7.08203 119.71 9.10703 119.545 11.8071ZM115.675 8.47703C114.835 8.47703 113.695 8.98703 113.53 10.5021H117.73C117.685 9.24203 116.725 8.47703 115.675 8.47703Z"
fill="black"/>
<path d="M108.47 8.34203V7.26203H110.255V14.5221C110.255 15.8271 109.925 16.7721 109.28 17.3721C108.635 17.9721 107.675 18.2421 106.415 18.2421C104.645 18.2421 103.25 17.5371 102.965 15.7671H104.735C104.9 16.5321 105.38 16.8321 106.46 16.8321C107.255 16.8321 107.765 16.6071 108.065 16.2471C108.365 15.9021 108.47 15.4071 108.47 14.8821V13.9371C107.99 14.7321 107.15 15.1971 106.07 15.1971C104.15 15.1971 102.56 13.6521 102.56 11.1321C102.56 8.61203 104.15 7.08203 106.07 7.08203C107.15 7.08203 107.99 7.54703 108.47 8.34203ZM108.545 11.1321C108.545 9.33203 107.615 8.50703 106.46 8.50703C105.26 8.50703 104.42 9.51203 104.42 11.1321C104.42 12.7971 105.26 13.7871 106.46 13.7871C107.615 13.7871 108.545 12.9471 108.545 11.1321Z"
fill="black"/>
<path d="M99.5697 12.1535V11.5385C97.0197 11.7785 95.9847 12.1535 95.9847 13.0685C95.9847 13.7735 96.5697 14.1935 97.4697 14.1935C98.7897 14.1935 99.5697 13.5335 99.5697 12.1535ZM97.0797 15.5285C95.3247 15.5285 94.0947 14.5835 94.0947 13.1135C94.0947 11.0885 96.5847 10.6085 99.5247 10.2935V10.1435C99.5247 8.76344 98.7447 8.34344 97.8447 8.34344C96.9447 8.34344 96.2697 8.82344 96.2247 9.79844H94.4697C94.5897 8.16344 95.9547 7.02344 97.9047 7.02344C99.8397 7.02344 101.355 7.90844 101.31 10.4885C101.31 10.8785 101.28 11.8385 101.28 12.5735C101.28 13.5935 101.355 14.6585 101.52 15.3335H99.8847C99.8247 14.9885 99.7797 14.7935 99.7347 14.2385C99.2097 15.1235 98.2797 15.5285 97.0797 15.5285Z"
fill="black"/>
<path d="M92.7861 15.333H90.7461V13.293H92.7861V15.333Z" fill="black"/>
<path d="M85.3721 17.9567H84.5621V16.5917H85.2371C86.0171 16.5917 86.3471 16.5317 86.7071 15.4817L86.7971 15.2867L83.8721 7.26172H85.8221L87.6521 13.0517L89.4821 7.26172H91.3121L88.4771 15.3167C87.7121 17.4017 87.1871 17.9567 85.3721 17.9567Z"
fill="black"/>
<path d="M76.7764 4.45703H78.5614V10.5021L81.5464 7.26203H83.6914L80.6014 10.5771L84.0364 15.3321H81.9514L79.4164 11.8371L78.5614 12.7521V15.3321H76.7764V4.45703Z"
fill="black"/>
<path d="M75.1664 9.46703H73.4864C73.2914 8.73203 72.6164 8.44703 71.7164 8.44703C70.9364 8.44703 70.2164 8.79203 70.2164 9.33203C70.2164 9.87203 70.5914 10.1571 71.2964 10.2921L72.4364 10.5171C74.0714 10.8321 75.3164 11.3421 75.3164 12.9171C75.3164 14.5971 73.7264 15.5271 71.8964 15.5271C69.9164 15.5271 68.5964 14.3871 68.4014 12.8721H70.1414C70.3064 13.7121 70.8914 14.1771 71.9564 14.1771C72.9014 14.1771 73.5764 13.7871 73.5764 13.1271C73.5764 12.4671 72.9764 12.1821 72.1814 12.0171L70.9664 11.7771C69.6014 11.4921 68.5364 10.9071 68.5364 9.42203C68.5364 7.99703 70.0814 7.08203 71.8214 7.08203C73.3964 7.08203 74.8364 7.84703 75.1664 9.46703Z"
fill="black"/>
<path d="M64.3896 7.26203V6.76703C64.3896 4.89203 65.0946 4.45703 67.0596 4.45703H67.7646V5.82203H67.2546C66.3696 5.82203 66.1746 5.98703 66.1746 6.82703V7.26203H67.7646V8.55203H66.1746V15.3321H64.3896V8.55203H63.2646V7.26203H64.3896Z"
fill="black"/>
<path d="M59.541 7.26203V6.76703C59.541 4.89203 60.246 4.45703 62.211 4.45703H62.916V5.82203H62.406C61.521 5.82203 61.326 5.98703 61.326 6.82703V7.26203H62.916V8.55203H61.326V15.3321H59.541V8.55203H58.416V7.26203H59.541Z"
fill="black"/>
<path d="M51.6555 11.3121C51.6555 13.1721 52.6455 14.0721 53.7855 14.0721C54.9255 14.0721 55.9155 13.1721 55.9155 11.3121C55.9155 9.45203 54.9255 8.53703 53.7855 8.53703C52.6455 8.53703 51.6555 9.45203 51.6555 11.3121ZM53.7855 7.08203C55.7505 7.08203 57.7605 8.40203 57.7605 11.3121C57.7605 14.2371 55.7505 15.5271 53.7855 15.5271C51.8205 15.5271 49.8105 14.2371 49.8105 11.3121C49.8105 8.40203 51.8205 7.08203 53.7855 7.08203Z"
fill="black"/>
<path d="M46.5506 8.34203V4.45703H48.3356V15.3321H46.5506V14.2671C46.0706 15.0621 45.2306 15.5271 44.1506 15.5271C42.2306 15.5271 40.6406 13.8921 40.6406 11.2971C40.6406 8.71703 42.2306 7.08203 44.1506 7.08203C45.2306 7.08203 46.0706 7.54703 46.5506 8.34203ZM46.6256 11.2971C46.6256 9.43703 45.6956 8.53703 44.5406 8.53703C43.3406 8.53703 42.5006 9.61703 42.5006 11.2971C42.5006 13.0221 43.3406 14.0721 44.5406 14.0721C45.6956 14.0721 46.6256 13.1571 46.6256 11.2971Z"
fill="black"/>
<path d="M39.6376 11.8071H33.6226C33.7426 13.3071 34.7926 14.0421 35.8126 14.0421C36.7576 14.0421 37.4776 13.6821 37.7926 12.9171H39.5476C39.1876 14.2071 37.9576 15.5271 35.8876 15.5271C33.2926 15.5271 31.8076 13.5621 31.8076 11.2371C31.8076 8.80703 33.4726 7.08203 35.7676 7.08203C38.2426 7.08203 39.8026 9.10703 39.6376 11.8071ZM35.7676 8.47703C34.9276 8.47703 33.7876 8.98703 33.6226 10.5021H37.8226C37.7776 9.24203 36.8176 8.47703 35.7676 8.47703Z"
fill="black"/>
<path d="M30.3387 4.45703V15.3321H28.5537V4.45703H30.3387Z" fill="black"/>
</g>
</g>
<defs>
<clipPath id="clip0_2190_3233">
<rect width="145" height="24" fill="white"/>
</clipPath>
</defs>
</svg>
</a></div>
</div>

View File

@@ -61,7 +61,7 @@ function register_acf_blocks() {
acf_register_block_type(array(
'name' => 'club-cards-block',
'title' => __('Блок с клубными картами'),
'description' => __('Блок с клубными картами для текущего языка'),
'description' => __('Блок с клубными картами для текущего зала'),
'render_template' => 'template-parts/la-components/blocks/club-cards-block/club-cards-block.php',
'category' => 'theme-blocks',
'icon' => 'id-alt',
@@ -73,6 +73,36 @@ function register_acf_blocks() {
),
));
acf_register_block_type(array(
'name' => 'trainer-block',
'title' => __('Блок с тренерами'),
'description' => __('Блок с тренерами для текущего зала'),
'render_template' => 'template-parts/la-components/blocks/trainers-block/trainer-block.php',
'category' => 'theme-blocks',
'icon' => 'id-alt',
'keywords' => array('тренеры', 'тренер', 'trainers'),
'supports' => array(
'align' => array('wide', 'full'),
'anchor' => true,
'customClassName' => true,
),
));
acf_register_block_type(array(
'name' => 'training-block',
'title' => __('Блок с тренировками'),
'description' => __('Блок с тренировками для текущего зала'),
'render_template' => 'template-parts/la-components/blocks/training-block/training-block.php',
'category' => 'theme-blocks',
'icon' => 'id-alt',
'keywords' => array('тренировки', 'тренеровка', 'trainings'),
'supports' => array(
'align' => array('wide', 'full'),
'anchor' => true,
'customClassName' => true,
),
));
acf_register_block_type(array(
'name' => 'form-block',
'title' => __('Блок формы'),
@@ -93,6 +123,13 @@ function register_acf_blocks() {
[],
'1.0.0'
);
wp_enqueue_script(
'form-block-js',
get_template_directory_uri() . '/template-parts/la-components/blocks/form-block/form-block.js',
['jquery'],
'1.0.0',
true
);
}
));
@@ -111,6 +148,51 @@ function register_acf_blocks() {
),
));
acf_register_block_type(array(
'name' => 'line-block',
'title' => __('Блок преимуществ в линию'),
'description' => __('Блок преимуществ в линию'),
'render_template' => 'template-parts/la-components/blocks/line-block/line-block.php',
'category' => 'theme-blocks',
'icon' => 'grid-view',
'keywords' => array('плитки', 'преимущества', 'line', 'линия'),
'supports' => array(
'align' => array('wide', 'full'),
'anchor' => true,
'customClassName' => true,
),
));
acf_register_block_type(array(
'name' => 'masonry-tiles-block',
'title' => __('Блок с высокой первой плиткой'),
'description' => __('Блок с высокой первой плиткой'),
'render_template' => 'template-parts/la-components/blocks/masonry-tiles-1/masonry-tiles-1.php',
'category' => 'theme-blocks',
'icon' => 'grid-view',
'keywords' => array('плитки', 'карточки', 'tiles', 'cards'),
'supports' => array(
'align' => array('wide', 'full'),
'anchor' => true,
'customClassName' => true,
),
));
acf_register_block_type(array(
'name' => 'masonry-wide-tiles-block',
'title' => __('Блок с широкой последней плиткой'),
'description' => __('Блок с широкой последней плиткой'),
'render_template' => 'template-parts/la-components/blocks/masonry-tiles-2/masonry-tiles-2.php',
'category' => 'theme-blocks',
'icon' => 'grid-view',
'keywords' => array('плитки', 'карточки', 'tiles', 'cards'),
'supports' => array(
'align' => array('wide', 'full'),
'anchor' => true,
'customClassName' => true,
),
));
acf_register_block_type(array(
'name' => 'advantages-block',
@@ -148,6 +230,28 @@ function register_acf_blocks() {
'1.0.0',
true
);
wp_enqueue_style(
'glightbox-css',
'https://cdnjs.cloudflare.com/ajax/libs/glightbox/3.2.0/css/glightbox.min.css',
[],
'3.2.0'
);
wp_enqueue_script(
'glightbox-js',
'https://cdnjs.cloudflare.com/ajax/libs/glightbox/3.2.0/js/glightbox.min.js',
[],
'3.2.0',
true
);
wp_enqueue_style(
'reviews-block-css',
get_template_directory_uri() . '/template-parts/la-components/blocks/reviews-block/reviews-block.css',
[],
'1.0.0'
);
}
));
@@ -182,6 +286,12 @@ function register_acf_blocks() {
true
);
wp_enqueue_style(
'gallery-block-css',
get_template_directory_uri() . '/template-parts/la-components/blocks/gallery-tabs/gallery-tabs.css',
[],
'1.0.0'
);
wp_enqueue_script(
'gallery-tabs-js',
@@ -192,6 +302,46 @@ function register_acf_blocks() {
);
}
));
acf_register_block_type(array(
'name' => 'simple-gallery',
'title' => __('Галерея с текстом'),
'description' => __('Галерея с текстом'),
'render_template' => 'template-parts/la-components/blocks/simple-gallery/simple-gallery.php',
'category' => 'theme-blocks',
'icon' => 'images-alt2',
'keywords' => array('gallery', 'tabs', 'slider', 'галерея', 'слайдер'),
'supports' => array(
'align' => array('wide', 'full'),
'anchor' => true,
'customClassName' => true,
),
'enqueue_assets' => function() {
wp_enqueue_style(
'glightbox-css',
'https://cdnjs.cloudflare.com/ajax/libs/glightbox/3.2.0/css/glightbox.min.css',
[],
'3.2.0'
);
wp_enqueue_script(
'glightbox-js',
'https://cdnjs.cloudflare.com/ajax/libs/glightbox/3.2.0/js/glightbox.min.js',
[],
'3.2.0',
true
);
wp_enqueue_script(
'simple-gallery-js',
get_template_directory_uri() . '/template-parts/la-components/blocks/simple-gallery/simple-gallery.js',
['swiper-js', 'glightbox-js'],
'1.0.0',
true
);
}
));
}
}
add_action('acf/init', 'register_acf_blocks');

View File

@@ -0,0 +1,439 @@
<?php
/**
* хлебные крошки
*/
if (!function_exists('generate_yandex_breadcrumbs')) {
function generate_yandex_breadcrumbs()
{
$current_region = 'RU';
$home_title = 'Главная';
$home_url = home_url('/');
$texts = array(
'you_are_here' => 'Вы находитесь здесь:',
'search_prefix' => 'Поиск:',
'not_found' => 'Страница не найдена',
'author_prefix' => 'Публикации автора',
'breadcrumb_nav' => 'Навигация по разделам'
);
$clean_title = function ($title) {
return trim(preg_replace('/\s*\([^)]*\)/', '', $title));
};
$separator_svg = '<svg width="7" height="14" viewBox="0 0 7 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 13.9365L4.976 0.0644531H6.352L1.36 13.9365H0Z" fill="#6C6B6B" />
</svg>';
if (get_current_room() === 'gym') {
$home_icon_svg = '<svg width="13" height="12" viewBox="0 0 13 12" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2307_15997)">
<path d="M0.584984 10.087C0.584984 11.1419 1.4431 12 2.498 12H5.0487C5.40085 12 5.68637 11.7148 5.68637 11.3623V8.81164H6.96172V11.3623C6.96172 11.7148 7.24723 12 7.59938 12H10.1501C11.205 12 12.0631 11.1419 12.0631 10.087V4.06395C12.0631 3.62119 11.8389 3.21704 11.4637 2.98226L7.00004 0.192428C6.58934 -0.0641426 6.05879 -0.0641426 5.64809 0.192428L1.18435 2.98226C0.809164 3.21704 0.584961 3.62119 0.584961 4.06395V10.087H0.584984ZM1.86034 4.06395L6.32405 1.27412L10.7878 4.06395V10.087C10.7878 10.4388 10.502 10.7247 10.1501 10.7247H8.23709V8.17395C8.23709 7.82211 7.95158 7.53629 7.59943 7.53629H5.04873C4.69658 7.53629 4.41106 7.82211 4.41106 8.17395V10.7247H2.498C2.14616 10.7247 1.86034 10.4388 1.86034 10.087V4.06395Z" fill="#F8F8F8" />
</g>
<defs>
<clipPath id="clip0_2307_15997">
<rect width="12" height="12" fill="white" transform="translate(0.324219)" />
</clipPath>
</defs>
</svg>';
} else {
$home_icon_svg = '<svg class="fill-[#222]" width="13" height="12" viewBox="0 0 13 12" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0.584984 10.087C0.584984 11.1419 1.4431 12 2.498 12H5.0487C5.40085 12 5.68637 11.7148 5.68637 11.3623V8.81164H6.96172V11.3623C6.96172 11.7148 7.24723 12 7.59938 12H10.1501C11.205 12 12.0631 11.1419 12.0631 10.087V4.06395C12.0631 3.62119 11.8389 3.21704 11.4637 2.98226L7.00004 0.192428C6.58934 -0.0641426 6.05879 -0.0641426 5.64809 0.192428L1.18435 2.98226C0.809164 3.21704 0.584961 3.62119 0.584961 4.06395V10.087H0.584984ZM1.86034 4.06395L6.32405 1.27412L10.7878 4.06395V10.087C10.7878 10.4388 10.502 10.7247 10.1501 10.7247H8.23709V8.17395C8.23709 7.82211 7.95158 7.53629 7.59943 7.53629H5.04873C4.69658 7.53629 4.41106 7.82211 4.41106 8.17395V10.7247H2.498C2.14616 10.7247 1.86034 10.4388 1.86034 10.087V4.06395Z"
/>
</svg>';
}
// Создаем элемент главной страницы отдельно
$home_breadcrumb = array(
"@type" => "ListItem",
"position" => 1,
"name" => $home_title,
"item" => $home_url
);
// Массив для остальных крошек (без главной)
$breadcrumbs = array();
$position = 2; // Начинаем с позиции 2, так как главная уже позиция 1
if (is_post_type_archive()) {
$post_type = get_queried_object();
$breadcrumbs[] = array(
"@type" => "ListItem",
"position" => $position++,
"name" => $clean_title($post_type->labels->name),
"item" => get_post_type_archive_link($post_type->name)
);
// Категории (включая иерархические)
} elseif (is_category()) {
$category = get_queried_object();
// Родительские категории
$parent_cats = array();
$parent_id = $category->parent;
while ($parent_id) {
$parent_cat = get_category($parent_id);
array_unshift($parent_cats, $parent_cat);
$parent_id = $parent_cat->parent;
}
foreach ($parent_cats as $parent_cat) {
$breadcrumbs[] = array(
"@type" => "ListItem",
"position" => $position++,
"name" => $clean_title($parent_cat->name),
"item" => get_category_link($parent_cat->term_id)
);
}
$breadcrumbs[] = array(
"@type" => "ListItem",
"position" => $position++,
"name" => $clean_title($category->name),
"item" => get_category_link($category->term_id)
);
// Теги
} elseif (is_tag()) {
$tag = get_queried_object();
$breadcrumbs[] = array(
"@type" => "ListItem",
"position" => $position++,
"name" => $clean_title($tag->name),
"item" => get_tag_link($tag->term_id)
);
// Кастомные таксономии
}
// elseif (is_tax()) {
// $term = get_queried_object();
// $taxonomy = $term->taxonomy;
//
// // Архив типа поста для этой таксономии
// $taxonomy_obj = get_taxonomy($taxonomy);
// if (!empty($taxonomy_obj->object_type)) {
// $post_type = $taxonomy_obj->object_type[0];
// $post_type_obj = get_post_type_object($post_type);
//
// if ($post_type_obj && $post_type_obj->has_archive) {
// $archive_link = get_post_type_archive_link($post_type);
// if ($archive_link) {
// $breadcrumbs[] = array(
// "@type" => "ListItem",
// "position" => $position++,
// "name" => $clean_title($post_type_obj->labels->name),
// "item" => $archive_link
// );
// }
// }
// }
//
// // Родительские термины для иерархических таксономий
// if (is_taxonomy_hierarchical($taxonomy)) {
// $parent_terms = array();
// $parent_id = $term->parent;
// while ($parent_id) {
// $parent_term = get_term($parent_id, $taxonomy);
// array_unshift($parent_terms, $parent_term);
// $parent_id = $parent_term->parent;
// }
//
// foreach ($parent_terms as $parent_term) {
// $breadcrumbs[] = array(
// "@type" => "ListItem",
// "position" => $position++,
// "name" => $clean_title($parent_term->name),
// /* "item" => get_term_link($parent_term)*/ // TODO: Ссылки на таксономии отключены
// "item" => $archive_link
// );
// }
// }
//
// $breadcrumbs[] = array(
// "@type" => "ListItem",
// "position" => $position++,
// "name" => $clean_title($term->name),
// "item" => get_term_link($term)
// );
//
// // Отдельные посты
// }
elseif (is_single()) {
global $post;
$post_type = get_post_type($post);
if ($post_type === 'post') {
// Обычные посты - категории
$categories = get_the_category();
if (!empty($categories)) {
$main_category = $categories[0];
// Родительские категории
$parent_cats = array();
$parent_id = $main_category->parent;
while ($parent_id) {
$parent_cat = get_category($parent_id);
array_unshift($parent_cats, $parent_cat);
$parent_id = $parent_cat->parent;
}
foreach ($parent_cats as $parent_cat) {
$breadcrumbs[] = array(
"@type" => "ListItem",
"position" => $position++,
"name" => $clean_title($parent_cat->name),
"item" => get_category_link($parent_cat->term_id)
);
}
$breadcrumbs[] = array(
"@type" => "ListItem",
"position" => $position++,
"name" => $clean_title($main_category->name),
"item" => get_category_link($main_category->term_id)
);
}
} else {
// Кастомные типы постов
$post_type_obj = get_post_type_object($post_type);
// Архив типа поста
if ($post_type_obj && $post_type_obj->has_archive) {
$archive_link = get_post_type_archive_link($post_type);
if ($archive_link) {
$breadcrumbs[] = array(
"@type" => "ListItem",
"position" => $position++,
"name" => $clean_title($post_type_obj->labels->name),
"item" => $archive_link
);
}
}
// Основная таксономия для кастомного типа
$taxonomies = get_object_taxonomies($post_type, 'objects');
$main_taxonomy = null;
// Ищем основную таксономию (hierarchical в приоритете)
foreach ($taxonomies as $taxonomy) {
if ($taxonomy->public && !in_array($taxonomy->name, array('post_tag', 'post_format'))) {
if ($taxonomy->hierarchical) {
$main_taxonomy = $taxonomy->name;
break;
} elseif (!$main_taxonomy) {
$main_taxonomy = $taxonomy->name;
}
}
}
// if ($main_taxonomy) {
// $terms = get_the_terms($post, $main_taxonomy);
// if (!empty($terms) && !is_wp_error($terms)) {
// $main_term = $terms[0];
//
// // Родительские термины для иерархических таксономий
// if (is_taxonomy_hierarchical($main_taxonomy)) {
// $parent_terms = array();
// $parent_id = $main_term->parent;
// while ($parent_id) {
// $parent_term = get_term($parent_id, $main_taxonomy);
// array_unshift($parent_terms, $parent_term);
// $parent_id = $parent_term->parent;
// }
//
// foreach ($parent_terms as $parent_term) {
// $breadcrumbs[] = array(
// "@type" => "ListItem",
// "position" => $position++,
// "name" => $clean_title($parent_term->name),
// /* "item" => get_term_link($parent_term)*/
// "item" => $archive_link
// );
// }
// }
//
// $breadcrumbs[] = array(
// "@type" => "ListItem",
// "position" => $position++,
// "name" => $clean_title($main_term->name),
// "item" => get_term_link($main_term)
// );
// }
// }
}
// Текущий пост
$breadcrumbs[] = array(
"@type" => "ListItem",
"position" => $position++,
"name" => $clean_title(get_the_title()),
"item" => get_permalink()
);
// Страницы
} elseif (is_page()) {
global $post;
$ancestors = get_post_ancestors($post);
$ancestors = array_reverse($ancestors);
foreach ($ancestors as $ancestor_id) {
$breadcrumbs[] = array(
"@type" => "ListItem",
"position" => $position++,
"name" => $clean_title(get_the_title($ancestor_id)),
"item" => get_permalink($ancestor_id)
);
}
$breadcrumbs[] = array(
"@type" => "ListItem",
"position" => $position++,
"name" => $clean_title(get_the_title()),
"item" => get_permalink()
);
// Авторы
} elseif (is_author()) {
$author = get_queried_object();
$breadcrumbs[] = array(
"@type" => "ListItem",
"position" => $position++,
"name" => $texts['author_prefix'] . ' ' . $author->display_name,
"item" => get_author_posts_url($author->ID)
);
// Поиск
} elseif (is_search()) {
$breadcrumbs[] = array(
"@type" => "ListItem",
"position" => $position++,
"name" => $texts['search_prefix'] . ' ' . get_search_query(),
"item" => home_url('?s=' . urlencode(get_search_query()))
);
// 404
} elseif (is_404()) {
$breadcrumbs[] = array(
"@type" => "ListItem",
"position" => $position++,
"name" => $texts['not_found'],
"item" => home_url($_SERVER['REQUEST_URI'])
);
}
// Объединяем главную страницу с остальными крошками для JSON-LD
$all_breadcrumbs = array_merge(array($home_breadcrumb), $breadcrumbs);
if (empty($all_breadcrumbs)) {
return false;
}
$yandex_schema = array(
"@context" => "https://schema.org",
"@type" => "BreadcrumbList",
"name" => "Навигация по разделам сайта",
"description" => "Путь навигации к текущей странице",
"areaServed" => array(
"@type" => "Country",
"name" => $current_region
),
"itemListElement" => $all_breadcrumbs
);
?>
<nav class="h-[30px] rounded-[24px] max-w-fit flex items-center bg-[linear-gradient(180deg,_#f2f2f2_69.59%,_#ededed_100%)] dark:bg-none dark:bg-[transparent] px-[12px]"
role="navigation"
aria-label="<?php echo esc_attr($texts['breadcrumb_nav']); ?>"
itemscope
itemtype="https://schema.org/BreadcrumbList"
data-region="<?php echo esc_attr($current_region); ?>">
<span class="absolute !w-[1px] !h-[1px] !p-0 !m-[-1px] overflow-hidden !clip-[rect(0,0,0,0)] !border-0">
<?php echo esc_html($texts['you_are_here']); ?>
</span>
<ol class="[&>li>a]:!no-underline flex items-center gap-[8px] text-[14px] leading-[20px] flex-wrap" role="list">
<!-- Главная -->
<li class="flex items-center"
itemscope
itemprop="itemListElement"
itemtype="https://schema.org/ListItem">
<a href="<?php echo esc_url($home_breadcrumb['item']); ?>"
class="font-[600] text-[14px] leading-[125%] text-[#222] hover:text-[#9d9994] dark:hover:text-[#9d9994] dark:text-[#f8f8f8] flex gap-[6px] items-center"
itemprop="item"
title="<?php echo esc_attr('Перейти на главную страницу'); ?>">
<?php echo $home_icon_svg; ?>
<span itemprop="name"><?php echo esc_html($home_breadcrumb['name']); ?></span>
</a>
<meta itemprop="position" content="<?php echo esc_attr($home_breadcrumb['position']); ?>">
<?php if (!empty($breadcrumbs)): ?>
<span class="select-none ml-[8px] flex items-center" aria-hidden="true">
<?php echo $separator_svg; ?>
</span>
<?php endif; ?>
</li>
<?php foreach ($breadcrumbs as $index => $crumb):
$is_last = ($index === count($breadcrumbs) - 1);
?>
<li class="flex items-center"
itemscope
itemprop="itemListElement"
itemtype="https://schema.org/ListItem">
<?php if (!$is_last): ?>
<a href="<?php echo esc_url($crumb['item']); ?>"
class="hover:text-[#222] text-[#6c6b6b] dark:text-[#6c6b6b] dark:hover:text-[#f8f8f8] transition font-[500] leading-[125%] text-[14px]"
itemprop="item"
title="<?php echo esc_attr('Перейти в раздел: ' . $crumb['name']); ?>">
<span itemprop="name"><?php echo esc_html($crumb['name']); ?></span>
</a>
<?php else: ?>
<span class="text-[#6c6b6b] dark:text-[#6c6b6b] font-[500] leading-[125%] text-[14px]"
itemprop="name"
aria-current="page">
<?php echo esc_html($crumb['name']); ?>
</span>
<?php endif; ?>
<meta itemprop="position" content="<?php echo esc_attr($crumb['position']); ?>">
<?php if (!$is_last): ?>
<span class="select-none ml-[8px] flex items-center"
aria-hidden="true">
<?php echo $separator_svg; ?>
</span>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ol>
</nav>
<script type="application/ld+json">
<?php echo json_encode($yandex_schema, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT); ?>
</script>
<?php
return true;
}
}
if (!function_exists('display_yandex_breadcrumbs')) {
function display_yandex_breadcrumbs()
{
if (is_front_page() || is_home() || is_admin()) {
return;
}
generate_yandex_breadcrumbs();
}
}

View File

@@ -25,9 +25,9 @@ function modal_system_container() {
}
?>
<div id="modal-overlay" class="fixed inset-0 bg-[rgba(0,0,0,0.5)] backdrop-blur-sm z-50 flex items-center justify-center p-4 opacity-0 invisible transition-all duration-300">
<div class="bg-white rounded-lg shadow-2xl max-w-2xl w-full max-h-[90vh] relative transform scale-90 transition-transform duration-300 overflow-hidden">
<button id="modal-close" class="absolute top-4 right-4 z-10 w-8 h-8 flex items-center justify-center rounded-full hover:bg-gray-100 transition-colors text-gray-500 hover:text-gray-700">
<div id="modal-overlay" class="fixed inset-0 bg-[rgba(0,0,0,0.5)] backdrop-blur-sm z-50 flex items-center justify-center p-4 opacity-0 invisible transition-all ">
<div id="modal-container" class="bg-[#f9f9f9] rounded-[20px] w-full max-h-[90vh] relative transform transition-transform overflow-hidden" style="max-width: 970px;">
<button id="modal-close" class="absolute top-4 right-4 z-10 w-8 h-8 flex items-center cursor-pointer justify-center rounded-full hover:bg-gray-100 transition-colors text-black outline-none hover:text-gray-700">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
</svg>

View File

@@ -12,9 +12,13 @@ document.addEventListener('DOMContentLoaded', function() {
if (!this.overlay) return;
this.content = document.getElementById('modal-content');
this.container = this.overlay.querySelector('.bg-white');
this.container = this.content ? this.content.parentElement : null;
this.closeBtn = document.getElementById('modal-close');
if (!this.content || !this.container) {
return;
}
this.bindEvents();
this.initFormHandling();
},
@@ -37,8 +41,16 @@ document.addEventListener('DOMContentLoaded', function() {
if (modalTrigger) {
e.preventDefault();
const modalName = modalTrigger.getAttribute('data-modal');
const cardId = modalTrigger.getAttribute('data-card-id');
this.open(modalName, { cardId });
const params = {};
Array.from(modalTrigger.attributes).forEach(attr => {
if (attr.name.startsWith('data-') && attr.name !== 'data-modal') {
const key = attr.name.replace('data-', '').replace(/-([a-z])/g, (g) => g[1].toUpperCase());
params[key] = attr.value;
}
});
this.open(modalName, params);
}
});
@@ -51,46 +63,59 @@ document.addEventListener('DOMContentLoaded', function() {
},
initFormHandling() {
console.log('Form handling initialized');
document.addEventListener('fluentform_submission_success', (e) => {
const form = e.target.closest('.ff-el-form-wrapper form');
if (form) {
setTimeout(() => {
if (this.isOpen()) {
this.replace('form-success');
} else {
this.open('form-success');
}
const thankYouUrl = this.getLocalizedUrl('/thank-you');
window.location.href = thankYouUrl;
}, 300);
}
}, true);
if (typeof jQuery !== 'undefined') {
jQuery(document).ajaxSuccess((event, xhr, settings) => {
if (settings.url && settings.url.includes('admin-ajax.php') &&
settings.data && settings.data.includes('fluentform_submit')) {
try {
const response = JSON.parse(xhr.responseText);
console.log('Response:', response);
if (response.success && response.data && response.data.insert_id) {
setTimeout(() => {
if (this.isOpen()) {
this.replace('form-success');
} else {
this.open('form-success');
}
const thankYouUrl = this.getLocalizedUrl('/thank-you');
window.location.href = thankYouUrl;
}, 300);
}
} catch (e) {
}
}
});
} else {
}
},
getLocalizedUrl(path) {
const htmlLang = document.documentElement.lang;
const currentLang = window.pll_current_language || this.getCurrentLangFromUrl();
if (currentLang) {
return `/${currentLang}${path}`;
}
return path;
},
getCurrentLangFromUrl() {
const currentPath = window.location.pathname;
const languageCodes = ['gym'];
const pathParts = currentPath.split('/').filter(part => part.length > 0);
return pathParts.length > 0 && languageCodes.includes(pathParts[0]) ? pathParts[0] : null;
},
getCurrentBranch() {
const isGymPage = window.location.pathname.includes('/gym/');
return isGymPage ? 'gym' : 'main';
},
open(modalName, params = {}) {
const template = document.getElementById(`modal-template-${modalName}`);
if (!template) return;
@@ -130,26 +155,147 @@ document.addEventListener('DOMContentLoaded', function() {
},
injectParams(params) {
if (params.cardId) {
setTimeout(() => {
const hiddenInput = this.content.querySelector('input[name="hidden"]');
if (hiddenInput && !hiddenInput.dataset.cardInjected) {
const currentValue = hiddenInput.value || '';
hiddenInput.value = currentValue + ` | Карта ID: ${params.cardId}`;
hiddenInput.dataset.cardInjected = 'true';
if (params.cardTitle) {
const titleElements = this.content.querySelectorAll('[data-inject="card-title"]');
titleElements.forEach(el => {
el.textContent = params.cardTitle;
});
}
const attrElements = this.content.querySelectorAll('[data-inject="card-attr"]');
attrElements.forEach(el => {
const parentDiv = el.closest('div');
if (params.cardAttr && params.cardAttr.trim() !== '') {
el.textContent = params.cardAttr;
if (parentDiv) {
parentDiv.style.display = 'flex';
}
}, 100);
} else {
if (parentDiv) {
parentDiv.style.display = 'none';
}
}
});
if (params.cardTime) {
this.fillTimeInfo(JSON.parse(params.cardTime));
}
if (params.cardPrices) {
this.fillPrices(JSON.parse(params.cardPrices), params.cardTitle, params.cardId);
}
},
show() {
this.overlay.classList.remove('opacity-0', 'invisible');
this.overlay.classList.add('opacity-100', 'visible');
fillTimeInfo(timeSlots) {
if (!timeSlots.length) return;
const firstSlot = timeSlots[0];
if (firstSlot.normal_days) {
const normalDaysEl = this.content.querySelector('[data-inject="normal-days"]');
if (normalDaysEl) normalDaysEl.textContent = firstSlot.normal_days;
}
if (firstSlot.vacation_days) {
const vacationDaysEl = this.content.querySelector('[data-inject="vacation-days"]');
if (vacationDaysEl) vacationDaysEl.textContent = firstSlot.vacation_days;
}
},
fillPrices(prices, cardTitle, cardId) {
const priceOptions = this.content.querySelectorAll('.price-option');
let firstAvailableOption = null;
let firstAvailablePeriod = null;
let firstAvailablePrice = null;
priceOptions.forEach(option => {
const period = option.dataset.period;
const price = prices[period];
if (!price || !price.full || !price.day) {
option.classList.add('hidden');
return;
}
option.classList.remove('hidden');
const fullElements = option.querySelectorAll(`[data-inject="price-${period.replace('_', '-')}-full"]`);
const dayElements = option.querySelectorAll(`[data-inject="price-${period.replace('_', '-')}-day"]`);
fullElements.forEach(el => el.textContent = price.full);
dayElements.forEach(el => el.textContent = price.day);
if (!firstAvailableOption) {
firstAvailableOption = option;
firstAvailablePeriod = period;
firstAvailablePrice = price;
}
option.addEventListener('click', () => {
this.selectPrice(option, period, price, cardTitle, cardId);
});
});
if (firstAvailableOption) {
this.selectPrice(firstAvailableOption, firstAvailablePeriod, firstAvailablePrice, cardTitle, cardId);
} else {
const priceContainer = this.content.querySelector('#price-options');
if (priceContainer) {
priceContainer.innerHTML = '<p class="text-center text-gray-500">Цены временно недоступны</p>';
}
}
},
selectPrice(selectedOption, period, price, cardTitle, cardId) {
this.content.querySelectorAll('.price-option').forEach(option => {
option.classList.remove('bg-[linear-gradient(90deg,_#2b2c35_39.42%,_#6e7996_92.9%)]', '[&_div]:text-[#f8f8f8]', '[&_p]:text-[#bcbcc0]');
option.classList.add('bg-[linear-gradient(180deg,_#f2f2f2_69.59%,_#ededed_100%)]', '[&_div]:text-[#222]', '[&_p]:text-[#6c6b6b]');
});
selectedOption.classList.remove('bg-[linear-gradient(180deg,_#f2f2f2_69.59%,_#ededed_100%)]', '[&_div]:text-[#222]', '[&_p]:text-[#6c6b6b]');
selectedOption.classList.add('bg-[linear-gradient(90deg,_#2b2c35_39.42%,_#6e7996_92.9%)]', '[&_div]:text-[#f8f8f8]', '[&_p]:text-[#bcbcc0]');
const periodNames = {
'1_month': '1 месяц',
'3_month': '3 месяца',
'6_month': '6 месяцев',
'12_month': '12 месяцев'
};
const selectedPeriodEl = this.content.querySelector('#selected-period');
const selectedFullPriceEl = this.content.querySelector('#selected-full-price');
const selectedDayPriceEl = this.content.querySelector('#selected-day-price');
if (selectedPeriodEl) selectedPeriodEl.textContent = periodNames[period];
if (selectedFullPriceEl) selectedFullPriceEl.textContent = price.full;
if (selectedDayPriceEl) selectedDayPriceEl.textContent = price.day;
setTimeout(() => {
this.container.classList.remove('scale-90');
this.container.classList.add('scale-100');
}, 10);
const hiddenInput = this.content.querySelector('input[name="hidden"]');
if (hiddenInput) {
const formWrapper = this.content.querySelector('.form-block-wrapper');
const baseValue = formWrapper ? formWrapper.dataset.hiddenValue : '';
const normalDays = this.content.querySelector('[data-inject="normal-days"]')?.textContent || '';
const vacationDays = this.content.querySelector('[data-inject="vacation-days"]')?.textContent || '';
const daysInfo = normalDays || vacationDays ? ` | Дни: обычные ${normalDays}, выходные ${vacationDays}` : '';
const tariffInfo = `Карта: ${cardTitle} | Тариф: ${periodNames[period]} | Цена: ${price.full} ₽ (${price.day} ₽/день)${daysInfo} | ID карты: ${cardId}`;
hiddenInput.value = `${baseValue} | ${tariffInfo}`;
}
}, 100);
},
camelToKebab(str) {
return str.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();
},
show() {
if (!this.overlay || !this.container) return;
this.overlay.classList.remove('opacity-0', 'invisible');
this.overlay.classList.add('opacity-100', 'visible');
setTimeout(() => {
if (this.closeBtn) this.closeBtn.focus();
@@ -159,6 +305,13 @@ document.addEventListener('DOMContentLoaded', function() {
close() {
if (this.modalStack.length === 0) return;
const currentModal = this.modalStack[this.modalStack.length - 1];
if (currentModal.name === 'welcome-branch') {
const currentBranch = this.getCurrentBranch();
localStorage.setItem('branch_choice_made', currentBranch);
}
this.modalStack.pop();
if (this.modalStack.length > 0) {
@@ -171,8 +324,7 @@ document.addEventListener('DOMContentLoaded', function() {
},
hide() {
this.container.classList.remove('scale-100');
this.container.classList.add('scale-90');
if (!this.container || !this.overlay) return;
this.overlay.classList.remove('opacity-100', 'visible');
this.overlay.classList.add('opacity-0', 'invisible');
@@ -186,4 +338,71 @@ document.addEventListener('DOMContentLoaded', function() {
};
ModalSystem.init();
function checkWelcomeModal() {
const isHomePage = window.location.pathname === '/' || window.location.pathname === '';
const isGymPage = window.location.pathname.includes('/gym/');
const hasChoiceMade = localStorage.getItem('branch_choice_made');
if ((isHomePage || isGymPage) && !hasChoiceMade) {
setTimeout(function() {
ModalSystem.open('welcome-branch');
}, 1000);
}
}
document.addEventListener('click', function(e) {
if (e.target.closest('.branch-card')) {
e.preventDefault();
const branchCard = e.target.closest('.branch-card');
const branch = branchCard.dataset.branch;
if (!branch) return;
localStorage.setItem('branch_choice_made', branch);
branchCard.classList.add('selecting');
const button = branchCard.querySelector('button');
if (button) {
button.querySelector('span').textContent = 'Переходим...';
}
setTimeout(function() {
const isHomePage = window.location.pathname === '/' || window.location.pathname === '';
const isGymPage = window.location.pathname.includes('/gym/');
if (branch === 'gym') {
if (isGymPage) {
ModalSystem.close();
} else {
window.location.href = '/gym/';
}
} else {
if (isHomePage) {
ModalSystem.close();
} else {
window.location.href = '/';
}
}
}, 500);
}
});
document.addEventListener('click', function(e) {
const branchCard = e.target.closest('.branch-card');
if (branchCard && !e.target.closest('.select-branch-btn')) {
document.querySelectorAll('.branch-card').forEach(function(card) {
card.classList.remove('selected');
});
branchCard.classList.add('selected');
}
});
checkWelcomeModal();
window.resetBranchChoice = function() {
localStorage.removeItem('branch_choice_made');
};
});

View File

@@ -2,14 +2,19 @@
/**
* Переключает язык (регионы) необходим плагин Polylang
*
* Поддерживает множественные вызовы на одной странице
* Исправлена проблема с архивами кастомных типов записей
*/
// Проверяем существование функций Polylang
if (!function_exists('pll_languages_list') || !function_exists('pll_current_language')) {
return;
}
static $instance_counter = 0;
$instance_counter++;
$unique_id = 'plLangSwitcher' . $instance_counter;
?>
<style>
@@ -19,10 +24,21 @@ if (!function_exists('pll_languages_list') || !function_exists('pll_current_lang
border: 1px solid #e0e0e0;
border-radius: 90px;
padding: 6px;
--pl-slider-width: 0px;
--pl-slider-x: 0px;
gap: 4px;
}
@media (max-width: 767px) {
.pl-lang-switcher-container {
width: 100%;
}
}
.dark .pl-lang-switcher-container {
border: 1px solid rgba(248, 248, 248, 0.05);
backdrop-filter: blur(20px);
background: linear-gradient(90deg, rgba(248, 248, 248, 0.04) 65.8%, rgba(255, 255, 255, 0.12) 100%);
background-position: -1px 0;
background-size: 101%;
}
.pl-lang-switcher-button,
.pl-lang-switcher-container a {
@@ -33,7 +49,7 @@ if (!function_exists('pll_languages_list') || !function_exists('pll_current_lang
color: #636363;
font-weight: 600;
font-size: 15px;
line-height: 110%;
line-height: 40%;
text-align: center;
border-radius: 90px;
cursor: pointer;
@@ -48,31 +64,46 @@ if (!function_exists('pll_languages_list') || !function_exists('pll_current_lang
padding-right: 12px;
}
.pl-lang-switcher-button:hover,
.pl-lang-switcher-container a:hover {
color: #222;
@media (max-width: 767px) {
.pl-lang-switcher-button,
.pl-lang-switcher-container a{
flex-grow: 1;
}
}
.dark .pl-lang-switcher-button,
.dark .pl-lang-switcher-container a {
color: #b9b7b9;
}
.pl-lang-switcher-button.pl-lang-switcher-active,
.pl-lang-switcher-container a.pl-lang-switcher-active,
.pl-lang-switcher-container a.pl-lang-switcher-current {
color: #f8f8f8;
}
.dark a.pl-lang-switcher-current {
color: #303030;
}
.pl-lang-switcher-slider {
position: absolute;
height: 29px;
background: linear-gradient(90deg, #2b2c35 67.31%, #4f5870 92.9%);
border-radius: 90px;
z-index: 1;
width: var(--pl-slider-width);
transform: translateX(var(--pl-slider-x));
transition: all 180ms cubic-bezier(0.4, 0.0, 0.2, 1);
}
.dark .pl-lang-switcher-slider {
background: #faf8f5;
}
</style>
<div class="pl-lang-switcher-container" id="plLangSwitcherContainer">
<div class="pl-lang-switcher-slider" id="plLangSwitcherSlider"></div>
<div class="pl-lang-switcher-container" data-switcher-id="<?php echo $unique_id; ?>">
<div class="pl-lang-switcher-slider"></div>
<?php
$languages = pll_languages_list();
$current_lang = pll_current_language('slug');
@@ -83,11 +114,41 @@ if (!function_exists('pll_languages_list') || !function_exists('pll_current_lang
$class = $is_current ? 'pl-lang-switcher-current' : '';
$lang_url = '';
if (function_exists('pll_home_url')) {
if (is_singular() && function_exists('pll_get_post')) {
$translated_post_id = pll_get_post(get_the_ID(), $lang_slug);
if ($translated_post_id) {
$lang_url = get_permalink($translated_post_id);
if (is_singular() && function_exists('pll_get_post')) {
$translated_post_id = pll_get_post(get_the_ID(), $lang_slug);
if ($translated_post_id) {
$lang_url = get_permalink($translated_post_id);
} else {
$lang_url = pll_home_url($lang_slug);
}
}
elseif (is_post_type_archive()) {
$post_type = get_post_type();
if ($post_type && function_exists('pll_get_post_type_archive_link')) {
$lang_url = pll_get_post_type_archive_link($post_type, $lang_slug);
}
if (empty($lang_url)) {
$archive_link = get_post_type_archive_link($post_type);
if ($archive_link) {
$lang_url = str_replace(home_url(), pll_home_url($lang_slug), $archive_link);
} else {
$lang_url = pll_home_url($lang_slug);
}
}
}
elseif (is_tax() || is_category() || is_tag()) {
$queried_object = get_queried_object();
if ($queried_object && function_exists('pll_get_term')) {
$translated_term = pll_get_term($queried_object->term_id, $lang_slug);
if ($translated_term) {
$lang_url = get_term_link($translated_term);
} else {
$lang_url = pll_home_url($lang_slug);
}
@@ -96,6 +157,39 @@ if (!function_exists('pll_languages_list') || !function_exists('pll_current_lang
}
}
elseif (is_archive()) {
if (is_author()) {
$author = get_queried_object();
if ($author) {
$author_posts_url = get_author_posts_url($author->ID);
$lang_url = str_replace(home_url(), pll_home_url($lang_slug), $author_posts_url);
} else {
$lang_url = pll_home_url($lang_slug);
}
}
elseif (is_date()) {
$current_url = home_url(add_query_arg(array(), $wp->request));
$lang_url = str_replace(home_url(), pll_home_url($lang_slug), $current_url);
}
else {
$lang_url = pll_home_url($lang_slug);
}
}
else {
if (function_exists('pll_home_url')) {
$lang_url = pll_home_url($lang_slug);
}
}
if (empty($lang_url)) {
$lang_url = pll_home_url($lang_slug);
}
$lang_name = '';
if (function_exists('pll_languages_list')) {
$lang_names = pll_languages_list(array('fields' => 'name'));
@@ -110,12 +204,24 @@ if (!function_exists('pll_languages_list') || !function_exists('pll_current_lang
$lang_name = strtoupper($lang_slug);
}
// Замена названий языков на кастомные
$custom_lang_names = array(
'Fakel Fitness' => 'Фитнес-центр',
'Fakel Gym' => 'Зал силовых'
);
if (isset($custom_lang_names[$lang_name])) {
$display_name = $custom_lang_names[$lang_name];
} else {
$display_name = $lang_name;
}
echo sprintf(
'<a href="%s" class="%s" data-lang="%s">%s</a>',
esc_url($lang_url),
esc_attr($class),
esc_attr($lang_slug),
esc_html($lang_name)
esc_html($display_name)
);
}
}
@@ -123,10 +229,15 @@ if (!function_exists('pll_languages_list') || !function_exists('pll_current_lang
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
const container = document.getElementById('plLangSwitcherContainer');
if (!container) return;
document.addEventListener('DOMContentLoaded', function () {
const containers = document.querySelectorAll('.pl-lang-switcher-container[data-switcher-id="<?php echo $unique_id; ?>"]');
containers.forEach(function(container) {
initLanguageSwitcher(container);
});
});
function initLanguageSwitcher(container) {
let isInitialized = false;
function updateSliderPosition(target = null, animate = false) {
@@ -135,7 +246,7 @@ if (!function_exists('pll_languages_list') || !function_exists('pll_current_lang
}
if (!target) return;
const slider = container.querySelector('#plLangSwitcherSlider');
const slider = container.querySelector('.pl-lang-switcher-slider');
const width = target.offsetWidth;
const x = target.offsetLeft - 6;
@@ -145,8 +256,8 @@ if (!function_exists('pll_languages_list') || !function_exists('pll_current_lang
slider.style.transition = 'none';
}
container.style.setProperty('--pl-slider-width', width + 'px');
container.style.setProperty('--pl-slider-x', x + 'px');
slider.style.width = width + 'px';
slider.style.transform = 'translateX(' + x + 'px)';
}
function initialize() {
@@ -180,14 +291,13 @@ if (!function_exists('pll_languages_list') || !function_exists('pll_current_lang
}
function setupClickHandlers() {
container.addEventListener('click', function(e) {
container.addEventListener('click', function (e) {
const link = e.target.closest('a');
if (!link) return;
e.preventDefault();
container.querySelectorAll('a').forEach(a => a.classList.remove('pl-lang-switcher-current'));
link.classList.add('pl-lang-switcher-current');
updateSliderPosition(link, true);
@@ -197,5 +307,5 @@ if (!function_exists('pll_languages_list') || !function_exists('pll_current_lang
}
initialize();
});
}
</script>

View File

@@ -1,22 +1,101 @@
<?php
$form_id = '4';
$form_title = 'Заявка на клубную карту';
$current_url = home_url($_SERVER['REQUEST_URI']);
$page_title = get_the_title() ?: 'Главная страница';
$hidden_value = "Форма: {$form_title} | Страница: {$page_title} | URL: {$current_url}";
$hidden_value = "Страница: {$page_title} | URL: {$current_url}";
?>
<div class="p-[30px] max-[768px]:p-[20px]">
<h3 class="text-[24px] max-[768px]:text-[20px] font-bold text-[#1f2937] mb-[24px] text-center">
<?php echo esc_html($form_title); ?>
</h3>
<div class="max-[1050px]:p-[24px] p-[40px]">
<div class="max-[768px]:gap-[6px] max-[768px]:items-start max-[768px]:justify-start max-[768px]:flex-col-reverse flex items-center gap-[24px]">
<h3 class="max-[1050px]:text-[30px] max-[768px]:text-[24px] font-[500] text-[40px] leading-[120%] text-[#222]">
Оформить карту “<span class="font-[700]" data-inject="card-title">не выбрана</span>”
</h3>
<div class="px-[12px] py-[4px] rounded-[32px] bg-[linear-gradient(90deg,_#ffd65a_39.42%,_#ffe595_92.9%)]">
<span data-inject="card-attr" class="font-[600] text-[14px] leading-[125%]">
-
</span>
<div class="form-block-wrapper"
data-form-id="<?php echo esc_attr($form_id); ?>"
data-hidden-value="<?php echo esc_attr($hidden_value); ?>">
<?php echo do_shortcode('[fluentform id="' . esc_attr($form_id) . '"]'); ?>
</div>
</div>
<div class="bg-[#fff] max-w-fit px-[20px] max-[768px]:px-[14px] rounded-[8px] py-[8px] flex items-center max-[1050px]:mt-[16px] mt-[32px] gap-[24px]"
id="card-time-info">
<h4 class="max-[768px]:hidden max-[1050px]:text-[14px] font-[600] text-[24px] leading-[125%] text-[#222] ">Время
посещений</h4>
<svg class="max-[768px]:hidden" width="2" height="50" viewBox="0 0 2 50" fill="none"
xmlns="http://www.w3.org/2000/svg">
<rect x="0.5" width="1" height="50" fill="#E0E0E0"/>
</svg>
<div class="flex flex-col gap-[4px] font-[500] text-[16px] leading-[145%] text-[#222]">
<span>Будние дни: <strong data-inject="normal-days">-</strong></span>
<span class="inline-flex flex-wrap">Выходные и праздничные дни: <strong
data-inject="vacation-days">-</strong></span>
</div>
</div>
<div class="max-[1050px]:mt-[16px] mt-[32px]">
<div id="price-options"
class="max-[1050px]:justify-start max-[1050px]:gap-[8px] flex overflow-x-auto overflow-y-hidden gap-[6px]">
<div class=" max-[1050px]:min-w-[120px] max-[1050px]:h-[83px] price-option [&_div]:text-[#f8f8f8] [&_p]:text-[#bcbcc0] w-full max-w-[213px] h-[147px] rounded-[12px] flex items-center justify-center flex-col cursor-pointer bg-[linear-gradient(180deg,_#f2f2f2_69.59%,_#ededed_100%)]"
data-period="1_month">
<div class="text-center flex flex-col gap-[6px]">
<div class="max-[1050px]:text-[14px] font-[600] text-[24px] leading-[125%]">1 месяц</div>
<div class="max-[1050px]:text-[20px] font-[700] text-[32px] leading-[115%]">
<span data-inject="price-1-month-full">-</span> ₽
</div>
<p class="max-[1050px]:text-[14px] font-[500] text-[20px] leading-[140%]">
<span data-inject="price-1-month-day">-</span> ₽ в день
</p>
</div>
</div>
<div class=" max-[1050px]:min-w-[120px] max-[1050px]:h-[83px] price-option [&_div]:text-[#f8f8f8] [&_p]:text-[#bcbcc0] w-full max-w-[213px] h-[147px] rounded-[12px] flex items-center justify-center flex-col cursor-pointer bg-[linear-gradient(180deg,_#f2f2f2_69.59%,_#ededed_100%)]"
data-period="3_month">
<div class="text-center flex flex-col gap-[6px]">
<div class="max-[1050px]:text-[14px] font-[600] text-[24px] leading-[125%]">3 месяца</div>
<div class="max-[1050px]:text-[20px] font-[700] text-[32px] leading-[115%]">
<span data-inject="price-3-month-full">-</span> ₽
</div>
<p class="max-[1050px]:text-[14px] font-[500] text-[20px] leading-[140%]">
<span data-inject="price-3-month-day">-</span> ₽ в день
</p>
</div>
</div>
<div class=" max-[1050px]:min-w-[120px] max-[1050px]:h-[83px] price-option [&_div]:text-[#f8f8f8] [&_p]:text-[#bcbcc0] w-full max-w-[213px] h-[147px] rounded-[12px] flex items-center justify-center flex-col cursor-pointer bg-[linear-gradient(180deg,_#f2f2f2_69.59%,_#ededed_100%)]"
data-period="6_month">
<div class="text-center flex flex-col gap-[6px]">
<div class="max-[1050px]:text-[14px] font-[600] text-[24px] leading-[125%]">6 месяцев</div>
<div class="max-[1050px]:text-[20px] font-[700] text-[32px] leading-[115%]">
<span data-inject="price-6-month-full">-</span> ₽
</div>
<p class="max-[1050px]:text-[14px] font-[500] text-[20px] leading-[140%]">
<span data-inject="price-6-month-day">-</span> ₽ в день
</p>
</div>
</div>
<div class=" max-[1050px]:min-w-[120px] max-[1050px]:h-[83px] price-option [&_div]:text-[#f8f8f8] [&_p]:text-[#bcbcc0] w-full max-w-[213px] h-[147px] rounded-[12px] flex items-center justify-center flex-col cursor-pointer bg-[linear-gradient(180deg,_#f2f2f2_69.59%,_#ededed_100%)]"
data-period="12_month">
<div class="text-center flex flex-col gap-[6px]">
<div class="max-[1050px]:text-[14px] font-[600] text-[24px] leading-[125%]">12 месяцев</div>
<div class="max-[1050px]:text-[20px] font-[700] text-[32px] leading-[115%]">
<span data-inject="price-12-month-full">-</span> ₽
</div>
<p class="max-[1050px]:text-[14px] font-[500] text-[20px] leading-[140%]">
<span data-inject="price-12-month-day">-</span> ₽ в день
</p>
</div>
</div>
</div>
<!-- Выбранный тариф -->
<div class="max-[1050px]:mt-[16px] mt-[32px] max-[1050px]:text-[14px] font-[500] text-[20px] leading-[140%]">
Выбрано: “<span data-inject="card-title">-</span>” на <span id="selected-period">-</span>
</div>
<div class="form-block-wrapper max-[1050px]:mt-[16px] mt-[32px]"
data-form-id="4"
data-hidden-value="<?php echo esc_attr($hidden_value); ?>">
<?php echo do_shortcode('[fluentform id="4"]'); ?>
</div>
</div>
</div>

View File

@@ -0,0 +1,16 @@
<?php
$current_url = home_url($_SERVER['REQUEST_URI']);
$page_title = get_the_title() ?: 'Главная страница';
$hidden_value = "Страница: {$page_title} | URL: {$current_url}";
?>
<div class="max-[1050px]:p-[24px] p-[40px]">
<p class="font-[700] text-[24px] leading-[125%] text-center">Пробная персональная тренировка <span
class="text-[#E21E24]">за 1200₽</span></p>
<p class="font-[500] text-[16px] leading-[145%] text-center mt-[12px]">Познакомимся, покажем зал и подберём
оптимальные для вас тренировки!</p>
<div class="form-block-wrapper max-[1050px]:mt-[16px] mt-[32px]"
data-hidden-value="<?php echo esc_attr($hidden_value); ?>">
<?php echo do_shortcode('[fluentform id="5"]'); ?>
</div>
</div>

View File

@@ -1,13 +1,4 @@
<?php
?>
<div class="bg-white max-w-lg w-full">
<div class="p-6">
<h2 class="text-xl font-bold text-gray-900 mb-4">Расписание</h2>
<div class="flex justify-end mt-6">
<button data-modal-close class="border w-full">
Понятно
</button>
</div>
</div>
</div>
<div id="mf_schedule_widget_cont_au1"></div>

View File

@@ -0,0 +1,121 @@
<?php
/**
* Шаблон приветственной модалки для выбора зала
*/
?>
<?php
$gymBg = get_template_directory_uri() . '/assets/images/welcom-dark.png';
$fitnessBg = get_template_directory_uri() . '/assets/images/welcom-light.png';
?>
<div>
<div class="max-[768px]:p-[20px] bg-[#e21e24] flex flex-col items-center justify-center py-[32px] px-[20px] gap-[16px]">
<svg width="100" height="16" viewBox="0 0 100 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2384_13059)">
<path d="M57.5345 15.9665C57.5345 15.9665 57.6027 15.7648 57.7731 15.395C57.9436 14.9917 58.1481 14.4875 58.3868 13.8488C58.6595 13.2102 58.9322 12.5043 59.2731 11.6976C59.614 10.8909 59.955 10.0506 60.2958 9.21018C60.6367 8.36986 60.9777 7.52954 61.3186 6.72281C61.6595 5.91609 61.9322 5.21021 62.205 4.57155C62.4777 3.9329 62.6822 3.4287 62.8527 3.02534C63.0231 2.62198 63.0913 2.45391 63.0913 2.45391C63.3981 1.78165 63.8754 1.27744 64.489 0.874086C65.1027 0.470723 65.7845 0.302656 66.5004 0.302656H81.0572L80.1368 2.48752C79.8299 3.19341 79.3868 3.76483 78.7391 4.1682C78.0913 4.60517 77.3754 4.80685 76.6254 4.80685H67.5572C67.1481 4.80685 66.8413 5.00853 66.6709 5.37828L66.2959 6.28584H74.0345L72.9436 8.90771C72.8073 9.24385 72.6027 9.51273 72.2959 9.71443C71.9891 9.91605 71.6823 10.0169 71.3072 10.0169H65.3754C64.9663 10.0169 64.6595 10.2186 64.489 10.5883L64.1141 11.4959H76.3527L75.4664 13.6471C75.1595 14.353 74.7163 14.9244 74.0686 15.3614C73.4209 15.7984 72.705 16.0001 71.9549 16.0001H57.5345V15.9665ZM45.6368 1.34467C45.7731 1.00854 45.9777 0.773243 46.2504 0.571563C46.5231 0.369883 46.864 0.269043 47.2049 0.269043H50.9208L48.4663 6.28584L48.5004 6.31945L54.5686 0.672403C54.8754 0.403496 55.1822 0.269043 55.5572 0.269043H61.5572L51.8413 9.34462C51.8754 9.41188 52.08 9.68076 52.4549 10.185C52.5913 10.3866 52.7959 10.6556 53.0345 10.9917C53.2731 11.2942 53.5458 11.6976 53.8867 12.1682C54.2277 12.6388 54.6026 13.1765 55.0799 13.8152C55.5231 14.4539 56.0686 15.1597 56.6481 16.0001H51.1595L46.8981 10.0842L44.9549 14.8573C44.8186 15.1934 44.614 15.4623 44.3072 15.664C44.0004 15.8656 43.6936 15.9665 43.3186 15.9665H39.6027L45.6368 1.34467ZM35.989 6.28584C36.1935 6.28584 36.364 6.185 36.4322 5.98332L36.9094 4.80685H29.9208C29.7163 4.80685 29.5458 4.90769 29.4777 5.10937L29.0004 6.28584H35.989ZM20.1367 15.9665L25.6594 2.58837C25.9663 1.88248 26.4095 1.31106 27.0231 0.907701C27.6368 0.504336 28.3527 0.269043 29.1367 0.269043H43.6595L38.1709 13.58C37.864 14.2858 37.4208 14.8573 36.7731 15.2943C36.1254 15.7312 35.4095 15.9329 34.6594 15.9329H32.3413L34.7959 9.94972H27.4663L25.4208 14.8573C25.2845 15.1934 25.08 15.4287 24.7731 15.6303C24.4663 15.832 24.1595 15.9329 23.7845 15.9329H20.1367V15.9665Z"
fill="white"/>
<path d="M5.13645 5.71449L6.39782 2.62206C6.70464 1.91617 7.14782 1.34475 7.79555 0.941391C8.44327 0.504414 9.15921 0.302734 9.90918 0.302734H12.2274L10.4546 4.60525L8.20464 10.1178C8.13646 10.2523 8.06827 10.3867 8.00009 10.5212L6.73873 13.6136C6.43191 14.3195 5.98873 14.8909 5.341 15.3279C4.69327 15.7649 3.97736 15.9665 3.22736 15.9665H0.90918L2.6819 11.664L4.9319 6.15146C5.00009 5.9834 5.06827 5.84894 5.13645 5.71449Z"
fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd"
d="M24.4319 0C21.6024 7.19326 15.466 3.36134 10.6592 5.10923C12.0569 1.07563 14.5796 0.336134 17.4092 0.30252C19.5228 0.268907 22.4888 0.504201 24.4319 0Z"
fill="white"/>
<path d="M99.0909 0.336348L93.6366 13.6136C93.3297 14.3195 92.8863 14.8909 92.2387 15.3279C91.5912 15.7649 90.8754 15.9666 90.125 15.9666H87.8072L92.3753 4.84054H91.6932C91.3863 4.84054 91.0794 4.90777 90.7733 5.04222C90.4664 5.17667 90.2278 5.37836 90.023 5.61365L81.3977 15.9666H75.5684L87.2954 1.7145C87.6369 1.27752 88.0795 0.941386 88.5913 0.672482C89.1023 0.437187 89.6478 0.302734 90.2278 0.302734H99.0909V0.336348Z"
fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd"
d="M19.6249 5.21045C17.4431 10.723 12.7726 7.66422 9.09082 9.00872C10.9999 3.49616 15.3636 6.31969 19.6249 5.21045Z"
fill="white"/>
</g>
<defs>
<clipPath id="clip0_2384_13059">
<rect width="98.1818" height="16" fill="white" transform="translate(0.90918)"/>
</clipPath>
</defs>
</svg>
<h2 class="max-[768px]:text-[20px] text-center w-full max-w-[450px] font-[600] text-[32px] leading-[115%] text-[#fff]">
Какой из залов вас интересует?
</h2>
</div>
<div class="grid grid-cols-2 max-[768px]:grid-cols-1">
<div class="bg-cover bg-center cursor-pointer flex items-center justify-center h-[453px] max-[768px]:h-[352px] w-full branch-card group cursor-pointer transition-all"
style=background-image:url("<?php echo $gymBg ?>"
data-branch="gym">
<div class="max-[768px]:px-[12px] w-full max-w-[365px] flex flex-col gap-[27px] max-[768px]:gap-[16px] items-center justify-center">
<div class="flex flex-col gap-[27px] max-[768px]:gap-[16px] items-center justify-center">
<?php display_icon('dark_logo_name'); ?>
<h3 class="text-[24px] font-[600] leading-[125%] text-[#fff]">
Зал силовых
</h3>
<p class="max-[768px]:text-[14px] text-center text-[16px] leading-[145%] text-[#fff]">
Пространство для работы с весами и тренажерами в цоколе, без лишнего.
Идеально, если вам нужен лишь тренажерный зал.
</p>
<p class="max-[768px]:text-[16px] font-[600] text-[20px] leading-[115%] text-[#fff]">от 3 190₽/мес.</p>
</div>
<button class="max-[768px]:text-[16px] max-[768px]:h-[59px] cursor-pointer max-w-[290px] !no-underline transition red-gradient-hover gap-[12px] w-full rounded-[90px] flex items-center justify-center h-[75px]">
<span class="font-[600] text-[18px] leading-[195%] text-[#f8f8f8]">Зал силовых тренировок</span>
<svg width="35" height="35" viewBox="0 0 35 35" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 17.5C0 7.83502 7.83502 0 17.5 0C27.165 0 35 7.83502 35 17.5C35 27.165 27.165 35 17.5 35C7.83502 35 0 27.165 0 17.5Z"
fill="url(#paint0_linear_4064_4274)"></path>
<path d="M22.3612 11.7656C22.8445 11.7656 23.2366 12.1578 23.2366 12.641V20.5156C23.2366 20.9989 22.8445 21.391 22.3612 21.391C21.878 21.391 21.4858 20.9989 21.4858 20.5156V14.7544L13.258 22.9823C12.9163 23.324 12.3617 23.324 12.02 22.9823C11.6782 22.6406 11.6782 22.0859 12.02 21.7442L20.2478 13.5164H14.4866C14.0033 13.5164 13.6112 13.1243 13.6112 12.641C13.6112 12.1578 14.0033 11.7656 14.4866 11.7656H22.3612Z"
fill="#F8F8F8"></path>
<defs>
<linearGradient id="paint0_linear_4064_4274" x1="0" y1="17.5" x2="35" y2="17.5"
gradientUnits="userSpaceOnUse">
<stop offset="0.443137" stop-color="#F8F8F8" stop-opacity="0.34"></stop>
<stop offset="0.929023" stop-color="white" stop-opacity="0.72"></stop>
</linearGradient>
</defs>
</svg>
</button>
</div>
</div>
<div class="bg-cover bg-center cursor-pointer flex items-center justify-center h-[453px] max-[768px]:h-[352px] w-full branch-card group cursor-pointer transition-all"
style=background-image:url("<?php echo $fitnessBg ?>"
data-branch="fitness">
<div class="max-[768px]:px-[12px] w-full max-w-[365px] flex flex-col gap-[27px] max-[768px]:gap-[16px] items-center justify-center">
<div class="flex flex-col gap-[27px] max-[768px]:gap-[16px] items-center justify-center">
<?php display_icon('light_logo_name'); ?>
<h3 class="text-[24px] font-[600] leading-[125%] text-[#222]">
Комплексный фитнес-центр
</h3>
<p class="max-[768px]:text-[14px] text-center text-[16px] leading-[145%] text-[#222]">
Фитнес-центр с большой кардио-зоной, залами групповых программ, сауной, кафе, зоной релакса
и мн. др.
</p>
<p class="max-[768px]:text-[16px] font-[600] text-[20px] leading-[115%] text-[#222]">от 8 900₽/мес.</p>
</div>
<button class="max-[768px]:text-[16px] max-[768px]:h-[59px] cursor-pointer max-w-[290px] !no-underline transition red-gradient-hover gap-[12px] w-full rounded-[90px] flex items-center justify-center h-[75px]">
<span class="font-[600] text-[18px] leading-[195%] text-[#f8f8f8]"> Фитнес-центр</span>
<svg width="35" height="35" viewBox="0 0 35 35" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 17.5C0 7.83502 7.83502 0 17.5 0C27.165 0 35 7.83502 35 17.5C35 27.165 27.165 35 17.5 35C7.83502 35 0 27.165 0 17.5Z"
fill="url(#paint0_linear_4064_4274)"></path>
<path d="M22.3612 11.7656C22.8445 11.7656 23.2366 12.1578 23.2366 12.641V20.5156C23.2366 20.9989 22.8445 21.391 22.3612 21.391C21.878 21.391 21.4858 20.9989 21.4858 20.5156V14.7544L13.258 22.9823C12.9163 23.324 12.3617 23.324 12.02 22.9823C11.6782 22.6406 11.6782 22.0859 12.02 21.7442L20.2478 13.5164H14.4866C14.0033 13.5164 13.6112 13.1243 13.6112 12.641C13.6112 12.1578 14.0033 11.7656 14.4866 11.7656H22.3612Z"
fill="#F8F8F8"></path>
<defs>
<linearGradient id="paint0_linear_4064_4274" x1="0" y1="17.5" x2="35" y2="17.5"
gradientUnits="userSpaceOnUse">
<stop offset="0.443137" stop-color="#F8F8F8" stop-opacity="0.34"></stop>
<stop offset="0.929023" stop-color="white" stop-opacity="0.72"></stop>
</linearGradient>
</defs>
</svg>
</button>
</div>
</div>
</div>
</div>
<style>
.branch-card.selected {
}
.branch-card.selecting {
}
</style>

View File

@@ -1,8 +1,4 @@
<?php
/**
* Навигационное меню с сео
* По умолчанию названию меню Шапка сайта
*/
$menu = wp_get_nav_menu_object('Шапка сайта');
@@ -11,14 +7,12 @@ if ($menu) {
$current_lang = function_exists('pll_current_language') ? pll_current_language() : null;
if ($menu_items) {
// Чистим заголовок от (переводов)
$clean_title = function($title) {
return trim(preg_replace('/\s*\([^)]*\)/', '', $title));
};
$current_region = 'RU';
// Навигационная схема для Яндекса
$navigation_schema = array(
"@context" => "https://schema.org",
"@type" => "SiteNavigationElement",
@@ -28,13 +22,6 @@ if ($menu) {
"areaServed" => $current_region,
"url" => array()
);
// Хлебные крошки для Яндекса
$breadcrumb_schema = array(
"@context" => "https://schema.org",
"@type" => "BreadcrumbList",
"itemListElement" => array()
);
?>
<nav class="main-navigation primary-navigation h-full"
@@ -47,15 +34,20 @@ if ($menu) {
<p class="screen-reader-text">Главное меню</p>
<ul class="flex items-center h-full gap-[30px] justify-between nav-menu main-menu" role="menubar" aria-label="Главная навигация">
<ul class="max-[1300px]:gap-[16px] max-[1140px]:gap-[8px] max-[1050px]:gap-[16px] flex items-center h-full gap-[30px] justify-between nav-menu main-menu" role="menubar" aria-label="Главная навигация">
<?php
$position = 1;
foreach ($menu_items as $index => $item) {
if ($current_lang === 'gym' && $item->type === 'post_type_archive' && $item->object === 'training') {
continue;
}
if ($item->type === 'taxonomy') {
continue;
}
$url = $item->url;
$title = $clean_title($item->title);
// Polylang
if ($current_lang && $item->object == 'page' && function_exists('pll_get_post')) {
$translated_page_id = pll_get_post($item->object_id, $current_lang);
if ($translated_page_id) {
@@ -67,15 +59,12 @@ if ($menu) {
}
}
// Дата изменения для Яндекса
$last_modified = '';
if ($item->object == 'page') {
$last_modified = get_the_modified_time('c', $item->object_id);
}
// Активный пункт меню
$is_current = false;
$current_classes = '';
$aria_current = '';
if (is_page()) {
@@ -84,13 +73,11 @@ if ($menu) {
if (($current_lang && function_exists('pll_get_post') && pll_get_post($item->object_id, $current_lang) == $post->ID) ||
$item->object_id == $post->ID) {
$is_current = true;
$current_classes = ' current-menu-item active current_page_item';
$aria_current = ' aria-current="page"';
}
}
}
// CSS классы
$css_classes = array(
'menu-item',
'menu-item-' . $item->ID,
@@ -102,14 +89,13 @@ if ($menu) {
if ($is_current) {
$css_classes[] = 'current-menu-item';
$css_classes[] = 'current_page_item';
$css_classes[] = 'active';
$css_classes[] = 'border-b border-b-[2px] !border-b-[#e21e24] dark:!border-b-[#fff]';
}
if (!empty($item->classes)) {
$css_classes = array_merge($css_classes, array_filter($item->classes));
}
// Схема для Яндекса
$page_data = array(
"@type" => "WebPage",
"name" => $title,
@@ -122,18 +108,11 @@ if ($menu) {
}
$navigation_schema['url'][] = $page_data;
$breadcrumb_schema['itemListElement'][] = array(
"@type" => "ListItem",
"position" => $position,
"name" => $title,
"item" => $url
);
?>
<li class="hover:translate-y-[-1px] transition h-full <?php echo esc_attr(implode(' ', $css_classes)); ?>" role="none">
<li class="h-full transition border-b border-b-[2px] border-b-[transparent] hover:border-b-[#e21e24] dark:hover:border-b-[#fff] <?php echo esc_attr(implode(' ', $css_classes)); ?>" role="none">
<a href="<?php echo esc_url($url); ?>"
class="menu-link !no-underline h-full flex items-center"
class="menu-link !no-underline h-full flex items-center"
role="menuitem"
itemprop="url"
tabindex="0"<?php echo $aria_current; ?>
@@ -143,18 +122,19 @@ if ($menu) {
onclick="if(typeof yaCounter !== 'undefined') { yaCounter.reachGoal('menu_click', {item: '<?php echo esc_js($title); ?>'}); }"
<?php if ($item->target): ?>target="<?php echo esc_attr($item->target); ?>"<?php endif; ?>
<?php if ($item->attr_title): ?>title="<?php echo esc_attr($item->attr_title); ?>"<?php endif; ?>>
<span itemprop="name"><?php echo esc_html($title); ?></span>
<span class="translate-y-[2px]" itemprop="name"><?php echo esc_html($title); ?></span>
</a>
</li>
<?php
// Сепаратор
if ($index < count($menu_items) - 1): ?>
<li class="menu-separator" role="none" aria-hidden="true">
<span class="separator"><svg width="7" height="15" viewBox="0 0 7 15" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0.574219 14.4345L5.55022 0.5625H6.92622L1.93422 14.4345H0.574219Z" fill="#E0E0E0"/>
</svg>
</span>
<span class="separator">
<svg width="7" height="15" viewBox="0 0 7 15" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0.574219 14.4345L5.55022 0.5625H6.92622L1.93422 14.4345H0.574219Z"
class="fill-[#E0E0E0] dark:fill-[#F8F8F8] dark:opacity-20" />
</svg>
</span>
</li>
<?php endif;
@@ -164,16 +144,11 @@ if ($menu) {
</nav>
<?php
// Cео
?>
<script type="application/ld+json">
<?php echo json_encode($navigation_schema, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); ?>
</script>
<script type="application/ld+json">
<?php echo json_encode($breadcrumb_schema, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); ?>
</script>
<?php
}
}

View File

@@ -0,0 +1,16 @@
<?php
/*
Template Name: Страница личного кабинета
*/
?>
<?php
get_header(); ?>
<script type="text/javascript" async="async" id="mobifitness_personal_widget_script_ksm" src="//mobifitness.ru/personal-widget/js/code.js" data-div="mf_personal_widget_cont_ksm" data-test="0" data-debug="0" data-domain="mobifitness.ru" data-code="614482" data-version="v6" data-type="personal" data-language="" data-club="1325"></script>
<section class="mx-auto">
<div id="mf_personal_widget_cont_ksm"></div>
<div style="display: none" id="mf_schedule_widget_cont_au1"></div>
</section>
<?php
get_footer();

View File

@@ -0,0 +1,61 @@
<?php
/**
* Template Name: Шаблон страницы спасибо за заявку
*/
get_header();
?>
<section class="max-[768px]:py-[40px] py-[90px]">
<div class="container mx-auto">
<h2 class="max-[1050px]:text-[28px] max-[768px]:text-[24px] font-[500] text-[32px] leading-[115%] text-center">
<strong>Подписывайтесь</strong> на нас:
</h2>
<div class="max-[768px]:mt-[24px] flex gap-[24px] flex-wrap justify-center mt-[40px]">
<?php $vk = get_field('vk'); ?>
<div class=" relative h-[580px] w-[424px] pb-[24px] flex flex-col px-[24px]">
<?php if ($vk) : ?>
<img class="w-full h-full rounded-[12px] object-cover absolute inset-0"
src="<?php echo esc_url($vk['url']); ?>" alt="<?php echo esc_attr($vk['alt']); ?>"/>
<?php endif; ?>
<div class="relative z-[1] mt-auto flex flex-col gap-[24px]">
<a class="!no-underline transition red-gradient-hover gap-[12px] w-full rounded-[90px] flex items-center justify-center h-[75px]" href="https://vk.com/fakelgym" target="_blank">
<span class="font-[600] text-[18px] leading-[195%] text-[#f8f8f8]">Подписаться</span>
<svg width="35" height="35" viewBox="0 0 35 35" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 17.5C0 7.83502 7.83502 0 17.5 0C27.165 0 35 7.83502 35 17.5C35 27.165 27.165 35 17.5 35C7.83502 35 0 27.165 0 17.5Z" fill="url(#paint0_linear_4064_4274)" />
<path d="M22.3612 11.7656C22.8445 11.7656 23.2366 12.1578 23.2366 12.641V20.5156C23.2366 20.9989 22.8445 21.391 22.3612 21.391C21.878 21.391 21.4858 20.9989 21.4858 20.5156V14.7544L13.258 22.9823C12.9163 23.324 12.3617 23.324 12.02 22.9823C11.6782 22.6406 11.6782 22.0859 12.02 21.7442L20.2478 13.5164H14.4866C14.0033 13.5164 13.6112 13.1243 13.6112 12.641C13.6112 12.1578 14.0033 11.7656 14.4866 11.7656H22.3612Z" fill="#F8F8F8" />
<defs>
<linearGradient id="paint0_linear_4064_4274" x1="0" y1="17.5" x2="35" y2="17.5" gradientUnits="userSpaceOnUse">
<stop offset="0.443137" stop-color="#F8F8F8" stop-opacity="0.34" />
<stop offset="0.929023" stop-color="white" stop-opacity="0.72" />
</linearGradient>
</defs>
</svg>
</a>
</div>
</div>
<?php $dzen = get_field('dzen'); ?>
<div class="relative h-[580px] w-[424px] pb-[24px] flex flex-col px-[24px]">
<?php if ($dzen) : ?>
<img class="w-full h-full rounded-[12px] object-cover absolute inset-0"
src="<?php echo esc_url($dzen['url']); ?>" alt="<?php echo esc_attr($dzen['alt']); ?>"/>
<?php endif; ?>
<div class="relative z-[1] mt-auto flex flex-col gap-[24px]">
<a class="!no-underline red-gradient-hover gap-[12px] w-full rounded-[90px] flex items-center justify-center h-[75px]" href="https://dzen.ru/id/63d29eb15cb285585078a426" target="_blank">
<span class="font-[600] text-[18px] leading-[195%] text-[#f8f8f8]">Подписаться</span>
<svg width="35" height="35" viewBox="0 0 35 35" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 17.5C0 7.83502 7.83502 0 17.5 0C27.165 0 35 7.83502 35 17.5C35 27.165 27.165 35 17.5 35C7.83502 35 0 27.165 0 17.5Z" fill="url(#paint0_linear_4064_4274)" />
<path d="M22.3612 11.7656C22.8445 11.7656 23.2366 12.1578 23.2366 12.641V20.5156C23.2366 20.9989 22.8445 21.391 22.3612 21.391C21.878 21.391 21.4858 20.9989 21.4858 20.5156V14.7544L13.258 22.9823C12.9163 23.324 12.3617 23.324 12.02 22.9823C11.6782 22.6406 11.6782 22.0859 12.02 21.7442L20.2478 13.5164H14.4866C14.0033 13.5164 13.6112 13.1243 13.6112 12.641C13.6112 12.1578 14.0033 11.7656 14.4866 11.7656H22.3612Z" fill="#F8F8F8" />
<defs>
<linearGradient id="paint0_linear_4064_4274" x1="0" y1="17.5" x2="35" y2="17.5" gradientUnits="userSpaceOnUse">
<stop offset="0.443137" stop-color="#F8F8F8" stop-opacity="0.34" />
<stop offset="0.929023" stop-color="white" stop-opacity="0.72" />
</linearGradient>
</defs>
</svg>
</a>
</div>
</div>
</div>
</div>
</section>
<?php get_footer(); ?>

View File

@@ -0,0 +1,17 @@
<?php
/*
Template Name: Страница расписания
*/
?>
<?php
get_header(); ?>
<script type="text/javascript" async="async" id="mobifitness_personal_widget_script_ksm" src="//mobifitness.ru/personal-widget/js/code.js" data-div="mf_personal_widget_cont_ksm" data-test="0" data-debug="0" data-domain="mobifitness.ru" data-code="614482" data-version="v6" data-type="personal" data-language="" data-club="1325"></script>
<script type="text/javascript" async="async" id="mobifitness_personal_widget_script_au1" src="//mobifitness.ru/personal-widget/js/code.js" data-div="mf_schedule_widget_cont_au1" data-test="0" data-debug="0" data-domain="mobifitness.ru" data-code="614482" data-version="v6" data-type="schedule" data-language="" data-club="1325"></script>
<section class="mx-auto">
<div style="display: none" id="mf_personal_widget_cont_ksm"></div>
<div id="mf_schedule_widget_cont_au1"></div>
</section>
<?php
get_footer();