PageSourceSearch

https://xiaoxiaofeng.com/assets/Links-Dchhtxxf.js

js xiaoxiaofeng.com collected 2026-10-05 22:12:38 UTC 9,593 bytes, 26 lines download raw bytes

1import{j as e}from"./markdown-DgF9YmM-.js";import{b as i}from"./react-vendor-Z1IwLdtg.js";import{f as l,D as C,h as k,p as v,S as E,G as w,b as y,v as g,a as x,i as L,E as _}from"./index-DM2JlXa9.js";import{P as A}from"./PageHeader-Bckr-mem.js";import{G as S}from"./github-D6LGt5NX.js";import"./motion-vendor-alnVVcP-.js";/**
2 * @license lucide-react v0.546.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const M=[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]],I=l("graduation-cap",M);/**
7 * @license lucide-react v0.546.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const G=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],T=l("heart",G);/**
12 * @license lucide-react v0.546.0 - ISC
13 *
14 * This source code is licensed under the ISC license.
15 * See the LICENSE file in the root directory of this source tree.
16 */const P=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],H=l("link-2",P);/**
17 * @license lucide-react v0.546.0 - ISC
18 *
19 * This source code is licensed under the ISC license.
20 * See the LICENSE file in the root directory of this source tree.
21 */const $=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],z=l("star",$);/**
22 * @license lucide-react v0.546.0 - ISC
23 *
24 * This source code is licensed under the ISC license.
25 * See the LICENSE file in the root directory of this source tree.
26 */const O=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],R=l("users",O);function D(s){const a=k.LINK.GET_PAGE;return C(()=>v(a,s),{url:a,method:"POST",body:s,ttl:3e3})}function K(s){return v(`${k.LINK.CLICK}/${s}`)}const u=[{key:"learning",name:"学习资源",icon:I,dot:"bg-chart-2"},{key:"github",name:"GitHub",icon:S,dot:"bg-chart-3"},{key:"recommend",name:"特别推荐",icon:z,dot:"bg-chart-4"},{key:"friends",name:"大佬伙伴",icon:R,dot:"bg-chart-1"}];function q(s){return s?s.trim()[0].toUpperCase():"?"}const N=["from-primary to-primary/60","from-chart-2 to-chart-2/60","from-chart-3 to-chart-3/60","from-chart-4 to-chart-4/60","from-chart-5 to-chart-5/60","from-primary/80 to-chart-5/80"];function U(s){const a=s||"?";let t=0;for(let n=0;n<a.length;n++)t=t*31+a.charCodeAt(n)>>>0;return N[t%N.length]}function V(s){const a=s.linkType;if(a===3)return"github";if(a===4)return"learning";if(a===2)return"recommend";const t=(s.name||"").toLowerCase(),n=(s.url||"").toLowerCase();return n.includes("github.com")||t.includes("github")?"github":t.includes("教程")||t.includes("学习")||t.includes("课程")||n.includes("mooc")||n.includes("edu")||n.includes("course")?"learning":t.includes("推荐")||t.includes("精选")||t.includes("工具")||t.includes("优秀")?"recommend":"friends"}function Y(){const[s,a]=i.useState([]),[t,n]=i.useState("all"),[d,m]=i.useState(!0);i.useEffect(()=>{D({page:{current:1,size:100}}).then(r=>{r&&r.records&&a(r.records)}).catch(console.error).finally(()=>m(!1))},[]);const p=r=>{K(r).catch(console.error)},c=i.useMemo(()=>{const r={};return u.forEach(o=>{r[o.key]=[]}),s.forEach(o=>{const h=V(o);(r[h]||r.friends).push(o)}),r},[s]),f=i.useMemo(()=>t==="all"?s:c[t]||[],[t,c,s]);return e.jsxs("div",{className:"container mx-auto px-4 py-8 xl:px-0",children:[e.jsx(E,{title:"友情链接 - 伙伴与资源",description:"笑小枫的友情链接集合,收录优质技术博客、学习资源、开源项目与开发者社区。欢迎志同道合的博主与开发者互换友链,一起成长。",keywords:"友情链接,技术博客,学习资源,开源项目,开发者社区,友链交换"}
26),e.jsx(A,{icon:w,title:"友情链接",subtitle:"海内存知己,天涯若比邻。",stats:[{label:"个友链",value:s.length}]}),e.jsxs("div",{className:"mb-8 flex flex-wrap justify-center gap-2",role:"group","aria-label":"友链分类筛选",children:[e.jsx(y,{variant:t==="all"?"default":"ghost",onClick:()=>n("all"),children:"全部"}),u.map(r=>{const o=r.icon;return e.jsxs(y,{variant:t===r.key?"default":"ghost",onClick:()=>n(r.key),children:[e.jsx(o,{className:"mr-2 h-4 w-4","aria-hidden":"true"}),r.name,e.jsx("span",{className:"ml-2 rounded-full bg-foreground/10 px-2 py-0.5 text-xs",children:c[r.key]?.length||0})]},r.key)})]}),d?e.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:Array.from({length:8}).map((r,o)=>e.jsxs(g,{className:"flex items-center gap-4 p-5",children:[e.jsx(x,{className:"h-14 w-14 shrink-0"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(x,{className:"h-4 w-2/3"}),e.jsx(x,{className:"h-3 w-full"})]})]},o))}):t==="all"?e.jsx("div",{className:"space-y-12",children:u.map(r=>{const o=c[r.key];if(!o||o.length===0)return null;const h=r.icon;return e.jsxs("section",{className:"space-y-6","aria-label":r.name,children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:L("flex h-10 w-10 items-center justify-center rounded-xl bg-muted","text-foreground"),children:e.jsx(h,{className:"h-5 w-5","aria-hidden":"true"})}),e.jsx("h2",{className:"font-heading text-xl font-bold text-foreground md:text-2xl",children:r.name}),e.jsxs("span",{className:"ml-2 text-sm text-muted-foreground",children:["(",o.length,")"]})]}),e.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:o.map(j=>e.jsx(b,{link:j,onClick:p},j.id))})]},r.key)})}):f.length===0?e.jsx(_,{icon:H,title:"暂无此类别的链接",description:"换个分类看看吧。"}):e.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:f.map(r=>e.jsx(b,{link:r,onClick:p},r.id))}),e.jsx(g,{className:"mt-16 rounded-lg border-border p-8 shadow-card",children:e.jsxs("div",{className:"mx-auto max-w-3xl",children:[e.jsxs("h3",{className:"mb-6 flex items-center gap-2 font-heading text-xl font-bold text-foreground",children:[e.jsx(T,{className:"h-5 w-5 text-primary","aria-hidden":"true"}),"申请友链格式"]}),e.jsxs("div",{className:"grid gap-8 md:grid-cols-2",children:[e.jsxs("ul",{className:"list-inside list-disc space-y-2 text-sm text-muted-foreground",children:[e.jsxs("li",{children:[e.jsx("span",{className:"font-semibold text-foreground",children:"名称:"}),"笑小枫"]}),e.jsxs("li",{children:[e.jsx("span",{className:"font-semibold text-foreground",children:"链接:"}),"https://xiaoxiaofeng.com"]}),e.jsxs("li",{children:[e.jsx("span",{className:"font-semibold text-foreground",children:"头图:"}),"https://xiaoxiaofeng.com/logo.png"]}),e.jsxs("li",{children:[e.jsx("span",{className:"font-semibold text-foreground",children:"描述:"}),"一个热爱后端技术的程序员网站。"]})]}),e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{className:"rounded-lg border border-border bg-muted/50 p-4",children:[e.jsx("p",{className:"mb-2 text-sm text-foreground",children:"要求:"}),e.jsxs("ul",{className:"space-y-1 text-xs text-muted-foreground",children:[e.jsx("li",{children:"HTTPS 支持"}),e.jsx("li",{children:"内容健康向上"}),e.jsx("li",{children:"经常更新优先"}),e.jsx("li",{children:"请先添加本站友链"})]})]})})]}),e.jsx("p",{className:"mt-6 text-sm text-muted-foreground",children:"如果你也想和我交换友链,请先在贵站添加上方本站链接后,点击顶部的「申请友链」或发邮件联系我~"})]})})]})}function b({link:s,onClick:a}){const t=q(s.name),n=!!s.logo,d=U(s.name);return e.jsx("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",onClick:()=>a(s.id),children:e.jsxs(g,{className:"group flex items-center gap-4 roun
26ded-lg border-border bg-card p-5 shadow-card transition-all hover:-translate-y-1 hover:border-primary/40 hover:shadow-hover",children:[e.jsx("div",{className:L("flex h-14 w-14 shrink-0 items-center justify-center overflow-hidden rounded-xl bg-gradient-to-br shadow-sm",d),children:n?e.jsx("img",{src:s.logo,alt:s.name,loading:"lazy",className:"h-10 w-10 object-contain transition-transform group-hover:scale-110",onError:m=>{m.target.style.display="none"}}):e.jsx("span",{className:"font-mono text-xl font-bold text-white drop-shadow-sm",children:t})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h3",{className:"truncate text-base font-bold text-foreground transition-colors group-hover:text-primary",children:s.name}),e.jsx("p",{className:"mt-1 line-clamp-2 text-xs leading-relaxed text-muted-foreground",children:s.description})]}),e.jsx("div",{className:"text-muted-foreground/50 transition-colors group-hover:text-primary",children:e.jsx(w,{className:"h-4 w-4","aria-hidden":"true"})})]})})}export{Y as Links};

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.