PageSourceSearch

https://www.uniandes.edu.co/storybook/dist/js/designsystem/03-orga…/card-slider-ranking.js?tm76jr

js uniandes.edu.co collected 2026-10-01 08:47:53 UTC 4,605 bytes, 1 lines download raw bytes

1Drupal.behaviors.rankingCardsCarousel={attach:function(t){t.querySelectorAll(".sliders__ranking").forEach(function(t){if(!t.classList.contains("ranking-carousel-initialized")){var e=t.querySelector(".sliders__ranking__container"),n=e?Array.from(e.children).map(function(t){return t.cloneNode(!0)}):[],r=t.querySelector(".sliders__ranking__pager"),a=r?r.querySelectorAll(".action-btn-small"):[],i=a[0],o=a[1],s=600,c="cubic-bezier(0.4, 0, 0.2, 1)";if(0!==n.length){b();var l,u=0,d=!1,f=[],v=!1,m=0,h=0,p=0,y=0,g=0,E=0;e&&(e.style.display="flex",e.style.transition="transform ".concat(s,"ms ").concat(c),e.style.willChange="transform",e.style.flexWrap="nowrap",e.style.cursor="grab",t.style.overflow="hidden",t.style.userSelect="none"),i&&i.addEventListener("click",C),o&&o.addEventListener("click",q),e&&(e.addEventListener("touchstart",D,{passive:!1}),e.addEventListener("touchmove",T,{passive:!1}),e.addEventListener("touchend",z),e.addEventListener("touchcancel",F),e.addEventListener("mousedown",D),e.addEventListener("mousemove",T),e.addEventListener("mouseup",z),e.addEventListener("mouseleave",F),e.addEventListener("dragstart",function(t){t.preventDefault()}));var L=function(){clearTimeout(l),l=setTimeout(function(){d||v||(k(),A(),_(!1))},150)};window.addEventListener("resize",L),A(),setTimeout(function(){_(!1)},100),t.classList.add("ranking-carousel-initialized"),t._rankingCarouselCleanup=function(){e&&(e.removeEventListener("touchstart",D),e.removeEventListener("touchmove",T),e.removeEventListener("touchend",z),e.removeEventListener("touchcancel",F),e.removeEventListener("mousedown",D),e.removeEventListener("mousemove",T),e.removeEventListener("mouseup",z),e.removeEventListener("mouseleave",F),e.removeEventListener("dragstart",preventDragStart)),window.removeEventListener("resize",L)}}}function b(){var t=window.innerWidth;return t<768?1:t<1024?2:3}function k(){var t=b();return n.length>t}function A(){e.innerHTML="",f=[],b(),k()?(n.forEach(function(t,n){var r=t.cloneNode(!0);r.setAttribute("data-ranking-position",n),r.setAttribute("data-ranking-type","primary"),r.style.flexShrink="0",e.appendChild(r),f.push(r)}),n.forEach(function(t,n){var r=t.cloneNode(!0);r.setAttribute("data-ranking-position",n),r.setAttribute("data-ranking-type","forward-loop"),r.style.flexShrink="0",e.appendChild(r),f.push(r)}),n.forEach(function(t,n){var r=t.cloneNode(!0);r.setAttribute("data-ranking-position",n),r.setAttribute("data-ranking-type","end-loop"),r.style.flexShrink="0",e.appendChild(r),f.push(r)}),u=0):(n.forEach(function(t,n){var r=t.cloneNode(!0);r.setAttribute("data-ranking-position",n),r.setAttribute("data-ranking-type","static"),r.style.flexShrink="0",e.appendChild(r),f.push(r)}),u=0),r&&(k()?r.style.display="":r.style.display="none")}function w(){for(var t=0,e=0;e<u;e++)f[e]&&(t+=f[e].offsetWidth+32);return t}function _(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;0!==f.length&&(e.style.transition=t?"transform ".concat(s,"ms ").concat(c):"none",requestAnimationFrame(function(){if(k()){var r=null!==n?n:w();e.style.transform="translateX(-".concat(r,"px)")}else e.style.transform="translateX(0)";t||(e.offsetHeight,e.style.transition="transform ".concat(s,"ms ").concat(c))}))}function S(){if(k()){var t=n.length;if(u>=2*t){var r=u%t;e.style.transition="none",u=r,requestAnimationFrame(function(){_(!1),requestAnimationFrame(function(){e.style.transition="transform ".concat(s,"ms ").concat(c)})})}else if(u<0){var a=(u%t+t)%t;e.style.transition="none",u=t+a,requestAnimationFrame(function(){_(!1),requestAnimationFrame(function(){e.style.transition="transform ".concat(s,"ms ").concat(c)})})}}}function q(){!d&&k()&&(d=!0,u++,_(!0),setTimeout(function(){S(),d=!1},650))}function C(){!d&&k()&&(d=!0,u--,_(!0),setTimeout(function(){S(),d=!1},650))}function x(t){return t.type.includes("touch")?t.touches[0].clientX:t.clientX}function D(t){!d&&k()&&(v=!0,m=x(t),h=m,p=w(),y=p,g=Date.now(),E=0,e.style.cursor="grabbing",e.style.transition="none",t.preventDefault())}function T(n){if(v){n.preventDefault();var r=(h=x(n))-m,a=Date.now(),i=a-g;i>0&&(E=r/i),g=a;var o=1,s=.3*t.offsetWidth;Math.abs(r)>s&&(o=s/Math.abs(r)),y=p-r*o,e.style.transform="translateX(-".concat(y,"px)")}}function z(t){if(v){v=!1,e.style.cursor="grab";var n=h-m,r=Math.abs(n),a=Math.abs(E);r>100||a>.5?n>0?C():q():(e.style.transition="transform ".concat(s,"ms ").concat(c),_(!0)),m=0,h=0,E=0}}function F(){v&&(v=!1,e.style.cursor="grab",e.style.transition="transform ".concat(s,"ms ").concat(c),_(!0),m=0,h=0,E=0)}})}};

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.