feat: add photo information icon toggle option and optimise font

This commit is contained in:
David Ralph
2021-05-09 16:37:28 +01:00
parent 63e49b79cd
commit 9b9c2e74f6
12 changed files with 36 additions and 21 deletions

View File

@@ -149,6 +149,7 @@ export default class BackgroundSettings extends React.PureComponent {
<Switch name='background' text={this.language.enabled} category='background' />
<Checkbox name='ddgProxy' text={background.ddg_proxy} />
<Checkbox name='bgtransition' text={background.transition} />
<Checkbox name='photoInformation' text={background.photo_information} category='background' element='.photoInformation' />
<h3>{background.source.title}</h3>
<Dropdown label={background.type.title} name='backgroundType' onChange={(value) => this.setState({ backgroundType: value })} category='background'>

View File

@@ -49,25 +49,26 @@ export default function PhotoInformation(props) {
return (
<div className='photoInformation'>
<h1>{photo} <span id='credit'>{credit}</span></h1>
<Info className='photoInformationHover'/>
<div className={props.className || 'infoCard'}>
<Info className='infoIcon'/>
<h1>{language.information}</h1>
<hr/>
<Location/>
<span id='infoLocation'>{props.info.location || 'N/A'}</span>
<Camera/>
<span id='infoCamera'>{props.info.camera || 'N/A'}</span>
<Resolution/>
<span id='infoResolution'>{props.info.resolution || 'N/A'}</span>
<Photographer/>
<span>{photographer}</span>
{(localStorage.getItem('downloadbtn') === 'true') && !props.info.offline && !props.info.photographerURL ?
<>
<Download/>
<span className='download' onClick={() => downloadImage(props.info)}>{language.download}</span>
</> : null}
</div>
{localStorage.getItem('photoInformation') !== 'false' ? <><Info className='photoInformationHover'/>
<div className={props.className || 'infoCard'}>
<Info className='infoIcon'/>
<h1>{language.information}</h1>
<hr/>
<Location/>
<span id='infoLocation'>{props.info.location || 'N/A'}</span>
<Camera/>
<span id='infoCamera'>{props.info.camera || 'N/A'}</span>
<Resolution/>
<span id='infoResolution'>{props.info.resolution || 'N/A'}</span>
<Photographer/>
<span>{photographer}</span>
{(localStorage.getItem('downloadbtn') === 'true') && !props.info.offline && !props.info.photographerURL ?
<>
<Download/>
<span className='download' onClick={() => downloadImage(props.info)}>{language.download}</span>
</> : null}
</div>
</>: null}
</div>
);
}

View File

@@ -8,8 +8,7 @@ import './scss/index.scss';
// the toast css is based on default so we need to import it
import 'react-toastify/dist/ReactToastify.min.css';
import '@fontsource/lexend-deca/latin-400.css';
import '@fontsource/montserrat/cyrillic-500.css';
import '@fontsource/lexend-deca/400.css';
// language
import merge from '@material-ui/utils/esm/deepmerge';
@@ -23,6 +22,11 @@ if (languagecode === 'en') {
window.languagecode = 'en_GB';
}
// only load font if needed
if (languagecode === 'ru') {
require('@fontsource/montserrat/cyrillic-500.css');
}
// these are merged so if a string is untranslated it doesn't break mue
window.language = merge(require('./translations/en_GB.json'), require(`./translations/${window.languagecode}.json`));

View File

@@ -131,6 +131,7 @@
"title": "Hintergrund",
"ddg_proxy": "DuckDuckGo Bilder Proxy verwenden",
"transition": "Weicher übergang",
"photo_information": "Show photo information",
"category": "Kategorie",
"buttons": {
"title": "Schaltflächen",

View File

@@ -131,6 +131,7 @@
"title": "Background",
"ddg_proxy": "Use DuckDuckGo image proxy",
"transition": "Fade-in transition",
"photo_information": "Show photo information",
"category": "Category",
"buttons": {
"title": "Buttons",

View File

@@ -131,6 +131,7 @@
"title": "Background",
"ddg_proxy": "Use DuckDuckGo image proxy",
"transition": "Fade-in transition",
"photo_information": "Show photo information",
"category": "Category",
"buttons": {
"title": "Buttons",

View File

@@ -131,6 +131,7 @@
"title": "Fondo",
"ddg_proxy": "Utilizar el proxy de imágenes de DuckDuckGo",
"transition": "Transición fade-in",
"photo_information": "Show photo information",
"category": "Categoría",
"buttons": {
"title": "Botones",

View File

@@ -131,6 +131,7 @@
"title": "Fond",
"ddg_proxy": "Utiliser le proxy d'image DuckDuckGo",
"transition": "Transition en fondu",
"photo_information": "Show photo information",
"category": "Catégorie",
"buttons": {
"title": "Boutons",

View File

@@ -131,6 +131,7 @@
"title": "Achtergrond",
"ddg_proxy": "Use DuckDuckGo image proxy",
"transition": "Fade-in transition",
"photo_information": "Show photo information",
"category": "Category",
"buttons": {
"title": "Buttons",

View File

@@ -131,6 +131,7 @@
"title": "Bakgrunn",
"ddg_proxy": "Use DuckDuckGo image proxy",
"transition": "Fade-in transition",
"photo_information": "Show photo information",
"category": "Category",
"buttons": {
"title": "Buttons",

View File

@@ -131,6 +131,7 @@
"title": "Фон",
"ddg_proxy": "Use DuckDuckGo image proxy",
"transition": "Fade-in transition",
"photo_information": "Show photo information",
"category": "Category",
"buttons": {
"title": "Buttons",

View File

@@ -131,6 +131,7 @@
"title": "背景",
"ddg_proxy": "Use DuckDuckGo image proxy",
"transition": "Fade-in transition",
"photo_information": "Show photo information",
"category": "Category",
"buttons": {
"title": "Buttons",