mirror of
https://github.com/mue/mue.git
synced 2026-07-26 18:21:27 +02:00
feat: background filters
This commit is contained in:
@@ -170,6 +170,14 @@ export default class BackgroundSettings extends React.PureComponent {
|
||||
<Slider title={background.effects.blur} name='blur' min='0' max='100' default='0' display='%' category='background' />
|
||||
<Slider title={background.effects.brightness} name='brightness' min='0' max='100' default='90' display='%' category='background' />
|
||||
<br/><br/>
|
||||
<Dropdown label={background.effects.filters.title} name='backgroundFilter' category='background'>
|
||||
<option value='grayscale'>{background.effects.filters.grayscale}</option>
|
||||
<option value='sepia'>{background.effects.filters.sepia}</option>
|
||||
<option value='invert'>{background.effects.filters.invert}</option>
|
||||
<option value='saturate'>{background.effects.filters.saturate}</option>
|
||||
<option value='contrast'>{background.effects.filters.contrast}</option>
|
||||
</Dropdown>
|
||||
<Slider title={background.effects.filters.amount} name='backgroundFilterAmount' min='0' max='100' default='0' display='%' category='background' />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -301,10 +301,12 @@ export default class Background extends React.PureComponent {
|
||||
}
|
||||
|
||||
// background effects so we don't get another image again
|
||||
const backgroundFilter = localStorage.getItem('backgroundFilter');
|
||||
|
||||
if (this.state.video === true) {
|
||||
document.getElementById('backgroundVideo').style.webkitFilter = `blur(${localStorage.getItem('blur')}px) brightness(${localStorage.getItem('brightness')}%)`;
|
||||
document.getElementById('backgroundVideo').style.webkitFilter = `blur(${localStorage.getItem('blur')}px) brightness(${localStorage.getItem('brightness')}%) ${backgroundFilter ? backgroundFilter + '(' + localStorage.getItem('backgroundFilterAmount') + '%)' : ''}`;
|
||||
} else {
|
||||
element.style.webkitFilter = `blur(${localStorage.getItem('blur')}px) brightness(${localStorage.getItem('brightness')}%)`;
|
||||
element.style.webkitFilter = `blur(${localStorage.getItem('blur')}px) brightness(${localStorage.getItem('brightness')}%) ${backgroundFilter ? backgroundFilter + '(' + localStorage.getItem('backgroundFilterAmount') + '%)' : ''}`;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -339,9 +341,11 @@ export default class Background extends React.PureComponent {
|
||||
);
|
||||
}
|
||||
|
||||
const backgroundFilter = localStorage.getItem('backgroundFilter');
|
||||
|
||||
return (
|
||||
<>
|
||||
<div style={{ 'WebkitFilter': `blur(${localStorage.getItem('blur')}px) brightness(${localStorage.getItem('brightness')}%)` }} id='backgroundImage'/>
|
||||
<div style={{ 'WebkitFilter': `blur(${localStorage.getItem('blur')}px) brightness(${localStorage.getItem('brightness')}%) ${backgroundFilter ? backgroundFilter + '(' + localStorage.getItem('backgroundFilterAmount') + '%)' : ''}` }} id='backgroundImage'/>
|
||||
{(this.state.photoInfo.credit !== '') ?
|
||||
<PhotoInformation className={this.props.photoInformationClass} info={this.state.photoInfo}/>
|
||||
: null}
|
||||
|
||||
@@ -141,7 +141,16 @@
|
||||
"effects": {
|
||||
"title": "Effekte",
|
||||
"blur": "Unschärfe anpassen",
|
||||
"brightness": "Helligkeit anpassen"
|
||||
"brightness": "Helligkeit anpassen",
|
||||
"filters": {
|
||||
"title": "Background filter",
|
||||
"amount": "Filter amount",
|
||||
"grayscale": "Grayscale",
|
||||
"sepia": "Sepia",
|
||||
"invert": "Invert",
|
||||
"saturate": "Saturate",
|
||||
"constrast": "Contrast"
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
"title": "Type",
|
||||
|
||||
@@ -141,7 +141,16 @@
|
||||
"effects": {
|
||||
"title": "Effects",
|
||||
"blur": "Adjust blur",
|
||||
"brightness": "Adjust brightness"
|
||||
"brightness": "Adjust brightness",
|
||||
"filters": {
|
||||
"title": "Background filter",
|
||||
"amount": "Filter amount",
|
||||
"grayscale": "Grayscale",
|
||||
"sepia": "Sepia",
|
||||
"invert": "Invert",
|
||||
"saturate": "Saturate",
|
||||
"constrast": "Contrast"
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
"title": "Type",
|
||||
|
||||
@@ -141,7 +141,16 @@
|
||||
"effects": {
|
||||
"title": "Effects",
|
||||
"blur": "Adjust blur",
|
||||
"brightness": "Adjust brightness"
|
||||
"brightness": "Adjust brightness",
|
||||
"filters": {
|
||||
"title": "Background filter",
|
||||
"amount": "Filter amount",
|
||||
"grayscale": "Grayscale",
|
||||
"sepia": "Sepia",
|
||||
"invert": "Invert",
|
||||
"saturate": "Saturate",
|
||||
"constrast": "Contrast"
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
"title": "Type",
|
||||
|
||||
@@ -141,7 +141,16 @@
|
||||
"effects": {
|
||||
"title": "Efectos",
|
||||
"blur": "Ajustar difuminado",
|
||||
"brightness": "Ajustar brillo"
|
||||
"brightness": "Ajustar brillo",
|
||||
"filters": {
|
||||
"title": "Background filter",
|
||||
"amount": "Filter amount",
|
||||
"grayscale": "Grayscale",
|
||||
"sepia": "Sepia",
|
||||
"invert": "Invert",
|
||||
"saturate": "Saturate",
|
||||
"constrast": "Contrast"
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
"title": "Tipo",
|
||||
|
||||
@@ -141,7 +141,16 @@
|
||||
"effects": {
|
||||
"title": "Effets",
|
||||
"blur": "Ajuster le flou",
|
||||
"brightness": "Ajuster la luminosité"
|
||||
"brightness": "Ajuster la luminosité",
|
||||
"filters": {
|
||||
"title": "Background filter",
|
||||
"amount": "Filter amount",
|
||||
"grayscale": "Grayscale",
|
||||
"sepia": "Sepia",
|
||||
"invert": "Invert",
|
||||
"saturate": "Saturate",
|
||||
"constrast": "Contrast"
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
"title": "Type",
|
||||
|
||||
@@ -141,7 +141,16 @@
|
||||
"effects": {
|
||||
"title": "Effects",
|
||||
"blur": "Vervaging instellen",
|
||||
"brightness": "Adjust brightness"
|
||||
"brightness": "Adjust brightness",
|
||||
"filters": {
|
||||
"title": "Background filter",
|
||||
"amount": "Filter amount",
|
||||
"grayscale": "Grayscale",
|
||||
"sepia": "Sepia",
|
||||
"invert": "Invert",
|
||||
"saturate": "Saturate",
|
||||
"constrast": "Contrast"
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
"title": "Type",
|
||||
|
||||
@@ -141,7 +141,16 @@
|
||||
"effects": {
|
||||
"title": "Effects",
|
||||
"blur": "Juster Blur",
|
||||
"brightness": "Adjust brightness"
|
||||
"brightness": "Adjust brightness",
|
||||
"filters": {
|
||||
"title": "Background filter",
|
||||
"amount": "Filter amount",
|
||||
"grayscale": "Grayscale",
|
||||
"sepia": "Sepia",
|
||||
"invert": "Invert",
|
||||
"saturate": "Saturate",
|
||||
"constrast": "Contrast"
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
"title": "Type",
|
||||
|
||||
@@ -141,7 +141,16 @@
|
||||
"effects": {
|
||||
"title": "Effects",
|
||||
"blur": "Размытие",
|
||||
"brightness": "Яркость"
|
||||
"brightness": "Яркость",
|
||||
"filters": {
|
||||
"title": "Background filter",
|
||||
"amount": "Filter amount",
|
||||
"grayscale": "Grayscale",
|
||||
"sepia": "Sepia",
|
||||
"invert": "Invert",
|
||||
"saturate": "Saturate",
|
||||
"constrast": "Contrast"
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
"title": "Type",
|
||||
|
||||
@@ -141,7 +141,16 @@
|
||||
"effects": {
|
||||
"title": "Effects",
|
||||
"blur": "调整模糊",
|
||||
"brightness": "调整亮度"
|
||||
"brightness": "调整亮度",
|
||||
"filters": {
|
||||
"title": "Background filter",
|
||||
"amount": "Filter amount",
|
||||
"grayscale": "Grayscale",
|
||||
"sepia": "Sepia",
|
||||
"invert": "Invert",
|
||||
"saturate": "Saturate",
|
||||
"constrast": "Contrast"
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
"title": "Type",
|
||||
|
||||
Reference in New Issue
Block a user