Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5b166ef0e2 | ||
|
|
4f89c63b28 |
@@ -186,6 +186,7 @@ function seedDefaults() {
|
|||||||
smtp_from_name: 'RainWeb',
|
smtp_from_name: 'RainWeb',
|
||||||
theme_wallpaper: '',
|
theme_wallpaper: '',
|
||||||
theme_wallpaper_scale: 'cover',
|
theme_wallpaper_scale: 'cover',
|
||||||
|
theme_wallpaper_enabled: '1',
|
||||||
nav_style: 'default',
|
nav_style: 'default',
|
||||||
card_style: 'default',
|
card_style: 'default',
|
||||||
glass_blur: '20',
|
glass_blur: '20',
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ export default function ThemeSettings() {
|
|||||||
primary_color: '#6750a4',
|
primary_color: '#6750a4',
|
||||||
theme_wallpaper: '',
|
theme_wallpaper: '',
|
||||||
theme_wallpaper_scale: 'cover',
|
theme_wallpaper_scale: 'cover',
|
||||||
|
theme_wallpaper_enabled: true,
|
||||||
nav_style: 'default',
|
nav_style: 'default',
|
||||||
card_style: 'default',
|
card_style: 'default',
|
||||||
glass_blur: '20',
|
glass_blur: '20',
|
||||||
@@ -34,6 +35,7 @@ export default function ThemeSettings() {
|
|||||||
primary_color: s.primary_color || '#6750a4',
|
primary_color: s.primary_color || '#6750a4',
|
||||||
theme_wallpaper: s.theme_wallpaper || '',
|
theme_wallpaper: s.theme_wallpaper || '',
|
||||||
theme_wallpaper_scale: s.theme_wallpaper_scale || 'cover',
|
theme_wallpaper_scale: s.theme_wallpaper_scale || 'cover',
|
||||||
|
theme_wallpaper_enabled: s.theme_wallpaper_enabled !== '0',
|
||||||
nav_style: s.nav_style || 'default',
|
nav_style: s.nav_style || 'default',
|
||||||
card_style: s.card_style || 'default',
|
card_style: s.card_style || 'default',
|
||||||
glass_blur: s.glass_blur || '20',
|
glass_blur: s.glass_blur || '20',
|
||||||
@@ -65,6 +67,7 @@ export default function ThemeSettings() {
|
|||||||
primary_color: form.primary_color,
|
primary_color: form.primary_color,
|
||||||
theme_wallpaper: form.theme_wallpaper.trim(),
|
theme_wallpaper: form.theme_wallpaper.trim(),
|
||||||
theme_wallpaper_scale: form.theme_wallpaper_scale,
|
theme_wallpaper_scale: form.theme_wallpaper_scale,
|
||||||
|
theme_wallpaper_enabled: form.theme_wallpaper_enabled ? '1' : '0',
|
||||||
theme_force_dark: form.theme_force_dark ? '1' : '0',
|
theme_force_dark: form.theme_force_dark ? '1' : '0',
|
||||||
nav_style: form.nav_style,
|
nav_style: form.nav_style,
|
||||||
card_style: form.card_style,
|
card_style: form.card_style,
|
||||||
@@ -92,6 +95,11 @@ export default function ThemeSettings() {
|
|||||||
|
|
||||||
<Paper sx={{ p: 3, mb: 2 }}>
|
<Paper sx={{ p: 3, mb: 2 }}>
|
||||||
<Typography variant="subtitle1" sx={{ mb: 1 }}>壁纸背景</Typography>
|
<Typography variant="subtitle1" sx={{ mb: 1 }}>壁纸背景</Typography>
|
||||||
|
<FormControlLabel
|
||||||
|
control={<Switch checked={form.theme_wallpaper_enabled} onChange={(e) => setForm((p) => ({ ...p, theme_wallpaper_enabled: e.target.checked }))} />}
|
||||||
|
label="启用壁纸背景"
|
||||||
|
sx={{ mb: 1 }}
|
||||||
|
/>
|
||||||
<Box sx={{ display: 'flex', gap: 1, alignItems: 'center', mb: 1 }}>
|
<Box sx={{ display: 'flex', gap: 1, alignItems: 'center', mb: 1 }}>
|
||||||
<Button variant="outlined" onClick={() => fileRef.current && fileRef.current.click()}>上传图片</Button>
|
<Button variant="outlined" onClick={() => fileRef.current && fileRef.current.click()}>上传图片</Button>
|
||||||
<input ref={fileRef} type="file" accept="image/*" style={{ display: 'none' }} onChange={handleWallpaperUpload} />
|
<input ref={fileRef} type="file" accept="image/*" style={{ display: 'none' }} onChange={handleWallpaperUpload} />
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ export default function Layout() {
|
|||||||
const wallpaper = settings.theme_wallpaper || '';
|
const wallpaper = settings.theme_wallpaper || '';
|
||||||
const scale = settings.theme_wallpaper_scale || 'cover';
|
const scale = settings.theme_wallpaper_scale || 'cover';
|
||||||
|
|
||||||
if (wallpaper) {
|
if (wallpaper && settings.theme_wallpaper_enabled !== '0') {
|
||||||
body.classList.add('has-wallpaper');
|
body.classList.add('has-wallpaper');
|
||||||
body.style.setProperty('--wallpaper', `url(${wallpaper})`);
|
body.style.setProperty('--wallpaper', `url(${wallpaper})`);
|
||||||
const bgSizeMap = { cover: 'cover', contain: 'contain', repeat: 'auto', stretch: '100% 100%' };
|
const bgSizeMap = { cover: 'cover', contain: 'contain', repeat: 'auto', stretch: '100% 100%' };
|
||||||
|
|||||||
@@ -1559,6 +1559,18 @@ button.glass-card, .btn.glass-card, .nav-tab.glass-card, .chip.glass-card {
|
|||||||
-webkit-backdrop-filter: blur(8px);
|
-webkit-backdrop-filter: blur(8px);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 壁纸下内容区统一磨砂背景:半透明底 + 模糊,保证文字清晰同时保留壁纸美感 */
|
||||||
|
body.has-wallpaper .page {
|
||||||
|
background: rgba(255,251,254,0.65);
|
||||||
|
backdrop-filter: blur(12px);
|
||||||
|
-webkit-backdrop-filter: blur(12px);
|
||||||
|
border-radius: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
[data-theme="dark"] body.has-wallpaper .page {
|
||||||
|
background: rgba(28,27,31,0.6);
|
||||||
|
}
|
||||||
|
|
||||||
/* Forum sidebar glass with wallpaper */
|
/* Forum sidebar glass with wallpaper */
|
||||||
.has-wallpaper .forum-sidebar .forum-cat-item {
|
.has-wallpaper .forum-sidebar .forum-cat-item {
|
||||||
backdrop-filter: blur(4px);
|
backdrop-filter: blur(4px);
|
||||||
|
|||||||
+2
-2
@@ -6,7 +6,7 @@ const router = express.Router();
|
|||||||
|
|
||||||
const PUBLIC_KEYS = ['site_name','site_description','site_url','primary_color',
|
const PUBLIC_KEYS = ['site_name','site_description','site_url','primary_color',
|
||||||
'recaptcha_site_key','turnstile_site_key',
|
'recaptcha_site_key','turnstile_site_key',
|
||||||
'theme_wallpaper','theme_wallpaper_scale','nav_style','card_style',
|
'theme_wallpaper','theme_wallpaper_scale','theme_wallpaper_enabled','nav_style','card_style',
|
||||||
'glass_blur','glass_opacity','theme_force_dark',
|
'glass_blur','glass_opacity','theme_force_dark',
|
||||||
'captcha_type','captcha_login','captcha_register','captcha_forum',
|
'captcha_type','captcha_login','captcha_register','captcha_forum',
|
||||||
'homepage_avatar','homepage_bio','homepage_content','blog_show_sidebar',
|
'homepage_avatar','homepage_bio','homepage_content','blog_show_sidebar',
|
||||||
@@ -15,7 +15,7 @@ const PUBLIC_KEYS = ['site_name','site_description','site_url','primary_color',
|
|||||||
|
|
||||||
const ALL_KEYS = ['site_name','site_description','site_url','primary_color','recaptcha_site_key','turnstile_site_key',
|
const ALL_KEYS = ['site_name','site_description','site_url','primary_color','recaptcha_site_key','turnstile_site_key',
|
||||||
'smtp_host','smtp_port','smtp_user','smtp_from_email','smtp_from_name',
|
'smtp_host','smtp_port','smtp_user','smtp_from_email','smtp_from_name',
|
||||||
'theme_wallpaper','theme_wallpaper_scale','nav_style','card_style','glass_blur','glass_opacity','theme_force_dark',
|
'theme_wallpaper','theme_wallpaper_scale','theme_wallpaper_enabled','nav_style','card_style','glass_blur','glass_opacity','theme_force_dark',
|
||||||
'captcha_type','captcha_login','captcha_register','captcha_forum',
|
'captcha_type','captcha_login','captcha_register','captcha_forum',
|
||||||
'homepage_avatar','homepage_bio','homepage_content','blog_show_sidebar',
|
'homepage_avatar','homepage_bio','homepage_content','blog_show_sidebar',
|
||||||
'site_favicon','homepage_contacts','music_embed_enabled','music_embed_code','music_embed_position','music_embed_autohide','music_embed_idle_timeout',
|
'site_favicon','homepage_contacts','music_embed_enabled','music_embed_code','music_embed_position','music_embed_autohide','music_embed_idle_timeout',
|
||||||
|
|||||||
Reference in New Issue
Block a user