+ +
+ + + +Квалификация и достижения
+-
+
+
+
- + + + + + +
Документы
+Тренировки с
++ +
+ ++ +
+ ++ +
+ + + +Что происходит на тренировке
+-
+
+
+
- + + + + + +
Для кого подходит
+-
+
+
+
- + + + + + +
Тренеры
++ +
+ + + ++ +
+ + ++ +
+ ++ В клубные карты входит +
+Дополнительные + услуги
+ + ++ +
+- -
- + + + ++ +
+
+
-
- Контакты
-
+
-
+
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
@@ -85,22 +104,32 @@ $section_padding = $is_first_block ? "pt-[64px] max-[768px]:pt-[40px]" : "pt-[80
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
@@ -109,18 +138,18 @@ $section_padding = $is_first_block ? "pt-[64px] max-[768px]:pt-[40px]" : "pt-[80
-
+
-
+
-
+
@@ -130,7 +159,7 @@ $section_padding = $is_first_block ? "pt-[64px] max-[768px]:pt-[40px]" : "pt-[80
+ class="object-contain w-[42px]" />
diff --git a/template-parts/la-components/blocks/form-block/form-block.css b/template-parts/la-components/blocks/form-block/form-block.css
index 66cee77..fc5b231 100644
--- a/template-parts/la-components/blocks/form-block/form-block.css
+++ b/template-parts/la-components/blocks/form-block/form-block.css
@@ -1,91 +1,89 @@
-.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;
+}
+
+#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);
+#fluentform_3 .ff-btn-submit:hover {
+ font-weight: 700;
+ transition: 180ms ease-in;
}
-.form-block-wrapper .ff-btn-submit:active {
- transform: translateY(0);
+#fluentform_3 .ff_submit_btn_wrapper {
+ margin-bottom: 0!important;
}
-.form-block-wrapper .asterisk-right label::after {
- content: ' *';
- color: #ef4444;
- font-weight: bold;
+#fluentform_3 .error.text-danger {
+ position: absolute;
+ margin-top: 0;
+ bottom: -18px;
+ left: 0;
+ width: 100%;
+ text-align: center;
}
-.form-block-wrapper .ff-message-success,
-.form-block-wrapper .ff-message-container {
- display: none !important;
+#fluentform_3 .ff-el-group {
+ position: relative;
+ margin-bottom: 18px;
}
-.form-block-wrapper.form-loading .ff-btn-submit {
- opacity: 0.7;
+#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;
}
\ No newline at end of file
diff --git a/template-parts/la-components/blocks/form-block/form-block.js b/template-parts/la-components/blocks/form-block/form-block.js
new file mode 100644
index 0000000..3a21b83
--- /dev/null
+++ b/template-parts/la-components/blocks/form-block/form-block.js
@@ -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);
+ }
+ }
+ });
+ }
+});
\ No newline at end of file
diff --git a/template-parts/la-components/blocks/form-block/form-block.php b/template-parts/la-components/blocks/form-block/form-block.php
index fdc99b6..1acc361 100644
--- a/template-parts/la-components/blocks/form-block/form-block.php
+++ b/template-parts/la-components/blocks/form-block/form-block.php
@@ -10,24 +10,44 @@ $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';
+ $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';
+ $style_attr = 'style="background-image: url(' . esc_url($bg_image) . ')"';
+}
+
$hidden_value = "Форма: {$form_name} | Страница: {$page_title} | URL: {$current_url}";
?>
-
-
-
-
+
+>
-
-
+
+
+
+ Пробная персональная
+ тренировка
+ за 1200 ₽
+
+ Познакомимся, покажем зал и
+ подберём
+ оптимальные для вас тренировки!
+
+
\ No newline at end of file
diff --git a/template-parts/la-components/blocks/gallery-tabs/gallery-tabs.css b/template-parts/la-components/blocks/gallery-tabs/gallery-tabs.css
new file mode 100644
index 0000000..55aaecd
--- /dev/null
+++ b/template-parts/la-components/blocks/gallery-tabs/gallery-tabs.css
@@ -0,0 +1,55 @@
+.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%);
+}
+.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;
+}
+
diff --git a/template-parts/la-components/blocks/gallery-tabs/gallery-tabs.js b/template-parts/la-components/blocks/gallery-tabs/gallery-tabs.js
index afe3a9e..4e1b6ff 100644
--- a/template-parts/la-components/blocks/gallery-tabs/gallery-tabs.js
+++ b/template-parts/la-components/blocks/gallery-tabs/gallery-tabs.js
@@ -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,126 @@ 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');
- }
+ thumbnailSwipers[tabId] = new Swiper(`#${blockId} #thumbnail-swiper-${tabId}`, {
+ slidesPerView: 'auto',
+ spaceBetween: 24,
+ freeMode: true,
+ grabCursor: true,
+ watchSlidesProgress: true,
+ });
- 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');
+ swipers[tabId] = new Swiper(`#${blockId} #swiper-${tabId}`, {
+ slidesPerView: 'auto',
+ spaceBetween: 24,
+ centeredSlides: true,
+ initialSlide: 1,
+ 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);
}
}
});
+
+ 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 +140,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();
});
}
\ No newline at end of file
diff --git a/template-parts/la-components/blocks/gallery-tabs/gallery-tabs.php b/template-parts/la-components/blocks/gallery-tabs/gallery-tabs.php
index 1a49d96..d70c25f 100644
--- a/template-parts/la-components/blocks/gallery-tabs/gallery-tabs.php
+++ b/template-parts/la-components/blocks/gallery-tabs/gallery-tabs.php
@@ -1,85 +1,124 @@
-
+
+
+
+
+
+
-
-
-
-
-
-
- $tab) : ?>
-
-
-
-
-
-
+
+
+ $tab) : ?>
+
+
+
+
+
+
+
$tab) : ?>
-
-
+
+
-
-
-
-
-
- $image) : ?>
-
-
+
+
+
+ $image) : ?>
+
+
-
+
-
-
-
-
+
diff --git a/template-parts/la-components/blocks/hero-block/hero-block.js b/template-parts/la-components/blocks/hero-block/hero-block.js
index 1f0f288..bbccb5e 100644
--- a/template-parts/la-components/blocks/hero-block/hero-block.js
+++ b/template-parts/la-components/blocks/hero-block/hero-block.js
@@ -8,7 +8,6 @@ document.addEventListener('DOMContentLoaded', function() {
const swiper = new Swiper(swiperContainer, {
slidesPerView: 1,
- loop: true,
grabCursor: true,
on: {
slideChange: function () {
diff --git a/template-parts/la-components/blocks/hero-block/hero-block.php b/template-parts/la-components/blocks/hero-block/hero-block.php
index 09e3cbb..8fa2d0d 100644
--- a/template-parts/la-components/blocks/hero-block/hero-block.php
+++ b/template-parts/la-components/blocks/hero-block/hero-block.php
@@ -42,19 +42,20 @@ if (!empty($slider_data) && is_array($slider_data)) {
}
$room = get_current_room();
-$base_classes = 'hero-block pb-[30px] pt-[14px]';
if ($room === 'fitness') {
- $section_classes = $base_classes . 'radient-bg';
+ $section_classes = 'radient-bg';
$style_attr = '';
} else {
- $section_classes = $base_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_classes = 'bg-cover bg-center bg-no-repeat';
+ $bg_image = 'data:image/webp;base64,UklGRgoWAABXRUJQVlA4IP4VAADwZQGdASqgBWYDPpFInE0lpCMioDHIOLASCWlu/HyWI38b/t311v/u9l/qEfbguB5tB89Av/+7hX+1Qx7mfHAD4XHf7v9OD6BSfgAJ95l7jT3l5/4ecy9xp7yf6dOnTp06dOnTp06dOnTp06dOnT5Zyf6dOnT5aCBIOwXrrqOMf1HllAPeT/Tp06dOnTp06dOj7lAJqf4W6saMGmfik4FHJ/o+oommUdK9b2PU9ZQD3k/06dOnTp06dOnTp06dOnm5Axu8rb/TqGeediH8+1U1opmi3X87DKGmF5P9OnTp06dOnTp06dOnTgOgIL+eCYijzlhT+tHCms6eeRVfl8YRsA93ulAI/077akmdOnTp06dOwdxp7yf6dOnTp6kE7oyf6dPlxjxlD2wgRwT5KiV1vT/Tp060dsqvl7jT3k/06eepRooBH+nTp54aWuUEzAJCH3wAyTosKzyTN7pQCP9QPeMKgHvJ/p06dOnVZ/D0GWUA0kDpk+CIszV1GwqgJoeI6KF7EUx/j+HmPao16MTxie8n+nUp8fm2APhb1AiUT/VQ+96k5FLXPgPhaJhLwNJmcIvzJkUcn+jvqGVApVXy9xp6FlYIJJdvXEErJ/xpsyyNPrnZOnYO4zdCk2by7YlR6qR86vm41o1nzuMXPl8syshXXqprVrYPeTWod2ZZGnvJ/rMv9Wl84L7lDVsnNPH5n55rPSXGbqzCWRp7z5qK69UeXo3ReT8IS3oKty/POZe41HMenQCP9OnnseIhBhB3aze6wO+MfYoBH+nTqBmn4lQYf9OrHBXuT/Tp06dP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2QCtUhGretg+IAAAQiLokgI9zR2iwr8wdUIv/YX/O0tHjHgM4jEIKgAADs/OJTb558SHMbvyStYzGiyTsgIxH28jBBcwAAYJwAfrafi+T3TJqDKWvWNt9uUsIqVUR3xZZp27lQnrma71zxufeueIlHf6DU6d9Bnlj6DPD3qC6UxH9BqQxro+g0szXoNI5CFPuSnvYEM1Wtc7I6ufrnhrKtVH2dOuchLPQZ5v+gzwAAA==';
+
+ $style_attr = 'style="background-image: url(' . esc_attr($bg_image) . ')"';
}
+
?>
->
+>
@@ -100,7 +101,7 @@ if ($room === 'fitness') {
$slide): ?>
@@ -153,7 +154,6 @@ if ($room === 'fitness') {
for (let selector of selectors) {
swiperContainer = document.querySelector(selector);
- console.log(`🔍 Checking selector "${selector}":`, swiperContainer);
if (swiperContainer) break;
}
diff --git a/template-parts/la-components/blocks/line-block/line-block.php b/template-parts/la-components/blocks/line-block/line-block.php
new file mode 100644
index 0000000..f015f71
--- /dev/null
+++ b/template-parts/la-components/blocks/line-block/line-block.php
@@ -0,0 +1,108 @@
+
+
+
+
+
+
+
+
+
+
+ 2500 м²
+ светлого пространства
+
+
+
+
+
+
+
+ 45+
+ направлений тренировок
+
+
+
+
+
+
+
+ ТОП
+ оборудование из США
+
+
+
+
+
\ No newline at end of file
diff --git a/template-parts/la-components/blocks/masonry-tiles-1/masonry-tiles-1.php b/template-parts/la-components/blocks/masonry-tiles-1/masonry-tiles-1.php
new file mode 100644
index 0000000..f13d9d6
--- /dev/null
+++ b/template-parts/la-components/blocks/masonry-tiles-1/masonry-tiles-1.php
@@ -0,0 +1,192 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ style="background-image: url(''); background-size: cover; background-position: center;"
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ style="background-image: url(''); background-size: cover; background-position: center;"
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/template-parts/la-components/blocks/masonry-tiles-2/masonry-tiles-2.php b/template-parts/la-components/blocks/masonry-tiles-2/masonry-tiles-2.php
new file mode 100644
index 0000000..80481ab
--- /dev/null
+++ b/template-parts/la-components/blocks/masonry-tiles-2/masonry-tiles-2.php
@@ -0,0 +1,210 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ style="background-image: url(''); background-size: cover; background-position: center;"
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ style="background-image: url(''); background-size: cover; background-position: center;"
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ style="background-image: url(''); background-size: cover; background-position: center;"
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/template-parts/la-components/blocks/reviews-block/reviews-block.css b/template-parts/la-components/blocks/reviews-block/reviews-block.css
new file mode 100644
index 0000000..7a91864
--- /dev/null
+++ b/template-parts/la-components/blocks/reviews-block/reviews-block.css
@@ -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;
+}
+
diff --git a/template-parts/la-components/blocks/reviews-block/reviews-block.js b/template-parts/la-components/blocks/reviews-block/reviews-block.js
index bbf2e6e..4a32525 100644
--- a/template-parts/la-components/blocks/reviews-block/reviews-block.js
+++ b/template-parts/la-components/blocks/reviews-block/reviews-block.js
@@ -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();
});
}
\ No newline at end of file
diff --git a/template-parts/la-components/blocks/reviews-block/reviews-block.php b/template-parts/la-components/blocks/reviews-block/reviews-block.php
index 149cc8f..27e2839 100644
--- a/template-parts/la-components/blocks/reviews-block/reviews-block.php
+++ b/template-parts/la-components/blocks/reviews-block/reviews-block.php
@@ -1,28 +1,29 @@
-
-
+
+
@@ -31,8 +32,10 @@ $stars = get_field('stars');
$tab) : ?>
-
-
-
-
-
-
-
-
-
- Оценок:
+
+
+
+
$tab) : ?>
-
-
-
+
@@ -103,50 +139,49 @@ $stars = get_field('stars');
-
+ Пробная персональная + тренировка + за 1200 ₽ +
+Познакомимся, покажем зал и + подберём + оптимальные для вас тренировки!
+ +2500 м²
+45+
+ТОП
++ +
+ + + + + +
+