From 1a818cbaefed4af46d1c48d22ff18ac335e41162 Mon Sep 17 00:00:00 2001 From: Ayesha Nisar Date: Mon, 6 Jul 2026 23:11:34 +0500 Subject: [PATCH 1/2] =?UTF-8?q?feat(hyva):=20make=20the=20slider=20work=20?= =?UTF-8?q?on=20Hyv=C3=A4=20(JS=20+=20CSS)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The slider only worked on Luma. Two Hyvä gaps: - JS: the slider inits via text/x-magento-init -> requireJS (slider.js). Hyvä strips requireJS + x-magento-init, so it never initialised. - CSS: styles ship as _module.less (Luma pipeline only). Hyvä does not compile Magento LESS, so the slider had NO CSS (slides rendered position:static, opacity:1 — stacked and unstyled). Fix (in slider.phtml, no new files, works on both themes): - Inline + + \ No newline at end of file From b19593331ff2ab42eac9f15d35c08c17ec30695c Mon Sep 17 00:00:00 2001 From: Ayesha Nisar Date: Tue, 7 Jul 2026 09:42:03 +0500 Subject: [PATCH 2/2] =?UTF-8?q?fix(hyva):=20eager-load=20deferred=20slide?= =?UTF-8?q?=20images=20on=20Hyv=C3=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The requireJS slider.js normally un-lazies each slide image (lazyLoad). On Hyvä that never runs, so slides 2..n kept their loading=lazy / data-src placeholder inside a visibility:hidden slide and rendered blank. Add loadSlide(): swap data-src->src, data-srcset->srcset, and force loading=eager (re-assigning src) for the shown slide + preload the next. Verified on the demo: all 3 banner images load and rotate on Hyvä. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../BannerSlider/view/frontend/templates/slider.phtml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/code/ETechFlow/BannerSlider/view/frontend/templates/slider.phtml b/app/code/ETechFlow/BannerSlider/view/frontend/templates/slider.phtml index 1b09d9d..2a9803f 100644 --- a/app/code/ETechFlow/BannerSlider/view/frontend/templates/slider.phtml +++ b/app/code/ETechFlow/BannerSlider/view/frontend/templates/slider.phtml @@ -256,8 +256,16 @@ $slideCount = count($slides); var bullets = Array.prototype.slice.call(root.querySelectorAll('.etf-bannerslider__bullet')); if (slides.length < 1) { return; } var cur = 0, timer = null; + function loadSlide(el) { + el.querySelectorAll('source[data-srcset]').forEach(function (so) { so.srcset = so.getAttribute('data-srcset'); so.removeAttribute('data-srcset'); }); + el.querySelectorAll('img').forEach(function (im) { + if (im.getAttribute('data-src')) { im.src = im.getAttribute('data-src'); im.removeAttribute('data-src'); } + if (im.loading === 'lazy') { im.loading = 'eager'; if (!im.complete || !im.naturalWidth) { var u = im.getAttribute('src'); if (u) { im.src = ''; im.src = u; } } } + }); + } function show(i) { var n = slides.length; i = (i % n + n) % n; + loadSlide(slides[i]); loadSlide(slides[(i + 1) % n]); slides.forEach(function (s, k) { s.classList.toggle('is-active', k === i); }); bullets.forEach(function (b, k) { b.classList.toggle('is-active', k === i); }); cur = i;