feat(comments): add decorative image to comment input with focus fade effect

This commit is contained in:
xfy 2026-06-29 14:42:03 +08:00
parent fbd706b198
commit 0b53e968c1

View File

@ -147,13 +147,20 @@ pub fn CommentForm(post_id: i32, parent_id: Option<i64>, parent_indent: Option<i
class: "block text-sm font-medium text-paper-secondary mb-1", class: "block text-sm font-medium text-paper-secondary mb-1",
"内容 *" "内容 *"
} }
div { class: "relative",
textarea { textarea {
id: "comment-content-{id_suffix}", id: "comment-content-{id_suffix}",
class: "{INPUT_CLASS} min-h-[100px] resize-y", class: "{INPUT_CLASS} peer min-h-[100px] resize-y",
value: "{content_md}", value: "{content_md}",
disabled: submitting(), disabled: submitting(),
oninput: move |e| content_md.set(e.value()), oninput: move |e| content_md.set(e.value()),
} }
img {
src: "/images/xiantiaoxiaogou_03.webp",
alt: "",
class: "absolute bottom-2 right-2 w-24 pointer-events-none opacity-60 peer-focus:opacity-10 transition-opacity duration-300",
}
}
} }
p { class: "text-xs text-paper-tertiary", "支持 Markdown 语法" } p { class: "text-xs text-paper-tertiary", "支持 Markdown 语法" }