]> _ Git - fluidbook-v3.git/commitdiff
wait #7831 @1:00
authorsoufiane <soufiane@cubedesigners.com>
Mon, 15 Dec 2025 10:58:42 +0000 (11:58 +0100)
committersoufiane <soufiane@cubedesigners.com>
Mon, 15 Dec 2025 10:58:42 +0000 (11:58 +0100)
framework/application/views/helpers/Logos.php
js/106-logos.js
less/106-logos.less

index dad74f7e9e33be91f7cf852ac943cf68d55ef71e..67e75eb7b546f09b69704c295db46bb79a1cad85 100644 (file)
@@ -18,13 +18,6 @@ class Fluidbook_View_Helper_Logos extends CubeIT_View_Helper_Abstract {
                        $res .= $this->htmlElement($img, 'div', ['class' => 'logos-item']);\r
                }\r
 \r
-        // For making animated marquee loop\r
-        // https://www.youtube.com/watch?v=uw5jVO1eNF8\r
-        foreach ($images as $image) {\r
-            $img = $this->imageCms($image, '', null, null, ['class' => 'logos-image']);\r
-            $res .= $this->htmlElement($img, 'div', ['class' => 'logos-item logos-item-home', 'aria-hidden' => 'true']);\r
-        }\r
-\r
                $res = $this->htmlElement($res, 'div', ['class' => 'logos-grid', 'id' => 'marquee']);\r
                return $this->htmlElement($res, $wrapper_element, ['class' => 'logos-wrapper']);\r
        }\r
index 8dd4a3ae3bbdb368b1ee5edb83c9ebef28408c28..b9093e569199b0196451ec77768c12e7cbb7cb1f 100644 (file)
@@ -1,4 +1,23 @@
 registerLoader(load_logo, true);
 
 function load_logo() {
+    let container = $(".logos-grid")
+    const pictures = $(".logos-grid .logos-item")
+    const picturesWidth = Array.from(pictures.map((v,i) => {return $(i).width()}))
+    const ww = $(window).innerWidth()
+    const initialValue = 0;
+
+    const picturesTotalWidth = picturesWidth.reduce(
+        (accumulator, currentValue) => accumulator + currentValue,
+        initialValue,
+    );
+
+    let i = 1;
+
+    if($(".logos-grid .logos-item").length > 0) {
+        while (i <= Math.round(ww / picturesTotalWidth)) {
+            pictures.clone().appendTo(container);
+            i++;
+        }
+    }
 }
\ No newline at end of file
index 26007840ff1a4c4a018384de5405d38f00022ec5..9f6a2cedc8163cd3d41a77315bc7dbb7e4da4b02 100644 (file)
@@ -1,19 +1,5 @@
 @import "000-imports";\r
 \r
-[data-template="home"] .logos {\r
-       &-grid {\r
-               justify-content: left;\r
-               width: max-content;\r
-               animation: marquee 35s linear infinite forwards;\r
-       }\r
-}\r
-\r
-body:not([data-template="home"]) {\r
-       .logos-item-home {\r
-               display: none;\r
-       }\r
-}\r
-\r
 .logos {\r
        &-wrapper {\r
                background-color: #e8eefa;\r
@@ -25,9 +11,11 @@ body:not([data-template="home"]) {
        &-grid {\r
                display: flex !important;\r
                align-items: center;\r
-               justify-content: center;\r
                padding: 0 0 0 70px;\r
                gap: 70px;\r
+               justify-content: left;\r
+               width: max-content;\r
+               animation: marquee 35s linear infinite forwards;\r
 \r
                @media (max-width: 1299px) {\r
                        padding: 0;\r