From 94442c8d3e86c2a87645cf492505c8985e18c6ec Mon Sep 17 00:00:00 2001 From: soufiane Date: Mon, 24 Nov 2025 16:11:46 +0100 Subject: [PATCH] wait #7831 @4:00 --- framework/application/views/helpers/Logos.php | 16 +++++++++++----- .../library/CubeIT/View/Helper/HeadScript.php | 15 --------------- js/106-logos.js | 19 +------------------ less/106-logos.less | 14 ++++++++++++-- 4 files changed, 24 insertions(+), 40 deletions(-) diff --git a/framework/application/views/helpers/Logos.php b/framework/application/views/helpers/Logos.php index a3489dd..5329d9e 100644 --- a/framework/application/views/helpers/Logos.php +++ b/framework/application/views/helpers/Logos.php @@ -5,7 +5,7 @@ class Fluidbook_View_Helper_Logos extends CubeIT_View_Helper_Abstract { * @return string */ public function logos($logos, $wrapper_element = 'section') { - $this->headScript()->addSplideCarousel(); + $this->headScript()->addDynamicMarquee(); $images = CubeIT_Util_Cms::extractFiles($logos); if (!count($images)) { @@ -17,11 +17,17 @@ class Fluidbook_View_Helper_Logos extends CubeIT_View_Helper_Abstract { $res = ''; foreach ($images as $image) { $img = $this->imageCms($image, '', null, null, ['class' => 'logos-image']); - $res .= $this->htmlElement($img, 'div', ['class' => 'logos-item splide__slide']); + $res .= $this->htmlElement($img, 'div', ['class' => 'logos-item']); } - $res = $this->htmlElement($res, 'div', ['class' => 'logos-grid splide__list']); - $res = $this->htmlElement($res, 'div', ['class' => 'splide__track']); - return $this->htmlElement($res, $wrapper_element, ['class' => 'logos-wrapper splide']); + // 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', '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/framework/library/CubeIT/View/Helper/HeadScript.php b/framework/library/CubeIT/View/Helper/HeadScript.php index b4fd0e0..aea25e0 100644 --- a/framework/library/CubeIT/View/Helper/HeadScript.php +++ b/framework/library/CubeIT/View/Helper/HeadScript.php @@ -1060,21 +1060,6 @@ class CubeIT_View_Helper_HeadScript extends Zend_View_Helper_HeadScript return $this; } - public function addSplideCarousel() - { - if (!$this->_add('splidejs')) { - return $this; - } - $this->view->headLink()->addDNSPrefetch('//cdnjs.cloudflare.com/'); - $this->appendFile('//cdnjs.cloudflare.com/ajax/libs/splidejs/' . static::SPLIDECAROUSEL_VERSION . '/js/splide.min.js'); - $this->view->headLink()->appendStylesheet('//cdnjs.cloudflare.com/ajax/libs/splidejs/' . static::SPLIDECAROUSEL_VERSION . '/css/splide.min.css'); - - $this->view->headLink()->addDNSPrefetch('//cdnjs.jsdelivr.net/'); - $this->appendFile('//cdn.jsdelivr.net/npm/@splidejs/splide-extension-auto-scroll@0.5.3/dist/js/splide-extension-auto-scroll.min.js'); - - return $this; - } - public function addDotDotDot() { if (!$this->_add('dotdotdot')) { diff --git a/js/106-logos.js b/js/106-logos.js index d329aa3..d56bba0 100644 --- a/js/106-logos.js +++ b/js/106-logos.js @@ -1,22 +1,5 @@ registerLoader(load_logo, true); function load_logo() { - console.log(window.splide.Extensions) - new Splide( '.splide', { - drag: false, - autoWidth: true, - type: 'loop', - gap: 40, - pagination: false, - arrows: false, - autoScroll: { - speed: .5, - }, - mediaQuery: 'min', - breakpoints: { - 768: { - gap: 90, - }, - } - } ).mount(window.splide.Extensions); + // } \ No newline at end of file diff --git a/less/106-logos.less b/less/106-logos.less index 883968f..8ddc61d 100644 --- a/less/106-logos.less +++ b/less/106-logos.less @@ -5,12 +5,16 @@ background-color: #e8eefa; padding-top: 3%; padding-bottom: 3%; + overflow: clip; } &-grid { display: flex !important; align-items: center; - padding: 0 70px; + padding: 0 0 0 70px; + gap: 70px; + width: max-content; + animation: marquee 30s linear infinite forwards; @media (max-width: 1299px) { padding: 0; @@ -25,8 +29,14 @@ &-image { width: 120px; - height: 100%; + height: 45px; max-width: 120px; max-height: 45px; } } + +@keyframes marquee { + to { + transform: translateX(-50%); + } +} \ No newline at end of file -- 2.39.5