'); $('head').append(``); $('head').append(` `); createBlocks(dataBlocks); hasLoadedSlick = true; }); } // Initialisation du script function initAlloBlocks(dataBlocks) { // Ajout des classes parentes obligatoires $('html').addClass('style-blue-1 custom-colors-enabled custom-primary-button-color-bright custom-secondary-button-color-bright custom_fonts comps live_website'); $('body').addClass('font-lato body--desktop body--loaded comps').attr('id', '82076-147499'); $('footer').addClass('custom-footer'); initAlloAssets(dataBlocks); } function generateCards(items, wrapper) { const wrapperIdentifier = $('.' + wrapper); const htmlGen = items.map(item => { const postItem = $('', { class: 'imgCard', href: item.href, style: 'background: url(' + item.image + ') no-repeat center center; background-size: cover;' }); const postItemTitle = $('

', {class: 'imgCardText', text: item.title}); const postItemContainer = $('

', {class: 'imgCardContainer'}); postItemContainer.append(postItem, postItemTitle); return postItemContainer; }); wrapperIdentifier.html(htmlGen); } function generateLongs(items, wrapper) { const wrapperIdentifier = $('.' + wrapper); const htmlGen = items.map(item => { const postItem = $('
', {class: 'posts-02__item posts-02__item--accent posts-02__item-scrollable', href: item.href}); const postItemText = $('
', {class: 'posts-02__text'}); const postItemTitle = $('

', {class: 'posts-02__title', text: item.title}); const postItemInfo = $('
', {class: 'posts-02__info', text: item.info}); const postItemImgBox = $('
', {class: 'posts-02__img_box'}); const postItemImage = $('', {class: 'posts-02__img', src: item.image}); postItemText.append(postItemTitle, postItemInfo); postItemImgBox.append(postItemImage); postItem.append(postItemText, postItemImgBox); return postItem; }); wrapperIdentifier.html(htmlGen); } // Searchbar filter function filteredAndSearched(search, block = 0, container = null) { const gotDataBlock = window['dataBlock' + block]; const projects = gotDataBlock.projects.filter((project) => { return ( (project.nom.toLowerCase().includes(search.toLowerCase()) || project.metier.toLowerCase().includes(search.toLowerCase()) || project.title.toLowerCase().includes(search.toLowerCase())) && project.category.indexOf(gotDataBlock.currentFilter) !== -1 ); }); if (container === null) { generateProjects(projects, $('.projects')); } else { const projectContainer = $('.' + container); generateProjects(projects, projectContainer, true, gotDataBlock.projectsTextColor, gotDataBlock.projectsBackgroundColor); } } // Set category filter function setFilter(thiis, category, block = 0, container = null, description = null) { const gotDataBlock = window['dataBlock' + block]; $('.filter').removeClass('active'); $(thiis).addClass('active'); const selected = gotDataBlock.filterButtons.filter((button) => { return button.value === category })[0]; this.currentFilter = selected.value; const projects = gotDataBlock.projects.filter((project) => { return project.category.includes(category); }); if (description !== null) { $('.' + description).text(gotDataBlock.categories[category]); } if (container === null) { generateProjects(projects, $('.projects')); } else { const projectContainer = $('.' + container); generateProjects(projects, projectContainer, true, gotDataBlock.projectsTextColor, gotDataBlock.projectsBackgroundColor); } } // Bubbel Navbar function setBubbleFilter(thiis, category, block = 0, container = null, cards = true) { const gotDataBlock = window['dataBlock' + block]; $('.bubbleNavItem').removeClass('active'); $(thiis).addClass('active'); const selected = gotDataBlock.filterButtons.filter((button) => { return button.value === category })[0]; this.currentFilter = selected.value; const projects = gotDataBlock.list.filter((project) => { return project.category.includes(category); }); if (cards) { generateCards(projects, container); } else { generateLongs(projects, container); } } function alloGetTimeDifference(targetDateTime) { const now = new Date(); const targetDate = new Date(targetDateTime); if (targetDate < now) return false; const difference = targetDate - now; const days = Math.floor(difference / (1000 * 60 * 60 * 24)); const hours = Math.floor((difference % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); const minutes = Math.floor((difference % (1000 * 60 * 60)) / (1000 * 60)); const seconds = Math.floor((difference % (1000 * 60)) / 1000); return { days, hours, minutes, seconds }; } function alloStartCounter(days, hours, minutes, seconds, uniqId) { const interval = setInterval(() => { if (seconds > 0) { seconds--; $('.seconds' + uniqId).text(seconds); } else { seconds = 59; $('.seconds' + uniqId).text(seconds); if (minutes > 0) { minutes--; $('.minutes' + uniqId).text(minutes); } else { minutes = 59; $('.minutes' + uniqId).text(minutes); if (hours > 0) { hours--; $('.hours' + uniqId).text(hours); } else { hours = 23; $('.hours' + uniqId).text(hours); if (days > 0) { days--; $('.days' + uniqId).text(days); } else { clearInterval(interval); } } } } }, 1000); } function alloShowPopup(id) { $('.popup' + id).show(); } // ================== BLOCK 0 function Block0(data) { if (data.visible !== 'oui') return; const parentDiv = $('
'); const innerDiv = $('
', { class: 'page-component__wrapper', style: 'z-index: 15; padding-top: 50px; padding-bottom: 50px' }).css('background-color', data.backgroundColor); const containerDiv1 = $('
', {class: 'containor container--small'}); const containerDiv2 = $('
', {class: 'containor container--mid title-container'}); // Randoms const randomCategoryDescription = "categoryDescription" + Math.floor(Math.random() * 1000000000); // TITRE / DESCRIPTION const titleBox = $('
', {class: 'title-box title-box--center', style: 'margin-bottom:20px;'}); const heading = $('

