<!-- start Simple Custom CSS and JS -->
<script type="text/javascript">
/* Default comment here */
// document.addEventListener("DOMContentLoaded", function () {
// const container = document.querySelector(".cstm-scroll-mbl");
// const items = container.innerHTML;
// container.innerHTML += items;
// let scrollSpeed = 1;
// function autoScroll() {
// container.scrollLeft += scrollSpeed;
// if (container.scrollLeft >= container.scrollWidth / 2) {
// container.scrollLeft = 0;
// }
// requestAnimationFrame(autoScroll);
// }
// autoScroll();
// });
document.addEventListener('DOMContentLoaded', function() {
const cartLink = document.querySelector('.dropdown-cart');
if (cartLink) {
cartLink.setAttribute('href', '/cart/');
}
});
document.addEventListener('DOMContentLoaded', function() {
const cartLink = document.querySelector('.woocommerce-mini-cart__buttons .button.wc-forward');
if (cartLink) {
cartLink.setAttribute('href', '/cart/');
}
});
document.addEventListener("DOMContentLoaded", function () {
if (window.innerWidth <= 768) { // only run on mobile
const container = document.querySelector(".cstm-scroll-mbl");
const items = container.innerHTML;
// Duplicate content for smooth infinite loop
container.innerHTML += items;
let scrollSpeed = 1; // px per frame
function autoScroll() {
container.scrollLeft += scrollSpeed;
if (container.scrollLeft >= container.scrollWidth / 2) {
container.scrollLeft = 0;
}
requestAnimationFrame(autoScroll);
}
autoScroll();
}
});
</script>
<!-- end Simple Custom CSS and JS -->