' ); $("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); } // 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, gotDataBlock.projectsSponsoText, gotDataBlock.badgeUrl ); } } // 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); } } // ================= BLOCK 23 function Block23(data) { if (data.visible !== "oui") return; // Create the outermost div with specified classes and attributes var outerDiv = $("
", { class: "page-component__bg_image_box page-component__bg_image_box--dark-bg bg-accent-color page-component__bg_image_box--has-image", id: "header-23-190821", style: 'background-image: url("' + data.image + '")' }); // Create the first inner div with class and opacity style var overlayDiv = $("
", { class: "page-component__bg_overlay_box", style: "opacity: unset;background-color: rgba(33, 39, 46, " + data.imageOpacity + ");" }); // Create the second inner div with z-index and padding styles var wrapperDiv = $("
", { class: "page-component__wrapper", style: "z-index: 10;padding-top:40px;padding-bottom:70px;" }); // Create the header element with specified classes var header = $("
", { class: "header-23 graphics-image default-graphics-image" }); // Create the container div with the specified classes var container = $("
", { class: "container container--large header-23__container", style: "margin-right: auto;margin-left: auto;padding: 0 15px;" }); // Create the left section of the header var leftDiv = $("
", { class: "header-23__left" }); // Create the content box within the left section var contentDiv = $("
", { class: "header-23__left_content" }); // Create the heading element with specified classes and text var heading = $("

", { class: "heading--accent header-23__heading", text: data.title, style: "letter-spacing: 0.4px;color: " + data.textColor + ";" }); // Create the text paragraph within the left section var textDiv = $("
", { class: "header-23__text content_box", style: "color: " + data.textColor + ";" }); // Create the text within the paragrap var text = $("

", { text: data.text }); // Create the CTA (Call to Action) box var ctaDiv = $("

", { class: "header-23__cta_box" }); // Append all elements in the correct hierarchy textDiv.append(text); contentDiv.append(heading, textDiv); data.buttons.forEach(function (button) { // Create the button within the CTA box var myButton = $("", { class: "button", href: button.href, style: "background-color: " + button.backgroundColor + ";", target: "_self" }); // Create the button text var buttonText = $("", { class: "button__text", style: "color: " + button.textColor + ";", text: button.text }); // Append it to the CTA container myButton.append(buttonText); if (button.visible === "oui") ctaDiv.append(myButton); }); contentDiv.append(ctaDiv); leftDiv.append(contentDiv); container.append(leftDiv); header.append(container); wrapperDiv.append(header); overlayDiv.append(wrapperDiv); outerDiv.append(overlayDiv); // Append the final HTML to the body of the document $(".customAlloBlocks").append(outerDiv); } // DEBUT PERSONNALISATION // Configuration des PROFILS var versionAlloScript = "3.0"; var dataBlock23 = { visible: "oui", textColor: "#fff", title: "Alexiavoyance", text: "Besoin de lever un doute sur votre avenir ? Obtenez des consultations de voyance authentiques, sérieuses et confidentielles à toute heure.", image: "https://ucarecdn.com/1f485ebd-7f68-46db-8b72-acf70356b0e4/-/preview/1000x333/", imageOpacity: "0.01", buttons: [ { visible: "oui", text: "Retour vers l'accueil ->", textColor: "#fff", backgroundColor: "#fa4976", href: "https://alexiavoyance.com" }, { visible: "oui", text: "Mon compte ->", textColor: "#fff", backgroundColor: "#fa4976", href: "https://fr.alexiavoyance.com/signup" }, { visible: "oui", text: "Consulter Alexia ->", textColor: "#fff", backgroundColor: "#fa4976", href: "https://fr.alexiavoyance.com/2/alexia-je-vous-devoile-votre-avenir-a-tout-de-suite-99-de-retours-positifs" } ] }; // Création des blocks dans l'ordre définie function createBlocks(dataBlocks) { $("section:not(.white):has(div.container)").after( "
" ); Block23(dataBlocks[0]); } const TEST = false; // Mettre true pour codepen, Mettre false pour les sites // FIN PERSONNALISATION // Ne pas toucher la partie en dessous if (TEST) { var script = document.createElement("script"); script.src = "https://code.jquery.com/jquery-3.6.3.min.js"; document.getElementsByTagName("head")[0].appendChild(script); window.setTimeout(() => { var siteUrl = ""; let currentUrl = window.location.href.split("?")[0]; let isHomePage = currentUrl.replace("www.", "").replace(siteUrl, "") === "" || currentUrl.replace("www.", "").replace(siteUrl, "") === "/"; initAlloBlocks([ dataBlock23, ]); }, 125); } else { let isLoadingBlocks = false; const blocksCreator = () => { if (hasLoadedJQuery === false) { if (window.jQuery) hasLoadedJQuery = true; } if (hasLoadedJQuery) { let customAlloBlockTwo = $(".customAlloBlocks").length; if (customAlloBlockTwo) { isLoadingBlocks = false; } let currentUrl = window.location.href.split("?")[0]; let isHomePage = currentUrl.replace("www.", "").replace(siteUrl, "") === "" || currentUrl.replace("www.", "").replace(siteUrl, "") === "/"; if (!isLoadingBlocks && isHomePage && !customAlloBlockTwo) { isLoadingBlocks = true; initAlloBlocks([ dataBlock23, ]); } } window.setTimeout(blocksCreator, 25); }; window.setTimeout(blocksCreator, 35); }