外观设置改为半屏布局;背景图仅保存后生效,并支持媒体库选用。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-20 10:51:20 +08:00
parent e598782279
commit 68e90ff6ff
7 changed files with 953 additions and 481 deletions

View File

@@ -50,6 +50,11 @@ export function normalizeBgMode(raw: string | null | undefined): BgMode {
return MODE_SET.has(m) ? m : DEFAULT_BG_MODE;
}
/** 媒体库条目是否可作为背景图(JPEG / PNG / WebP) */
export function mediaURLFitsBackground(url: string): boolean {
return /\.(jpe?g|png|webp)(\?|$)/i.test(url);
}
export function bgConfigFromSettings(s: SiteBgInput | null | undefined): SiteBgConfig {
return {
bg_site_url: normalizeBgURL(s?.bg_site_url),