|
@@ -57,7 +57,10 @@ class setMarginTexts extends Paged.Handler {
|
|
let vignetteSize = bottomVignette.getBoundingClientRect().height;
|
|
let vignetteSize = bottomVignette.getBoundingClientRect().height;
|
|
if (bottomVignette.previousElementSibling) {
|
|
if (bottomVignette.previousElementSibling) {
|
|
let textBottom = bottomVignette.previousElementSibling.getBoundingClientRect().bottom;
|
|
let textBottom = bottomVignette.previousElementSibling.getBoundingClientRect().bottom;
|
|
- if (bottomVignette.previousElementSibling.classList.contains('labeur')) {
|
|
|
|
|
|
+ if (bottomVignette.previousElementSibling.classList.contains('labeur') ||
|
|
|
|
+ bottomVignette.previousElementSibling.classList.contains('citation') ||
|
|
|
|
+ bottomVignette.previousElementSibling.classList.contains('free') ||
|
|
|
|
+ bottomVignette.previousElementSibling.classList.contains('temps')) {
|
|
bottomVignette.style.marginTop = `${(pageBottom - textBottom) - vignetteSize}px`;
|
|
bottomVignette.style.marginTop = `${(pageBottom - textBottom) - vignetteSize}px`;
|
|
}
|
|
}
|
|
bottomVignette.style.transform = 'translateY(12px)';
|
|
bottomVignette.style.transform = 'translateY(12px)';
|
|
@@ -132,12 +135,13 @@ class setMarginTexts extends Paged.Handler {
|
|
// encarts
|
|
// encarts
|
|
let encarts = document.querySelectorAll('.latour, .lampe, .latour_nohead, .lampe_nohead');
|
|
let encarts = document.querySelectorAll('.latour, .lampe, .latour_nohead, .lampe_nohead');
|
|
for (let encart of encarts) {
|
|
for (let encart of encarts) {
|
|
- if (encart.previousElementSibling != null) {
|
|
|
|
|
|
+/* if (encart.previousElementSibling != null) {
|
|
encart.style.marginTop = '10mm';
|
|
encart.style.marginTop = '10mm';
|
|
}
|
|
}
|
|
if (encart.nextElementSibling != null) {
|
|
if (encart.nextElementSibling != null) {
|
|
encart.style.marginBottom = '10mm';
|
|
encart.style.marginBottom = '10mm';
|
|
}
|
|
}
|
|
|
|
+ */
|
|
|
|
|
|
if (encart.hasAttribute('data-split-to')) {
|
|
if (encart.hasAttribute('data-split-to')) {
|
|
let plainColor = document.createElement('div');
|
|
let plainColor = document.createElement('div');
|
|
@@ -153,6 +157,7 @@ class setMarginTexts extends Paged.Handler {
|
|
}
|
|
}
|
|
|
|
|
|
if (encart.hasAttribute('data-split-from')) {
|
|
if (encart.hasAttribute('data-split-from')) {
|
|
|
|
+ encart.style.marginTop = "0mm";
|
|
let plainColor = document.createElement('div');
|
|
let plainColor = document.createElement('div');
|
|
plainColor.setAttribute('class', 'encart-split');
|
|
plainColor.setAttribute('class', 'encart-split');
|
|
if (encart.closest('.pagedjs_page').classList.contains('pagedjs_right_page')) {
|
|
if (encart.closest('.pagedjs_page').classList.contains('pagedjs_right_page')) {
|
|
@@ -169,7 +174,7 @@ class setMarginTexts extends Paged.Handler {
|
|
// TITRES ATELIERS
|
|
// TITRES ATELIERS
|
|
let h3s = document.querySelectorAll('h3');
|
|
let h3s = document.querySelectorAll('h3');
|
|
for (let h3 of h3s) {
|
|
for (let h3 of h3s) {
|
|
- if (h3.nextSibling?.firstChild.tagName === "IMG") {
|
|
|
|
|
|
+ if (h3.nextSibling?.firstChild?.tagName === "IMG") {
|
|
let coverPhoto;
|
|
let coverPhoto;
|
|
let photoContainer = h3.nextElementSibling;
|
|
let photoContainer = h3.nextElementSibling;
|
|
if (h3.nextSibling?.children.length === 2) {
|
|
if (h3.nextSibling?.children.length === 2) {
|
|
@@ -327,6 +332,23 @@ class setMarginTexts extends Paged.Handler {
|
|
'#cb8e31'
|
|
'#cb8e31'
|
|
]
|
|
]
|
|
|
|
|
|
|
|
+ let sprays = [
|
|
|
|
+ '/user/themes/carnet-atterrissage/assets/sprays/spary_couleurs-page001.png',
|
|
|
|
+ '/user/themes/carnet-atterrissage/assets/sprays/spary_couleurs-page002.png',
|
|
|
|
+ '/user/themes/carnet-atterrissage/assets/sprays/spary_couleurs-page003.png',
|
|
|
|
+ '/user/themes/carnet-atterrissage/assets/sprays/spary_couleurs-page004.png',
|
|
|
|
+ '/user/themes/carnet-atterrissage/assets/sprays/spary_couleurs-page005.png',
|
|
|
|
+ '/user/themes/carnet-atterrissage/assets/sprays/spary_couleurs-page006.png',
|
|
|
|
+ '/user/themes/carnet-atterrissage/assets/sprays/spary_couleurs-page007.png',
|
|
|
|
+ '/user/themes/carnet-atterrissage/assets/sprays/spary_couleurs-page008.png',
|
|
|
|
+ '/user/themes/carnet-atterrissage/assets/sprays/spary_couleurs-page009.png',
|
|
|
|
+ '/user/themes/carnet-atterrissage/assets/sprays/spary_couleurs-page010.png',
|
|
|
|
+ '/user/themes/carnet-atterrissage/assets/sprays/spary_couleurs-page011.png',
|
|
|
|
+ '/user/themes/carnet-atterrissage/assets/sprays/spary_couleurs-page012.png',
|
|
|
|
+ '/user/themes/carnet-atterrissage/assets/sprays/spary_couleurs-page013.png',
|
|
|
|
+ '/user/themes/carnet-atterrissage/assets/sprays/spary_couleurs-page014.png'
|
|
|
|
+ ]
|
|
|
|
+
|
|
// set all colors
|
|
// set all colors
|
|
let allPages = document.querySelectorAll('.pagedjs_page');
|
|
let allPages = document.querySelectorAll('.pagedjs_page');
|
|
let atelierColor = '';
|
|
let atelierColor = '';
|
|
@@ -347,6 +369,27 @@ class setMarginTexts extends Paged.Handler {
|
|
if (pageCounter) {
|
|
if (pageCounter) {
|
|
pageCounter.style.color = atelierColor;
|
|
pageCounter.style.color = atelierColor;
|
|
}
|
|
}
|
|
|
|
+ let citations = page.querySelectorAll('.citation');
|
|
|
|
+ for (let citation of citations) {
|
|
|
|
+ // dessiner et colorer les guillemets
|
|
|
|
+ if (citation.innerText.charAt(0) === '“') {
|
|
|
|
+ citation.innerText = citation.innerText.substring(1);
|
|
|
|
+ }
|
|
|
|
+ if (citation.innerText.charAt(citation.innerText.length - 1) === '”') {
|
|
|
|
+ citation.innerText = citation.innerText.substring(0, citation.innerText.length - 1);
|
|
|
|
+ }
|
|
|
|
+ let guillemetOuvrant = document.createElement('div');
|
|
|
|
+ guillemetOuvrant.innerText = '“';
|
|
|
|
+ guillemetOuvrant.style.color = atelierColor;
|
|
|
|
+ guillemetOuvrant.classList.add('guillement_ouvrant');
|
|
|
|
+ citation.prepend(guillemetOuvrant);
|
|
|
|
+
|
|
|
|
+ let guillemetFermant = document.createElement('div');
|
|
|
|
+ guillemetFermant.innerText = '”';
|
|
|
|
+ guillemetFermant.style.color = atelierColor;
|
|
|
|
+ guillemetFermant.classList.add('guillement_fermant');
|
|
|
|
+ citation.append(guillemetFermant);
|
|
|
|
+ }
|
|
let atelierTitle = page.querySelector('h3');
|
|
let atelierTitle = page.querySelector('h3');
|
|
if (atelierTitle) {
|
|
if (atelierTitle) {
|
|
atelierTitle.style.color = atelierColor;
|
|
atelierTitle.style.color = atelierColor;
|
|
@@ -358,24 +401,33 @@ class setMarginTexts extends Paged.Handler {
|
|
let bibliographiePage = bibliographie.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement;
|
|
let bibliographiePage = bibliographie.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement;
|
|
bibliographiePage.style.backgroundColor = bgColor;
|
|
bibliographiePage.style.backgroundColor = bgColor;
|
|
let nextPage = bibliographiePage.parentElement?.nextElementSibling?.firstElementChild;
|
|
let nextPage = bibliographiePage.parentElement?.nextElementSibling?.firstElementChild;
|
|
- if (nextPage) {
|
|
|
|
- nextPage.style.backgroundColor = bgColor;
|
|
|
|
|
|
+ if (!bibliographie.closest('.pagedjs_page').previousElementSibling.querySelector('.bibliographie')) {
|
|
|
|
+ if (nextPage) {
|
|
|
|
+ nextPage.style.backgroundColor = bgColor;
|
|
|
|
+ }
|
|
|
|
+ let sprayImg = document.createElement('img');
|
|
|
|
+ sprayImg.setAttribute('src', sprays[atelierIndex]);
|
|
|
|
+ sprayImg.style.height = "242mm";
|
|
|
|
+ sprayImg.style.width = "60mm";
|
|
|
|
+ sprayImg.style.position = "absolute";
|
|
|
|
+ sprayImg.style.top = "-22mm";
|
|
|
|
+ sprayImg.style.right = "-20mm";
|
|
|
|
+ sprayImg.style.mixBlendMode = "multiply";
|
|
|
|
+ bibliographiePage.parentElement.nextElementSibling?.querySelector('.bibliographie').insertAdjacentElement("afterend", sprayImg);
|
|
}
|
|
}
|
|
- let sprayImg = document.createElement('img');
|
|
|
|
- sprayImg.setAttribute('src', '/user/themes/carnet-atterrissage/assets/sprays/spary_couleurs-page001.png');
|
|
|
|
- sprayImg.style.height = "242mm";
|
|
|
|
- sprayImg.style.width = "60mm";
|
|
|
|
- sprayImg.style.position = "absolute";
|
|
|
|
- sprayImg.style.top = "-22mm";
|
|
|
|
- sprayImg.style.right = "-20mm";
|
|
|
|
- sprayImg.style.mixBlendMode = "multiply";
|
|
|
|
- bibliographiePage.parentElement.nextElementSibling?.querySelector('.pagedjs_page_content').prepend(sprayImg);
|
|
|
|
|
|
|
|
}
|
|
}
|
|
let h4 = page.querySelector('h4');
|
|
let h4 = page.querySelector('h4');
|
|
if (h4 && h4?.nextElementSibling?.classList.contains('bibliographie')) {
|
|
if (h4 && h4?.nextElementSibling?.classList.contains('bibliographie')) {
|
|
h4.style.color = atelierColor;
|
|
h4.style.color = atelierColor;
|
|
}
|
|
}
|
|
|
|
+ let serpentins = document.querySelectorAll('img[alt="serpentin"]');
|
|
|
|
+ for (let serpentin of serpentins) {
|
|
|
|
+ let page = serpentin.closest('.pagedjs_page');
|
|
|
|
+ let nextPage = page.nextElementSibling;
|
|
|
|
+ page.style.backgroundColor = "rgb(245, 245, 245)";
|
|
|
|
+ nextPage.style.backgroundColor = "rgb(245, 245, 245)";
|
|
|
|
+ }
|
|
let links = page.querySelectorAll('a');
|
|
let links = page.querySelectorAll('a');
|
|
for (let link of links) {
|
|
for (let link of links) {
|
|
link.style.color = atelierColor;
|
|
link.style.color = atelierColor;
|