Privacy UX-ontwerppatronen: vertrouwen opbouwen als concurrentievoordeel in 2026

a2.textContent = text; li2.appendChild(a2); mobileList.appendChild(li2); } }); // Mobile TOC toggle var mobileToggle = document.querySelector('.post-toc-mobile__toggle'); var mobilePanel = document.getElementById('toc-mobile'); if (mobileToggle && mobilePanel) { mobileToggle.addEventListener('click', function () { var isOpen = mobilePanel.hasAttribute('data-open'); if (isOpen) { mobilePanel.removeAttribute('data-open'); mobileToggle.setAttribute('aria-expanded', 'false'); } else { mobilePanel.setAttribute('data-open', ''); mobileToggle.setAttribute('aria-expanded', 'true'); } }); } // Desktop TOC: highlight active heading on scroll if ('IntersectionObserver' in window && desktopList) { var tocLinks = desktopList.querySelectorAll('.post-toc__link'); var headingMap = {}; tocLinks.forEach(function (link) { headingMap[link.getAttribute('href').substring(1)] = link; }); // Keep the active TOC link scrolled into view within the (scrollable) sidebar. var tocScroller = document.getElementById('toc-desktop'); function revealInToc(link) { if (!tocScroller || tocScroller.scrollHeight = tocScroller.clientHeight) return; var pad = 16; var top = link.offsetTop; var bottom = top + link.offsetHeight; if (top tocScroller.scrollTop + pad) { tocScroller.scrollTo({ top: top - pad, behavior: 'smooth' }); } else if (bottom > tocScroller.scrollTop + tocScroller.clientHeight - pad) { tocScroller.scrollTo({ top: bottom - tocScroller.clientHeight + pad, behavior: 'smooth' }); } } var tocObserver = new IntersectionObserver(function (entries) { entries.forEach(function (entry) { if (entry.isIntersecting) { tocLinks.forEach(function (l) { l.removeAttribute('data-active'); }); var active = headingMap[entry.target.id]; if (active) { active.setAttribute('data-active', ''); revealInToc(active); } } }); }, { rootMargin: '-80px 0px -70% 0px' }); headings.forEach(function (h) { tocObserver.observe(h); }); } })();