|
|
@@ -1,126 +1,65 @@
|
|
|
-# ericwu.me
|
|
|
-
|
|
|
-The personal site of Eric Wu, an SDE II at AWS building agentic systems and generative UI.
|
|
|
-Live at **[ericwu.me](https://ericwu.me)**.
|
|
|
-
|
|
|
-<picture>
|
|
|
- <source media="(prefers-color-scheme: dark)" srcset="docs/screenshots/desktop-dark.webp">
|
|
|
- <img alt="The ericwu.me home page: liquid-glass bento cards with the hero, FinOps Agent, Amazon Q artifacts, the Seattle sky, a globe and SecondSelf" src="docs/screenshots/desktop-light.webp">
|
|
|
-</picture>
|
|
|
-
|
|
|
-It's a bento grid of liquid-glass cards, built from scratch with Next.js 16, React 19 and Tailwind CSS v4.
|
|
|
-There's no UI kit: the cards, the glass material and the motion are all hand-made.
|
|
|
-
|
|
|
-## Highlights
|
|
|
-
|
|
|
-- **The glass period.** The period in "Hey, I'm Eric." is a bead of liquid glass. Pull it and it swells into a lens that magnifies the card and stretches with speed. Let go and it springs back into a period. Chromium bends light through an SVG displacement map, and Safari and iOS get a magnified copy of the card.
|
|
|
-- **A grid you can rearrange.** Drag a card onto another to swap them (on touch, press and hold first). The All, About and Work views reflow the grid with spring-driven FLIP animations.
|
|
|
-- **Cards that do something.**
|
|
|
- - Seattle's sky right now, with the sun's real position and the moon's phase.
|
|
|
- - A WebGL globe tracing Purdue → UCLA → Seattle.
|
|
|
- - A toolbox sphere you can spin and a photo deck you can fling.
|
|
|
- - iOS-style FinOps Agent notifications and Amazon Q artifacts you can click through.
|
|
|
- - A 3D MINI that loads only when asked for.
|
|
|
- - An emoji card that picks an emoji for how you feel.
|
|
|
-- **A blog on Notion.** Posts are written in Notion, rendered with react-notion-x, prerendered and refreshed hourly.
|
|
|
-- **English and Chinese.** Every page has a Chinese twin under `/zh`, and the nav, the footer and ⌘K switch between them. Chinese headings are set in Noto Serif SC beside Fraunces, and a post carries its Chinese version as a sub-page in Notion.
|
|
|
-- **⌘K everywhere.** A command palette with fuzzy search over views, projects, links and a few tricks.
|
|
|
-- **Light and dark.** The theme switches with a circular reveal. Safari switches instantly, because it paints view-transition snapshots without glass.
|
|
|
-- **Built to be fast.**
|
|
|
- - Pages are prerendered and the CSS is inlined.
|
|
|
- - The web fonts load after first paint, and Apple devices use SF Pro.
|
|
|
- - The globe and three.js load only when they're needed.
|
|
|
- - A tab left open picks up a new deploy when you come back to it.
|
|
|
-- **Mount Rainier behind it all.** The contour lines come from AWS Terrain Tiles (USGS 3DEP), generated by `scripts/gen-topo.py`.
|
|
|
-
|
|
|
-<p align="center">
|
|
|
- <img alt="The home page on a phone, in light and dark mode" src="docs/screenshots/phones.webp" width="640">
|
|
|
-</p>
|
|
|
-
|
|
|
-<p align="center">
|
|
|
- <img alt="The glass period pulled over the bio, magnifying the words beneath it, in light and dark mode" src="docs/screenshots/lens.webp" width="820">
|
|
|
-</p>
|
|
|
-
|
|
|
-## Tech stack
|
|
|
-
|
|
|
-| Part | Built with |
|
|
|
-| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
|
-| Framework | [Next.js 16](https://nextjs.org) (App Router), [React 19](https://react.dev), [TypeScript](https://www.typescriptlang.org) |
|
|
|
-| Styling | [Tailwind CSS v4](https://tailwindcss.com), container queries, hand-built liquid glass |
|
|
|
-| Type | [Fraunces](https://fonts.google.com/specimen/Fraunces) for display, [Figtree](https://fonts.google.com/specimen/Figtree) for text (SF Pro on Apple devices), [Noto Serif SC](https://fonts.google.com/noto/specimen/Noto+Serif+SC) for Chinese headings |
|
|
|
-| Blog | [Notion](https://www.notion.so) through [notion-client](https://github.com/NotionX/react-notion-x/tree/master/packages/notion-client) and [react-notion-x](https://github.com/NotionX/react-notion-x) |
|
|
|
-| Graphics | [cobe](https://github.com/shuding/cobe) for the globe, [three.js](https://threejs.org) with [React Three Fiber](https://r3f.docs.pmnd.rs) and [drei](https://drei.docs.pmnd.rs) for the MINI |
|
|
|
-| Data | [Firebase Storage](https://firebase.google.com/docs/storage) for photos, [OpenAI](https://platform.openai.com) for the emoji card |
|
|
|
-| Search | [Fuse.js](https://www.fusejs.io) |
|
|
|
-| Hosting | [Vercel](https://vercel.com), with Vercel Analytics |
|
|
|
-
|
|
|
-## Project structure
|
|
|
-
|
|
|
-```text
|
|
|
-app/[lang]/ Pages in each language (English at /, Chinese at /zh): home, /blog, /blog/[blogId]
|
|
|
-app/ The emoji and version APIs, OG image, sitemap
|
|
|
-messages/ Every string on the site, in English and Chinese
|
|
|
-components/
|
|
|
- bento/ The grid: layout per view, drag to swap, FLIP view changes
|
|
|
- cards/ Every card on the home page
|
|
|
- glass/ Liquid-glass material, refraction maps, the cursor lens
|
|
|
- nav/ Floating nav and the ⌘K command palette
|
|
|
- backdrop/ The Mount Rainier contour background
|
|
|
- blog/ Blog list and Notion page renderer
|
|
|
-config/ Site metadata, links, projects and fonts
|
|
|
-lib/ Layouts, Notion and Firebase data, motion springs, theme transition
|
|
|
-scripts/ Generators for the contour background and the Rainier skyline
|
|
|
-public/ Static files: contour data, the MINI model, emoji
|
|
|
-```
|
|
|
+# 康临随记
|
|
|
+
|
|
|
+邓康临的个人主页:一个液态玻璃质感的 bento 卡片网格,用来放项目、工具和生活片段。
|
|
|
|
|
|
-## Getting started
|
|
|
+## 技术栈
|
|
|
|
|
|
-You need Node.js 24.
|
|
|
+| 层 | 选型 |
|
|
|
+|---|---|
|
|
|
+| 框架 | Next.js 16(App Router)+ React 19 + TypeScript |
|
|
|
+| 样式 | Tailwind CSS v4,无 UI 库,卡片与玻璃材质全部手写 |
|
|
|
+| 3D | three.js + @react-three/fiber + drei(车模,点击才加载) |
|
|
|
+| 地球 | cobe(点阵 WebGL 地球,进入视口才初始化) |
|
|
|
+| 图片 | 本地文件为主,Firebase Storage 仅用于项目截图(可选) |
|
|
|
+| 博客 | Notion API(当前停用,见下方说明) |
|
|
|
+
|
|
|
+## 本地运行
|
|
|
|
|
|
```bash
|
|
|
-git clone https://github.com/itsEricWu/ericwu.me.git
|
|
|
-cd ericwu.me
|
|
|
npm install
|
|
|
-npm run dev
|
|
|
+npm run dev # http://localhost:3000
|
|
|
```
|
|
|
|
|
|
-Then open [localhost:3000](http://localhost:3000).
|
|
|
-
|
|
|
-### Environment variables
|
|
|
+首页需要 `NEXT_PUBLIC_FIREBASE_API_KEY` 才会去拉项目截图;不配也能正常启动,会跳过 Firebase、使用本地图片。需要的话复制 `.env.local.example` 为 `.env.local` 再填。
|
|
|
|
|
|
-Copy `.env.local.example` to `.env.local`. Both variables are optional.
|
|
|
+## 常用脚本
|
|
|
|
|
|
-| Variable | What it's for |
|
|
|
-| ------------------------------ | -------------------------------------------------------------------------------------------------------- |
|
|
|
-| `OPENAI_API_KEY` | The emoji card (`/api/emoji`). Without it, only that card shows an error. |
|
|
|
-| `NEXT_PUBLIC_FIREBASE_API_KEY` | The Firebase project that stores the photos, the avatar and the project images (`firebase/firebase.ts`). |
|
|
|
+| 命令 | 说明 |
|
|
|
+|---|---|
|
|
|
+| `npm run dev` | 开发服务器(Turbopack) |
|
|
|
+| `npm run build` | 生产构建 |
|
|
|
+| `npm start` | 启动生产服务 |
|
|
|
+| `npm run lint` | ESLint |
|
|
|
+| `npm run typecheck` | TypeScript 类型检查 |
|
|
|
+| `npm run format` | Prettier |
|
|
|
|
|
|
-### Scripts
|
|
|
+## 语言与路由
|
|
|
|
|
|
-| Command | What it does |
|
|
|
-| ----------------------------------------------------- | ------------------------------------- |
|
|
|
-| `npm run dev` | Dev server with Turbopack |
|
|
|
-| `npm run build`, `npm start` | Production build and server |
|
|
|
-| `npm run lint`, `npm run typecheck`, `npm run format` | ESLint, TypeScript, Prettier |
|
|
|
-| `npm run topo` | Regenerate the Mount Rainier contours |
|
|
|
+- **中文**:裸路径,`/`、`/blog`
|
|
|
+- **英文**:`/en`、`/en/blog`
|
|
|
+- `/zh/*` 会 308 跳转到对应的裸路径,保证每个页面只有一个地址
|
|
|
|
|
|
-## Make it yours
|
|
|
+语言切换按钮、`⌘K` 命令面板和页脚都会跟随当前路径切换,不会把英文链接指到中文页。
|
|
|
|
|
|
-- **Who you are:** edit your name, links and projects in `config/site.ts`, and the bio and every other string in `messages/en.ts` and `messages/zh.ts`.
|
|
|
-- **Your blog:** point `notionBlogConfig.blogParentId` at your own public Notion page.
|
|
|
-- **Your images:** point `firebase/firebase.ts` at your own Firebase project and upload your photos and avatar (the paths are in `lib/data.ts`).
|
|
|
-- **Your cards:** cards live in `components/cards`. `app/[lang]/page.tsx` lists them with their size at each breakpoint and the views they belong to.
|
|
|
-- **Chinese versions of posts:** inside a post in Notion, add a sub-page titled with the post's Chinese title and put the translation in it. An empty sub-page translates only the title. A post without one shows the English original on `/zh`, under a note.
|
|
|
+## 目录结构
|
|
|
|
|
|
-## Deployment
|
|
|
-
|
|
|
-The site runs on Vercel, and every push to `main` deploys to [ericwu.me](https://ericwu.me).
|
|
|
-Any host that runs Next.js 16 on Node.js 24 works too.
|
|
|
+```
|
|
|
+app/[lang]/ 页面(首页、博客列表、文章详情)
|
|
|
+components/bento/ 卡片网格与拖拽换位
|
|
|
+components/cards/ 各张卡片(个人信息、天空、足迹、照片、车模…)
|
|
|
+components/blog/ 博客列表与文章渲染
|
|
|
+lib/ 数据获取、i18n、动效工具
|
|
|
+messages/ 中英文案
|
|
|
+public/ 静态资源(头像、照片、mini.glb)
|
|
|
+```
|
|
|
|
|
|
-## Star history
|
|
|
+## 目前的状态
|
|
|
|
|
|
-[](https://star-history.com/#itsEricWu/ericwu.me&Date)
|
|
|
+- 首页有 9 张卡片是**空白占位**,由 `app/[lang]/page.tsx` 里的 `show` 开关控制。想恢复某张卡片把对应值改成 `true` 即可,组件和文案都还在。
|
|
|
+- **博客已清空**:不再请求 Notion,`/blog` 显示 0 篇;`lib/notion.ts` 和文章详情页保留,接回来就能用。
|
|
|
+- 头像和照片走本地文件(`public/avatar/`、`public/photos/`),不依赖外网,国内访问不会卡在加载上。
|
|
|
+- QQ 按钮目前隐藏(`components/cards/hero.tsx` 的 `SHOW_QQ`)。
|
|
|
|
|
|
-## License
|
|
|
+## 许可
|
|
|
|
|
|
-[MIT](LICENSE)
|
|
|
+MIT,见 [LICENSE](./LICENSE)。
|