From 9cda9349b8a9fdfe37d4af99b51499d9f6920759 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 13 Feb 2025 19:11:29 +0100 Subject: [PATCH] #7241 --- src/Links/NormalLink.php | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/src/Links/NormalLink.php b/src/Links/NormalLink.php index 2251de8..549d2c9 100644 --- a/src/Links/NormalLink.php +++ b/src/Links/NormalLink.php @@ -14,15 +14,20 @@ class NormalLink extends Link public function getHTMLContent() { $class = $this->getClasses(); + $attrs = ''; if ($this->display_area) { - $class[] = 'displayArea'; + if ($this->compiler->getSetting('linksAnimationLayer', 'top') === 'top' || $this->compiler->getSetting('linksAnimation', 'fade') === 'fade') { + $class[] = 'displayArea'; + $attrs .= ' data-animation="' . $this->compiler->getSetting('linksAnimation', 'fade') . '"'; + } else { + $attrs .= ' data-display-area=""'; + } } - $attrs = ''; if (count($class)) { $attrs .= ' class="' . implode(' ', $class) . '"'; } $attrs .= $this->getTooltipAttribute(); - if ($this->blinkdelay>0) { + if ($this->blinkdelay > 0) { $attrs .= ' data-blinkdelay="' . intval($this->blinkdelay) . '"'; } return 'getAdditionnalContent() . $this->getTrack() . '>' . $this->getInnerContent() . ''; @@ -44,5 +49,30 @@ class NormalLink extends Link return '_self'; } + /** + * @throws \Exception + */ + public function getDisplayAreaLink($color, $opacity, $duration) + { + $init = $this->_init; + $init['type'] = self::COLOR; + $init['to'] = $color; + $init['zindex'] = 29; + $init['uid'] .= '_da'; + $init['id'] .= '_da'; + $init['image_rollover'] = 'type=reveal +direction=right +ease=power1.easeOut +opacity=' . $opacity . ' +duration=' . $duration . ' +delay=0.5 +borderRadius=' . ($this->compiler->getSetting('linksRoundedCorners', 0) * 2) . ' +--------------- +type=fadeout +ease=power1.easeOut +duration=' . $duration . ' +delay=' . ($duration + 0.5); + return self::getInstance($init['id'], $init, $this->compiler); + } } -- 2.39.5