diff --git a/src/components/modals/main/scss/index.scss b/src/components/modals/main/scss/index.scss index 7a2d6a34..8c7854ef 100644 --- a/src/components/modals/main/scss/index.scss +++ b/src/components/modals/main/scss/index.scss @@ -272,7 +272,7 @@ li { } } -@media only screen and (max-width: 1300px) { +@media only screen and (max-width: 1650px) { li.navbar-item { span { display: none; diff --git a/src/components/widgets/background/Background.jsx b/src/components/widgets/background/Background.jsx index 9c4f6ecc..ef7e19f1 100644 --- a/src/components/widgets/background/Background.jsx +++ b/src/components/widgets/background/Background.jsx @@ -15,7 +15,10 @@ export default class Background extends React.PureComponent { url: '', currentAPI: '', photoInfo: { - hidden: false + hidden: false, + offline: false, + photographerURL: '', + photoURL: '' } }; this.language = window.language.widgets.background; @@ -55,6 +58,7 @@ export default class Background extends React.PureComponent { this.setState({ url: `./offline-images/${randomImage}.webp`, photoInfo: { + offline: true, credit: photographer } }); @@ -158,7 +162,9 @@ export default class Background extends React.PureComponent { location: (data.location.replace(/[null]+/g, '') !== ' ') ? data.location : 'N/A', camera: data.camera, resolution: data.resolution, - url: data.file + url: data.file, + photographerURL: (backgroundAPI === 'unsplash') ? data.photographer_page : '', + photoURL: (backgroundAPI === 'unsplash') ? data.photo_page : '' } }); break; diff --git a/src/components/widgets/background/PhotoInformation.jsx b/src/components/widgets/background/PhotoInformation.jsx index b9d20dcb..bd3cb877 100644 --- a/src/components/widgets/background/PhotoInformation.jsx +++ b/src/components/widgets/background/PhotoInformation.jsx @@ -29,9 +29,21 @@ export default function PhotoInformation(props) { return null; } + // remove unsplash text + const photographer = props.info.credit.split(` ${language.unsplash}`)[0]; + + let credit = props.info.credit; + let photo = language.credit; + + // unsplash + if (props.info.photographerURL !== '' && !props.info.offline) { + photo = {language.credit}; + credit = <>{photographer} {language.unsplash}>; + } + return (