PageSourceSearch

https://www.icsi.edu/assets/HomeCard-Cv31o-10.js

js icsi.edu collected 2026-10-02 03:42:18 UTC 2,869 bytes, 1 lines download raw bytes

1import{r as t,j as e,R as b,y as S,L as f}from"./index-CMfIf9m3.js";import{u as N,a as _,S as C,C as E}from"./useAccessibleCarousel-C8Bcex-Z.js";const I=[["(max-width: 767px) and (orientation: portrait)",1],["(max-width: 1023px) and (orientation: landscape)",2],["(max-width: 1100px)",3]],A=4,L=15,k=()=>{const[r,m]=t.useState([]),[p,i]=t.useState(!0),[l,u]=t.useState(null);t.useEffect(()=>{(async()=>{try{i(!0);const o=await S();m(o.cards.slice(0,L))}catch(o){console.error("Error fetching information cards:",o),u("Failed to load cards. Please try again later.")}finally{i(!1)}})()},[]);const d=N(I,A),{sliderRef:n,nextBtnRef:h,isPlaying:g,keyboardInside:j,togglePlayPause:w,regionProps:v}=_(r.length),s=r.length>d,y={dots:!1,arrows:!1,infinite:s,speed:600,slidesToShow:d,slidesToScroll:1,autoplay:s,autoplaySpeed:3500,pauseOnHover:!0,cssEase:"ease-in-out"};if(p)return e.jsx("div",{className:"py-10 text-center text-gray-500 font-semibold",children:"Loading cards..."});if(l)return e.jsx("div",{role:"alert",className:"py-10 text-center text-red-700 font-semibold",children:l});const c=a=>e.jsxs(f,{to:a.url,target:a.open_in_new_tab?"_blank":"_self",rel:a.open_in_new_tab?"n
1oopener noreferrer":void 0,"data-open-new-tab":a.open_in_new_tab?"true":"false",className:"block bg-white rounded-xl shadow-md overflow-hidden",children:[e.jsx("div",{className:"overflow-hidden",children:e.jsx("img",{src:a.image,loading:"lazy",decoding:"async",alt:a.title||"Information card",title:a.title||"Information card",className:"w-full h-40 object-cover transition-transform duration-300 hover:scale-110"})}),e.jsx("div",{className:"py-3 ps-3",children:e.jsx("h3",{className:"text-md font-bold text-blue-800 capitalize",children:a.title})})]}),x=e.jsx(f,{to:"/viewall-information-card","aria-label":"View All Information Cards",title:"View All Information Cards",className:"whitespace-nowrap text-sm font-semibold text-[#0B2C6F] underline underline-offset-2 transition hover:text-[#09306a]",children:"View All"});return e.jsxs("div",{className:"py-2 px-2 sm:px-4 md:px-4 lg:px-15",children:[e.jsxs("div",{...v,role:"region","aria-roledescription":"carousel","aria-label":"Information cards",children:[s?e.jsx(C,{ref:n,...y,waitForAnimate:!j,children:r.map(a=>e.jsx("div",{className:"px-3 pb-2",children:c(a)},a.id))}):e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-6",children:r.map(a=>e.jsx(b.Fragment,{children:c(a)},a.id))}),s&&e.jsxs("div",{className:"mt-4 grid grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center gap-2",children:[e.jsx("span",{"aria-hidden":"true"}),e.jsx(E,{noun:"information card",isPlaying:g,onPrev:()=>n.current?.slickPrev(),onNext:()=>n.current?.slickNext(),onTogglePlay:w,nextRef:h}),e.jsx("div",{className:"justify-self-end",children:x})]})]}),!s&&e.jsx("div",{className:"mt-4 flex justify-end",children:x})]})};export{k as default};

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.