Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ https://hulingjun.github.io/
- 首页:自己的知识、成长随记,以及女儿的成长足迹。
- /art/:原比例绘画作品,手机可跳转 GitHub 上传。
- /knowledge/:保留现有节点编辑器,可提交 / 打开 GitHub 知识空间。
- /learning/:保留原《关键对话》学习实验;/3d-alpha/ 不变。
- 旧 /learning/ 与 /3d-alpha/ 地址转到新的成长首页,不再展示旧界面。

## 保存方式

Expand Down
14 changes: 3 additions & 11 deletions app/globals.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ export default function GrowthHome(){
<section id="timeline" aria-labelledby="timeline-heading"><div className="archive-section-heading"><h2 id="timeline-heading">留下的足迹</h2><div className="archive-filters" aria-label="记录分类">{[["all","全部"],["mine","我的成长"],["daughter","她的成长"]].map(([id,label])=><button key={id} aria-pressed={scope===id} onClick={()=>setScope(id)}>{label}</button>)}</div></div>
{state==="loading"?<p className="archive-status" role="status">正在读取成长档案……</p>:state==="error"?<div className="archive-status" role="alert"><p>记录暂时无法载入,请稍后重试。</p><button onClick={()=>setRetry(r=>r+1)}>重试</button></div>:entries.length?<div className="archive-timeline">{entries.map(e=><article className="archive-entry" key={e.key}><time dateTime={e.date||undefined}>{e.date||"日期未记录"}</time><div><span className="entry-type">{e.kind}</span><h3><a href={e.href}>{e.title}</a></h3>{e.content&&(e.content.length>220?<details><summary>阅读这段记录</summary><p>{e.content}</p></details>:<p>{e.content}</p>)}{e.image&&<a href={e.href}><img src={e.image.thumbnail} width={e.image.width} height={e.image.height} alt={e.title} loading="lazy"/></a>}<a className="entry-link" href={e.href}>{e.kind.startsWith("知识")?"打开知识空间":"查看记录"} ↗</a></div></article>)}</div>:<div className="archive-empty"><h3>从今天开始,留下第一条记录。</h3><p>旧的知识草稿仍在原浏览器中。进入知识空间,提交到 GitHub 后,就会出现在这里。</p><a className="a-button" href={NEW_NOTE}>写一条成长随记 ↗</a></div>}
</section>
</main><div className="archive-foot"><span>HJ / GROWTH ARCHIVE · 记录,而非赶路。</span><a href="/learning/">过往阅读实验:关键对话 ↗</a></div></div>;
</main><div className="archive-foot"><span>HJ / GROWTH ARCHIVE · 记录,而非赶路。</span><a href="/knowledge/">我的知识空间 ↗</a></div></div>;
}
6 changes: 1 addition & 5 deletions content/index.json
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
{
"version": 1,
"knowledge": [],
"journal": []
}
{"version":1,"knowledge":[],"journal":[]}
3 changes: 2 additions & 1 deletion github-pages/3d-alpha/index.html
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
<!doctype html><html lang="zh-CN"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="description" content="高难度沟通三维概念学习空间"/><link rel="icon" href="/favicon.svg"/><title>高难度沟通 · alpha-3d-0.2</title></head><body><div id="root"></div><script type="module" src="/src.tsx"></script></body></html>
<!doctype html>
<html lang="zh-CN"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="description" content="记录阅读与思考,也留存女儿的成长与画作。"/><meta name="theme-color" content="#090e16"/><link rel="icon" href="/favicon.svg"/><title>HJ · 个人成长记录</title></head><body><div id="root"></div><script type="module" src="/src.tsx"></script></body></html>
2 changes: 1 addition & 1 deletion github-pages/learning/index.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<!doctype html>
<html lang="zh-CN"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="description" content="过往的概念学习实验。"/><meta name="theme-color" content="#090e16"/><link rel="icon" href="/favicon.svg"/><title>关键对话 · 阅读实验</title></head><body><div id="root"></div><script type="module" src="/src.tsx"></script></body></html>
<html lang="zh-CN"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="description" content="记录阅读与思考,也留存女儿的成长与画作。"/><meta name="theme-color" content="#090e16"/><link rel="icon" href="/favicon.svg"/><title>HJ · 个人成长记录</title></head><body><div id="root"></div><script type="module" src="/src.tsx"></script></body></html>
29 changes: 9 additions & 20 deletions github-pages/src.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
import React, { lazy, Suspense } from "react";
import { createRoot } from "react-dom/client";
import React, {lazy,Suspense} from "react";
import {createRoot} from "react-dom/client";
import "../app/globals.css";
import "./feedback.css";

const Art = lazy(() => import("../app/art/page"));
const Learning = lazy(() => import("../app/learning/page"));
const isArt = window.location.pathname.replace(/\/$/, "").endsWith("/art");
const isLearning = window.location.pathname.replace(/\/$/, "").endsWith("/learning");
const Home = lazy(() => import("../app/page"));
const Alpha3D = lazy(() => import("../app/3d-alpha/page"));
const KnowledgeEditor = lazy(() => import("../app/knowledge/page"));
const is3D = window.location.pathname.replace(/\/$/, "").endsWith("/3d-alpha");
const isKnowledge = window.location.pathname.replace(/\/$/, "").endsWith("/knowledge");

function GithubPagesApp() {
const page = is3D ? <Alpha3D /> : isKnowledge ? <KnowledgeEditor /> : isArt ? <Art /> : isLearning ? <Learning /> : <Home />;
return <><Suspense fallback={<div style={{minHeight:"100vh",display:"grid",placeItems:"center",background:"#071417",color:"#dff7f1"}}>正在载入学习空间…</div>}>{page}</Suspense>{isLearning && <a className="github-feedback" href="https://github.com/hulingjun/hulingjun.github.io/issues/new?title=%5B%E5%8F%8D%E9%A6%88%5D%20%E9%AB%98%E9%9A%BE%E5%BA%A6%E6%B2%9F%E9%80%9A%E5%AD%A6%E4%B9%A0%E7%AB%99&body=%E6%88%91%E4%BD%BF%E7%94%A8%E7%9A%84%E7%89%88%E6%9C%AC%EF%BC%9A%0A%0A%E6%88%91%E6%83%B3%E5%8F%8D%E9%A6%88%EF%BC%9A%0A" target="_blank" rel="noreferrer">一键反馈</a>}</>;
}

createRoot(document.getElementById("root")!).render(<GithubPagesApp />);
const Home=lazy(()=>import("../app/page"));
const Art=lazy(()=>import("../app/art/page"));
const Knowledge=lazy(()=>import("../app/knowledge/page"));
const route=window.location.pathname.replace(/\/$/,"");
if(route==="/learning"||route==="/3d-alpha")window.location.replace("/");
function App(){return <Suspense fallback={<div style={{minHeight:"100vh",display:"grid",placeItems:"center",background:"#090e16",color:"#b4d7e5"}}>正在打开成长档案……</div>}>{route==="/knowledge"?<Knowledge/>:route==="/art"?<Art/>:<Home/>}</Suspense>}
createRoot(document.getElementById("root")!).render(<App/>);
Loading