]> _ Git - fluidbook_tools.git/commitdiff
#7241
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 13 Feb 2025 18:11:29 +0000 (19:11 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 13 Feb 2025 18:11:29 +0000 (19:11 +0100)
src/Links/NormalLink.php

index 2251de83e98062dbcfac614ab8713dd3cf116030..549d2c9ce758fd99028883693eece7cd5694de9a 100644 (file)
@@ -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 '<a href="' . $this->getURL() . '" data-type="' . $this->type . '" target="' . $this->getTarget() . '"' . $attrs . $this->getAdditionnalContent() . $this->getTrack() . '>' . $this->getInnerContent() . '</a>';
@@ -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);
+    }
 
 }