// Use an IIFE (Immediately Invoked Function Expression) to avoid global scope pollution
(function() {
// Scope variables to the specific section to avoid conflicts with plentymarkets
const section = document.querySelector('.animalixs-category-section');
if (!section) return;
// Add smooth scroll indicator for mobile
const categoryScroll = section.querySelector('#categoryScroll');
const scrollHint = section.querySelector('#scrollHint');
if (!categoryScroll) return;
// Track scroll position for visual feedback
function checkScrollPosition() {
const scrollLeft = categoryScroll.scrollLeft;
const scrollWidth = categoryScroll.scrollWidth;
const clientWidth = categoryScroll.clientWidth;
// Show hint if there is more content to scroll to the right
// (adding a small 2px buffer for rounding errors)
if (scrollWidth - clientWidth - scrollLeft > 2 && scrollLeft < 20) {
if(scrollHint) scrollHint.classList.remove('hidden');
} else {
if(scrollHint) scrollHint.classList.add('hidden');
}
}
categoryScroll.addEventListener('scroll', checkScrollPosition);
// Also check on window resize
window.addEventListener('resize', checkScrollPosition);
// Mobile-specific: Add touch scroll hint for first load
window.addEventListener('load', function() {
checkScrollPosition(); // Check initially on load
// Removed the window.innerWidth <= 768 check so it animates on all devices
categoryScroll.style.animation = 'pulse-scroll 2s ease-in-out';
});
// Add keyboard navigation support (only when mouse is over the container)
section.addEventListener('mouseenter', function() {
document.addEventListener('keydown', handleKeydown);
});
section.addEventListener('mouseleave', function() {
document.removeEventListener('keydown', handleKeydown);
});
function handleKeydown(e) {
if (e.key === 'ArrowLeft') {
categoryScroll.scrollBy({ left: -100, behavior: 'smooth' });
} else if (e.key === 'ArrowRight') {
categoryScroll.scrollBy({ left: 100, behavior: 'smooth' });
}
}
// Dynamically inject the keyframes animation to ensure isolation
const styleId = 'animalixs-category-animations';
if (!document.getElementById(styleId)) {
const styleEl = document.createElement('style');
styleEl.id = styleId;
styleEl.textContent = `
@keyframes pulse-scroll {
0%, 100% { opacity: 1; }
50% { opacity: 0.7; }
}
`;
document.head.appendChild(styleEl);
}
})();
- Top itemMineral Lick-Bar Starter Set 4x3kg – Complete Equine Health£42.00 *12 kilogram | £3.50 / kilogram* Incl. VAT excl. Shipping
- Premium Mineral Lick Set 4x3kg Herbablock, PROBIOTIC, VitaminPlus Selen and PREMIUMBLOCK£51.00 *12 kilogram | £4.25 / kilogram* Incl. VAT excl. Shipping
- New itemPRO IMMUN Natural Mineral Lick Block, 3kg£17.00 *3 kilogram | £5.67 / kilogram* Incl. VAT excl. Shipping
- New item[Bundle] PRO IMMUN Natural Mineral Lick Block, 4x3kg£66.00 *12 kilogram | £5.50 / kilogram* Incl. VAT excl. Shipping
- Top item[Bundle] MultiVitamin BRONCHIAL Mineral Lick 2x3kg – Respiratory Support£23.00 *6 kilogram | £3.83 / kilogram* Incl. VAT excl. Shipping
- Top itemHerbaBlock Mineral Lick 3kg – Natural Intestinal Support£17.00 *3 kilogram | £5.67 / kilogram* Incl. VAT excl. Shipping
- Top item[Bundle] HerbaBlock Mineral Lick 4x3kg – Natural Intestinal Support£66.00 *12 kilogram | £5.50 / kilogram* Incl. VAT excl. Shipping
- SPIRULINA PLUS Mineral Lick 3kg – ADMR-Free Immune Support£15.00 *3 kilogram | £5.00 / kilogram* Incl. VAT excl. Shipping
- New item[Bundle] SPIRULINA PLUS Mineral Lick 2x3kg – ADMR-Free Immune Support£29.00 *6 kilogram | £4.83 / kilogram* Incl. VAT excl. Shipping
- Item bundle[Bundle] SPIRULINA PLUS Mineral Lick 4x3kg – ADMR-Free Immune Support£58.00 *12 kilogram | £4.83 / kilogram* Incl. VAT excl. Shipping
- Top itemZINCOBLOCK Mineral Lick 3kg – Organic Zinc & Hoof Support£12.50 *3 kilogram | £4.17 / kilogram* Incl. VAT excl. Shipping
- Item bundle[Bundle] ZINCOBLOCK Mineral Lick 2x3kg – Organic Zinc & Hoof Support£23.00 *6 kilogram | £3.83 / kilogram* Incl. VAT excl. Shipping
- Item bundle[Bundle] ZINCOBLOCK Mineral Lick 4x3kg – Organic Zinc & Hoof Support£48.00 *12 kilogram | £4.00 / kilogram* Incl. VAT excl. Shipping
- SuperMAG Mineral Lick 3kg – Muscle & Stress Support£13.50 *3 kilogram | £4.50 / kilogram* Incl. VAT excl. Shipping
- Item bundle[Bundle] SuperMAG Mineral Lick 2x3kg – Muscle & Stress Support£25.00 *6 kilogram | £4.17 / kilogram* Incl. VAT excl. Shipping
- Item bundle[Bundle] SuperMAG Magnesium Mineral Lick 4x3kg – Muscle & Stress Support£52.00 *12 kilogram | £4.33 / kilogram* Incl. VAT excl. Shipping
- BIOTIN+ Mineral Lick 3kg – Strong Hooves & Radiant Coat£12.50 *3 kilogram | £4.17 / kilogram* Incl. VAT excl. Shipping
- Item bundle[Bundle] BIOTIN+ Mineral Lick 2x3kg – Biotin & Vitamin E for Hooves£23.00 *6 kilogram | £3.83 / kilogram* Incl. VAT excl. Shipping
- Item bundle[Bundle] BIOTIN+ Mineral Lick 4x3kg – Biotin & Vitamin E Hoof Support£48.00 *12 kilogram | £4.00 / kilogram* Incl. VAT excl. Shipping
- VitaminPlus Selen Mineral Lick 3kg – Bioavailable Immune Support£12.50 *3 kilogram | £4.17 / kilogram* Incl. VAT excl. Shipping