You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

332 lines
24 KiB

<?php
$id = 'contacts-block-' . $block['id'];
if ( ! empty($block['anchor'] ) ) {
$id = $block['anchor'];
}
$classes = 'block-contacts-block';
if ( ! empty( $block['className'] ) ) {
$classes .= ' ' . $block['className'];
}
if ( ! empty( $block['align'] ) ) {
$classes .= ' align' . $block['align'];
}
$heading = get_field('heading');
$work_time = get_field('work_time');
$address = get_field('address');
$contacts = get_field('contacts');
$blocks = parse_blocks(get_the_content());
$is_first_block = false;
if (!empty($blocks) && isset($blocks[0]['blockName']) && $blocks[0]['blockName'] === 'acf/contacts-block') {
$is_first_block = true;
}
$section_padding = $is_first_block ? "!pt-[0]" : "!pt-[0px]";
?>
<style type="text/css">
<?php echo '#' . $id; ?> {
}
.ymaps-2-1-79-copyright,
.ymaps-2-1-79-gototech,
.ymaps-2-1-79-gototaxi,
.ymaps-2-1-79-gotoymaps,
.ymaps-2-1-79-map-copyrights-promo,
.ymaps-2-1-79-copyright__wrap,
.ymaps-2-1-79-copyright__content-cell,
[class*="ymaps-2"][class*="copyright"],
[class*="ymaps-2"][class*="gototech"],
[class*="ymaps-2"][class*="gototaxi"],
[class*="ymaps-2"][class*="gotoymaps"] {
display: none !important;
}
</style>
<section id="<?php echo esc_attr( $id ); ?>" class="<?php echo esc_attr( $classes ); ?> <?php echo $section_padding ?>">
<div class="w-full max-[1050px]:flex max-[1050px]:flex-col relative">
<!-- Плашка на мобильных (отдельно сверху) -->
<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="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; ?>
<?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 (!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:hello@fakelfitness.ru"
class="!decoration-transparent hover:!decoration-inherit text-[20px] font-[600]">
hello@fakelfitness.ru
</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($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; ?>
<?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($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="!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 w-[42px]" />
<?php endif; ?>
</a>
<?php endif; ?>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
<?php if(!is_front_page()):
?>
<div class="mt-[14px]">
<a href="mailto:hello@fakelfitness.ru"
class="!decoration-transparent hover:!decoration-inherit text-[24px] font-[600]">
hello@fakelfitness.ru
</a>
</div>
<?php
endif; ?>
</div>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
<script src="https://api-maps.yandex.ru/2.1/?lang=ru_RU&amp;apikey=03df01cd-1a4b-4cb2-9ae5-d32d62590767"
type="text/javascript"></script>
</section>