refactor(assets): 背景图固定 opacity-10,移除动态透明度逻辑
动态判断不生效,统一固定为 10% 透明度,移除聚焦/有内容的条件类。
This commit is contained in:
parent
5fd883d7a1
commit
48a21564c4
@ -155,21 +155,10 @@ pub fn CommentForm(post_id: i32, parent_id: Option<i64>, parent_indent: Option<i
|
|||||||
disabled: submitting(),
|
disabled: submitting(),
|
||||||
oninput: move |e| content_md.set(e.value()),
|
oninput: move |e| content_md.set(e.value()),
|
||||||
}
|
}
|
||||||
{
|
img {
|
||||||
// 无内容时半透明(60%);有内容或聚焦时淡出(10%)。
|
src: "/images/xiantiaoxiaogou_input_bg.webp",
|
||||||
// content_md 由 oninput 实时维护,输入即触发重渲染。
|
alt: "",
|
||||||
let bg_opacity = if content_md().trim().is_empty() {
|
class: "absolute bottom-1.5 right-1.5 w-24 opacity-10 pointer-events-none z-0",
|
||||||
"opacity-60"
|
|
||||||
} else {
|
|
||||||
"opacity-10"
|
|
||||||
};
|
|
||||||
rsx! {
|
|
||||||
img {
|
|
||||||
src: "/images/xiantiaoxiaogou_input_bg.webp",
|
|
||||||
alt: "",
|
|
||||||
class: "absolute bottom-1.5 right-1.5 w-24 pointer-events-none peer-focus:opacity-10 transition-opacity duration-300 z-0 {bg_opacity}",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -469,21 +469,10 @@ fn write_editor(post_id: Option<i32>) -> Element {
|
|||||||
div {
|
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",
|
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",
|
id: "tiptap-editor",
|
||||||
{
|
img {
|
||||||
// 无内容时半透明(60%);有内容或聚焦时淡出(10%)。
|
src: "/images/xiantiaoxiaogou_input_bg.webp",
|
||||||
// content 是 onUpdate 回调实时维护的 signal,编辑即触发重渲染。
|
alt: "",
|
||||||
let bg_opacity = if content().trim().is_empty() {
|
class: "absolute bottom-1.5 right-1.5 opacity-10 pointer-events-none z-0",
|
||||||
"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}",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user