33 Commits

Author SHA1 Message Date
xfy
3ade2569df chore(assets): add new empty state image for search page 2026-06-29 14:03:10 +08:00
xfy
ac1f92d816 refactor(core): 迁移 post-content 到 yggdrasil-core,删除 public/js
逐行 TypeScript 化(逻辑不变),改走 window.__initPostContent 全局入口。
post-content.js 已迁移进 libs/yggdrasil-core/,public/js/ 目录随之删除。
2026-06-26 13:57:48 +08:00
xfy
cfd2af1fab refactor(empty-state): 内联 SVG 换成 webp 配图
移除手绘的 LineDog 内联 SVG,改用 <img> 引用
public/images/xiaotiaoxiaogou_01.webp 原始插画。
2026-06-25 13:43:23 +08:00
xfy
022b63aedc refactor(lightbox): remove legacy public/js/lightbox.js (migrated to libs/lightbox) 2026-06-24 11:07:46 +08:00
xfy
c1610ace99 fix(lightbox): prevent background flash on open
Some checks failed
CI / check (push) Failing after 5m16s
CI / build (push) Has been skipped
overlay inherited opacity:1 from .lightbox-overlay CSS, so the moment
it was appended to the DOM it painted a full-opacity black background.
this showed for ~24ms (the time until the image loaded and start() ran
the first frame that sets opacity 0), visible as a black flash before
the fade-in.

set overlay.style.opacity = '0' right after creating it, so it is
transparent when appended; start()'s transition then fades it to 1 as
intended.
2026-06-23 17:37:38 +08:00
xfy
8bdc3553bd fix(lightbox): correct zoom origin, scroll-close, blur-up rendering
several bugs found via in-browser debugging, all in lightbox.js + the
blur-up CSS:

1. DOMRect attribute mismatch: getBoundingClientRect returns .width/
   .height, but code read .w/.h -> NaN transforms. map rectOf() to a
   uniform {x,y,w,h}.

2. zoom scale base was the huge original natural size (2942px), so the
   centered state collapsed to a tiny scale and the open animation ran
   backwards (shrink). base the scale on originRect instead: first
   frame is the in-article image at scale 1, centered state scales to
   target.w/originRect.w. open is always grow, close always shrink.

3. scroll-to-close fired on a phantom scroll jump: the oversized
   original img (layout size = naturalW) expanded the document's
   scrollable area. set img layout size explicitly and add
   overflow:hidden on the (position:fixed) overlay so the img cannot
   expand the body.

4. first open animation jumped from the wrong position: a single rAF
   was not enough to commit the no-transition first frame. use a forced
   reflow (offsetHeight) + double-rAF before starting the transition.

5. blur-up full layer stuck at opacity 0 until a forced reflow (opening
   the lightbox) repainted it. drop the opacity transition on .blur-img-
   full and set opacity:1 from JS on load (deterministic, no repaint
   race). mark the container .is-loaded and hide the placeholder via
   the container class.

6. a 16px grey gap above in-article images: .md-content img { margin:
   1rem 0 } applied to the absolute .blur-img-full too, pushing it
   down. reset margin:0 / max-width:none on the blur-up img layers.
