PageSourceSearch

https://mubashirabbas12-globalcollege.hf.space/assets/resources-BZOecDnb.js

js mubashirabbas12-globalcollege.hf.space collected 2026-10-03 17:08:51 UTC 19,512 bytes, 6 lines download raw bytes

1import{j as e}from"./query-vendor-hhwDzQ2O.js";import{M as V,A as W,v,I as D,B as g,c as w,C as H,f as q}from"./index-DCdJkPd2.js";import{u as K,r as l,L as k}from"./react-vendor-CeHpY9tY.js";import{m as I,E as O,B as G,ai as R,ay as Z,a3 as J,t as X,r as z,Z as Y,az as ee,K as te,aA as se,aw as ae,aB as le,u as re,z as ie,au as ne}from"./icons-vendor-B7tMGsnB.js";function oe({text:r,speed:p=25}){const[i,c]=l.useState(""),[m,j]=l.useState(!0);return l.useEffect(()=>{let d=0;c("");const x=setInterval(()=>{d<r.length?(c(r.slice(0,d+1)),d++):clearInterval(x)},p);return()=>clearInterval(x)},[r,p]),l.useEffect(()=>{const d=setInterval(()=>{j(x=>!x)},450);return()=>clearInterval(d)},[]),e.jsxs("span",{children:[i,e.jsx("span",{className:`inline-block w-0.5 h-[1.1em] align-middle ml-1 bg-emerald-400 transition-opacity duration-150 ${m?"opacity-100":"opacity-0"}`})]})}function he(){const[r]=K(),p=r.includes("blog")||r.includes("article")?"blogs":"updates",[i,c]=l.useState(p),[m,j]=l.useState([]),[d,x]=l.useState(!0),[u,C]=l.useState(""),[N,S]=l.useState("All"),[b,P]=l.useState([]),[o,A]=l.useState(""),[f,L]=l.useState("ALL"),[M,T]=l.useState(null),[B,$]=l.useState(6);l.useEffect(()=>{r.includes("blog")||r.includes("article")?c("blogs"):(r.includes("update")||r.includes("news")||r.includes("announcement"))&&c("updates")},[r]),l.useEffect(()=>{(async()=>{try{x(!0);const a=await fetch(`/api/articles?_t=${Date.now()}`,{cache:"no-store",headers:{"Cache-Control":"no-cache",Pragma:"no-cache"}});a.ok&&j(await a.json())}catch(a){console.error("Failed to load articles:",a)}finally{x(!1)}})()},[]),l.useEffect(()=>{(async()=>{try{const a=await fetch("/api/announcements/public");if(a.ok){const s=await a.json();Array.isArray(s)&&P(s)}}catch(a){console.error("Failed to load announcements:",a)}})()},[]);const _=["All",...Array.from(new Set(m.map(t=>t.category||"General")))],U=m.filter(t=>{const a=(t.title||"").toLowerCase().includes(u.toLowerCase())||(t.excerpt||"").toLowerCase().includes(u.toLowerCase())||(t.content||"").toLowerCase().includes(u.toLowerCase()),s=N==="All"||t.category===N;return a&&s}),E=(t,a)=>{navigator.clipboard.writeText(a),T(t),setTimeout(()=>T(null),2e3)};return e.jsx(V,{children:e.jsxs("div",{className:"min-h-screen bg-slate-50",children:[e.jsxs("section",{className:"relative pt-16 pb-14 overflow-hidden bg-gradient-to-br from-[#0c2461] via-[#0f2c6f] to-[#004d40] text-white",children:[e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_50%_30%,rgba(16,185,129,0.15),transparent_60%)]"}),e.jsx("div",{className:"absolute bottom-0 left-0 w-full h-px bg-gradient-to-r from-transparent via-emerald-500/40 to-transparent"}),e.jsxs("div",{className:"w-full px-4 md:px-10 lg:px-16 max-w-5xl mx-auto relative z-10 text-center",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 bg-emerald-500/10 border border-emerald-500/20 rounded-full px-4 py-1.5 mb-6 backdrop-blur-md",children:[e.jsx(I,{className:"h-3.5 w-3.5 text-emerald-400"}),e.jsx("span",{className:"text-emerald-300 text-xs font-black uppercase tracking-widest",children:"LATEST NEWS & BLOGS"})]}),e.jsxs("h1",{className:"text-3xl sm:text-5xl md:text-6xl font-black text-white mb-4 leading-tight tracking-tight",children:["Branch Updates & ",e.jsx("span",{className:"text-transparent bg-clip-text bg-gradient-to-r from-emerald-400 to-teal-300",children:"Official Blogs"})]}),e.jsx("p",{className:"text-slate-300 text-sm sm:text-lg max-w-2xl mx-auto leading-relaxed font-medium mb-10 min-h-[3.2rem] sm:min-h-[3.8rem]",children:e.jsx(oe,{text:"Stay informed with our latest announcements, official branch updates, and insightful educational articles written by our expert faculty."})}),e.jsxs("div",{className:"bg-slate-900/80 backdrop-blur-xl p-1.5 rounded-full border border-white/20 inline-flex shadow-2xl max-w-md w-full sm:w-auto",children:[e.jsxs("button",{onClick:()=>c("updates"),className:`flex-1 sm:flex-initial flex items-center justify-center gap-2.5 px-6 sm:px-9 py-3.5 rounded-full text-xs sm:text-sm font-black transition-all duration-300 cursor-pointer ${i==="updates"?"bg-white text-slate-900 shadow-xl scale-100":"text-slate-300 hover:text-white hover:bg-white/10"}`,children:[e.jsx(O,{className:`h-4 w-4 ${i==="updates"?"text-emerald-600":"text-slate-400"}`}),e.jsx("span",{children:"Branch Updates"}),b.length>0&&e.jsx("span",{className:`text-[10px] px-2 py-0.5 rounded-full font-black ${i==="updates"?"bg-emerald-100 text-emerald-800":"bg-emerald-500/20 text-emerald-300"}`,children:b.length})]}),e.jsxs("button",{onClick:()=>c("blogs"),className:`flex-1 sm:flex-initial flex items-center justify-center gap-2.5 px-6 sm:px-9 py-3.5 rounded-full text-xs sm:text-sm font-black transition-all duration-300 cursor-pointer ${i==="blogs"?"bg-white text-slate-900 shadow-xl scale-100":"text-slate-300 hover:text-white hover:bg-white/10"}`,children:[e.jsx(G,{className:`h-4 w-4 ${i==="blogs"?"text-blue-600":"text-slate-400"}`}),e.jsx("span",{children:"Blog Articles"}),m.length>0&&e.jsx("span",{className:`text-[10px] px-2 py-0.5 rounded-full font-black ${i==="blogs"?"bg-blue-100 text-blue-800":"bg-blue-500/20 text-blue-300"}`,children:m.length})]})]})]})]}),e.jsx("div",{className:"w-full px-4 md:px-10 lg:px-16 max-w-6xl mx-auto py-12",children:e.jsxs(W,{mode:"wait",children:[i==="updates"&&e.jsxs(v.div,{initial:{opacity:0,y:15}
1,animate:{opacity:1,y:0},exit:{opacity:0,y:-15},transition:{duration:.3},className:"space-y-8",children:[e.jsxs("div",{className:"bg-white rounded-3xl p-6 sm:p-8 border border-slate-200 shadow-sm space-y-6",children:[e.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between gap-4 border-b border-slate-100 pb-6",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"inline-flex items-center gap-2 px-3.5 py-1.5 rounded-full bg-emerald-50 border border-emerald-200 text-emerald-700 text-xs font-bold mb-2",children:[e.jsx(I,{className:"h-4 w-4 text-emerald-600 animate-bounce"}),"Official Announcements & News Feed"]}),e.jsx("h2",{className:"text-2xl sm:text-3xl font-black text-slate-900 tracking-tight",children:"Official Branch Updates"}),e.jsx("p",{className:"text-slate-500 text-sm font-medium mt-1",children:"Stay informed with official notices, exam schedules, events, and branch alerts."})]}),e.jsx("div",{className:"flex items-center gap-3",children:e.jsxs("span",{className:"text-xs font-bold text-slate-500 bg-slate-100 px-4 py-2 rounded-full border border-slate-200",children:["Total Notices: ",e.jsx("strong",{className:"text-slate-900 font-black",children:b.length})]})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-3 pt-1",children:[e.jsxs("div",{className:"md:col-span-6 relative",children:[e.jsx(R,{className:"absolute left-3.5 top-1/2 -translate-y-1/2 h-4 w-4 text-slate-400 pointer-events-none"}),e.jsx(D,{type:"text",placeholder:"Search notices by title, keyword, or author...",value:o,onChange:t=>A(t.target.value),className:"pl-10 h-11 bg-slate-50/80 border-slate-200 rounded-2xl focus:bg-white text-xs font-semibold text-slate-800 placeholder:text-slate-400"})]}),e.jsx("div",{className:"md:col-span-6 flex items-center gap-1.5 overflow-x-auto pb-1 sm:pb-0 scrollbar-none",children:[{id:"ALL",label:"All Notices",icon:Z},{id:"STUDENTS",label:"Students",icon:J},{id:"TEACHERS",label:"Teachers",icon:G}].map(t=>{const a=t.icon,s=f===t.id;return e.jsxs("button",{onClick:()=>{L(t.id),$(6)},className:`flex items-center gap-1.5 px-3.5 py-2.5 rounded-xl text-xs font-bold transition-all whitespace-nowrap ${s?"bg-[#0f2c6f] text-white shadow-md shadow-indigo-950/20 scale-[1.02]":"bg-slate-100 text-slate-600 hover:bg-slate-200/80"}`,children:[e.jsx(a,{className:"h-3.5 w-3.5"}),t.label]},t.id)})})]})]}),(()=>{const t=b.filter(s=>{const n=f==="ALL"||s.targetType===f||f==="ALL"&&!s.targetType,h=!o.trim()||s.title&&s.title.toLowerCase().includes(o.toLowerCase())||s.message&&s.message.toLowerCase().includes(o.toLowerCase())||s.sentBy&&s.sentBy.toLowerCase().includes(o.toLowerCase());return n&&h}),a=t.slice(0,B);return t.length===0?e.jsxs("div",{className:"bg-white rounded-3xl shadow-sm border-2 border-dashed border-slate-200 p-12 sm:p-16 text-center",children:[e.jsx("div",{className:"h-16 w-16 rounded-2xl bg-amber-50 border border-amber-200 flex items-center justify-center mx-auto mb-4 text-amber-600 shadow-sm",children:e.jsx(O,{className:"h-8 w-8 animate-pulse"})}),e.jsx("h3",{className:"text-xl sm:text-2xl font-black text-slate-900 mb-2",children:"No Matching Updates Found"}),e.jsx("p",{className:"text-slate-500 font-medium text-xs sm:text-sm max-w-md mx-auto mb-4",children:o?`No notices found matching "${o}". Try searching for another keyword.`:"All branch notices and official updates will appear here."}),o&&e.jsx(g,{variant:"outline",onClick:()=>{A(""),L("ALL")},className:"rounded-xl font-bold text-xs",children:"Clear Search & Filters"})]}):e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"grid grid-cols-1 gap-6",children:a.map((s,n)=>{const h=new Date(s.sentAt||s.createdAt||Date.now()),Q=Date.now()-h.getTime()<4320*60*1e3,y=s.targetType==="STUDENTS"?{label:"Students Only",color:"from-emerald-600 to-teal-700",badgeBg:"bg-emerald-500/20 text-emerald-200 border-emerald-400/30"}:s.targetType==="TEACHERS"?{label:"Teachers Only",color:"from-purple-600 to-indigo-800",badgeBg:"bg-purple-500/20 text-purple-200 border-purple-400/30"}:{label:"Official Branch Notice",color:"from-[#0a1f5c] via-[#0f2c6f] to-[#1e3a8a]",badgeBg:"bg-amber-400/20 text-amber-300 border-amber-400/40"},F=`[Global Group of Colleges Notice #${n+1}]
2${s.title}
3
4${s.message}
5
6Posted by: ${s.sentBy||"Admin Office"} on ${h.toLocaleDateString()}`;return e.jsxs(v.div,{initial:{opacity:0,y:15}
6,animate:{opacity:1,y:0},transition:{duration:.25,delay:n*.05},className:"group bg-white rounded-3xl shadow-md hover:shadow-xl border border-slate-200/90 overflow-hidden transition-all duration-300 transform hover:-translate-y-0.5",children:[e.jsxs("div",{className:`bg-gradient-to-r ${y.color} text-white p-5 sm:p-6 flex flex-col sm:flex-row sm:items-center justify-between gap-4 relative overflow-hidden`,children:[e.jsx("div",{className:"absolute -top-12 -right-12 w-40 h-40 bg-white/10 rounded-full blur-2xl pointer-events-none"}),e.jsxs("div",{className:"flex items-center gap-3.5 relative z-10",children:[e.jsxs("div",{className:"h-11 w-11 rounded-2xl bg-white/15 backdrop-blur-md text-white flex items-center justify-center font-black text-sm border border-white/25 shrink-0 shadow-inner",children:["#",n+1]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("h4",{className:"font-black text-base text-white tracking-tight flex items-center gap-1.5",children:[e.jsx(X,{className:"h-4 w-4 text-amber-300"})," Global Group of Colleges Administration"]}),e.jsx(w,{className:`border text-[10px] px-2.5 py-0.5 font-bold ${y.badgeBg}`,children:y.label}),Q&&e.jsx(w,{className:"bg-rose-500 text-white border-none text-[9px] px-2 py-0.5 font-black animate-pulse",children:"NEW"})]}),e.jsxs("p",{className:"text-xs text-slate-200/90 font-medium flex items-center gap-2 mt-1",children:[e.jsx(z,{className:"h-3.5 w-3.5 text-amber-300"}),h.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric",year:"numeric"})," at ",h.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0})]})]})]}),e.jsx("div",{className:"flex items-center gap-3 self-end sm:self-auto relative z-10 border-t sm:border-t-0 border-white/10 pt-2 sm:pt-0 w-full sm:w-auto justify-between sm:justify-end",children:e.jsxs("div",{className:"text-left sm:text-right",children:[e.jsx("p",{className:"text-[9px] uppercase font-bold text-slate-300 tracking-wider",children:"Official Publisher"}),e.jsxs("p",{className:"font-black text-xs sm:text-sm text-white flex items-center gap-1",children:[e.jsx(Y,{className:"h-3.5 w-3.5 text-emerald-300"}),s.sentBy||"Principal / Admin"]})]})})]}),e.jsxs("div",{className:"p-6 sm:p-8 space-y-4",children:[e.jsx("h3",{className:"text-xl sm:text-2xl font-black text-slate-900 leading-snug group-hover:text-indigo-950 transition-colors",children:s.title}),e.jsx("div",{className:"p-5 rounded-2xl bg-slate-50/80 border border-slate-100 text-slate-800 text-sm sm:text-base leading-relaxed whitespace-pre-wrap font-medium",children:s.message}),e.jsxs("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-3 pt-3 border-t border-slate-100 text-xs font-semibold text-slate-500",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-3 py-1 rounded-full bg-slate-100 text-slate-700 font-bold",children:[e.jsx(ee,{className:"h-3.5 w-3.5 text-amber-500"})," Official Branch Notice"]})}),e.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[e.jsx("button",{onClick:()=>E(s.id||n,F),className:"inline-flex items-center gap-1.5 px-3.5 py-2 rounded-xl bg-slate-100 hover:bg-slate-200 text-slate-700 font-bold transition-all active:scale-95",title:"Copy notice text",children:M===(s.id||n)?e.jsxs(e.Fragment,{children:[e.jsx(te,{className:"h-3.5 w-3.5 text-emerald-600"}),e.jsx("span",{className:"text-emerald-700",children:"Copied!"})]}):e.jsxs(e.Fragment,{children:[e.jsx(se,{className:"h-3.5 w-3.5 text-slate-500"}),e.jsx("span",{children:"Copy Notice"})]})}),e.jsxs("button",{onClick:()=>{navigator.share?navigator.share({title:s.title,text:s.message,url:window.location.href}):E(s.id||n,F)},className:"inline-flex items-center gap-1.5 px-3.5 py-2 rounded-xl bg-indigo-50 hover:bg-indigo-100 text-indigo-700 font-bold transition-all active:scale-95",children:[e.jsx(ae,{className:"h-3.5 w-3.5 text-indigo-600"}),e.jsx("span",{children:"Share"})]})]})]})]})]},s.id||n)})}),t.length>B&&e.jsx("div",{className:"text-center pt-6 pb-2",children:e.jsxs(g,{onClick:()=>$(s=>s+6),className:"px-8 h-12 rounded-2xl bg-[#0f2c6f] hover:bg-[#0a1f5c] text-white font-black text-sm shadow-lg shadow-indigo-950/20 hover:scale-105 transition-all",children:["Load More Updates (Showing ",a.length," of ",t.length,")"]})})]})})()]},"updates-tab"),i==="blogs"&&e.jsxs(v.div,{initial:{opacity:0,y:15}
6,animate:{opacity:1,y:0},exit:{opacity:0,y:-15},transition:{duration:.3},className:"space-y-8",children:[e.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between gap-6 bg-white p-6 rounded-3xl border border-slate-200 shadow-sm",children:[e.jsx("div",{className:"flex items-center gap-2 overflow-x-auto hide-scrollbar w-full md:w-auto py-1",children:_.map(t=>e.jsx("button",{onClick:()=>S(t),className:`px-5 py-2.5 rounded-full text-xs font-black transition-all whitespace-nowrap cursor-pointer border ${N===t?"bg-slate-900 border-slate-900 text-white shadow-md":"bg-slate-50 border-slate-200 text-slate-600 hover:bg-slate-100"}`,children:t},t))}),e.jsxs("div",{className:"relative w-full md:w-72 shrink-0",children:[e.jsx(R,{className:"absolute left-4 top-1/2 -translate-y-1/2 h-4 w-4 text-slate-400"}),e.jsx(D,{value:u,onChange:t=>C(t.target.value),placeholder:"Search articles...",className:"pl-11 pr-4 py-3 rounded-full border-slate-200 focus-visible:ring-emerald-500 h-11 text-sm font-medium"})]})]}),d?e.jsxs("div",{className:"py-24 text-center",children:[e.jsx("div",{className:"h-12 w-12 border-4 border-emerald-600 border-t-transparent rounded-full animate-spin mx-auto mb-4"}),e.jsx("p",{className:"text-slate-500 font-bold",children:"Fetching latest articles..."})]}):U.length===0?e.jsxs("div",{className:"bg-white border border-slate-200 rounded-3xl p-16 text-center shadow-sm max-w-lg mx-auto space-y-4",children:[e.jsx(le,{className:"h-16 w-16 mx-auto text-slate-300 animate-pulse"}),e.jsx("h3",{className:"text-xl font-black text-slate-900",children:"No articles found"}),e.jsx("p",{className:"text-slate-500 text-sm font-medium",children:"We couldn't find any articles matching your search query or chosen category."}),e.jsx(g,{onClick:()=>{C(""),S("All")},className:"rounded-full font-black mt-2 bg-slate-900 hover:bg-emerald-600",children:"Reset All Filters"})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:U.map(t=>e.jsxs(H,{className:"overflow-hidden border border-slate-200 bg-white shadow-sm hover:shadow-2xl transition-all duration-500 rounded-3xl flex flex-col h-[520px] group",children:[e.jsx(k,{href:`/resources/${t.slug}`,className:"block cursor-pointer",children:e.jsxs("div",{className:"h-52 bg-slate-900 relative overflow-hidden flex items-center justify-center shrink-0",children:[t.imageUrl?e.jsx("img",{src:t.imageUrl,alt:t.title,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-700 opacity-90"}):e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-[#0f2c6f] to-[#004d40] opacity-80"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/60 via-trans
6parent to-transparent z-10"}),e.jsxs("div",{className:"absolute top-4 left-4 z-20 flex gap-2",children:[e.jsx(w,{className:"bg-white/20 backdrop-blur-md text-white border-white/20 font-black uppercase tracking-wider text-[9px] px-2.5 py-1",children:t.category}),t.isFeatured&&e.jsxs(w,{className:"bg-amber-400 text-slate-900 border-none font-black uppercase tracking-wider text-[9px] px-2.5 py-1 shadow-lg flex items-center gap-1",children:[e.jsx(re,{className:"h-3 w-3 fill-slate-900 text-slate-900"})," Featured"]})]})]})}),e.jsxs(q,{className:"p-7 flex-1 flex flex-col justify-between",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3 text-slate-400 text-xs font-bold",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ie,{className:"h-3.5 w-3.5"}),new Date(t.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})]}),e.jsx("span",{children:"•"}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(z,{className:"h-3.5 w-3.5"}),t.readTime||"5 min read"]})]}),e.jsx(k,{href:`/resources/${t.slug}`,className:"block cursor-pointer",children:e.jsx("h3",{className:"text-xl font-black text-slate-900 leading-snug group-hover:text-emerald-600 transition-colors line-clamp-2",children:t.title})}),e.jsx("p",{className:"text-slate-500 text-sm font-medium leading-relaxed line-clamp-3",children:t.excerpt})]}),e.jsxs("div",{className:"flex items-center justify-between pt-5 border-t border-slate-100 shrink-0 mt-4",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0 mr-4",children:[e.jsx("div",{className:"h-9 w-9 rounded-full bg-emerald-50 text-emerald-700 font-black text-xs flex items-center justify-center shrink-0 border border-emerald-100",children:(t.author||"A").charAt(0).toUpperCase()}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-xs font-black text-slate-900 truncate",children:t.author||"Global Group of Colleges Staff"}),e.jsx("p",{className:"text-[9px] font-bold text-slate-400 uppercase tracking-wider mt-0.5",children:"Author"})]})]}),e.jsx(k,{href:`/resources/${t.slug}`,children:e.jsxs(g,{className:"rounded-full font-bold text-xs h-9 px-4 flex items-center gap-1 bg-slate-900 hover:bg-emerald-600 text-white border-0 group/btn shadow-md",children:["Read ",e.jsx(ne,{className:"h-3.5 w-3.5 group-hover/btn:translate-x-0.5 group-hover/btn:-translate-y-0.5 transition-transform"})]})})]})]})]},t.id))})]},"blogs-tab")]})})]})})}export{he 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.