From 48a21564c4395dce14a67ece0c8748eecd17823a Mon Sep 17 00:00:00 2001 From: xfy Date: Thu, 2 Jul 2026 11:17:41 +0800 Subject: [PATCH] =?UTF-8?q?refactor(assets):=20=E8=83=8C=E6=99=AF=E5=9B=BE?= =?UTF-8?q?=E5=9B=BA=E5=AE=9A=20opacity-10=EF=BC=8C=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E9=80=8F=E6=98=8E=E5=BA=A6=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 动态判断不生效,统一固定为 10% 透明度,移除聚焦/有内容的条件类。 --- src/components/comments/form.rs | 19 ++++--------------- src/pages/admin/write.rs | 19 ++++--------------- 2 files changed, 8 insertions(+), 30 deletions(-) diff --git a/src/components/comments/form.rs b/src/components/comments/form.rs index d4bf543..e3c917a 100644 --- a/src/components/comments/form.rs +++ b/src/components/comments/form.rs @@ -155,21 +155,10 @@ pub fn CommentForm(post_id: i32, parent_id: Option, parent_indent: Option) -> Element { div { class: "relative group flex-1 min-h-0 w-full border border-[var(--color-paper-border)] rounded-xl overflow-hidden bg-[var(--color-paper-entry)] shadow-[0_2px_8px_rgba(0,0,0,0.04)] dark:shadow-none", id: "tiptap-editor", - { - // 无内容时半透明(60%);有内容或聚焦时淡出(10%)。 - // content 是 onUpdate 回调实时维护的 signal,编辑即触发重渲染。 - let bg_opacity = if content().trim().is_empty() { - "opacity-60" - } else { - "opacity-10" - }; - rsx! { - img { - src: "/images/xiantiaoxiaogou_input_bg.webp", - alt: "", - class: "absolute bottom-1.5 right-1.5 group-focus-within:opacity-10 transition-opacity duration-300 pointer-events-none z-0 {bg_opacity}", - } - } + img { + src: "/images/xiantiaoxiaogou_input_bg.webp", + alt: "", + class: "absolute bottom-1.5 right-1.5 opacity-10 pointer-events-none z-0", } } }