', {class: 'heading', text: data.title, style: 'color:' + data.textColor}); titleBox.append(heading); const contentBox = $('
', {class: 'title-box__text content_box'}); const contentParagraph = $('

', {text: data.text, style: 'color: ' + data.textColor}); contentBox.append(contentParagraph); titleBox.append(contentBox); containerDiv1.append(titleBox); innerDiv.append(containerDiv1); const projectsContainer = $('', {class: 'projects'}); const filtersContainer = document.createElement('div'); filtersContainer.className = 'filters'; data.filterButtons.forEach(button => { const filterButton = document.createElement('button'); const activeClass = (button.value === data.currentFilter) ? 'active' : ''; filterButton.className = 'filter ' + activeClass; filterButton.textContent = button.label; filterButton.setAttribute('onclick', `setFilter(this, '${button.value}', 0, null, '${randomCategoryDescription}')`); filterButton.style.color = data.listColor; filtersContainer.appendChild(filterButton); }); const searchWrapper = $('

').addClass('search-wrapper'); const selectElement = $('').attr({ type: 'text', placeholder: ' 🔍 Rechercher', class: 'search-bar' }).attr('onkeyup', 'filteredAndSearched(this.value)'); data.filterButtons.forEach(option => { let isSelected = (option.value === data.currentFilter); const selectOption = $('
', { class: 'page-component__bg_image_box page-component__bg_image_box--dark-bg bg-accent-color first_component', id: 'posts-04-551551', }); const innerDiv1 = $('
', {class: 'page-component__bg_overlay_box'}); parentDiv.append(innerDiv1); const innerDiv2 = $('
', { class: 'page-component__wrapper', style: 'z-index: 15; padding-top: 50px; padding-bottom: 90px' }).css('background-color', data.backgroundColor); parentDiv.append(innerDiv2); const containerDiv1 = $('
', {class: 'containor container--small'}); const containerDiv2 = $('
', {class: 'containor container--mid'}); const titleBox = $('
', {class: 'title-box title-box--center'}); const heading = $('

', {class: 'heading', text: data.title, style: 'color:' + data.textColor}); titleBox.append(heading); const contentBox = $('
', {class: 'title-box__text content_box'}); const contentParagraph = $('

', {text: data.text, style: 'color:' + data.textColor}); contentBox.append(contentParagraph); titleBox.append(contentBox); containerDiv1.append(titleBox); innerDiv2.append(containerDiv1); const postsWrapperDiv = $('

', {class: 'posts-04__wrapper'}); const items = data.list; items.forEach(item => { const itemDiv = $('', {href: item.lien, target: '_self', class: 'posts-04__item'}); const img = $('', {class: 'posts-04__img', height: '50', src: item.src}); const title = $('

