revert(cards): 撤掉卡片外观配置与分组页卡片外壳,改用文字对比度
- 回退 card.opacity / card.blur 设置与后台「卡片外观」面板 - 分组页内容恢复为直接压在背景图上,不再套卡片 - 分组页文字:次级文字提一档 + 同主题描边(深色暗描边、浅色亮描边) - 保留上一轮:背景缓存、搜索记忆、明暗图标、卡片描边/阴影、侧栏实底
This commit is contained in:
@@ -13,8 +13,6 @@ pub const SETTINGS_KEY: &str = "site";
|
||||
pub const MAX_HEADER_ITEMS: usize = 8;
|
||||
pub const MIN_SPEED: u32 = 8;
|
||||
pub const MAX_SPEED: u32 = 120;
|
||||
pub const MIN_CARD_OPACITY: u32 = 40;
|
||||
pub const MAX_CARD_OPACITY: u32 = 100;
|
||||
|
||||
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, Default)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
@@ -121,25 +119,6 @@ pub struct BackgroundSettings {
|
||||
pub dark: String,
|
||||
}
|
||||
|
||||
/// 卡片外观:透明度与毛玻璃。前台所有卡片共用一套(首页 / 分组页 / 详情页 / 侧栏)。
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(default)]
|
||||
pub struct CardSettings {
|
||||
/// 卡片底色的不透明度(百分比,40–100)
|
||||
pub opacity: u32,
|
||||
/// 毛玻璃:背景模糊 + 提饱和度
|
||||
pub blur: bool,
|
||||
}
|
||||
|
||||
impl Default for CardSettings {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
opacity: 100,
|
||||
blur: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Default)]
|
||||
#[serde(default)]
|
||||
pub struct SearchEngineSettings {
|
||||
@@ -309,7 +288,6 @@ pub struct Settings {
|
||||
pub header: HeaderSettings,
|
||||
pub sidebar: SidebarSettings,
|
||||
pub background: BackgroundSettings,
|
||||
pub card: CardSettings,
|
||||
pub search: SearchSettings,
|
||||
pub profile: ProfileSettings,
|
||||
pub site: SiteMetaSettings,
|
||||
@@ -376,11 +354,6 @@ pub fn validate(settings: &Settings) -> Result<(), StashError> {
|
||||
"暗色背景地址最多 500 个字符".into(),
|
||||
));
|
||||
}
|
||||
if !(MIN_CARD_OPACITY..=MAX_CARD_OPACITY).contains(&settings.card.opacity) {
|
||||
return Err(StashError::InvalidDirectory(format!(
|
||||
"卡片不透明度需在 {MIN_CARD_OPACITY}–{MAX_CARD_OPACITY} 之间"
|
||||
)));
|
||||
}
|
||||
if settings.search.engines.len() > 10 {
|
||||
return Err(StashError::InvalidDirectory("搜索引擎最多 10 个".into()));
|
||||
}
|
||||
@@ -578,14 +551,6 @@ mod tests {
|
||||
let mut empty = Settings::default();
|
||||
empty.header.items.clear();
|
||||
assert!(save(&mut conn, empty, 0).is_err());
|
||||
|
||||
let mut too_transparent = Settings::default();
|
||||
too_transparent.card.opacity = MIN_CARD_OPACITY - 1;
|
||||
assert!(save(&mut conn, too_transparent, 0).is_err());
|
||||
|
||||
let mut clear = Settings::default();
|
||||
clear.card.opacity = MAX_CARD_OPACITY;
|
||||
assert!(save(&mut conn, clear, 0).is_ok());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user