]> _ Git - cubeextranet.git/commitdiff
wip #4835 @1
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 28 Oct 2021 16:27:37 +0000 (16:27 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 28 Oct 2021 16:27:37 +0000 (16:27 +0000)
inc/ws/Util/html5/master/class.ws.html5.compiler.php
inc/ws/Util/html5/master/class.ws.html5.links.php

index 64848c9fab4d210dc78f8e3fdd0d806f03667e49..7b60c4cfd130970fd00af22f61fd5a634139e189 100644 (file)
@@ -2852,6 +2852,11 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
         $this->addLess('videojs/videojs');
     }
 
+    public function addParallax()
+    {
+        $this->addJsLib('parallax', ['js/libs/fluidbook/fluidbook.parallax.js']);
+    }
+
     public function addLottie($animationData, $params, $hash)
     {
         if (isset($this->_lottieIDByHash[$hash])) {
index a119594281a7cbe662efee44150cd327e7e0468a..0a2ff95853faf50ef3db8de38d463eb8f231f896 100644 (file)
@@ -50,6 +50,7 @@ class wsHTML5Link
     public $gamifyCoins = 0;
     public $tooltipColor = null;
     public $tooltipBackgroundColor = null;
+    public $parallax = 0;
     protected $role = 'button';
 
     protected $_init;
@@ -555,6 +556,10 @@ class wsHTML5Link
         if ($this->tooltipColor) {
             $res .= 'data-tooltip-color="' . $this->tooltipColor . '" ';
         }
+        if ($this->parallax) {
+            $this->compiler->addParallax();
+            $res .= ' data-parallax="' . $this->parallax . '"';
+        }
 
         return $res;
 
@@ -1016,6 +1021,10 @@ class contentLink extends wsHTML5Link
             if (isset($animation['addzindex'])) {
                 $this->addzindex = $animation['addzindex'];
             }
+            if (isset($animation['parallax'])) {
+                $this->parallax = $animation['parallax'];
+                unlink($animation['parallax']);
+            }
         }
         $res .= ' data-animations="' . htmlspecialchars(json_encode($animations), ENT_QUOTES) . '" ';
         if ($this->_isHiddenFirst($animations)) {