]> _ Git - fluidbook_tools.git/commitdiff
wait #6719 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 9 Feb 2024 14:25:46 +0000 (15:25 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 9 Feb 2024 14:25:46 +0000 (15:25 +0100)
src/Links/ContentLink.php
src/Links/Link.php

index 35390ccc6051c6e6ea3a91496df2b0592791e53f..659b627753c920977baa4a855f59d9af4891f6ec 100644 (file)
@@ -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']);
index 7735053bbc46bf53e478ba26ac134c969f290de5..9850516076817a30ea185fe1c473e5263a898add 100644 (file)
@@ -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 '<div class="' . $this->getHTMLContainerClass() . '" style="mix-blend-mode:' . $this->blendmode . ';" data-blendmode="' . $this->blendmode . '" ' . $attached . ' data-hidden="' . $this->hidden . '" data-scorm="' . $this->scorm . '" data-id="' . $this->uid . '" id="l_' . $this->id . '"' . $addContent . '>' . $this->getHTMLContent() . '</div>';
+        return '<div class="' . $this->getHTMLContainerClass() . '" style="mix-blend-mode:' . $this->blendmode . ';'.$this->inlineStyles.'" data-blendmode="' . $this->blendmode . '" ' . $attached . ' data-hidden="' . $this->hidden . '" data-scorm="' . $this->scorm . '" data-id="' . $this->uid . '" id="l_' . $this->id . '"' . $addContent . '>' . $this->getHTMLContent() . '</div>';
     }
 
     public function getHTMLContainerClass()