2026-06-23 17:30:37 +08:00
xfy
75b9080df8 refactor(post-cover): use raw blur-img structure as single lightbox image
drop ImageViewer; render .blur-img with a lightbox-single class (the
class, not a data attribute, because Dioxus' typed span elements reject
arbitrary data-* attrs). lightbox.js now keys single-mode off the
lightbox-single class instead of data-single. cover uses ?w=20
placeholder + ?w=1200 display; SSR writes --ar from real dimensions.
2026-06-23 15:48:02 +08:00
xfy
bace31933f refactor(post-content): remove lightbox/lazy-load, keep copy only
the lightbox + IntersectionObserver lazy-load now live in lightbox.js;
post-content.js is reduced to just the code-block copy button.
2026-06-23 15:44:46 +08:00
xfy
5d2b6e502d feat(lightbox): gallery navigation with fade, arrows + keyboard
add prev/next arrow buttons (only in gallery mode with >1 image) and
ArrowLeft/ArrowRight keyboard handling. switching uses a 150ms
fade-out -> swap src -> fade-in (no fly, matching Medium). originNode
is updated to the new image so close/scroll-close flies back to the
right place; openScrollY is reset to keep scroll-close baseline valid.
2026-06-23 15:43:24 +08:00
xfy
ab4f006107 fix(lightbox): bind interactions immediately, before image loads
bindInteractions() was only called from start(), which waits for the
image load event. during the load window Esc/scroll/backdrop-click did
nothing. bind right after appending the overlay so the lightbox is
closable throughout the load.
2026-06-23 15:41:22 +08:00
xfy
a5c7e64230 feat(lightbox): open/close with origin-aware zoom + scroll-to-close
click a .blur-img to open: record its viewport rect, the lightbox img
starts at that position/size and transforms to centered (Medium-style
origin-aware zoom). close flies back to the live originNode rect.

scroll-to-close: while open, any window scroll drives the image back
to its (moving) position via per-frame rect tracking + linear
interpolation; the article keeps its scroll position on close.

