Smooth Scroll

document.querySelectorAll(‘a[href^=”/#”]’).forEach(link => { link.addEventListener(‘click’, function(e) { e.preventDefault(); const target = document.querySelector(this.getAttribute(‘href’).replace(‘/’, ”)); if (target) { window.scrollTo({ top: target.offsetTop – 80, behavior: ‘smooth’ }); } }); }); “Continue reading

Home JS

// Mythos homepage interactions — WPCode → JS Snippet → Site Wide Footer (function(){ function ready(fn){ if(document.readyState!==’loading’)fn(); else document.addEventListener(‘DOMContentLoaded’,fn); } ready(function(){ var root=document.querySelector(‘.mt-page’); if(!root)return; // Scroll-aware nav var nav=document.getElementById(‘mtNav’); window.addEventListener(‘scroll’,function(){ nav.classList.toggle(‘scrolled’,window.scrollY>30); },{passive:true}); // Mobile menu var burger=document.getElementById(‘mtBurger’), mob=document.getElementById(‘mtMobile’); if(burger){ burger.addEventListener(‘click’,function(){…Continue reading

Colour Code Structure Panel JS

(() => { “use strict”; /* —————————– Config (Dark Mode Optimized) —————————– */ const PSEUDO_TAG_SELECTOR = “.etch-builder-accordion__header-button > span:not([class])”; const LABEL_SELECTOR = “.etch-builder-accordion__header-label”; // Pastell-Töne für bessere Lesbarkeit auf dunklem Grund const COMPONENT_COLOUR = “#c084fc”; // Soft Purple const LOOP_COLOUR…Continue reading

AI Buzz — Auto Article Count

/** * AI BUZZ — AUTO ARTICLE COUNT UPDATER * * Automatically updates any element with id=”aibuzz-article-count” * on the page with the current total number of published articles. * * Uses localStorage to cache the count for 24 hours.…Continue reading

Listing Hover Image JS

// GSAP animation setup const cards = document.querySelectorAll(‘.list-card’); cards.forEach(card => { const hoverContent = card.querySelector(‘.list-card-hover-content’); card.addEventListener(‘mouseenter’, () => { // Make the hover content visible and animate in gsap.fromTo( hoverContent, { opacity: 0, clipPath: “polygon(0% 100%, 100% 100%, 100% 100%,…Continue reading

Modal Pop Up closes Nav (JS)

// Close Oxygen Pro Menu drawer ONLY for the modal trigger, then open the modal. // Robust: tries toggle button, overlay, and class removal; waits until closed; then re-fires click. (function(){ const MOBILE_BP = 991; // match your CSS breakpoint…Continue reading