mirror of
https://github.com/mue/mue.git
synced 2026-07-13 04:02:32 +02:00
feat: duckduckgo image proxy option
This commit is contained in:
@@ -86,6 +86,8 @@ export default class BackgroundSettings extends React.PureComponent {
|
||||
<>
|
||||
<h2>{background.title}</h2>
|
||||
<Switch name='background' text={this.language.enabled} />
|
||||
<Checkbox name='ddgProxy' text={background.ddg_proxy} />
|
||||
|
||||
<h3>{background.buttons.title}</h3>
|
||||
<Checkbox name='view' text={background.buttons.view} />
|
||||
<Checkbox name='favouriteEnabled' text={background.buttons.favourite} />
|
||||
|
||||
@@ -20,6 +20,7 @@ export default class Background extends React.PureComponent {
|
||||
}
|
||||
};
|
||||
this.language = window.language.widgets.background;
|
||||
this.ddgproxy = (localStorage.getItem('ddgProxy') === 'true');
|
||||
}
|
||||
|
||||
gradientStyleBuilder(gradientSettings) {
|
||||
@@ -43,9 +44,11 @@ export default class Background extends React.PureComponent {
|
||||
}
|
||||
|
||||
if (this.state.url !== '') {
|
||||
const url = this.ddgproxy ? window.constants.DDG_PROXY + this.state.url : this.state.url;
|
||||
|
||||
document.querySelector('#backgroundImage').setAttribute(
|
||||
'style',
|
||||
`background-image: url(${this.state.url}); -webkit-filter: blur(${localStorage.getItem('blur')}px) brightness(${brightness}%);`
|
||||
`background-image: url(${url}); -webkit-filter: blur(${localStorage.getItem('blur')}px) brightness(${brightness}%);`
|
||||
);
|
||||
} else {
|
||||
document.querySelector('#backgroundImage').setAttribute(
|
||||
@@ -157,10 +160,10 @@ export default class Background extends React.PureComponent {
|
||||
if (customBackground.includes('.mp4') || customBackground.includes('.webm') || customBackground.includes('.ogg')) {
|
||||
return this.setState({
|
||||
url: customBackground,
|
||||
video: true,
|
||||
photoInfo: {
|
||||
hidden: true
|
||||
}
|
||||
video: true,
|
||||
photoInfo: {
|
||||
hidden: true
|
||||
}
|
||||
});
|
||||
// normal background
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user