', {class: 'posts-04__title', text: item.title}); const text = $('', {class: 'posts-04__text', text: item.text}); itemDiv.append(img, title, text); postsWrapperDiv.append(itemDiv); }); containerDiv2.append(postsWrapperDiv); innerDiv2.append(containerDiv2); const bottomCTADiv = $('
', {class: 'bottom_cta'}); containerDiv2.append(bottomCTADiv); $('.customAlloBlocks').append(parentDiv.html()); ButtonBlock(data.button, data.backgroundColor); SeparatorBlock(data.separator, data.backgroundColor); } // ================== BLOCK 2 function Block2(data) { if (data.visible !== 'oui') return; const pageComponentBgImageBox = $('
', { class: 'page-component__bg_image_box page-component__bg_image_box--dark-bg bg-accent-color', id: 'posts-02-570311' }).css('background-color', data.backgroundColor); const pageComponentBgOverlayBox = $('
', {class: 'page-component__bg_overlay_box'}); const pageComponentWrapper = $('
', { class: 'page-component__wrapper', style: 'z-index: 14; padding-top: 50px; padding-bottom: 75px' }); pageComponentBgOverlayBox.append(pageComponentWrapper); pageComponentBgImageBox.append(pageComponentBgOverlayBox); const posts02 = $('
', {class: 'posts-02'}); const containerSmall = $('
', {class: 'containor container--small'}); const containerMid = $('
', {class: 'containor container--mid'}); const posts02Wrapper = $('
', {class: 'posts-02__wrapper'}); const titleBox = $('
', {class: 'title-box title-box--center'}); const titleBoxText = $('
', {class: 'title-box__text content_box', style: 'color:' + data.textColor}); titleBox.append($('

', {class: 'heading', text: data.title, style: 'color:' + data.textColor})); titleBox.append(titleBoxText.html(data.text)); containerSmall.append(titleBox); const itemsData = data.list; posts02Wrapper.append(itemsData.map(item => { const postItem = $('
', {class: 'posts-02__item posts-02__item--accent', href: item.href}); const postItemText = $('
', {class: 'posts-02__text'}); const postItemTitle = $('

', {class: 'posts-02__title', text: item.title}); const postItemInfo = $('
', {class: 'posts-02__info', text: item.info}); const postItemImgBox = $('
', {class: 'posts-02__img_box'}); const postItemImage = $('', {class: 'posts-02__img', src: item.image}); postItemText.append(postItemTitle, postItemInfo); postItemImgBox.append(postItemImage); postItem.append(postItemText, postItemImgBox); return postItem; })); containerMid.append(posts02Wrapper); posts02.append(containerSmall, containerMid); pageComponentWrapper.append(posts02); pageComponentBgImageBox.appendTo('.customAlloBlocks'); // Rends les blocs cliquables $(document).ready(function () { $(document).on('click', '.posts-02__item', function () { var href = $(this).attr('href'); window.location.href = href; }); }); ButtonBlock(data.button, data.backgroundColor); SeparatorBlock(data.separator, data.backgroundColor); } // ================== BLOCK 3 function Block3(data) { if (data.visible !== 'oui') return; var html = $('
', { class: 'page-component__bg_image_box page-component__bg_image_box--dark-bg bg-accent-color', id: 'slider-05-111911' }).css('background-color', data.backgroundColor); var bgOverlayBox = $('
', { class: 'page-component__bg_overlay_box', style: '' }); html.append(bgOverlayBox); var pageWrapper = $('
', { class: 'page-component__wrapper', style: 'z-index: 13; padding-top: 50px; padding-bottom: 50px;' }); html.append(pageWrapper); var sliderDiv = $('
', { class: 'slider-05 graphics-image default-graphics-image' }); pageWrapper.append(sliderDiv); var containerDiv = $('
', { class: 'containor container--small' }); sliderDiv.append(containerDiv); var titleBox = $('
', { class: 'title-box title-box--center' }); containerDiv.append(titleBox); var heading = $('

', { class: 'heading', text: data.title, style: 'color:' + data.textColor }); titleBox.append(heading); var contentBox = $('
', { class: 'title-box__text content_box', text: data.text, style: 'color:' + data.textColor }); titleBox.append(contentBox); var containerMaxDiv = $('
', { class: 'containor container--max slider-05__wrapper' }); sliderDiv.append(containerMaxDiv); var sliderContainer = $('
', { class: 'slider-05__slider_container' }); containerMaxDiv.append(sliderContainer); var slider = $('
', { class: 'slickslider slider-05__slider' }); sliderContainer.append(slider); slider.append(NextPrevButtons(slider, data.arrowsColor)); const itemsData = data.list; const container = $('