From ae83cb0c44c1aa8a3bcc28498b5f69b255217c08 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 21 Jul 2025 18:27:02 +0200 Subject: [PATCH] wip #7650 @1 --- src/Links/Link.php | 10 ++++++++-- src/Links/NormalLink.php | 13 ++++++++----- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/Links/Link.php b/src/Links/Link.php index e717343..8623a9f 100644 --- a/src/Links/Link.php +++ b/src/Links/Link.php @@ -850,7 +850,7 @@ class Link $css .= $this->getCSSClipPath(); $css .= $this->getCSS(); $css .= '}'; - $css.=$this->getExtraCSS(); + $css .= $this->getExtraCSS(); if ($this->cursor) { $css .= '#l_' . $this->id . ' a{cursor:' . $this->cursor . ' !important;}'; } @@ -897,7 +897,8 @@ class Link return ''; } - public function getExtraCSS(){ + public function getExtraCSS() + { return ''; } @@ -1158,4 +1159,9 @@ class Link { return (!$this->animation_type || $this->animation_type === 'default') ? $this->compiler->getSetting('linksAnimation', 'fade') : $this->animation_type; } + + public function getDisplayArea() + { + return $this->animation_type == '1' || $this->display_area === 'default' ? $this->compiler->getSetting('linksDisplayArea', 'fill') : $this->display_area; + } } diff --git a/src/Links/NormalLink.php b/src/Links/NormalLink.php index ad22271..b9ee506 100644 --- a/src/Links/NormalLink.php +++ b/src/Links/NormalLink.php @@ -17,9 +17,9 @@ class NormalLink extends Link $attrs = ''; if ($this->compiler->getSetting('linksAnimationLayer', 'top') === 'top') { $attrs .= ' data-animation="' . $this->getAnimationType() . '"'; - $attrs .= ' data-display-area="' . $this->display_area . '" '; + $attrs .= ' data-display-area="' . $this->getDisplayArea() . '" '; } else { - $attrs .= ' data-display-area="none" data-display-area-related=" ' . $this->display_area . '" '; + $attrs .= ' data-display-area="none" data-display-area-related=" ' . $this->getDisplayArea() . '" '; } if (count($class)) { @@ -56,6 +56,8 @@ class NormalLink extends Link { $animDuration = 0.4; + $borderRadius = $this->compiler->getSetting('linksRoundedCorners', 0) * 2; + $init = $this->_init; $init['type'] = self::COLOR; $init['to'] = $color; @@ -69,7 +71,7 @@ ease=power1.easeOut opacity=' . $opacity . ' duration=' . $animDuration . ' delay=' . $delay . ' -borderradius=' . ($this->compiler->getSetting('linksRoundedCorners', 0) * 2) . ' +borderradius=' . $borderRadius . ' --------------- type=fadeout ease=power1.easeOut @@ -78,9 +80,10 @@ delay=' . ($delay - 0.5 + $animDuration + $duration); } else if ($this->getAnimationType() === 'fade') { $init['image_rollover'] = 'type=fadein ease=power1.easeOut +opacity=' . $opacity . ' duration=' . $animDuration . ' delay=' . $delay . ' -borderradius=' . ($this->compiler->getSetting('linksRoundedCorners', 0) * 2) . ' +borderradius=' . $borderRadius . ' --------------- type=fadeout ease=power1.easeOut @@ -89,7 +92,7 @@ delay=' . ($delay - 0.5 + $animDuration + $duration); } else if ($this->getAnimationType() === 'none') { $init['image_rollover'] = 'type=keephidden duration=0.5 -borderradius=' . ($this->compiler->getSetting('linksRoundedCorners', 0) * 2); +borderradius=' . $borderRadius; } return self::getInstance($init['id'], $init, $this->compiler); -- 2.39.5