<!--КОД ДЛЯ МЕНЮ В ZERO-->

<style>
:root {
  /* Цвета */
  --primary-color: #E8F6C8; /*Основной цвет*/  
  --text-color: #E8F6C8; /*Цвет текста в меню*/
  --button-text: #fff;  /*Цвет текста кнопки*/
  --border-color: #F5F5F5; /*Цвет бордера у кнопки*/
  
  /* Размеры шрифтов */
  --font-size-crs: 16px; /*Подзаголовок*/
  --font-size-xs: 12px;  /*Кнопка до 960px*/
  --font-size-sm: 14px;  /*Кнопка от 960px*/
  --font-size-md: 16px;  /*Заголовок закрытой вкладки до 960px*/
  --font-size-lg: 24px;  /*Заголовок закрытой вкладки от 960px*/
  --font-size-xl: 26px;  /*Заголовок до 960px*/
  --font-size-xxl: 36px; /*Заголовок от 960px*/
  
  /* Отступы */
  --padding-sm: 4px 14px; /*Отступы у кнопки до 960px*/
  --padding-md: 6px 22px; /*Отступы у кнопки от 960px*/
  --padding-title: 40px; /*Верхний Отступ заголовка*/
  --gap: 40px; /*Отступ между заголовком и подзаголовком*/
  --margin-bottom: 40px; /*Нижний отступ у кнопки*/
  --btn-width: 160px; /*Ширина кнопки*/
  
  /* Анимации */
  --transition-flex: 0.8s;
  --transition-opacity: 0.5s ease;
  --transition-delay: 0.5s;
  
  /* Размеры */
  --border-radius: 7px; /*кнопка скругление*/
  --icon-width: 12px; /*размер иконки в кнопке ширина*/
  --icon-height: 9px; /*размер иконки в кнопке высота*/
  --mobile-max-width: 90%;
}

.items .item-content .item-content-title{
    font-family: 'Montserrat', Arial, sans-serif; /*Шрифт для заголовка*/
    line-height: 1; /*Межстрочный интервал для заголовка*/
    letter-spacing: 1px; /*Межбуквенный интервал*/
}

.item-content-text {
    font-family: 'Liana', Arial, sans-serif; /*Шрифт для подзаголовка*/
    font-size: var(--font-size-crs);
    line-height: 1; /*Межстрочный интервал для подзаголовка*/
    letter-spacing: 1px; /*Межбуквенный подзаголовка*/
}



.uc-menu-block {
  display: none;
}




/* Основные стили меню */
#allrecords .t396 .accordElement .tn-atom,
.tn-atom .menu-item,
.menu-item .item-title,
.items .item-content {
  display: flex;
}

#allrecords .t396 .accordElement .tn-atom {
  height: inherit;
  flex-direction: row;
  align-items: stretch;
  position: absolute;
  border: none;
}

.tn-atom .menu-item {
  position: relative;
  cursor: default;
  transition: flex var(--transition-flex);
  width: 100%;
  overflow: hidden;
  background-size: cover;
  background-position: top center;
  user-select: none;
  justify-content: center;
  color: var(--text-color);
  box-shadow: 0 0 0 1px var(--primary-color);
  margin-right: 1px;
  height: inherit;
}

/* Состояния menu-item */
.menu-item.active {
  flex: 5;
}

.menu-item:not(.active) {
  flex: 1;
}

.menu-item.active:not(.video-mode) .background-image {
  opacity: 1;
}

.menu-item.active .item-title {
  width: 0;
  opacity: 0;
}

/* Заголовок элемента */
.menu-item .item-title {
  position: relative;
  writing-mode: vertical-rl;
  font-size: var(--font-size-lg);
  font-weight: 400;
  user-select: none;
  padding-top: var(--padding-title);
  width: inherit;
  height: 100%;
  align-items: center;
  box-sizing: border-box;
  cursor: pointer;
  z-index: 30;
}

/* Контент элементов */
.menu-item .items {
  position: absolute;
  height: inherit;
  left: 0;
  z-index: 25;
  font-weight: 400;
  opacity: 0;
  width: 100%;
  transition: opacity var(--transition-opacity) var(--transition-delay);
}

.menu-item.active .items {
  opacity: 1;
}

.items .item-content {
  opacity: 0;
  gap: var(--gap); 
  flex-direction: column;
  align-items: center;
  height: inherit;
}

.menu-item.active .items .item-content {
  opacity: 1;
}

.items .item-content .item-content-title {
  font-size: var(--font-size-xxl);
  font-weight: 400;
  padding-top: var(--padding-title);
  text-align: center;
  color: var(--text-color);
}

