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

GTM_Tracking

document.addEventListener(‘DOMContentLoaded’, function() { /***** EVENTS ANFANG *****/ /***** Clicktracking Tabs *****/ /* with mousedown */ /*jQuery(“.su-tabs-nav span[role=’button’]”).on(“mousedown”, function() { window.dataLayer = window.dataLayer || []; window.dataLayer.push({ ‘event’: ‘click_tab’, ‘tab_type’: jQuery(this).data(“anchor”).toLowerCase() }); });*/ /* using the fact that clicks on a tab…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

scroll-header

document.addEventListener(‘DOMContentLoaded’, function () { const headerRest = document.querySelector(‘.scroll-header-rest’); const headerHome = document.querySelector(‘.scroll-header-home’); let lastScrollY = window.scrollY; let isHeaderHidden = false; window.addEventListener(‘scroll’, function () { const currentScrollY = window.scrollY; // Runterscrollen: Header 1 ausblenden if (currentScrollY > lastScrollY && currentScrollY >…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