From 350a695edf8e1328e5b9c5c1deeb2a42af5e58c1 Mon Sep 17 00:00:00 2001 From: soufiane Date: Mon, 15 Dec 2025 11:58:42 +0100 Subject: [PATCH] wait #7831 @1:00 --- framework/application/views/helpers/Logos.php | 7 ------- js/106-logos.js | 19 +++++++++++++++++++ less/106-logos.less | 18 +++--------------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/framework/application/views/helpers/Logos.php b/framework/application/views/helpers/Logos.php index dad74f7..67e75eb 100644 --- a/framework/application/views/helpers/Logos.php +++ b/framework/application/views/helpers/Logos.php @@ -18,13 +18,6 @@ class Fluidbook_View_Helper_Logos extends CubeIT_View_Helper_Abstract { $res .= $this->htmlElement($img, 'div', ['class' => 'logos-item']); } - // For making animated marquee loop - // https://www.youtube.com/watch?v=uw5jVO1eNF8 - foreach ($images as $image) { - $img = $this->imageCms($image, '', null, null, ['class' => 'logos-image']); - $res .= $this->htmlElement($img, 'div', ['class' => 'logos-item logos-item-home', 'aria-hidden' => 'true']); - } - $res = $this->htmlElement($res, 'div', ['class' => 'logos-grid', 'id' => 'marquee']); return $this->htmlElement($res, $wrapper_element, ['class' => 'logos-wrapper']); } diff --git a/js/106-logos.js b/js/106-logos.js index 8dd4a3a..b9093e5 100644 --- a/js/106-logos.js +++ b/js/106-logos.js @@ -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 diff --git a/less/106-logos.less b/less/106-logos.less index 2600784..9f6a2ce 100644 --- a/less/106-logos.less +++ b/less/106-logos.less @@ -1,19 +1,5 @@ @import "000-imports"; -[data-template="home"] .logos { - &-grid { - justify-content: left; - width: max-content; - animation: marquee 35s linear infinite forwards; - } -} - -body:not([data-template="home"]) { - .logos-item-home { - display: none; - } -} - .logos { &-wrapper { background-color: #e8eefa; @@ -25,9 +11,11 @@ body:not([data-template="home"]) { &-grid { display: flex !important; align-items: center; - justify-content: center; padding: 0 0 0 70px; gap: 70px; + justify-content: left; + width: max-content; + animation: marquee 35s linear infinite forwards; @media (max-width: 1299px) { padding: 0; -- 2.39.5