From cd69767e6fe74dc53c3e60233a0a049fe374eafe Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 17 Jul 2025 17:35:28 +0200 Subject: [PATCH] wip #7647 @0.5 --- src/Links/Link.php | 6 ++++++ src/Links/NormalLink.php | 25 +++++++++++++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/Links/Link.php b/src/Links/Link.php index 9b96248..5045bff 100644 --- a/src/Links/Link.php +++ b/src/Links/Link.php @@ -102,6 +102,7 @@ class Link public $inline; public $in_popup = false; public $display_area; + public $animation_type; public $read_mode; public $background_color; public $group; @@ -1129,4 +1130,9 @@ class Link $compiler->addIssue(2, ['page' => $link['page'], 'uid' => $link['uid']]); return ''; } + + public function getAnimationType() + { + return (!$this->animation_type || $this->animation_type === 'default') ? $this->compiler->getSetting('linksAnimation', 'fade') : $this->animation_type; + } } diff --git a/src/Links/NormalLink.php b/src/Links/NormalLink.php index ab670a1..ca5f402 100644 --- a/src/Links/NormalLink.php +++ b/src/Links/NormalLink.php @@ -18,7 +18,7 @@ class NormalLink extends Link if ($this->display_area) { if ($this->compiler->getSetting('linksAnimationLayer', 'top') === 'top' || $this->compiler->getSetting('linksAnimation', 'fade') === 'fade') { $class[] = 'displayArea'; - $attrs .= ' data-animation="' . $this->compiler->getSetting('linksAnimation', 'fade') . '"'; + $attrs .= ' data-animation="' . $this->getAnimationType() . '"'; } else { $attrs .= ' data-display-area=""'; } @@ -30,6 +30,7 @@ class NormalLink extends Link if ($this->blinkdelay > 0) { $attrs .= ' data-blinkdelay="' . intval($this->blinkdelay) . '"'; } + return 'getAdditionnalContent() . $this->getTrack() . '>' . $this->getInnerContent() . ''; } @@ -62,7 +63,8 @@ class NormalLink extends Link $init['zindex'] = 29; $init['uid'] .= '_da'; $init['id'] .= '_da'; - $init['image_rollover'] = 'type=reveal + if ($this->getAnimationType() === 'highlight') { + $init['image_rollover'] = 'type=reveal direction=right ease=power1.easeOut opacity=' . $opacity . ' @@ -74,6 +76,25 @@ type=fadeout ease=power1.easeOut duration=' . $animDuration . ' delay=' . ($delay - 0.5 + $animDuration + $duration); + } else if ($this->getAnimationType() === 'fade') { + $init['image_rollover'] = 'type=fadein +ease=power1.easeOut +duration=' . $animDuration . ' +delay=' . $delay . ' +borderradius=' . ($this->compiler->getSetting('linksRoundedCorners', 0) * 2) . ' +--------------- +type=fadeout +ease=power1.easeOut +duration=' . $animDuration . ' +delay=' . ($delay - 0.5 + $animDuration + $duration); + } else if ($this->getAnimationType() === 'none') { + $init['image_rollover'] = 'type=fadeout +ease=power1.easeOut +duration=0 +delay=0 +borderradius=' . ($this->compiler->getSetting('linksRoundedCorners', 0) * 2); + } + return self::getInstance($init['id'], $init, $this->compiler); } -- 2.39.5