PageSourceSearch

https://paper2gal.com/assets/StudyDashboardPage-CrJYba4q.js

js paper2gal.com collected 2026-10-09 22:39:47 UTC 18,224 bytes, 1 lines download raw bytes

1import{r as x,j as e}from"./react-vendor-CHQL15iE.js";import{u as xe,l as _}from"./main-Dck1T9BT.js";import{g as he}from"./publicIdentity-C99q7MBr.js";import{R as C}from"./ResponsiveCloudflareImage-DdXVaAv7.js";import{L as ue,ae as be,J as pe,R as ge,b3 as we}from"./lucide-BFLOpGdB.js";import"./pdfjs-ji3DqnKJ.js";import"./markdown-W-rE_H7s.js";import"./katex-math-BxKHCrdI.js";import"./assetUrl-D33wRw9g.js";const fe={zh:{title:"学习看板",subtitle:"专属计划 / 追踪 / 统计",loginTitle:"登录后查看学习看板",login:"登录",back:"返回",refresh:"刷新",savePlan:"保存计划",plan:"专属学习计划",focus:"当前方向",weeklyTarget:"每周生成目标",dailyMinutes:"每日学习分钟",reviewRhythm:"复盘节奏",deadline:"阶段节点",dashboard:"直观看板",todayUses:"今日生成",weeklyProgress:"周目标进度",totalRuns:"累计生成",totalTime:"累计学习",saveCount:"存档",sharedCount:"已公开",categoryCount:"分区",activeDays:"7 日活跃",trend:"7 日趋势",categoryBoard:"内容分区",nextActions:"下一步",useSaves:"整理存档",upgrade:"会员权益",minutes:"分钟",times:"次",noDeadline:"未设置",loading:"加载中",empty:"暂无数据",saved:"已保存",focusPlaceholder:"例如:机器学习论文精读",rhythmDaily:"每日复盘",rhythmTwice:"每周两次",rhythmWeekly:"每周复盘"},en:{title:"Study Board",subtitle:"Plan / tracking / stats",loginTitle:"Log in to view your study board",login:"Log in",back:"Back",refresh:"Refresh",savePlan:"Save plan",plan:"Personal plan",focus:"Focus",weeklyTarget:"Weekly target",dailyMinutes:"Daily minutes",reviewRhythm:"Review rhythm",deadline:"Milestone",dashboard:"Dashboard",todayUses:"Today",weeklyProgress:"Week progress",totalRuns:"Total runs",totalTime:"Study time",saveCount:"Saves",sharedCount:"Public",categoryCount:"Sections",activeDays:"7-day active",trend:"7-day trend",categoryBoard:"Sections",nextActions:"Next",useSaves:"Organize saves",upgrade:"Membership",minutes:"min",times:"runs",noDeadline:"Unset",loading:"Loading",empty:"No data",saved:"Saved",focusPlaceholder:"e.g. ML paper reading",rhythmDaily:"Daily review",rhythmTwice:"Twice a week",rhythmWeekly:"Weekly review"}},ye=s=>fe[s==="zh"?"zh":"en"],v=s=>({focus:s==="zh"?"论文精读与知识卡片":"Paper reading and knowledge cards",weeklyTarget:5,dailyMinutes:45,reviewRhythm:"weekly",deadline:""}),R=(s,l,m)=>Math.max(l,Math.min(m,Number.isFinite(s)?s:l)),X=s=>{const l=s.getFullYear(),m=String(s.getMonth()+1).padStart(2,"0"),h=String(s.getDate()).padStart(2,"0");return`${l}-${m}-${h}`},ve=s=>`${s.getMonth()+1}/${s.getDate()}`,M="/background.jpg",T="/logo.webp",je="/assets/local/branding/sakura2.png",g=({label:s,value:l})=>e.jsxs("div",{className:"min-w-0 rounded-full border border-white/65 bg-white/56 px-3.5 py-2 shadow-[0_8px_24px_rgba(236,72,153,0.08)] backdrop-blur-md",children:[e.jsx("span",{className:"mr-2 text-[11px] font-bold text-slate-500",children:s}),e.jsx("span",{className:"text-sm font-black text-slate-950",children:l})]}),q=({children:s,onClick:l,tone:m="pink"})=>{const h=m==="gold"?"hover:border-amber-300 hover:text-amber-700":m==="blue"?"hover:border-blue-300 hover:text-blue-700":"hover:border-pink-300 hover:text-pink-700";return e.jsxs("button",{type:"button",onClick:l,className:`group flex h-12 items-center justify-between rounded-2xl border border-white/65 bg-white/58 px-4 text-left text-sm font-black text-slate-700 shadow-sm backdrop-blur-md transition duration-300 hover:-translate-y-0.5 hover:bg-white/78 ${h}`,children:[e.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("img",{src:je,alt:"",className:"h-4 w-4 shrink-0 object-contain opacity-75 transition duration-300 group-hover:rotate-45 group-hover:opacity-100",loading:"lazy",decoding:"async"}),e.jsx("span",{className:"truncate",children:s})]}),e.jsx("span",{className:"text-pink-300 transition group-hover:translate-x-1",children:"›"})]})},D=({label:s,value:l,width:m,tone:h="pink"})=>{const $=h==="blue"?"from-blue-400 to-pink-300":h==="emerald"?"from-emerald-400 to-blue-400":"from-pink-400 to-blue-400";return e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1.5 flex items-center justify-between gap-3 text-xs font-black text-slate-600",children:[e.jsx("span",{className:"truncate",children:s}),e.jsx("span",{className:"shrink-0",children:l})]}),e.jsx("div",{className:"h-2 overflow-hidden rounded-full bg-white/75",children:e.jsx("div",{className:`h-full rounded-full bg-gradient-to-r ${$} transition-all duration-500`,style:{width:`${Math.max(5,Math.min(100,m))}%`}})})]})},k=({children:s})=>e.jsx("span",{className:"mb-1.5 block text-[11px] font-black tracking-[0.16em] text-slate-500",children:s}),A="h-11 w-full rounded-2xl border border-white/75 bg-white/68 px-4 text-sm font-bold text-slate-800 shadow-sm outline-none transition focus:border-pink-300 focus:bg-white/82 focus:ring-4 focus:ring-pink-100/70",Q="h-11 w-full rounded-2xl border border-white/75 bg-white/68 px-4 text-sm font-black text-slate-800 shadow-sm outline-none transition focus:border-blue-300 focus:bg-white/82 focus:ring-4 focus:ring-blue-100/70",N=({kicker:s,title:l})=>e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] font-black uppercase tracking-[0.22em] text-pink-500/80",children:s}),e.jsx("h2",{className:"mt-1 text-xl font-black text-slate-950",children:l})]}),_e=({language:s,user:l,onBack:m,onLogin:h,onLogout:$,onOpenSaves:V,onOpenMembership:Z})=>{var F,W,J,K,H;const t=ye(s),z=xe(),[i,ee]=x.useState(l),[r,te]=x.useState(null),[w,se]=x.use
1State([]),[L,O]=x.useState(!1),[ae,E]=x.useState(!1),S=l!=null&&l.id?`p2g_study_plan_${l.id}`:"p2g_study_plan_guest",[d,u]=x.useState(()=>{try{const a=localStorage.getItem(S);return a?{...v(s),...JSON.parse(a)}:v(s)}catch{return v(s)}});x.useEffect(()=>{if(l!=null&&l.id)try{const a=localStorage.getItem(S);u(a?{...v(s),...JSON.parse(a)}:v(s))}catch{u(v(s))}},[l==null?void 0:l.id,s,S]);const I=async()=>{if(l){O(!0);try{const a=localStorage.getItem("p2g_token"),c=a?{Authorization:`Bearer ${a}`}:{},[b,y,f]=await Promise.all([_("/api/user/profile",{headers:c}),_("/api/user/status",{headers:c}),_("/api/saves",{headers:c})]);if([b.status,y.status,f.status].includes(401)){$();return}if(b.ok&&ee(await b.json()),y.ok&&te(await y.json()),f.ok){const j=await f.json();se(Array.isArray(j)?j:[])}}finally{O(!1)}}};x.useEffect(()=>{I()},[l==null?void 0:l.id]);const o=x.useMemo(()=>{const a=new Date,b=Array.from({length:7},(n,p)=>{const P=new Date(a);return P.setDate(a.getDate()-(6-p)),P}).map(n=>{const p=X(n),P=w.filter(Y=>X(new Date(Y.updatedAt||Y.createdAt))===p).length;return{key:p,label:ve(n),count:P}}),y=b.reduce((n,p)=>n+p.count,0),f=Array.from(new Set(w.map(n=>n.category||"").filter(Boolean))),j=f.length>0?f.map(n=>({name:n,count:w.filter(p=>p.category===n).length})):[{name:s==="zh"?"未分区":"Unsectioned",count:w.length}],re=Math.max(1,...j.map(n=>n.count)),ie=b.filter(n=>n.count>0).length,ne=Math.floor(((i==null?void 0:i.totalPlayTime)||0)/60),oe=R(d.weeklyTarget,1,99),ce=Math.min(100,Math.round(y/oe*100)),de=r!=null&&r.limit?Math.min(100,Math.round(r.count/r.limit*100)):0,me=Math.max(1,...b.map(n=>n.count));return{series:b,categoryRows:j,maxCategory:re,maxSeries:me,weeklyCount:y,activeDays:ie,totalMinutes:ne,weeklyProgress:ce,todayProgress:de,sharedCount:w.filter(n=>n.isShared).length,categories:f.length}},[w,i==null?void 0:i.totalPlayTime,d.weeklyTarget,r==null?void 0:r.count,r==null?void 0:r.limit,s]),B=(F=r==null?void 0:r.membership)!=null&&F.unlimitedAll?"∞":`${(r==null?void 0:r.count)??0}/${(r==null?void 0:r.limit)??0}`,le=()=>{const a={...d,weeklyTarget:R(Number(d.weeklyTarget),1,99),dailyMinutes:R(Number(d.dailyMinutes),5,600)};u(a),localStorage.setItem(S,JSON.stringify(a)),E(!0),window.setTimeout(()=>E(!1),1200)};if(!l)return e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center overflow-hidden bg-[#fff0f5] p-6",children:[e.jsx("img",{src:M,alt:"",className:"absolute inset-0 h-full w-full object-cover object-center saturate-[1.08] contrast-[1.04]"}),e.jsx("img",{src:M,alt:"",className:"absolute inset-0 h-full w-full object-cover object-center opacity-35 blur-[14px] saturate-[1.2] mix-blend-screen"}),e.jsx("div",{className:"absolute inset-0 bg-white/25"}),e.jsxs("div",{className:"relative w-full max-w-[390px] rounded-[28px] border border-white/70 bg-white/62 p-6 text-center shadow-[0_24px_80px_rgba(236,72,153,0.20)] backdrop-blur-xl",children:[e.jsx(C,{src:T,widths:[256,384,512],sizes:"224px",alt:"Paper2Galgame",className:"mx-auto h-auto w-56 drop-shadow-md"}),e.jsx("h1",{className:"mt-4 text-xl font-black text-slate-900",children:t.loginTitle}),e.jsxs("div",{className:"mt-5 flex justify-center gap-3",children:[e.jsx("button",{onClick:m,className:"rounded-2xl border border-white/80 bg-white/70 px-5 py-3 text-sm font-black text-slate-500 transition hover:text-pink-500",children:t.back}),e.jsxs("button",{onClick:h,className:"inline-flex items-center gap-2 rounded-2xl bg-pink-500 px-5 py-3 text-sm font-black text-white shadow-lg shadow-pink-200 transition hover:bg-pink-600",children:[e.jsx(ue,{size:16}),t.login]})]})]})]});const G=(i==null?void 0:i.name)||((W=i==null?void 0:i.email)==null?void 0:W.split("@")[0])||l.email.split("@")[0],U=he((J=r==null?void 0:r.membership)==null?void 0:J.active,"text-slate-950",(i==null?void 0:i.publicBadgeId)||l.publicBadgeId,(K=r==null?void 0:r.membership)==null?void 0:K.unlimitedAll);return e.jsxs("div",{className:`fixed inset-0 z-50 box-border overflow-hidden bg-[#fff0f5] font-sans ${z?"overflow-y-auto":""}`,children:[e.jsxs("div",{className:"pointer-events-none absolute inset-0 overflow-hidden",children:[e.jsx("img",{src:M,alt:"",className:"absolute inset-0 h-full w-full object-cover object-center saturate-[1.08] contrast-[1.04]"}),e.jsx("img",{src:M,alt:"",className:"absolute inset-0 h-full w-full object-cover object-center opacity-40 blur-[14px] brightness-[1.1] saturate-[1.18] mix-blend-screen"}),e.jsx("div",{className:"absolute inset-0 bg-[linear-gradient(90deg,rgba(255,255,255,0.74)_0%,rgba(255,244,250,0.48)_44%,rgba(255,255,255,0.16)_100%)]"}),e.jsx("div",{className:"absolute -left-20 top-10 h-72 w-72 rounded-full bg-pink-200/28 blur-3xl"}),e.jsx("div",{className:"absolute right-[-6rem] bottom-[-5rem] h-80 w-80 rounded-full bg-blue-200/24 blur-3xl"})]}),e.jsxs("div",{className:"relative z-10 flex min-h-full flex-col",children:[e.jsxs("header",{className:"flex shrink-0 items-center justify-between gap-4 px-4 py-4 md:px-8 md:py-5",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx("button",{onClick:m,className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-2xl border border-white/75 bg-white/58 text-slate-500 shadow-sm backdrop-blur-md transition hover:-translate-x-0.5 hover:text-pink-500",children:e.jsx(be,{size:22})}),e.jsx(C,{src:T,widths:[256,384],sizes:"192px",alt:"Paper2Galgame",className:"hidden h-auto w-48 drop-shadow-md sm:block"})]}),e.jsxs("button",{onClick:I,disabled:L,className:"flex h-11 items-center gap-2 rounded-2xl border border-white/75 bg-white/58 px-4 text-sm font-black text-slate-600 shadow-sm backdrop-blur-md transition hover:text-pink-500 disabled:opacity-60",children:[L?e.jsx(pe,{size:16,className:"animate-spin"}):e.jsx(ge,{size:16}),!z&&t.refresh]})]}),e.jsx("main",{className:"flex min-h-0 flex-1 overflow-y-auto px-4 pb-6 md:px-8",children:e.jsxs("div",{className:"mx-auto grid w-full max-w-6xl items-center gap-5 xl:grid-cols-[minmax(300px,0.78fr)_minmax(520px,1fr)]",children:[e.jsxs("section",{className:"hidden min-w-0 xl:block",children:[e.jsx(C,{src:T,widths:[360,540,720],sizes:"360
1px",alt:"Paper2Galgame",className:"w-[360px] max-w-full drop-shadow-lg"}),e.jsxs("div",{className:"mt-7 max-w-[430px] border-l-2 border-dashed border-pink-300/70 pl-5",children:[e.jsx("div",{className:"text-xs font-black uppercase tracking-[0.28em] text-pink-500/80",children:"STUDY BOARD"}),e.jsx("h1",{className:"mt-3 text-5xl font-black leading-tight text-slate-950 drop-shadow-sm",children:t.title}),e.jsx("div",{className:`mt-4 break-words text-lg font-black ${U}`,children:G}),e.jsxs("div",{className:"mt-5 flex flex-wrap gap-2",children:[e.jsx(g,{label:t.totalRuns,value:`${(i==null?void 0:i.totalPlayCount)??0}`}),e.jsx(g,{label:t.totalTime,value:`${o.totalMinutes}${t.minutes}`}),e.jsx(g,{label:t.activeDays,value:`${o.activeDays}/7`})]})]})]}),e.jsxs("section",{className:"relative w-full overflow-hidden rounded-[30px] border border-white/72 bg-white/60 p-4 shadow-[0_24px_90px_rgba(236,72,153,0.18)] backdrop-blur-2xl md:p-6",children:[e.jsx("div",{className:"pointer-events-none absolute inset-0 bg-[linear-gradient(135deg,rgba(255,255,255,0.56),rgba(255,231,242,0.34)_46%,rgba(219,234,254,0.24))]"}),e.jsxs("div",{className:"relative space-y-6",children:[e.jsxs("div",{className:"xl:hidden",children:[e.jsx(C,{src:T,widths:[256,384,512],sizes:"224px",alt:"Paper2Galgame",className:"mb-3 w-56 max-w-full drop-shadow-md"}),e.jsx("div",{className:"text-xs font-black uppercase tracking-[0.22em] text-pink-500/80",children:t.subtitle}),e.jsx("h1",{className:"mt-1 text-3xl font-black text-slate-950",children:t.title}),e.jsx("div",{className:`mt-1 truncate text-sm font-black ${U}`,children:G})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(g,{label:t.todayUses,value:B}),e.jsx(g,{label:t.weeklyProgress,value:`${o.weeklyProgress}%`}),e.jsx(g,{label:t.saveCount,value:`${w.length}`}),e.jsx(g,{label:t.sharedCount,value:`${o.sharedCount}`}),e.jsx(g,{label:t.categoryCount,value:`${o.categories}`})]}),e.jsxs("div",{className:"grid gap-5 lg:grid-cols-[minmax(280px,0.95fr)_minmax(320px,1.05fr)]",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"rounded-[26px] border border-white/70 bg-white/48 p-4 shadow-sm backdrop-blur-md",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsx(N,{kicker:"PLAN",title:t.plan}),e.jsxs("button",{onClick:le,className:"inline-flex h-10 shrink-0 items-center gap-2 rounded-2xl bg-slate-900 px-3 text-xs font-black text-white shadow-lg shadow-slate-200/70 transition hover:bg-pink-600",children:[e.jsx(we,{size:14}),ae?t.saved:t.savePlan]})]}),e.jsxs("div",{className:"mt-4 space-y-3",children:[e.jsxs("label",{className:"block",children:[e.jsx(k,{children:t.focus}),e.jsx("input",{value:d.focus,onChange:a=>u(c=>({...c,focus:a.target.value})),placeholder:t.focusPlaceholder,className:A})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("label",{className:"block",children:[e.jsx(k,{children:t.weeklyTarget}),e.jsx("input",{type:"number",min:1,max:99,value:d.weeklyTarget,onChange:a=>u(c=>({...c,weeklyTarget:Number(a.target.value)})),className:A})]}),e.jsxs("label",{className:"block",children:[e.jsx(k,{children:t.dailyMinutes}),e.jsx("input",{type:"number",min:5,max:600,value:d.dailyMinutes,onChange:a=>u(c=>({...c,dailyMinutes:Number(a.target.value)})),className:A})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("label",{className:"block",children:[e.jsx(k,{children:t.reviewRhythm}),e.jsxs("select",{value:d.reviewRhythm,onChange:a=>u(c=>({...c,reviewRhythm:a.target.value})),className:Q,children:[e.jsx("option",{value:"daily",children:t.rhythmDaily}),e.jsx("option",{value:"twice",children:t.rhythmTwice}),e.jsx("option",{value:"weekly",children:t.rhythmWeekly})]})]}),e.jsxs("label",{className:"block",children:[e.jsx(k,{children:t.deadline}),e.jsx("input",{type:"date",value:d.deadline,onChange:a=>u(c=>({...c,deadline:a.target.value})),className:Q})]})]})]})]}),e.jsxs("div",{className:"rounded-[26px] border border-white/70 bg-white/48 p-4 shadow-sm backdrop-blur-md",children:[e.jsx(N,{kicker:"NEXT",title:t.nextActions}),e.jsxs("div",{className:"mt-4 grid gap-3",children:[e.jsx(q,{onClick:V,tone:"blue",children:t.useSaves}),e.jsx(q,{onClick:Z,tone:"gold",children:t.upgrade}),e.jsx(D,{label:t.todayUses,value:B,width:(H=r==null?void 0:r.membership)!=null&&H.unlimitedAll?100:o.todayProgress})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"rounded-[26px] border border-white/70 bg-white/48 p-4 shadow-sm backdrop-blur-md",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsx(N,{kicker:"TREND",title:t.trend}),e.jsxs("span",{className:"rounded-full bg-white/64 px-3 py-1.5 text-xs font-black text-blue-600",children:[o.weeklyCount,"/",d.weeklyTarget," ",t.times]})]}),e.jsx("div",{className:"mt-5 flex h-44 items-end gap-2 rounded-2xl border border-white/65 bg-white/42 p-3",children:o.series.map(a=>e.jsxs("div",{className:"flex h-full flex-1 flex-col justify-end gap-2",children:[e.jsx("div",{className:"flex flex-1 items-end",children:e.jsx("div",{className:"w-full rounded-t-xl bg-gradient-to-t from-blue-500 to-pink-300 shadow-sm transition-all duration-500",style:{height:`${Math.max(8,a.count/o.maxSeries*100)}%`}})}),e.jsx("div",{className:"text-center text-[10px] font-black text-slate-400",children:a.label})]},a.key))})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-1",children:[e.jsxs("div",{className:"rounded-[26px] border border-white/70 bg-white/48 p-4 shadow-sm backdrop-blur-md",children:[e.jsx(N,{kicker:"GOAL",title:t.weeklyProgress}),e.jsxs("div",{className:"mt-4 space-y-3",children:[e.jsx(D,{label:d.focus||t.focu
1s,value:`${o.weeklyProgress}%`,width:o.weeklyProgress,tone:"pink"}),e.jsx(D,{label:t.totalTime,value:`${o.totalMinutes}${t.minutes}`,width:Math.min(100,o.totalMinutes/Math.max(1,d.dailyMinutes*7)*100),tone:"blue"})]})]}),e.jsxs("div",{className:"rounded-[26px] border border-white/70 bg-white/48 p-4 shadow-sm backdrop-blur-md",children:[e.jsx(N,{kicker:"SECTION",title:t.categoryBoard}),e.jsx("div",{className:"mt-4 space-y-3",children:o.categoryRows.length===0?e.jsx("div",{className:"rounded-2xl border border-dashed border-white/70 bg-white/36 py-7 text-center text-sm font-bold text-slate-400",children:t.empty}):o.categoryRows.slice(0,5).map(a=>e.jsx(D,{label:a.name,value:`${a.count}`,width:a.count/o.maxCategory*100,tone:"emerald"},a.name))})]})]})]})]})]})]})]})})]})]})};export{_e 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.