PageSourceSearch

https://www.nlc.org/wp-content/themes/nlc/dist/block-editor/blocks/cards-slider/script.min.js?ver=1790182035

js nlc.org collected 2026-09-24 07:27:21 UTC 4,517 bytes, 2 lines download raw bytes

1this.NLC=this.NLC||{},this.NLC.Blocks=this.NLC.Blocks||{},this.NLC.Blocks.CardsSlider=this.NLC.Blocks.CardsSlider||{},this.NLC.Blocks.CardsSlider.Script=function(){"use strict";var t=function(t,e){var s=this;void 0===e&&(e={}),this.node=t,this.opts=Object.assign({cards:".cards-slider__cards",wrap:".cards-slider__cards-wrap",kards:".kard",selectedClass:"cards-slider__card--selected",activeClass:"cards-slider--active",navClass:"cards-slider__nav",navPrevClass:"cards-slider__prev",navNextClass:"cards-slider__next",offscreenClass:"cards-slider__card--offscreen"},e),this.cards=this.node.querySelector(this.opts.cards),this.wrap=this.cards.querySelector(this.opts.wrap),this.kards=Array.from(this.wrap.querySelectorAll(this.opts.kards)),this.selected=-1,this.mode=this.getMode(),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.resize=this.resize.bind(this),this.onFocus=this.onFocus.bind(this),this.lastEventType=null,["mousedown","keydown"].forEach((function(t){return document.addEventListener(t,(function(t){return s.lastEventType=t.type}))})),this.kards.length>1&&(this.nav=document.createElement("nav"),this.nav.className=this.opts.navClass,this.cards.parentNode.appendChild(this.nav),this.navPrev=document.createElement("button"),this.navPrev.type="button",this.navPrev.className=this.opts.navPrevClass,this.navPrev.innerHTML='<svg focusable="false" height="16" width="16" viewbox="0 0 100 100" role="alt"><title>Previous</title><path fill="#fff" d="M100,55.5H22.1l33.8,31.4L48.4,95L0,50L48.4,5l7.5,8.1L22.1,44.5H100V55.5z"></path></svg>',this.navPrev.addEventListener("click",this.prev),this.nav.appendChild(this.navPrev),this.navNext=document.createElement("button"),this.navNext.type="button",this.navNext.className=this.opts.navNextClass,this.navNext.innerHTML='<svg focusable="false" height="16" width="16" viewbox="0 0 100 100" style="transform: rotate(180deg);" role="img"><title>Next</title><path fill="#fff" d="M100,55.5H22.1l33.8,31.4L48.4,95L0,50L48.4,5l7.5,8.1L22.1,44.5H100V55.5z"></path></svg>',this.navNext.addEventListener("click",this.next),this.nav.appendChild(this.navNext),"complete"===document.readyState?this.select(0):window.addEventListener("load",(function(){return s.select(0)})),this.node.addEventListener("focus",this.onFocus,!0)),window.addEventListener("resize",this.resize),this.resize()};return t.prototype.onFocus=function(t){if("keydown"===this.lastEventType)for(var e=t.target;e!==this.node;){var s=this.kards.indexOf(e);if(s>-1&&!this.kards[s].classList.contains(this.selectedClass))return t.preventDefault(),this.select(s);e=e.parentNode}},t.prototype.getMode=function(){return window.matchMedia("(min-width: 1024px").matches?"desktop":window.matchMedia("(min-width: 768px").matches?"tablet":"mobile"},t.prototype.resize=function(){var t=this.getMode();if(this.mode!==t){switch(t){case"desktop":case"tablet":this.select(0),this.wrap.scrollTo(0,0);break;case"mobile":this.wrap.removeAttribute("style")}this.mode=t}},t.prototype.select=function(t){var e=this;if(t!==this.selected){this.selected>-1&&this.kards[this.selected].classList.remove(this.opts.selectedClass),this.selected=t,this.kards[this.selected].classList.add(this.opts.selectedClass),this.selected>0?this.node.classList.add(this.opts.activeClass):this.node.classList.remove(this.opts.activeClass),0===this.selected?(this.navPrev.disabled=!0,this.navNext.disabled=!1):this.selected===this.kards.length-1?(this.navPrev.disabled=!1,this.navNext.disabled=!0):(this.navPrev.disabled=!1,this.navNext.disabled=!1);var s=function(){e.kards.forEach((function(s,i){if("desktop"===e.mode){if(i===t)return void s.classList.remove(e.opts.offscreenClass);var a=s.getBoundingClientRect();a.left<0||a.left+a.width>document.body.offsetWidth?s.classList.add(e.opts.offscreenClass):s.classList.remove(e.opts.offscreenClass)}else s.classList.remove(e.opts.offscreenClass)})),e.wrap.removeEventListener("transitionend",s)};this.wrap.addEventListener("transitionend",s);var i=window.getComputedStyle(this.kards[this.selected]);this.wrap.style.transform="translateX(-"+(parseInt(i.marginLeft,10)+this.kards[this.selected].offsetWidth+parseInt(i.marginRight,10))*this.selected+"px)"}},t.prototype.next=function(){this.selected<this.kards.length-1&&this.select(this.selected+1)},t.prototype.prev=function(){this.selected>0&&this.select(this.selected-1)},t.instances||(t.instances=Array.from(document.querySelectorAll(".cards-slider")).map((function(e){return new t(e)}))),t}();
2//# sourceMappingURL=script.min.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.