$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
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
@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
&-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