Compare commits

..

No commits in common. "369b4838a3f394ffeff4c73911090bdecbb18f59" and "373498870a160ee46b1cd84d7e985445704a0711" have entirely different histories.

4 changed files with 30 additions and 66 deletions

View File

@ -334,12 +334,6 @@
height: auto; height: auto;
} }
.dark .md-content img:not(.blur-img-placeholder):not(.blur-img-full),
.dark .md-content .blur-img,
.dark .lightbox-img {
filter: brightness(0.9);
}
.md-content-img-zoomable { .md-content-img-zoomable {
cursor: zoom-in; cursor: zoom-in;
transition: opacity 0.2s ease-out; transition: opacity 0.2s ease-out;
@ -634,6 +628,10 @@
background: transparent; background: transparent;
} }
/* 暗色模式灰底 */
.dark .blur-img {
background: var(--color-paper-code-bg, #2a2a2a);
}
} }
@keyframes fadeIn { @keyframes fadeIn {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

View File

@ -12,7 +12,6 @@ use dioxus::prelude::*;
use crate::api::posts::{search_posts, PostListResponse}; use crate::api::posts::{search_posts, PostListResponse};
use crate::components::post_card::PostCard; use crate::components::post_card::PostCard;
use crate::components::empty_state::EmptyState;
use crate::components::skeletons::delayed_skeleton::DelayedSkeleton; use crate::components::skeletons::delayed_skeleton::DelayedSkeleton;
use crate::components::skeletons::search_skeleton::SearchSkeleton; use crate::components::skeletons::search_skeleton::SearchSkeleton;
@ -73,10 +72,7 @@ pub fn Search() -> Element {
DelayedSkeleton { SearchSkeleton {} } DelayedSkeleton { SearchSkeleton {} }
} else if let Some(Ok(PostListResponse { posts, total: _ })) = search_res() { } else if let Some(Ok(PostListResponse { posts, total: _ })) = search_res() {
if posts.is_empty() { if posts.is_empty() {
EmptyState { div { class: "text-center text-paper-secondary py-20", "未找到相关文章" }
title: "未找到相关文章",
description: "换个关键词再试一次吧",
}
} else { } else {
for post in posts.iter() { for post in posts.iter() {
PostCard { key: "{post.id}", post: post.clone() } PostCard { key: "{post.id}", post: post.clone() }
@ -84,15 +80,6 @@ pub fn Search() -> Element {
} }
} else if search_res().as_ref().map(|r| r.is_err()).unwrap_or(false) { } else if search_res().as_ref().map(|r| r.is_err()).unwrap_or(false) {
div { class: "text-center text-red-500 dark:text-red-400 py-20", "搜索失败" } div { class: "text-center text-red-500 dark:text-red-400 py-20", "搜索失败" }
} else {
div { class: "flex flex-col items-center justify-center mt-24 mb-12 page-enter",
img {
class: "w-56 h-auto rounded-lg select-none dark:brightness-90",
src: "/images/xiantiaoxiaogou_02.webp",
alt: "空状态提示",
draggable: "false",
}
}
} }
} }
} }

View File

@ -18,7 +18,6 @@ use crate::api::posts::{get_posts_by_tag, list_tags, PostListResponse, TagListRe
use crate::components::post_card::PostCard; use crate::components::post_card::PostCard;
use crate::components::skeletons::delayed_skeleton::DelayedSkeleton; use crate::components::skeletons::delayed_skeleton::DelayedSkeleton;
use crate::components::skeletons::tags_skeleton::{TagDetailSkeleton, TagsSkeleton}; use crate::components::skeletons::tags_skeleton::{TagDetailSkeleton, TagsSkeleton};
use crate::components::empty_state::EmptyState;
use crate::router::Route; use crate::router::Route;
/// 标签云页面组件,对应路由 `/tags`。 /// 标签云页面组件,对应路由 `/tags`。
@ -50,34 +49,25 @@ fn TagsContent() -> Element {
match tags_data { match tags_data {
Some(Ok(tags)) => { Some(Ok(tags)) => {
if tags.is_empty() { let total = tags.iter().map(|t| t.post_count).sum::<i64>();
rsx! { rsx! {
EmptyState { div { class: "mt-2 text-base text-paper-secondary",
title: "暂无标签", ""
description: "当前还没有任何标签。" span { class: "font-medium text-paper-primary", "{tags.len()}" }
} " 个标签,"
span { class: "font-medium text-paper-primary", "{total}" }
" 篇文章"
} }
} else { ul { class: "flex flex-wrap gap-4 mt-6",
let total = tags.iter().map(|t| t.post_count).sum::<i64>(); for tag in tags {
rsx! { li { key: "{tag.name}",
div { class: "mt-2 text-base text-paper-secondary", Link {
"" class: "inline-flex items-center px-3 py-1.5 text-base font-medium bg-paper-accent-soft text-paper-accent rounded-lg hover:bg-paper-accent hover:text-white transition-all duration-200",
span { class: "font-medium text-paper-primary", "{tags.len()}" } to: Route::TagDetail {
" 个标签," tag: tag.name.clone(),
span { class: "font-medium text-paper-primary", "{total}" } },
" 篇文章" "{tag.name}"
} sup { class: "ml-1 text-sm text-paper-secondary", "{tag.post_count}" }
ul { class: "flex flex-wrap gap-4 mt-6",
for tag in tags {
li { key: "{tag.name}",
Link {
class: "inline-flex items-center px-3 py-1.5 text-base font-medium bg-paper-accent-soft text-paper-accent rounded-lg hover:bg-paper-accent hover:text-white transition-all duration-200",
to: Route::TagDetail {
tag: tag.name.clone(),
},
"{tag.name}"
sup { class: "ml-1 text-sm text-paper-secondary", "{tag.post_count}" }
}
} }
} }
} }
@ -126,25 +116,14 @@ fn TagDetailContent(tag: String) -> Element {
match posts_data { match posts_data {
Some(Ok((posts, total))) => { Some(Ok((posts, total))) => {
if posts.is_empty() { rsx! {
rsx! { div { class: "mt-2 text-base text-paper-secondary",
EmptyState { ""
title: "暂无文章", span { class: "font-medium text-paper-primary", "{total}" }
description: "该标签下还没有发布任何文章。" " 篇文章"
}
} }
} else { for post in posts.iter() {
rsx! { PostCard { key: "{post.id}", post: post.clone() }
div { class: "mt-2 mb-8 text-base text-paper-secondary",
""
span { class: "font-medium text-paper-primary", "{total}" }
" 篇文章"
}
div { class: "mt-8",
for post in posts.iter() {
PostCard { key: "{post.id}", post: post.clone() }
}
}
} }
} }
} }