3 Commits ecf5196890 ... 6119ae3df0

Author SHA1 Message Date
  Tibo 6119ae3df0 Supression Page 19 4 years ago
  Tibo 47c04539a1 CiCitation au centre 4 years ago
  Tibo 08db42c397 Correction position Pagination 4 years ago
3 changed files with 43 additions and 18 deletions
  1. 7 0
      src/css/layout.scss
  2. 16 14
      src/css/styles_de_paragraphes.scss
  3. 20 4
      src/pages/Index.vue

+ 7 - 0
src/css/layout.scss

@@ -102,3 +102,10 @@
   margin: 0;
   margin-top: -1em;
 }
+
+.pagedjs_page.pagedjs_left_page .pagedjs_margin-bottom-left > .pagedjs_margin-content::after {
+    margin-left: 0.2cm;
+}
+.pagedjs_page.pagedjs_right_page .pagedjs_margin-bottom-right > .pagedjs_margin-content::after {
+    margin-right: 0.2cm;
+}

+ 16 - 14
src/css/styles_de_paragraphes.scss

@@ -243,22 +243,28 @@ p img{
 	line-height: 9pt;
 }
 
-blockquote{
-
-//	align-items: center;
+.pagequote{
 	position: absolute;
 	background-image: url("/motifs/croix.png");
 	background-size: 0.4cm;
 	width: calc(100% + (#{$marge} + #{$fond-perdu})*2);
-  height: calc(100% + (#{$marge} + #{$fond-perdu})*2);
-  margin-left: calc(-#{$marge} - #{$fond-perdu} );
-  margin-top: calc(-#{$marge} - #{$fond-perdu}) !important;
-  left:0;
-  top:0;
-	padding: 2cm;
+	height: calc(100% + (#{$marge} + #{$fond-perdu})*2);
+	margin-left: calc(-#{$marge} - #{$fond-perdu} );
+	margin-top: calc(-#{$marge} - #{$fond-perdu}) !important;
+	left:0;
+	top:0;
+	display: flex;
+	justify-content: center;
+	& p {
+		line-height: 1.2em;
+	}
+}
+
+blockquote{
 	break-before: always;
+	break-inside: avoid;
 	break-after: always;
-	// display: flex;
+
 	& p{
 
 		position: relative;
@@ -268,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%);
 	}
 
 }

+ 20 - 4
src/pages/Index.vue

@@ -147,16 +147,32 @@ 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
+            let citations = Array.from(document.querySelectorAll("blockquote"));
+            citations.forEach((citation, i) => {
+              let l = citation.closest(".layout");
+              l.classList.add("pagequote");
+            });
+            // 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);
+            });
+
           });
         });
       });
-
-
     });
   }
 };