/* Фоновое изображение и видео */
.menu-item .background-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  z-index: 0;
  transition: opacity var(--transition-opacity);
  opacity: 0;
}

.menu-item video {
  width: 100%;
  height: 100%;
  opacity: 1;
  object-fit: cover;
  z-index: 0;
  display: none;
}

.menu-item.active video {
  display: block;
}

/* Прогресс-бар */
.menu-item .progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background-color: white;
  width: 0;
  z-index: 40;
  transition: none;
}

.menu-item .progress-bar.animate {
  animation: progressBar 7s linear forwards;
}

@keyframes progressBar {
  0% {
    width: 0;
  }
  100% {
    width: 100%;
  }
}

/* Кнопка */
a.button-link {
  margin-top: auto;
}

a.button-link div {
    color: var(--button-text);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: var(--padding-md);
    margin-bottom: var(--margin-bottom);
    font-size: var(--font-size-sm);
    width: var(--btn-width);
    text-align: center;
    box-sizing: border-box;
}

a.button-link div:after {
  content: "";
  background-image: url(https://static.tildacdn.com/tild6532-6639-4661-a431-343165636633/Vector_437.svg);
  width: var(--icon-width);
  height: var(--icon-height);
  margin-left: 5px;
  display: inline-block;
  background-size: contain;
  background-repeat: no-repeat;
}

/* Адаптивность */
@media (max-width: 960px) {
  .menu-item .item-title {
    font-size: var(--font-size-md);
  }
  
  .items .item-content .item-content-title {
    font-size: var(--font-size-xl);
  }
  
  .item-content-text {
    font-size: var(--font-size-sm);
  }
  
  a.button-link div {
    padding: var(--padding-sm);
    font-size: var(--font-size-xs);
  }
  
  a.button-link div:after {
    width: 8px;
    height: 7px;
    margin-left: 2px;
  }
}

@media (max-width: 640px) {
  #allrecords .t396 .accordElement .tn-atom {
    flex-direction: column;
  }
  
  .menu-item .item-title {
    writing-mode: unset;
    justify-content: center;
    align-items: center;
    padding: 0;
  }
  
  .tn-atom .menu-item {
    margin-top: 1px;
    box-shadow: none;
    border-bottom: 1px solid var(--primary-color);
  }
  
  .accordElement {
        border-top: 1px solid var(--primary-color);
   }

  
  .menu-item .items {
    height: 100%;
  }
}

@media (max-width: 480px) {
  .accordElement .tn-atom {
    flex-direction: column;
  }
  
  .menu-item .items,
  .menu-item .title {
    width: 100%;
    font-size: var(--font-size-sm) !important;
    transform: none !important;
    text-align: center !important;
  }
  
  .menu-item .item-content-text {
    max-width: var(--mobile-max-width);
    font-size: var(--font-size-xs);
  }
}
</style>


