PageSourceSearch

https://hiiiid-ispace1.hf.space/assets/PublicNavigationPage-CEdvKEz3.js

js hiiiid-ispace1.hf.space collected 2026-10-03 16:56:06 UTC 11,595 bytes, 11 lines download raw bytes

1import{d as A,r as g,v as R,f as s,z as o,L as t,ac as D,H as d,l as M,u as m,j as E,i as b,a5 as p,F as x,A as f,G as I,y as w,q as H,c as j}from"./vendor-vue-DHGubi9Q.js";import{a as O,_ as S,b as W}from"./index-D1LoOqJz.js";import{_ as Z}from"./Badge.vue_vue_type_script_setup_true_lang-BfoFr9jl.js";import{L as J,a as K}from"./list-C9VxHXeS.js";import{c as N}from"./createLucideIcon-C73RGe63.js";import{_ as Q}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./vendor-monaco-iaZ6B9cc.js";/**
2 * @license lucide-vue-next v0.468.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 X=N("MoonIcon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
7 * @license lucide-vue-next v0.468.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 Y=N("SunIcon",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),ee={class:"mx-auto flex max-w-7xl flex-wrap items-center gap-3 px-4 py-3 pb-[max(0.75rem,env(safe-area-inset-bottom))] sm:px-6 lg:px-8"},te={class:"flex min-w-0 flex-1 items-center gap-3 sm:flex-none"},ae={class:"min-w-0"},se={class:"truncate text-base font-semibold"},le={class:"order-3 flex w-full items-center gap-2 sm:order-none sm:mx-auto sm:w-full sm:max-w-2xl"},oe={class:"flex shrink-0 items-center gap-1"},re={class:"relative z-10 mx-auto grid max-w-7xl gap-6 px-4 py-6 pb-[max(2rem,env(safe-area-inset-bottom))] sm:px-6 sm:py-8 lg:grid-cols-[220px_minmax(0,1fr)] lg:px-8"},ne={class:"navigation-scrollbar flex gap-2 overflow-x-auto lg:block lg:space-y-1 lg:overflow-visible"},ie=["onClick"],de={class:"truncate"},ce={class:"ml-3 text-xs opacity-60"},ue={key:0,class:"mt-5 border-t pt-4"},me={class:"flex flex-wrap gap-2 px-2"},pe={class:"ml-1 opacity-70"},ve=["onClick"],ge={class:"ml-1 opacity-70"},he={class:"min-w-0"},xe={key:0,class:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4"},fe={key:1,class:"rounded-2xl border border-dashed p-8 text-center sm:p-12"},be={key:2,class:"rounded-2xl border border-dashed p-10 text-center opacity-70 sm:p-16"},we={key:3,class:"space-y-10"},ye=["id"],_e={class:"mb-3 flex items-center gap-3 sm:mb-4"},ke={class:"truncate text-lg font-semibold"},Ce={class:"shrink-0 text-xs opacity-50"},Me=["href"],Ee=["src"],Ie={class:"min-w-0 flex-1 overflow-hidden"},ze={class:"line-clamp-2 break-words text-sm font-semibold leading-5 group-hover:text-emerald-500"},Le={key:1,class:"mt-2 flex max-h-10 flex-wrap gap-1 overflow-hidden"},$e=["onClick"],je=A({__name:"PublicNavigationPage",setup(Se){const h=g(null),z=g(!0),y=g(""),L=g(""),r=g(localStorage.getItem("navigation-theme")==="dark"),u=g(localStorage.getItem("navigation-layout")==="app"),V=g(""),i=g("");function _(l){return(l.tags||"").split(",").map(e=>e.trim()).filter(Boolean)}const $=j(()=>{var l;return Array.from(new Set((((l=h.value)==null?void 0:l.categories)??[]).flatMap(e=>e.links.flatMap(_)))).sort((e,n)=>e.localeCompare(n,"zh-CN"))}),T=j(()=>{var e;const l=new Map;for(const n of((e=h.value)==null?void 0:e.categories)??[])for(const v of n.links)for(const a of _(v))l.set(a,(l.get(a)||0)+1);return l}),k=j(()=>{const l=L.value.trim().toLowerCase();return h.value?h.value.categories.map(e=>({...e,links:e.links.filter(n=>(!i.value||_(n).includes(i.value))&&(!l||[n.name,n.tips,n.url,n.tags].some(v=>v==null?void 0:v.toLowerCase().includes(l))))})).filter(e=>e.links.length>0):[]});function U(){r.value=!r.value,localStorage.setItem("navigation-theme",r.value?"dark":"light")}function F(){u.value=!u.value,localStorage.setItem("navigation-layout",u.value?"app":"card")}function G(l){var n;const e=(n=l.icon_url)==null?void 0:n.trim();if(e!=null&&e.toLowerCase().startsWith("<svg"))return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`;try{return e||`https://www.google.com/s2/favicons?domain=${encodeURIComponent(new URL(l.url).hostname)}&sz=128`}catch{return""}}function P(l){const e=l.target;e.src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop stop-color='%2310b981'/%3E%3Cstop offset='1' stop-color='%230ea5e9'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='64' height='64' rx='18' fill='url(%23g)'/%3E%3Cpath d='M20 32h24M32 20v24' stroke='white' stroke-width='6' stroke-linecap='round'/%3E%3C/svg%3E"}function q(l){var e;V.value=l,(e=document.getElementById(`nav-${l}`))==null||e.scrollIntoView({behavior:"smooth",block:"start"})}async function B(){z.value=!0,y.value="";try{const l=await W("/public/navigation",{allowUnauthorized:!0});if(!l.ok)throw new Error("加载失败");h.value=await l.json(),i.value&&!$.value.includes(i.value)&&(i.value="")}catch{y.value="导航加载失败,请稍后重试"}finally{z.value=!1}}return R(B),(l,e)=>{var n,v;return s(),o("main",{class:p(["min-h-screen transition-colors",r.value?"bg-slate-950 text-slate-100":"bg-slate-50 text-slate-900"])},[e[10]||(e[10]=t("div",{class:"fixed inset-0 -z-0 overflow-hidden pointer-events-none"},[t("div",{class:"absolute -left-32 -top-32 h-96 w-96 rounded-full bg-emerald-300/20 blur-3xl"}),t("div",{class:"absolute -bottom-40 -right-20 h-[28rem] w-[28rem] rounded-full bg-sky-300/20 blur-3xl"})],-1)),t("header",{class:p(["sticky top-0 z-20 border-b backdrop-blur-xl",r.value?"border-white/10 bg-slate-950/70":"border-slate-200/70 bg-white/85"])},[t("div",ee,[t("div",te,[e[3]||(e[3]=D('<div class="flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-gradient-to-br from-emerald-500 to-teal-600 text-white shadow-lg shadow-emerald-500/20" aria-label="链接导航" data-v-a03c665d><svg viewBox="0 0 24 24" class="h-8 w-8" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-a03c665d><path d="M10 13a5 5 0 0 0 7.07.07l2-2a5 5 0 0 0-7.07-7.07l-1.15 1.15" data-v-a03c665d></path><path d="M14 11a5 5 0 0 0-7.07-.07l-2 2A5 5 0 0 0 7 20l1.15-1.15" data-v-a03c665d></path><path d="m8 16 8-8" data-v-a03c665d></path></svg></div>',1)),t("div",ae,[t("h1",se,d(((n=h.value)==null?void 0:n.title)||"云导航"),1),e[2]||(e[2]=t("p",{class:"truncate text-xs opacity-60"},"发现常用网站与工具",-1))])]),t("div",le,[M(m(O),{modelValue:L.value,"onUpdate:modelValue":e[0]||(e[0]=a=>L.value=a),class:"h-11 min-w-0 rounded-xl border-0 bg-white/70 px-4 text-base shadow-sm dark:bg-white/10",placeholder:"搜索名称或网址…",inputmode:"search",autocomplete:"off"},null,8,["modelValue"])]),t("div",oe,[M(m(S),{variant:"outline",size:"icon",class:"h-10 w-10 rounded-xl",title:u.value?"切换为卡片布局":"切换为应用布局","aria-label":u.value?"切换为卡片布局":"切换为应用布局",onClick:F},{default:E(()=>[u.value?(s(),b(m(J),{key:0,class:"h-4 w-4"})):(s(),b(m(K),{key:1,class:"h-4 w-4"}))]),_:1},8,["title","aria-label"]),M(m(S),{variant:"ghost",size:"icon",class:"h-10 w-10 rounded-xl",title:r.value?"切换浅色主题":"切换深色主题","aria-label":r.value?"切换浅色主题":"切换深色主题",onClick:U},{default:E(()=>[r.value?(s(),b(m(Y),{key:0,class:"h-4 w-4"})):(s(),b(m(X),{key:1,class:"h-4 w-4"}))]),_:1},8,["title","aria-label"])])])],2),t("section",re,[k.value.length?(s(),o("aside",{key:0,class:p(["h-fit roun
11ded-2xl border p-3 lg:sticky lg:top-28",r.value?"border-white/10 bg-white/[0.04]":"border-slate-200/80 bg-white/75 shadow-sm"])},[e[6]||(e[6]=t("div",{class:"mb-2 px-3 text-xs font-semibold uppercase tracking-wider opacity-50"},"分类",-1)),t("nav",ne,[(s(!0),o(x,null,f(k.value,a=>(s(),o("button",{key:a.id,type:"button",class:p(["flex shrink-0 items-center justify-between rounded-xl px-3 py-2.5 text-left text-sm transition-colors lg:w-full",V.value===a.slug?r.value?"bg-emerald-500/25 text-emerald-100":"bg-emerald-600 text-white shadow-sm":r.value?"hover:bg-white/10":"hover:bg-emerald-50"]),onClick:c=>q(a.slug)},[t("span",de,d(a.name),1),t("span",ce,d(a.links.length),1)],10,ie))),128))]),$.value.length?(s(),o("div",ue,[e[5]||(e[5]=t("div",{class:"mb-2 px-3 text-xs font-semibold uppercase tracking-wider opacity-50"},"标签",-1)),t("div",me,[t("button",{type:"button",class:p(["rounded-full px-3 py-1.5 text-xs transition-colors",i.value?r.value?"bg-white/10 hover:bg-white/20":"bg-slate-100 hover:bg-emerald-50":r.value?"bg-emerald-500/25 text-emerald-100":"bg-emerald-600 text-white"]),onClick:e[1]||(e[1]=a=>i.value="")},[e[4]||(e[4]=I("全部 ",-1)),t("span",pe,d(((v=h.value)==null?void 0:v.total_links)||0),1)],2),(s(!0),o(x,null,f($.value,a=>(s(),o("button",{key:a,type:"button",class:p(["rounded-full px-3 py-1.5 text-xs transition-colors",i.value===a?r.value?"bg-emerald-500/25 text-emerald-100":"bg-emerald-600 text-white":r.value?"bg-white/10 hover:bg-white/20":"bg-slate-100 hover:bg-emerald-50"]),onClick:c=>i.value=i.value===a?"":a},[I(d(a)+" ",1),t("span",ge,d(T.value.get(a)||0),1)],10,ve))),128))])])):w("",!0)],2)):w("",!0),t("div",he,[z.value?(s(),o("div",xe,[(s(),o(x,null,f(8,a=>t("div",{key:a,class:"h-24 animate-pulse rounded-2xl bg-slate-200/70 dark:bg-white/10"})),64))])):y.value?(s(),o("div",fe,[t("p",null,d(y.value),1),M(m(S),{class:"mt-4 min-h-11 rounded-xl px-5",onClick:B},{default:E(()=>[...e[7]||(e[7]=[I("重试",-1)])]),_:1})])):k.value.length?(s(),o("div",we,[(s(!0),o(x,null,f(k.value,a=>(s(),o("section",{id:`nav-${a.slug}`,key:a.id,class:"scroll-mt-28"},[t("div",_e,[e[8]||(e[8]=t("span",{class:"h-6 w-1.5 rounded-full bg-emerald-500"},null,-1)),t("h2",ke,d(a.name),1),t("span",Ce,d(a.links.length),1)]),t("div",{class:p(u.value?"grid grid-cols-2 gap-3 sm:grid-cols-5 sm:gap-4 md:grid-cols-7 lg:grid-cols-9":"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4")},[(s(!0),o(x,null,f(a.links,c=>(s(),o("a",{key:c.id,href:c.url,target:"_blank",rel:"noopener noreferrer",class:p(["group relative min-h-[76px] overflow-hidden rounded-2xl border p-3.5 transition active:scale-[0.98] hover:-translate-y-0.5 hover:border-emerald-400 hover:shadow-lg sm:p-4",r.value?"border-white/10 bg-white/[0.04]":"border-slate-200/80 bg-white/75 shadow-sm",u.value?"flex min-h-[150px] flex-col items-center justify-start gap-2 text-center":"flex min-h-[150px] items-start gap-3"])},[t("img",{src:G(c),alt:"",class:"h-10 w-10 shrink-0 rounded-xl bg-white object-contain p-1.5 shadow-sm",onError:P},null,40,Ee),t("div",Ie,[t("div",ze,d(c.name),1),c.tips?(s(),o("p",{key:0,class:p(["mt-1 overflow-hidden text-xs leading-4 opacity-60",u.value?"line-clamp-2":"line-clamp-3"])},d(c.tips),3)):w("",!0),c.tags?(s(),o("div",Le,[(s(!0),o(x,null,f(_(c),C=>(s(),o("button",{key:C,type:"button",class:"max-w-full truncate rounded-full bg-emerald-500/10 px-2 py-0.5 text-[10px] text-emerald-600 hover:bg-emerald-500/20",onClick:H(Ve=>i.value=i.value===C?"":C,["prevent","stop"])},d(C),9,$e))),128))])):w("",!0)]),c.is_private?(s(),b(m(Z),{key:0,variant:"secondary",class:"absolute right-2 top-2 text-[10px]"},{default:E(()=>[...e[9]||(e[9]=[I("私密",-1)])]),_:1})):w("",!0)],10,Me))),128))],2)],8,ye))),128))])):(s(),o("div",be,"没有找到匹配的导航链接"))])])],2)}}}),qe=Q(je,[["__scopeId","data-v-a03c665d"]]);export{qe 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.