- WordPress 6.9.4 (es_ES) with Kadence theme - Homepage: Hero, La Asociación, Pilares, Beneficios, Eventos, Miembros, Hazte Miembro, Contacto - Brand identity: #13294b navy, #a12932 burgundy, #c69c48 gold - Fonts: Raleway (headings) + Source Sans 3 (body) + Lato (UI) - Plugins: Kadence Blocks, Polylang, Contact Form 7 - Custom CSS with full brand styling and responsive layout - HTTPS enforced via wp-config.php proxy detection
1 line
2.4 KiB
JavaScript
1 line
2.4 KiB
JavaScript
class KBStickyImage{constructor(a,b={}){this.root="string"==typeof a?document.querySelector(a):a,this.state="CREATED",this.isLogo=this.root.classList.contains("kb-identity"),this.standardElem=this.isLogo?this.root.querySelector(".custom-logo"):this.root.querySelector(".kb-img:not(.kb-img-sticky):not(.kb-img-transparent)"),this.stickyElem=this.root.querySelector(".kb-img-sticky"),this.transparentElem=this.root.querySelector(".kb-img-transparent"),this.isSticking=!1,this.isTransparentDesktop=this.root.closest(".wp-block-kadence-header")?.classList?.contains("header-desktop-transparent"),this.isTransparentTablet=this.root.closest(".wp-block-kadence-header")?.classList?.contains("header-tablet-transparent"),this.isTransparentMobile=this.root.closest(".wp-block-kadence-header")?.classList?.contains("header-mobile-transparent"),this.stickyElem&&this.initStickyTracking(),this.emitEvent("MOUNTED"),this.state="IDLE"}initStickyTracking(){window.addEventListener("KADENCE_HEADER_STICKY_CHANGED",this.toggleSticky.bind(this))}toggleSticky({isSticking:a}){this.isSticking=a,a?this.setStickyStyles():this.setStandardStyles()}setStickyStyles(){this.stickyElem&&(this.stickyElem.style.display="initial"),this.standardElem&&(this.standardElem.style.display="none"),this.transparentElem&&(this.transparentElem.style.display="none")}setStandardStyles(){const a=this.getActiveSize(),b="desktop"==a&&this.isTransparentDesktop||"tablet"==a&&this.isTransparentTablet||"mobile"==a&&this.isTransparentMobile;this.stickyElem&&(this.stickyElem.style.display="none"),this.transparentElem&&!this.isLogo&&(this.transparentElem.style.display="none"),b?this.transparentElem&&(this.transparentElem.style.display="initial"):this.standardElem&&(this.standardElem.style.display="initial")}getActiveSize(){if(parseInt(kadenceHeaderConfig.breakPoints.desktop)<window.innerWidth)return"desktop";return parseInt(kadenceHeaderConfig.breakPoints.tablet)<window.innerWidth?"tablet":"mobile"}get state(){return this._state}set state(a){this._state=a,this.emitEvent("STATE",{val:a})}emitEvent(a,b={}){const c=new CustomEvent(a,{bubbles:!0,detail:b});this.root.dispatchEvent(c)}}function initKBImages(){const a=document.querySelectorAll(".wp-block-kadence-image, .wp-block-kadence-identity");window.KBStickyBlocks=Array.from(a).map(a=>new KBStickyImage(a))}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",initKBImages):initKBImages(),window.KBStickyImage=KBStickyImage; |