Forráskód Böngészése

Suppression Page 19

Tibo 4 éve
szülő
commit
bf903220e1
2 módosított fájl, 20 hozzáadás és 12 törlés
  1. 7 7
      src/css/styles_de_paragraphes.scss
  2. 13 5
      src/pages/Index.vue

+ 7 - 7
src/css/styles_de_paragraphes.scss

@@ -253,14 +253,18 @@ p img{
 	margin-top: calc(-#{$marge} - #{$fond-perdu}) !important;
 	left:0;
 	top:0;
-	padding: 2cm;
-	break-before: always;
-	break-after: always;
 	display: flex;
 	justify-content: center;
+	& p {
+		line-height: 1.2em;
+	}
 }
 
 blockquote{
+	break-before: always;
+	break-inside: avoid;
+	break-after: always;
+
 	& p{
 
 		position: relative;
@@ -270,10 +274,6 @@ blockquote{
 		background-color: white;
 	  box-shadow: 0.1cm 0px 0px white, 0.1cm 0px 0px white;
 	  box-decoration-break: clone;
-		line-height: calc(100% + 0.2cm);
-		// align-self: center;
-		top: 8%;
-		// transform: translateY(-50%);
 	}
 
 }

+ 13 - 5
src/pages/Index.vue

@@ -147,9 +147,9 @@ export default {
       this.$nextTick(function() {
         Promise.all(allPromises).then(() => {
           let previewer = new Previewer();
-          previewer.preview().then((flow)=>{
+          previewer.preview().then((flow) => {
             let layouts = Array.from(document.querySelectorAll(".layout"));
-            layouts.forEach(l=>{
+            layouts.forEach(l => {
               l.classList.add("full-layout");
             });
             // Centrer les citations
@@ -157,14 +157,22 @@ export default {
             citations.forEach((citation, i) => {
               let l = citation.closest(".layout");
               l.classList.add("pagequote");
-              console.log(l);
+            });
+            // Suppression des pages vides
+            let pages = Array.from(document.querySelectorAll(".pagedjs_blank_page"));
+            pages.forEach((page, i) => {
+              let nextPage = document.querySelector(`.pagedjs_page[data-page-number='${parseInt(page.dataset.pageNumber) + 1}']`);
+              if (nextPage.querySelector(".blank-page") !== null &&
+                nextPage.classList.contains("pagedjs_left_page")
+              ) {
+                nextPage.parentNode.removeChild(nextPage);
+              }
+              page.parentNode.removeChild(page);
             });
 
           });
         });
       });
-
-
     });
   }
 };