блоки в админку и фиксы стилей
This commit is contained in:
@@ -1,7 +1,22 @@
|
||||
<?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;
|
||||
@@ -10,116 +25,122 @@ if (!empty($blocks) && isset($blocks[0]['blockName']) && $blocks[0]['blockName']
|
||||
$is_first_block = true;
|
||||
}
|
||||
|
||||
$section_padding = $is_first_block ? "pt-[65px] max-[768px]:pt-[35px]" : "pt-[120px] max-[768px]:pt-[70px]";
|
||||
$section_padding = $is_first_block ? "pt-[64px] max-[768px]:pt-[40px]" : "pt-[80px] max-[768px]:pt-[64px]";
|
||||
|
||||
?>
|
||||
|
||||
<style>
|
||||
/* Скрываем, но лучше не нужно по копирайту */
|
||||
.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"] {
|
||||
<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;
|
||||
opacity: 0 !important;
|
||||
visibility: hidden !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<section class="<?php echo $section_padding ?> full-layout">
|
||||
<div class="max-[1200px]:max-w-[640px] max-[768px]:max-w-[340px] hidden max-[1200px]:block mx-auto mb-[-120px] bg-white w-full max-w-[378px] simple-shadow rounded-[25px] relative z-10">
|
||||
<div class="max-[768px]:pl-[30px] max-[768px]:pt-[30px] max-[768px]:rounded-[20px] pl-[45px] pt-[40px] pb-[40px] relative rounded-[25px] overflow-hidden">
|
||||
<svg class="absolute bottom-[-55px] right-[-65px]" width="126" height="129" viewBox="0 0 126 129"
|
||||
fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect x="60.8145" width="82.2698" height="98.6297" transform="rotate(38.0681 60.8145 0)"
|
||||
fill="url(#paint0_linear_2001_4983)"/>
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear_2001_4983" x1="62.7686" y1="4.14594" x2="131.553" y2="37.4035"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#F41C1B"/>
|
||||
<stop offset="0.435" stop-color="#F72D2C"/>
|
||||
<stop offset="1" stop-color="#FA4242"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
<div class="py-[10px] px-[25px] w-full max-w-fit gap-[19px] border border-[#dedede] rounded-[1111px] flex items-center justify-center">
|
||||
<?php
|
||||
display_icon('dot');
|
||||
?>
|
||||
<span class="font-light text-[14px] leading-[140%] text-[#565656]">Связь с нами</span>
|
||||
</div>
|
||||
<div class="max-[768px]:max-w-[240px] flex flex-col gap-[20px]">
|
||||
<h2 class="max-[768px]:text-[28px] font-bold mt-[25px] text-[45px] leading-[130%] text-[#3f3f3f]">
|
||||
Контакты</h2>
|
||||
<div class="max-[768px]:text-[24px] flex flex-col font-semibold text-[28px] leading-[165%] text-[#3f3f3f]">
|
||||
<p class="max-[768px]:text-[15px] font-light text-[18px] text-[#828282]">Номер телефона:</p>
|
||||
<a target="_blank" href="tel:<?php echo get_field('phones', 'options')['main_phone'] ?>"
|
||||
class="hover:text-[#f62322] !decoration-transparent skip-ink transition-colors"
|
||||
href="tel:+7(800)302-11-85"><?php echo get_field('phones', 'options')['main_phone'] ?></a>
|
||||
<a target="_blank" href="tel:<?php echo get_field('phones', 'options')['phone'] ?>"
|
||||
class="hover:text-[#f62322] !decoration-transparent skip-ink transition-colors"
|
||||
href="tel:+7(911)098-59-77"><?php echo get_field('phones', 'options')['phone'] ?></a>
|
||||
</div>
|
||||
<div class="flex flex-col gap-[10px]">
|
||||
<p class="max-[768px]:text-[15px] font-light text-[18px] text-[#828282]">Головной офис:</p>
|
||||
<div class="max-[768px]:text-[19px] font-normal text-[23px] leading-[137%] text-[#3f3f3f]">
|
||||
<?php echo get_field('address', 'options') ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col gap-[10px]">
|
||||
<p class="max-[768px]:text-[15px] font-light text-[18px] text-[#828282]">E-mail:</p>
|
||||
<a class="max-[768px]:text-[19px] hover:text-[#f62322] !decoration-transparent skip-ink transition-colors font-normal text-[23px] leading-[137%] text-[#3f3f3f]"
|
||||
href="mailto:info@mylogistika2010.ru"><?php echo get_field('email', 'options') ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="map-container"
|
||||
class="max-[1200px]:p-0 max-[1200px]:h-[600px] pt-[90px] pl-[62px] pb-[89px] rounded-[35px] relative">
|
||||
<div id="map" class="absolute top-0 left-0 w-full h-full rounded-[35px] overflow-hidden z-0"></div>
|
||||
<div class="max-[1200px]:hidden bg-white w-full max-w-[378px] simple-shadow rounded-[25px] relative z-10">
|
||||
<div class=" pl-[45px] pt-[40px] pb-[40px] relative rounded-[25px] overflow-hidden">
|
||||
<svg class="absolute bottom-[-55px] right-[-65px]" width="126" height="129" viewBox="0 0 126 129"
|
||||
fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect x="60.8145" width="82.2698" height="98.6297" transform="rotate(38.0681 60.8145 0)"
|
||||
fill="url(#paint0_linear_2001_4983)"/>
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear_2001_4983" x1="62.7686" y1="4.14594" x2="131.553" y2="37.4035"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#F41C1B"/>
|
||||
<stop offset="0.435" stop-color="#F72D2C"/>
|
||||
<stop offset="1" stop-color="#FA4242"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
<div class="py-[10px] px-[25px] w-full max-w-fit gap-[19px] border border-[#dedede] rounded-[1111px] flex items-center justify-center">
|
||||
<?php
|
||||
display_icon('dot');
|
||||
?>
|
||||
<span class="font-light text-[14px] leading-[140%] text-[#565656]">Свяжитесь с нами</span>
|
||||
</div>
|
||||
<div class="flex flex-col gap-[20px]">
|
||||
<h2 class="max-[768px]:text-[28px] max-[1200px]:mb-[20px] font-bold mt-[25px] text-[45px] leading-[130%] text-[#3f3f3f]">
|
||||
Контакты</h2>
|
||||
<div class="flex flex-col font-semibold text-[28px] leading-[165%] text-[#3f3f3f]">
|
||||
<p class=" font-light text-[18px] text-[#828282]">Номер телефона:</p>
|
||||
<a target="_blank" href="tel:<?php echo get_field('phones', 'options')['main_phone'] ?>"
|
||||
class="hover:text-[#f62322] !decoration-transparent skip-ink transition-colors"
|
||||
href="tel:+7(800)302-11-85"><?php echo get_field('phones', 'options')['main_phone'] ?></a>
|
||||
<a target="_blank" href="tel:<?php echo get_field('phones', 'options')['phone'] ?>"
|
||||
class="hover:text-[#f62322] !decoration-transparent skip-ink transition-colors"
|
||||
href="tel:+7(911)098-59-77"><?php echo get_field('phones', 'options')['phone'] ?></a>
|
||||
</div>
|
||||
<div class="flex flex-col gap-[10px]">
|
||||
<p class="font-light text-[18px] text-[#828282]">Головной офис:</p>
|
||||
<div class="font-normal text-[23px] leading-[137%] text-[#3f3f3f]">
|
||||
<?php echo get_field('address', 'options') ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col gap-[10px]">
|
||||
<p class="font-light text-[18px] text-[#828282]">E-mail:</p>
|
||||
<a class="hover:text-[#f62322] !decoration-transparent skip-ink transition-colors font-normal text-[23px] leading-[137%] text-[#3f3f3f]"
|
||||
href="mailto:info@mylogistika2010.ru"><?php echo get_field('email', 'options') ?></a>
|
||||
<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="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">
|
||||
|
||||
<?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 endif; ?>
|
||||
|
||||
<div class="flex flex-col gap-[20px]">
|
||||
|
||||
<?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 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>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</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 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; ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($contacts) : ?>
|
||||
<div>
|
||||
<?php if (!empty($contacts['phone'])) : ?>
|
||||
<div class="mb-[16px]">
|
||||
<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">
|
||||
<?php echo esc_html($contacts['phone']); ?>
|
||||
</a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($contacts['social_repeater'])) : ?>
|
||||
<div>
|
||||
<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" />
|
||||
<?php endif; ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user