window.addEventListener("DOMContentLoaded", (event) => {
// FOOTER
let mainFooter = document.querySelector(".main-footer")
let footerRight = mainFooter.querySelector("div.medium-8.large-6.large-offset-3.column")
let footerLeft = mainFooter.querySelector("div.medium-4.large-3.column")
let miniFooter = document.querySelector(".mini-footer")
let copyrightOSP = miniFooter.querySelector(".mf-text")
footerRight.classList.remove("large-6")
footerRight.classList.add("large-3")
footerRight.classList.remove("large-offset-3")
footerRight.classList.add("large-offset-6")
let p = document.createElement("p")
p.innerHTML = "Suivez-nous"
p.style.marginTop = "1rem"
p.style.marginBottom = "0"
p.style.textTransform = "uppercase"
p.style.color = "var(--primary)"
footerLeft.insertBefore(p, footerLeft.firstChild)
let a = document.createElement("a")
a.setAttribute("href", "/pages/cese")
a.innerHTML = "Site du CESE"
footerLeft.insertBefore(a, footerLeft.firstChild)
copyrightOSP.style.marginRight = "10px"
let copyrightPhoto = document.createElement("div")
copyrightPhoto.classList.add("mf-text")
copyrightPhoto.innerHTML = "Crédit photo © Katrin Baumann"
let row = miniFooter.querySelector(".row")
row.appendChild(copyrightPhoto)
// ______________________________________________________________________
// INITIATIVES TITLE
let currentURL = window.location.href
if (currentURL === "https://petitions.lecese.fr/initiatives") {
let mainContent = document.querySelector("main#content")
let wrapper = mainContent.querySelector("div.wrapper")
let divWrapper = document.createElement("div")
divWrapper.classList.add("row")
divWrapper.classList.add("column")
let pageTitleWrapper = document.createElement("div")
pageTitleWrapper.classList.add("page-title-wrapper")
divWrapper.appendChild(pageTitleWrapper)
let antiFlexDiv = document.createElement("div")
antiFlexDiv.classList.add("anti-flex-div")
pageTitleWrapper.appendChild(antiFlexDiv)
let h1 = document.createElement("h1")
h1.classList.add("heading1")
h1.classList.add("page-title")
h1.innerHTML = "Bienvenue dans
l’espace des pétitions!"
antiFlexDiv.appendChild(h1)
let p1 = document.createElement("p")
p1.classList.add("custom-title-p")
p1.innerHTML = "C’est ici que vous pouvez parcourir les pétitions déjà en ligne, les soutenir et déposer de nouvelles pétitions.
Pour en savoir plus sur le dépôt ou la signature de pétition, ou encore le traitement des pétitions au CESE, rendez-vous sur la page Pétitions : mode d'emploi."
let p2= document.createElement("p")
p2.classList.add("custom-title-p")
p2.innerHTML = "Besoin d’aide ? Contactez-nous à l’adresse petitions@lecese.fr"
antiFlexDiv.appendChild(p1)
antiFlexDiv.appendChild(p2)
wrapper.insertBefore(divWrapper, wrapper.firstChild)
antiFlexDivBefore = window.getComputedStyle(antiFlexDiv, "::before")
antiFlexDivHeight = antiFlexDiv.offsetHeight
root = document.querySelector(":root");
root.style.setProperty("--antiflexdivheight", antiFlexDivHeight+"px");
// __________________________________________________________________
let img = document.createElement("img")
img.setAttribute("src", "https://opensourcepolitics.eu/wp-content/uploads/2023/02/icon3.svg")
let imgPlaceholder = document.querySelector(".page-title-wrapper")
imgPlaceholder.insertBefore(img, imgPlaceholder.firstChild)
}
// ______________________________________________________________________
// PAGE INITIATIVES TITLE
if (currentURL === "https://petitions.lecese.fr/pages/initiatives") {
let antiFlexDiv = document.querySelector("h1.heading1.page-title")
antiFlexDiv.style.marginBottom = "1rem"
antiFlexDiv.classList.add("anti-flex-div")
antiFlexDivBefore = window.getComputedStyle(antiFlexDiv, "::before")
antiFlexDivHeight = antiFlexDiv.offsetHeight
root = document.querySelector(":root");
root.style.setProperty("--antiflexdivheight", (antiFlexDivHeight + 16)+"px");
// __________________________________________________________________
let img = document.createElement("img")
img.setAttribute("src", "https://opensourcepolitics.eu/wp-content/uploads/2023/02/icon2.svg")
let imgPlaceholder = document.querySelector(".page-title-wrapper")
imgPlaceholder.insertBefore(img, imgPlaceholder.firstChild)
}
// PAGE TRAITEMENT TITLE
if (currentURL === "https://petitions.lecese.fr/pages/traitement") {
let antiFlexDiv = document.querySelector("h1.heading1.page-title")
antiFlexDiv.style.marginBottom = "1rem"
antiFlexDiv.classList.add("anti-flex-div")
antiFlexDivBefore = window.getComputedStyle(antiFlexDiv, "::before")
antiFlexDivHeight = antiFlexDiv.offsetHeight
root = document.querySelector(":root");
root.style.setProperty("--antiflexdivheight", (antiFlexDivHeight + 16)+"px");
// __________________________________________________________________
let img = document.createElement("img")
img.setAttribute("src", "https://opensourcepolitics.eu/wp-content/uploads/2023/02/icon2.svg")
let imgPlaceholder = document.querySelector(".page-title-wrapper")
imgPlaceholder.insertBefore(img, imgPlaceholder.firstChild)
}
// PAGE REGLEMENT TITLE
if (currentURL === "https://petitions.lecese.fr/pages/reglement") {
let antiFlexDiv = document.querySelector("h1.heading1.page-title")
antiFlexDiv.style.marginBottom = "1rem"
antiFlexDiv.classList.add("anti-flex-div")
antiFlexDivBefore = window.getComputedStyle(antiFlexDiv, "::before")
antiFlexDivHeight = antiFlexDiv.offsetHeight
root = document.querySelector(":root");
root.style.setProperty("--antiflexdivheight", (antiFlexDivHeight + 16)+"px");
// __________________________________________________________________
let img = document.createElement("img")
img.setAttribute("src", "https://opensourcepolitics.eu/wp-content/uploads/2023/02/icon2.svg")
let imgPlaceholder = document.querySelector(".page-title-wrapper")
imgPlaceholder.insertBefore(img, imgPlaceholder.firstChild)
}
// PAGE SIGNER TITLE
if (currentURL === "https://petitions.lecese.fr/pages/signer-une-petition") {
let antiFlexDiv = document.querySelector("h1.heading1.page-title")
antiFlexDiv.style.marginBottom = "1rem"
antiFlexDiv.classList.add("anti-flex-div")
antiFlexDivBefore = window.getComputedStyle(antiFlexDiv, "::before")
antiFlexDivHeight = antiFlexDiv.offsetHeight
root = document.querySelector(":root");
root.style.setProperty("--antiflexdivheight", (antiFlexDivHeight + 16)+"px");
// __________________________________________________________________
let img = document.createElement("img")
img.setAttribute("src", "https://opensourcepolitics.eu/wp-content/uploads/2023/02/icon2.svg")
let imgPlaceholder = document.querySelector(".page-title-wrapper")
imgPlaceholder.insertBefore(img, imgPlaceholder.firstChild)
}
// PAGE DEPOSER TITLE
if (currentURL === "https://petitions.lecese.fr/pages/deposer-une-petition") {
let antiFlexDiv = document.querySelector("h1.heading1.page-title")
antiFlexDiv.style.marginBottom = "1rem"
antiFlexDiv.classList.add("anti-flex-div")
antiFlexDivBefore = window.getComputedStyle(antiFlexDiv, "::before")
antiFlexDivHeight = antiFlexDiv.offsetHeight
root = document.querySelector(":root");
root.style.setProperty("--antiflexdivheight", (antiFlexDivHeight + 16)+"px");
// __________________________________________________________________
let img = document.createElement("img")
img.setAttribute("src", "https://opensourcepolitics.eu/wp-content/uploads/2023/02/icon2.svg")
let imgPlaceholder = document.querySelector(".page-title-wrapper")
imgPlaceholder.insertBefore(img, imgPlaceholder.firstChild)
}
});