(function () { function initUSPBar() { if (document.getElementById("pw-uspbar")) return; const translations = { nl: [ "Op werkdagen vóór 17:00 besteld? Dezelfde dag verzonden", "Wereldwijde verzending", "Al meer dan 45 jaar specialist" ], en: [ "Order before 5 PM (Dutch time) on business days? Dispatched the same day", "Worldwide shipping", "Over 45 years of expertise" ], de: [ "Werktags vor 17 Uhr bestellt? Versand am selben Tag", "Weltweiter Versand", "Seit über 45 Jahren Spezialist" ] }; const icons = [ '', '', '' ]; const style = document.createElement("style"); style.textContent = ` #pw-uspbar { background: #193c30; color: #fff; font-family: inherit; width: 100%; box-sizing: border-box; } #pw-uspbar .pw-items { max-width: 1400px; margin: 0 auto; padding: 0 20px; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); } #pw-uspbar .pw-item { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 43px; text-align: center; font-size: 12px; font-weight: 500; line-height: 1.4; letter-spacing: .1px; } #pw-uspbar .pw-item + .pw-item:before { content: ""; position: absolute; left: 0; height: 17px; width: 1px; background: rgba(255,255,255,.22); } #pw-uspbar svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; } @media (max-width: 700px) { #pw-uspbar .pw-items { display: block; padding: 0 12px; } #pw-uspbar .pw-item { display: none; min-height: 39px; font-size: 11px; } #pw-uspbar .pw-item.pw-active { display: flex; } #pw-uspbar .pw-item:before { display: none; } } `; document.head.appendChild(style); const bar = document.createElement("div"); bar.id = "pw-uspbar"; bar.setAttribute("aria-label", "Webshop voordelen"); const items = document.createElement("div"); items.className = "pw-items"; const labels = []; icons.forEach(function(icon, i) { const item = document.createElement("div"); item.className = "pw-item" + (i === 0 ? " pw-active" : ""); item.innerHTML = icon + ""; labels.push(item.querySelector("span")); items.appendChild(item); }); bar.appendChild(items); document.body.prepend(bar); function updateLanguage() { const locale = ( document.documentElement.lang || navigator.language || "nl" ).toLowerCase().split("-")[0]; const texts = translations[locale] || translations.en; labels.forEach((el, i) => { el.textContent = texts[i]; }); } updateLanguage(); new MutationObserver(updateLanguage).observe( document.documentElement, { attributes: true, attributeFilter: ["lang"] } ); if (!window.matchMedia("(prefers-reduced-motion: reduce)").matches) { let active = 0; setInterval(function() { const cards = items.querySelectorAll(".pw-item"); cards[active].classList.remove("pw-active"); active = (active + 1) % cards.length; cards[active].classList.add("pw-active"); }, 5000); } } if (document.readyState === "loading") { document.addEventListener("DOMContentLoaded", initUSPBar); } else { initUSPBar(); } })();