mirror of
https://github.com/mue/mue.git
synced 2026-07-18 06:24:17 +02:00
Automatic night mode and dark theme location tooltip
This commit is contained in:
@@ -19,7 +19,7 @@ export default class Settings extends React.PureComponent {
|
||||
document.getElementById('greetingName').value = localStorage.getItem('greetingName');
|
||||
document.getElementById('language').value = localStorage.getItem('language');
|
||||
|
||||
if (localStorage.getItem('darkTheme') === 'true') {
|
||||
if (document.getElementById('modal').classList.contains('dark')) {
|
||||
const choices = document.getElementsByClassName('choices');
|
||||
for (let i = 0; i < choices.length; i++) choices[i].style.backgroundColor = '#2f3542';
|
||||
}
|
||||
@@ -102,6 +102,7 @@ export default class Settings extends React.PureComponent {
|
||||
<Checkbox name='webp' text={this.props.language.experimental.webp} />
|
||||
<Checkbox name='animations' text={this.props.language.experimental.animations} />
|
||||
<Checkbox name='voiceSearch' text={this.props.language.experimental.voicesearch} newFeature={true} />
|
||||
<Checkbox name='brightnessTime' text='Automatic Night Mode' newFeature={true} />
|
||||
</Section>
|
||||
<LanguageSettings language={this.props.language} />
|
||||
|
||||
|
||||
@@ -26,11 +26,13 @@ export default class Background extends React.PureComponent {
|
||||
}
|
||||
}
|
||||
const background = typeof gradientSettings === 'object' && gradientSettings !== null ? this.gradientStyleBuilder(gradientSettings) : `background-image: url(${url});`;
|
||||
let brightness = localStorage.getItem('brightness');
|
||||
if (localStorage.getItem('brightnessTime') && new Date().getHours() > 18) brightness = 75;
|
||||
|
||||
document.querySelector('#backgroundImage').setAttribute(
|
||||
'style',
|
||||
`${background};
|
||||
-webkit-filter: blur(${localStorage.getItem('blur')}px) brightness(${localStorage.getItem('brightness')}%);`
|
||||
-webkit-filter: blur(${localStorage.getItem('blur')}px) brightness(${brightness}%);`
|
||||
);
|
||||
|
||||
if (credit === 'false') document.querySelector('#credits').style.display = 'none'; // Hide the credit
|
||||
|
||||
Reference in New Issue
Block a user