From: Vincent Vanwaelscappel Date: Thu, 13 Feb 2025 18:11:29 +0000 (+0100) Subject: #7241 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=9cda9349b8a9fdfe37d4af99b51499d9f6920759;p=fluidbook_tools.git #7241 --- 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); + } }