From 9ac2f4ff2d0c0839497d721b0e3c886ea86900eb Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Thu, 28 Oct 2021 16:27:37 +0000 Subject: [PATCH] wip #4835 @1 --- inc/ws/Util/html5/master/class.ws.html5.compiler.php | 5 +++++ inc/ws/Util/html5/master/class.ws.html5.links.php | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/inc/ws/Util/html5/master/class.ws.html5.compiler.php b/inc/ws/Util/html5/master/class.ws.html5.compiler.php index 64848c9fa..7b60c4cfd 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -2852,6 +2852,11 @@ height="0" width="0" style="display:none;visibility:hidden"> $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])) { diff --git a/inc/ws/Util/html5/master/class.ws.html5.links.php b/inc/ws/Util/html5/master/class.ws.html5.links.php index a11959428..0a2ff9585 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.links.php +++ b/inc/ws/Util/html5/master/class.ws.html5.links.php @@ -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)) { -- 2.39.5