From: Vincent Vanwaelscappel Date: Fri, 9 Feb 2024 14:25:46 +0000 (+0100) Subject: wait #6719 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=20d2ce825e89ddfeef7b51834ade8f2b41416b62;p=fluidbook_tools.git wait #6719 @0.25 --- diff --git a/src/Links/ContentLink.php b/src/Links/ContentLink.php index 35390cc..659b627 100644 --- a/src/Links/ContentLink.php +++ b/src/Links/ContentLink.php @@ -10,7 +10,7 @@ class ContentLink extends Link public $forceTexture = false; public $parallax = 0; - protected $contentInlineStyles=''; + protected $contentInlineStyles = ''; public function getHTMLContainerClass() { @@ -56,6 +56,9 @@ class ContentLink extends Link if ($s = $this->_isZoomedIn($animations)) { $res .= ' data-animation-zoomed-in="' . $s['scale'] . '" '; } + if ($s = $this->_isScaledIn($animations)) { + $res .= ' data-animation-zoomed-in="' . $s['scale'] . '" '; + } if ($s = $this->_isZoomedOut($animations)) { $scale = $s['scale'] ?? 1; @@ -63,6 +66,13 @@ class ContentLink extends Link $res .= ' data-animation-zoomed-out="' . $scale . '" data-animation-zoomed-origin="' . $to . '" '; $this->contentInlineStyles .= 'transform:scale(' . $scale . ');transform-origin:' . $to . ';'; } + + if ($s = $this->_isScaledOut($animations)) { + $scale = $s['scale'] ?? 1; + $to = $s['transformOrigin'] ?? '50% 50%'; + $res .= ' data-animation-zoomed-out="' . $scale . '" data-animation-zoomed-origin="' . $to . '" '; + $this->inlineStyles .= 'transform:scale(' . $scale . ');transform-origin:' . $to . ';'; + } } if ($this->parallax != 0) { @@ -85,14 +95,25 @@ class ContentLink extends Link protected function _isZoomedIn($animations) { - return $this->_hasAnimation($animations, ['zoomin', 'scaleto'], ['scale', 'transformOrigin']); + return $this->_hasAnimation($animations, ['zoomin'], ['scale', 'transformOrigin']); + } + + protected function _isScaledIn($animations) + { + return $this->_hasAnimation($animations, ['scale'], ['scale', 'transformOrigin']); } protected function _isZoomedOut($animations) { - return $this->_hasAnimation($animations, ['zoomout', 'scalefrom'], ['scale', 'transformOrigin']); + return $this->_hasAnimation($animations, ['zoomout'], ['scale', 'transformOrigin']); } + protected function _isScaledOut($animations) + { + return $this->_hasAnimation($animations, ['scalefrom'], ['scale', 'transformOrigin']); + } + + protected function _isFinallyHidden($animations) { return $this->_hasAnimation($animations, ['fadeout', 'unmask']); diff --git a/src/Links/Link.php b/src/Links/Link.php index 7735053..9850516 100644 --- a/src/Links/Link.php +++ b/src/Links/Link.php @@ -148,6 +148,8 @@ class Link protected static $_encryptedTypes = [14, 15, 35, 39]; protected static $_encryptedAttributes = ['image_rollover']; + protected $inlineStyles = ''; + /** * * @var CompilerInterface @@ -610,7 +612,7 @@ class Link } $attached = $this->attached ? ' data-attached="' . $this->attached . '" ' : ''; - return '
' . $this->getHTMLContent() . '
'; + return '
' . $this->getHTMLContent() . '
'; } public function getHTMLContainerClass()