<script>
document.addEventListener("DOMContentLoaded", () => {
    const timeAnimation = 50; // 7 секунд для анимации
    const menuBlock = document.querySelector('.uc-menu-block');
    if (!menuBlock) return;

    const cardData = Array.from(menuBlock.querySelectorAll('.t817__content')).map(contentElement => {
        const imgElement = contentElement.querySelector('.t-img');
        const titleElement = contentElement.querySelector('.t817__title');
        const textElement = contentElement.querySelector('.t-text');
        const buttonElement = contentElement.querySelector('.t-btn');
        const buttonTextElement = buttonElement?.querySelector('.t-btnflex__text');

        return {
            bgImagecardLink: imgElement?.getAttribute('data-original') || '',
            videocardLink: imgElement?.getAttribute('alt') || '',
            cardTitle: titleElement?.innerHTML?.trim() || '',
            cardTitleTxt: titleElement?.textContent?.trim() || '',
            cardText: textElement?.textContent?.trim() || '',
            cardButtonLink: buttonElement?.getAttribute('href') || '',
            cardButtonCaption: buttonTextElement?.textContent?.trim() || ''
        };
    });

    if (cardData.length) createMenuSlider(cardData);

    function createMenuSlider(cards) {
        const accordElement = document.querySelector('.accordElement .tn-atom');
        if (!accordElement) return;

        const menuItems = cards.map(card => {
            const menuItem = document.createElement('div');
            menuItem.className = 'menu-item t-text';
            
            const backgroundImage = document.createElement('div');
            backgroundImage.className = 'background-image';
            backgroundImage.style.backgroundImage = `url(${card.bgImagecardLink})`;
            menuItem.appendChild(backgroundImage);
            
            // Проверяем наличие видео и добавляем класс video-mode
            if (card.videocardLink) {
                menuItem.classList.add('video-mode'); // Добавляем класс если есть видео
                
                const video = document.createElement('video');
                Object.assign(video, {
                    muted: true,
                    loop: true,
                    playsInline: true,
                    src: card.videocardLink
                });
                menuItem.appendChild(video);
            }

            const title = document.createElement('div');
            title.className = 'item-title';
            title.textContent = card.cardTitleTxt;

            const itemsElement = document.createElement('div');
            itemsElement.className = 'items';
            itemsElement.innerHTML = `
                <div class="item-content">
                    <div class="item-content-title t-text">${card.cardTitle}</div>
                    <div class="item-content-text">${card.cardText}</div>
                    <a href="${card.cardButtonLink}" class="button-link">
                        <div>
                            ${card.cardButtonCaption}
                        </div>
                    </a>
                </div>
            `;

            menuItem.append(title, itemsElement);
            return menuItem;
        });

        accordElement.append(...menuItems);

        // Переменные для автоматического переключения
        let autoSwitchTimeout;
        let currentIndex = 0;

        // Функция для переключения активного элемента
        function switchActiveItem(nextIndex) {
            // Очищаем предыдущий таймер
            if (autoSwitchTimeout) {
                clearTimeout(autoSwitchTimeout);
            }
            
            menuItems.forEach((menuItem, index) => {
                menuItem.classList.remove('active');
                menuItem.querySelector('video')?.pause();
                
                // Удаляем существующий прогресс-бар
                const existingProgress = menuItem.querySelector('.progress-bar');
                if (existingProgress) {
                    existingProgress.remove();
                }
            });
            
            const nextItem = menuItems[nextIndex];
            nextItem.classList.add('active');
            nextItem.querySelector('video')?.play();
            
            // Создаем новый прогресс-бар
            createProgressBar(nextItem);
            
            // Обновляем текущий индекс
            currentIndex = nextIndex;
            
            // Запускаем таймер для следующего переключения
            autoSwitchTimeout = setTimeout(() => {
                switchToNextItem();
            }, timeAnimation * 1000);
        }

        // Функция для создания прогресс-бара
        function createProgressBar(menuItem) {
            const progressBar = document.createElement('div');
            progressBar.className = 'progress-bar';
            menuItem.appendChild(progressBar);
            
            // Запускаем анимацию
            setTimeout(() => {
                progressBar.classList.add('animate');
            }, 10);
        }

        // Функция для переключения на следующий элемент
        function switchToNextItem() {
            const nextIndex = (currentIndex + 1) % menuItems.length;
            switchActiveItem(nextIndex);
        }

        // Функция остановки автоматического переключения
        function stopAutoSwitch() {
            if (autoSwitchTimeout) {
                clearTimeout(autoSwitchTimeout);
                autoSwitchTimeout = null;
            }
        }

        // Обработчики кликов
        menuItems.forEach((item, index) => {
            item.addEventListener('click', function() {
                // Останавливаем автоматическое переключение
                stopAutoSwitch();
                
                // Переключаемся на выбранный элемент
                switchActiveItem(index);
            });
        });

        // Инициализация
        switchActiveItem(0); // Активируем первый элемент
    }
});
</script>
Book design is the art of incorporating the content, style, format, design, and sequence of the various components of a book into a coherent whole. In the words of Jan Tschichold, "Methods and rules that cannot be improved upon have been developed over centuries. To produce perfect books, these rules must be revived and applied." The front matter, or preliminaries, is the first section of a book and typically has the fewest pages. While all pages are counted, page numbers are generally not printed, whether the pages are blank or contain content.
Book design is the art of incorporating the content, style, format, design, and sequence of the various components of a book into a coherent whole. In the words of Jan Tschichold, "Methods and rules that cannot be improved upon have been developed over centuries. To produce perfect books, these rules must be revived and applied." The front matter, or preliminaries, is the first section of a book and typically has the fewest pages. While all pages are counted, page numbers are generally not printed, whether the pages are blank or contain content.
Book design is the art of incorporating the content, style, format, design, and sequence of the various components of a book into a coherent whole. In the words of Jan Tschichold, "Methods and rules that cannot be improved upon have been developed over centuries. To produce perfect books, these rules must be revived and applied." The front matter, or preliminaries, is the first section of a book and typically has the fewest pages. While all pages are counted, page numbers are generally not printed, whether the pages are blank or contain content.
Book design is the art of incorporating the content, style, format, design, and sequence of the various components of a book into a coherent whole. In the words of Jan Tschichold, "Methods and rules that cannot be improved upon have been developed over centuries. To produce perfect books, these rules must be revived and applied." The front matter, or preliminaries, is the first section of a book and typically has the fewest pages. While all pages are counted, page numbers are generally not printed, whether the pages are blank or contain content.
Made on
Tilda