diverses améliorations de la mep
This commit is contained in:
@@ -145,10 +145,10 @@
|
||||
}
|
||||
}
|
||||
// images collées en bas
|
||||
let bottomImgs = document.getElementsByClassName('bottomimg');
|
||||
let bottomImgs = document.querySelectorAll('.bottomimg, .tripleimgs_bottom, .tripleimgs2_bottom');
|
||||
for (let i = 0; i < bottomImgs.length; i++) {
|
||||
let page = bottomImgs[i].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
|
||||
bottomImgs[i].style.transform = 'translateY(' + (page.getBoundingClientRect().bottom - bottomImgs[i].firstElementChild.getBoundingClientRect().bottom) + 'px)';
|
||||
bottomImgs[i].style.transform = 'translateY(' + (page.getBoundingClientRect().bottom - bottomImgs[i].lastElementChild.getBoundingClientRect().bottom) + 'px)';
|
||||
}
|
||||
// éléments justifiés pas nécessaires
|
||||
let justifiedSplitEl = document.querySelectorAll("[data-align-last-split-element='justify']");
|
||||
@@ -161,16 +161,70 @@
|
||||
}
|
||||
}
|
||||
// images fullspread
|
||||
let fullspreadEl = document.getElementsByClassName('imgfullspreadleft');
|
||||
let fullspreadEl = document.querySelectorAll('.imgfullspreadleft, .imgfullspreadright');
|
||||
for (let i = 0; i < fullspreadEl.length; i++) {
|
||||
let imgSrc = fullspreadEl[i].firstElementChild.getAttribute('src');
|
||||
let nextPage = fullspreadEl[i].closest('.pagedjs_page').nextElementSibling.querySelectorAll('.pagedjs_page_content');
|
||||
let imgOverflowEl = document.createElement('div');
|
||||
imgOverflowEl.setAttribute('class', 'imgfullspreadleft-right');
|
||||
if (fullspreadEl[i].classList.contains('imgfullspreadleft')) {
|
||||
imgOverflowEl.setAttribute('class', 'imgfullspreadleft-right');
|
||||
} else {
|
||||
imgOverflowEl.setAttribute('class', 'imgfullspreadright-right');
|
||||
}
|
||||
let imgOverflow = document.createElement('img');
|
||||
imgOverflow.src = imgSrc;
|
||||
imgOverflowEl.append(imgOverflow);
|
||||
nextPage[0].append(imgOverflowEl);
|
||||
if (fullspreadEl[i].classList.contains('imgfullspreadright')) {
|
||||
let imgMargin = imgOverflowEl.getBoundingClientRect().right - fullspreadEl[i].firstElementChild.getBoundingClientRect().right;
|
||||
fullspreadEl[i].firstElementChild.style.marginLeft = imgMargin + 'px';
|
||||
}
|
||||
}
|
||||
// fullpage img page gauche
|
||||
let fullPageImg = document.getElementsByClassName('fullpageimage');
|
||||
for (let i = 0; i < fullPageImg.length; i++) {
|
||||
if (fullPageImg[i].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode
|
||||
.classList.contains('pagedjs_left_page')) {
|
||||
fullPageImg[i].style.marginLeft = '-22mm';
|
||||
}
|
||||
}
|
||||
// encarts bleed
|
||||
let encarts = document.querySelectorAll('.latour, .lampe')
|
||||
for (let i = 0; i < encarts.length; i++) {
|
||||
if (encarts[i].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode
|
||||
.classList.contains('pagedjs_right_page')) {
|
||||
encarts[i].style.marginRight = '-22mm';
|
||||
encarts[i].style.paddingRight = '22mm';
|
||||
}
|
||||
if (encarts[i].hasAttribute('data-split-original')) {
|
||||
let plainColor = document.createElement('div');
|
||||
let plainHeight = encarts[i]
|
||||
.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode
|
||||
.getBoundingClientRect().bottom - encarts[i].getBoundingClientRect().bottom;
|
||||
plainColor.setAttribute('class', 'encart-split');
|
||||
if (encarts[i]
|
||||
.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode
|
||||
.classList.contains('pagedjs_right_page')) {
|
||||
plainColor.style.width = "149mm";
|
||||
} else {
|
||||
plainColor.style.width = "129mm";
|
||||
}
|
||||
plainColor.style.height = plainHeight + "px";
|
||||
encarts[i].parentNode.append(plainColor);
|
||||
} else if (encarts[i].hasAttribute('data-split-from')) {
|
||||
let plainColor = document.createElement('div');
|
||||
plainColor.setAttribute('class', 'encart-split');
|
||||
if (encarts[i]
|
||||
.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode
|
||||
.classList.contains('pagedjs_right_page')) {
|
||||
plainColor.style.width = "149mm";
|
||||
} else {
|
||||
plainColor.style.width = "129mm";
|
||||
}
|
||||
plainColor.style.height = "22mm";
|
||||
plainColor.style.top = "-22mm";
|
||||
encarts[i].parentNode.prepend(plainColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user