Esc + click-on-backdrop close; click-on-image does not close.
prefers-reduced-motion falls back to fade-only / immediate close.
2026-06-23 15:29:59 +08:00
xfy
fe58d25b54 feat(lightbox): add lightbox.js skeleton with lazy-load 2026-06-23 15:28:47 +08:00
xfy
8ef9ee5621 feat(post-content): lazy-load hi-res images with blur-up fade-in 2026-06-22 18:00:52 +08:00
xfy
24f00184a5 删除 public/tiptap/editor.css 构建产物 2026-06-10 16:51:51 +08:00
xfy
44c1358da5 refactor: extract post content JS into standalone script 2026-06-09 13:18:40 +08:00
xfy
a8704e199f feat(editor): add slash command, table, task list, image and link extensions
- Add @tiptap/suggestion-based slash command menu with 12 commands
- Add TableKit for table support (3x3 with header)
- Add Image extension with base64 support
- Add Link extension with autolink and paste detection
- Add TaskList/TaskItem extensions for checklists
- Upgrade all tiptap packages from 3.23.6 to 3.25.0
- Add CSS styles for all new features including dark theme
2026-06-05 10:20:47 +08:00
xfy
245fd83ec8 feat: replace in-footer scroll-to-top link with fixed floating button 2026-06-04 17:55:26 +08:00
xfy
73fd3c30e2 build: remove obsolete WASM path fix and tracked index.html 2026-06-04 17:34:12 +08:00
xfy
9c38ca7a16 chore: stop tracking tiptap build artifacts (now gitignored) 2026-06-04 16:52:11 +08:00
xfy
8f2f00244c fix: add WASM loading script to SSR HTML template for client hydration 2026-06-03 16:30:03 +08:00
xfy
e48ea4f97f fix: add CSS stylesheets via document API for SSR
- Add document::Stylesheet for /style.css and /highlight.css in AppRouter
- This ensures CSS is included in SSR HTML for all pages (home, post detail, etc.)
- Also add public/index.html for production builds
- Remove stale ISRG cache files
2026-06-03 15:37:17 +08:00
xfy
956b2d7374 修复编辑器暗色主题和列表样式
- CSS 暗色主题选择器从 [data-theme="dark"] 改为 .dark
- 恢复无序列表圆点(覆盖 Tailwind preflight 重置)
- placeholder 改用 :has() 选择器适配 Tiptap v3

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 18:02:52 +08:00
xfy
f6d60520eb 集成 Tiptap Markdown 编辑器到文章撰写页面
- 新增 libs/tiptap-editor/ 打包子项目(Tiptap Core + StarterKit + Markdown)
- 构建产物输出到 public/tiptap/
- 替换原有的 textarea + pulldown_cmark 预览为 WYSIWYG 编辑器
- Makefile 新增 build-editor target
- Dioxus.toml 引入 editor.js 和 editor.css

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 17:46:04 +08:00
xfy
4a73e4d931 将生成的 style.css 从版本控制中移除 2026-05-26 14:29:59 +08:00
xfy
06302b14de 实现 PaperMod 风格标签页面:标签列表 + 标签详情
- 新增 /tags 页面:展示所有标签及文章数量,按字母排序
- 新增 /tags/:tag 动态路由:展示该标签下的文章列表
- Post/POSTS 改为 pub,供 tags 模块复用
- NavItem 高亮也匹配 TagDetailPage
- 修复 CSS 路径为绝对路径,解决子路由下样式失效

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 13:43:38 +08:00
xfy
7599bfbb13 实现 PaperMod 风格归档页面,支持按年份月份分组
- 新增 ArchivesPage 组件,三级结构:年份 → 月份 → 文章
- Header/NavItem/Footer 改为 pub 共享,NavItem 通过路由动态判断高亮
- 编译 Tailwind CSS 包含归档页面所需 utility classes

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 13:31:35 +08:00
xfy
a15394c935 返回顶部按钮迁移为 PaperMod 风格
- button "↑" → <a href="#top"> + 内联 SVG 双上箭头图标
- 滚动超过一屏才显示,添加 opacity/translate-y 过渡动画
- 平滑滚动到顶部并清除 URL hash(history.replaceState)
- 无障碍属性:aria-label、title、accesskey="g"

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 13:20:25 +08:00
xfy
61c1ec7282 修复暗色模式:class 变体、状态同步、FOUC 预防、系统偏好
- 配置 Tailwind v4 @custom-variant dark 使用 class 模式
- 用 use_context_provider 共享主题状态,修复 AppRouter/ThemeToggle 不同步
- 默认跟随系统偏好(matchMedia),无 localStorage 时自动检测
- 统一暗色标记为 .dark class,移除 data-theme 冗余
- ThemePreload 内联脚本在 DOM 解析前设置 class,消除首屏闪烁
- SVG 内联 + currentColor,图标颜色随主题切换
- Cargo.toml 补充 web-sys MediaQueryList/DomTokenList feature

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 11:31:06 +08:00
xfy
3079f1a505 ThemeToggle:用 SVG 图标替换 emoji,移除灰色背景
- 亮色模式使用太阳 SVG 图标
- 暗色模式使用月亮 SVG 图标
- 移除按钮的灰色背景,改为 hover 透明度变化

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 11:11:44 +08:00
xfy
1d57c91836 编译 Tailwind CSS,包含首页所需的 utility classes
- line-clamp-2, duration-250, backdrop-blur 等样式
- 验证首页 SSR 渲染正确

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 10:36:18 +08:00
xfy
c2d5619855 移除首页,将根路径重定向到登录页,添加注册链接
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 10:22:05 +08:00
xfy
390ab98b86 升级 Tailwind CSS 到 v4 并简化构建流程
- 将 input.css 从 v3 的 @tailwind 指令迁移到 v4 的 @import "tailwindcss"
- 删除 tailwind.config.js(v4 不再需要配置文件)
- 删除 package.json(完全使用本地 tailwindcss CLI)
- 重新构建 public/style.css 为 v4 格式
- 添加 Makefile 提供 dev/build/css/css-watch/clean 命令

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 09:59:42 +08:00
xfy
0b15cc7e1c 切换到本地 Tailwind CSS 构建并清理项目文件
- 移除 CDN Tailwind,改用本地构建的 style.css
- 添加 package.json、tailwind.config.js、input.css 构建配置
- 清理 prd.json、progress.txt 及误创建的文件
- 修复 login.rs 中未使用变量命名 (_token → token)
- 更新 .gitignore 排除 node_modules 和 package-lock.json

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 17:35:02 +08:00