From 77c0a175749d354926ac22c953f6fcd0c9a3fa06 Mon Sep 17 00:00:00 2001 From: soufiane Date: Tue, 7 Oct 2025 18:25:23 +0200 Subject: [PATCH] wip #7769 @7:00 corriger l'animation reveal --- resources/linkeditor/js/linkeditor.links.js | 12 +++- .../linkeditor/js/linkeditor.previewLinks.js | 67 +++++-------------- resources/linkeditor/style/inc/_links.sass | 9 +++ 3 files changed, 36 insertions(+), 52 deletions(-) diff --git a/resources/linkeditor/js/linkeditor.links.js b/resources/linkeditor/js/linkeditor.links.js index fa22c8e81..2b3bfedca 100644 --- a/resources/linkeditor/js/linkeditor.links.js +++ b/resources/linkeditor/js/linkeditor.links.js @@ -1589,7 +1589,17 @@ LinkeditorLinks.prototype = { let target = $("#linkeditor-layer-links [data-id-preview='"+links[link].uid+"']") target.css("display","block") let animations = this.resolveAnimation(animationText, target) - let previewDiv = links[link].type === '39' ? $("#linkeditor-layer-links > [data-id-preview-wrap="+links[link].uid+"] > [data-id-preview="+links[link].uid+"]") : $("[data-id-preview=" + links[link].uid + "]") + let previewDiv = $("[data-id-preview=" + links[link].uid + "]") + if(links[link].type === '39') { + console.log(links[link]) + if (links[link].to === "image") { + previewDiv = $("#linkeditor-layer-links > [data-id-preview-wrap="+links[link].uid+"] .linkeditor-page-images") + } else if (links[link].to === "onlytext" || links[link].to === "text") { + previewDiv = $("#linkeditor-layer-links > [data-id-preview-wrap="+links[link].uid+"] .linkeditor-page-texts") + }else { + previewDiv = $("#linkeditor-layer-links > [data-id-preview-wrap="+links[link].uid+"] > [data-id-preview="+links[link].uid+"]") + } + } var el = previewDiv let animWithBackground = animations.filter((v) => v.backgroundcolor) diff --git a/resources/linkeditor/js/linkeditor.previewLinks.js b/resources/linkeditor/js/linkeditor.previewLinks.js index 97b36dc1b..01a992f9e 100644 --- a/resources/linkeditor/js/linkeditor.previewLinks.js +++ b/resources/linkeditor/js/linkeditor.previewLinks.js @@ -73,8 +73,14 @@ LinkeditorPreviewLinks.prototype = {
-
-
+
+
+
+
+
+
+
+
@@ -175,56 +181,15 @@ LinkeditorPreviewLinks.prototype = { */ this.createPreviewLayerHTML($("#linkeditor-layer-links"),$this.linkData.uid) - /*if (animZoom.length > 0) { - $("#linkeditor-layer-links [data-id-preview=" + $this.linkData.uid + "] .preview").addClass("img") + if ($(".linkeditor-fluidbook-copy[data-id=" + $this.linkData.uid + "] img").length < 1) { + $("#linkeditor-page-left .contents img.images").clone().addClass('left').appendTo(".linkeditor-fluidbook-copy[data-id=" + $this.linkData.uid + "] .linkeditor-page-images .linkeditor-page-left-copy") + $("#linkeditor-page-right .contents img.images").clone().addClass('left').appendTo(".linkeditor-fluidbook-copy[data-id=" + $this.linkData.uid + "] .linkeditor-page-images .linkeditor-page-right-copy") - let srcImgLeft = $("#linkeditor-page-left .contents img.images").attr('src') - let srcTextLeft = $("#linkeditor-page-left .contents img.texts").attr('src') - - let bgLeft = 'url(' + srcTextLeft + '), url(' + srcImgLeft + ')' - - if ($this.linkData.to === "image") { - // do something - bgLeft = 'url(' + srcImgLeft + ')' - } else if ($this.linkData.to === "onlytext" || $this.linkData.to === "text") { - // do something - bgLeft = 'url(' + srcTextLeft + ')' - } - - $("#linkeditor-layer-links [data-id-preview=" + $this.linkData.uid + "] .preview").css({ - "background-image": bgLeft, - "background-size": "100%", - "height": "100%" - }) - - if($("#linkeditor").hasClass("double")) { - let srcImgRight = $("#linkeditor-page-right .contents img.images").attr('src') - let srcTextRight = $("#linkeditor-page-right .contents img.texts").attr('src') - - let bgRight = 'url(' + srcTextRight + '), url(' + srcImgRight + ')' - - if ($this.linkData.to === "image") { - // do something - bgRight = 'url(' + srcImgRight + ')' - } else if ($this.linkData.to === "onlytext" || $this.linkData.to === "text") { - // do something - bgRight = 'url(' + srcTextRight + ')' - } - - $(".linkeditor-fluidbook-copy[data-id=" + $this.linkData.uid + "] .linkeditor-page-right-copy").css({ - "background": bgRight, - "background-size": "100%" - }) - } + $("#linkeditor-page-left .contents img.texts").clone().addClass('right').appendTo(".linkeditor-fluidbook-copy[data-id=" + $this.linkData.uid + "] .linkeditor-page-texts .linkeditor-page-left-copy") + $("#linkeditor-page-right .contents img.texts").clone().addClass('right').appendTo(".linkeditor-fluidbook-copy[data-id=" + $this.linkData.uid + "] .linkeditor-page-texts .linkeditor-page-right-copy") + } + $("#linkeditor-layer-links [data-id-preview=" + $this.linkData.uid + "] .preview").removeClass("img") - //$("[data-id-preview=" + $this.linkData.uid + "] .preview-wrapper .linkeditor-page").remove() - } else {*/ - if ($(".linkeditor-fluidbook-copy[data-id=" + $this.linkData.uid + "] img").length < 1) { - $("#linkeditor-page-left .contents img").clone().addClass('left').appendTo(".linkeditor-fluidbook-copy[data-id=" + $this.linkData.uid + "] .linkeditor-page-left-copy") - $("#linkeditor-page-right .contents img").clone().addClass('right').appendTo(".linkeditor-fluidbook-copy[data-id=" + $this.linkData.uid + "] .linkeditor-page-right-copy") - } - $("#linkeditor-layer-links [data-id-preview=" + $this.linkData.uid + "] .preview").removeClass("img") - /*}*/ } this.setTransformOrigin($this.linkData) @@ -355,7 +320,7 @@ LinkeditorPreviewLinks.prototype = { let polygon = "polygon(" if(json.length > 0) { for(let i in json) { - polygon += (parseInt(x)+parseInt(json[i].x))+"px "+(parseInt(y)+parseInt(json[i].y))+"px" + polygon += parseInt(json[i].x)+"px "+parseInt(json[i].y)+"px" if(+i+1 !== json.length) { polygon += ',' } diff --git a/resources/linkeditor/style/inc/_links.sass b/resources/linkeditor/style/inc/_links.sass index 9ed7f901c..7aa3aec98 100644 --- a/resources/linkeditor/style/inc/_links.sass +++ b/resources/linkeditor/style/inc/_links.sass @@ -23,6 +23,15 @@ body:not(.preview) display: none #linkeditor + .linkeditor-page-texts, + .linkeditor-page-images + position: absolute + width: 100% + height: 100% + + .linkeditor-page-texts + z-index: 2 + .linkeditor-page-right-copy, .linkeditor-page-left-copy height: 100% -- 2.39.5