new function settings
This commit is contained in:
@ -54,7 +54,7 @@ const defaultSettings: SettingsState = {
|
||||
walkingSpeed: 0.5,
|
||||
|
||||
notifications: true,
|
||||
notificationPosition: 'top-right',
|
||||
notificationPosition: 'bottom-center',
|
||||
};
|
||||
|
||||
function safeParseSettings(raw: string | null): SettingsState | null {
|
||||
@ -229,13 +229,10 @@ const Settings = () => {
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (typeof document === 'undefined') return;
|
||||
|
||||
const scale = settings.uiScale / 100;
|
||||
document.documentElement.style.setProperty('--ui-scale', String(scale));
|
||||
// motion / blur классы — глобально на body
|
||||
document.body.classList.toggle('reduce-motion', settings.reduceMotion);
|
||||
document.body.classList.toggle('no-blur', !settings.blurEffects);
|
||||
}, [settings.uiScale, settings.reduceMotion, settings.blurEffects]);
|
||||
}, [settings.reduceMotion, settings.blurEffects]);
|
||||
|
||||
const SectionTitle = ({ children }: { children: string }) => (
|
||||
<Typography
|
||||
@ -255,6 +252,7 @@ const Settings = () => {
|
||||
|
||||
const Glass = ({ children }: { children: React.ReactNode }) => (
|
||||
<Paper
|
||||
className="glass glass--soft"
|
||||
elevation={0}
|
||||
sx={{
|
||||
borderRadius: '1.2vw',
|
||||
@ -263,7 +261,6 @@ const Settings = () => {
|
||||
'radial-gradient(circle at 10% 10%, rgba(242,113,33,0.14), transparent 55%), radial-gradient(circle at 90% 20%, rgba(233,64,205,0.12), transparent 55%), rgba(10,10,20,0.86)',
|
||||
border: '1px solid rgba(255,255,255,0.08)',
|
||||
boxShadow: '0 1.2vw 3.2vw rgba(0,0,0,0.55)',
|
||||
backdropFilter: 'blur(14px)',
|
||||
color: 'white',
|
||||
}}
|
||||
>
|
||||
@ -287,6 +284,10 @@ const Settings = () => {
|
||||
},
|
||||
} as const;
|
||||
|
||||
useEffect(() => {
|
||||
document.body.classList.toggle('no-blur', !settings.blurEffects);
|
||||
}, [settings.blurEffects]);
|
||||
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
|
||||
Reference in New Issue
Block a user