From: vincent@cubedesigners.com Date: Tue, 15 Jun 2021 16:05:45 +0000 (+0000) Subject: wait #4536 @0.75 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=6b158fca443af8016f4ff8cb81e834f392fd679d;p=cubeextranet.git wait #4536 @0.75 --- diff --git a/inc/ws/Util/html5/blendmode/class.ws.html5.links.php b/inc/ws/Util/html5/blendmode/class.ws.html5.links.php index 7d33354bc..865878c43 100644 --- a/inc/ws/Util/html5/blendmode/class.ws.html5.links.php +++ b/inc/ws/Util/html5/blendmode/class.ws.html5.links.php @@ -1533,7 +1533,7 @@ class layerLink extends imageLink if (!$this->rightClone) { zoomLink::generateImage($attributes, $this->compiler, 'layerlink', 'layer'); } - return 'background-image:url(' . $this->getImageUrl() . ');background-size:100% 100%;background-repeat:no-repeat;'; + return 'background-image:url(' . $this->getImageUrl() . ');background-size:' . $this->getBackgroundSize() . ';background-position:' . $this->getBackgroundPosition() . ';background-repeat:no-repeat;'; } public function getImageUrl() @@ -1561,7 +1561,9 @@ class colorLink extends contentLink public function getCSS() { - return 'background-color:' . wsHTML5::colorToCSS($this->to, 1) . ';'; + $res = parent::getCSS(); + $res .= 'background-color:' . wsHTML5::colorToCSS($this->to, 1) . ';'; + return $res; } public function getAdditionnalContent() @@ -1582,7 +1584,9 @@ class textLink extends contentLink } $fz = $this->height * $this->getCssScale(); $fz = round($fz / $font['capHeight'], 2); - return 'line-height:' . $font['capHeight'] . ';font-size:' . $fz . 'px;font-family:' . $font['family'] . ';color:' . wsHTML5::colorToCSS($this->extra, 1) . ';'; + $res = parent::getCSS(); + $res .= 'line-height:' . $font['capHeight'] . ';font-size:' . $fz . 'px;font-family:' . $font['family'] . ';color:' . wsHTML5::colorToCSS($this->extra, 1) . ';'; + return $res; } public function getHTMLContainerClass() @@ -1614,8 +1618,34 @@ class imageLink extends contentLink public function getCSS() { + $res = parent::getCSS(); $this->copyExternalFile($this->to); - return 'background-image:url(' . $this->getImageUrl() . ');background-size:100% 100%;background-repeat:no-repeat;'; + $res .= 'background-image:url(' . $this->getImageUrl() . ');background-size:' . $this->getBackgroundSize() . ';background-position:' . $this->getBackgroundPosition() . ';background-repeat:no-repeat;'; + return $res; + } + + public function getBackgroundPosition() + { + $animations = self::parseAnimations($this->image_rollover); + foreach ($animations as $animation) { + if (($animation['type'] === 'zoomout' || $animation['type'] === 'zoomin') && isset($animation['transformorigin'])) { + return $animation['transformorigin']; + } + } + return '50% 50%'; + } + + public function getBackgroundSize() + { + + $size = '100%'; + $animations = self::parseAnimations($this->image_rollover); + foreach ($animations as $animation) { + if ($animation['type'] === 'zoomout') { + $size = round($animation['scale'] * 100) . '%'; + } + } + return $size . ' ' . $size; } public function getAdditionnalContent()