feat: show navbar on hover setting, fix photo information toggle hot reload

Co-authored-by: Alex Sparkes <turbomarshmello@gmail.com>
This commit is contained in:
David Ralph
2021-05-09 22:39:45 +01:00
parent 9b9c2e74f6
commit 08bfa2772d
14 changed files with 72 additions and 34 deletions

View File

@@ -34,6 +34,7 @@ export default function AppearanceSettings() {
<h3>{appearance.navbar.title}</h3> <h3>{appearance.navbar.title}</h3>
<Checkbox name='notesEnabled' text={appearance.navbar.notes} element='.other' /> <Checkbox name='notesEnabled' text={appearance.navbar.notes} element='.other' />
<Checkbox name='refresh' text={appearance.navbar.refresh} element='.other' /> <Checkbox name='refresh' text={appearance.navbar.refresh} element='.other' />
<Checkbox name='navbarHover' text={appearance.navbar.hover} element='.other' />
<h3>{appearance.font.title}</h3> <h3>{appearance.font.title}</h3>
<Text title={appearance.font.custom} name='font' upperCaseFirst={true} category='other' /> <Text title={appearance.font.custom} name='font' upperCaseFirst={true} category='other' />

View File

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

View File

@@ -18,32 +18,35 @@ export default function Navbar(props) {
const backgroundEnabled = (localStorage.getItem('background') === 'true'); const backgroundEnabled = (localStorage.getItem('background') === 'true');
return ( return (
<div className='navbar-container'> <>
{(localStorage.getItem('view') === 'true' && backgroundEnabled) ? <Maximise/> :null} {(localStorage.getItem('navbarHover') === 'true') ? <div className='navbar-hidden'/> :null}
{(localStorage.getItem('favouriteEnabled') === 'true' && backgroundEnabled) ? <Favourite/> :null} <div className='navbar-container'>
{(localStorage.getItem('view') === 'true' && backgroundEnabled) ? <Maximise/> :null}
{(localStorage.getItem('favouriteEnabled') === 'true' && backgroundEnabled) ? <Favourite/> :null}
{(localStorage.getItem('notesEnabled') === 'true') ? {(localStorage.getItem('notesEnabled') === 'true') ?
<div className='notes'> <div className='notes'>
<NotesIcon className='topicons'/> <NotesIcon className='topicons'/>
<Notes/> <Notes/>
</div> </div>
:null} :null}
{(window.constants.BETA_VERSION === true) ? {(window.constants.BETA_VERSION === true) ?
<Tooltip title={language.widgets.navbar.tooltips.feedback}> <Tooltip title={language.widgets.navbar.tooltips.feedback}>
<Report className='topicons' onClick={() => props.openModal('feedbackModal')}/> <Report className='topicons' onClick={() => props.openModal('feedbackModal')}/>
</Tooltip>
:null}
{(localStorage.getItem('refresh') === 'true') ?
<Tooltip title={language.widgets.navbar.tooltips.refresh}>
<RefreshIcon className='refreshicon topicons' onClick={() => window.location.reload()}/>
</Tooltip>
:null}
<Tooltip title={language.modals.main.navbar.settings}>
<Gear className='settings-icon topicons' onClick={() => props.openModal('mainModal')}/>
</Tooltip> </Tooltip>
:null} </div>
</>
{(localStorage.getItem('refresh') === 'true') ?
<Tooltip title={language.widgets.navbar.tooltips.refresh}>
<RefreshIcon className='refreshicon topicons' onClick={() => window.location.reload()}/>
</Tooltip>
:null}
<Tooltip title={language.modals.main.navbar.settings}>
<Gear className='settings-icon topicons' onClick={() => props.openModal('mainModal')}/>
</Tooltip>
</div>
); );
} }

View File

@@ -36,3 +36,24 @@
.visibilityshow { .visibilityshow {
visibility: visible !important; visibility: visible !important;
} }
.navbar-hidden + .navbar-container {
display: none;
}
.navbar-hidden {
position: absolute;
width: 50vw;
right: 0;
top: 0;
background: none;
height: 75px;
}
.navbar-hidden:hover + .navbar-container {
display: block !important;
}
.navbar-container:hover {
display: block;
}

View File

@@ -214,5 +214,9 @@
{ {
"name": "backgroundFilter", "name": "backgroundFilter",
"value": "grayscale" "value": "grayscale"
},
{
"name": "navbarHover",
"value": false
} }
] ]

View File

@@ -220,7 +220,8 @@
"navbar": { "navbar": {
"title": "Navigationsleiste", "title": "Navigationsleiste",
"notes": "Notizen", "notes": "Notizen",
"refresh": "Aktualisieren" "refresh": "Aktualisieren",
"hover": "Display on hover"
}, },
"font": { "font": {
"title": "Schriftart", "title": "Schriftart",

View File

@@ -220,7 +220,8 @@
"navbar": { "navbar": {
"title": "Navbar", "title": "Navbar",
"notes": "Notes", "notes": "Notes",
"refresh": "Refresh button" "refresh": "Refresh button",
"hover": "Display on hover"
}, },
"font": { "font": {
"title": "Font", "title": "Font",

View File

@@ -220,7 +220,8 @@
"navbar": { "navbar": {
"title": "Navbar", "title": "Navbar",
"notes": "Notes", "notes": "Notes",
"refresh": "Refresh button" "refresh": "Refresh button",
"hover": "Display on hover"
}, },
"font": { "font": {
"title": "Font", "title": "Font",

View File

@@ -220,7 +220,8 @@
"navbar": { "navbar": {
"title": "Barra de búsqueda", "title": "Barra de búsqueda",
"notes": "Notas", "notes": "Notas",
"refresh": "Botón de recargar" "refresh": "Botón de recargar",
"hover": "Display on hover"
}, },
"font": { "font": {
"title": "Fuente", "title": "Fuente",

View File

@@ -220,7 +220,8 @@
"navbar": { "navbar": {
"title": "Navbar", "title": "Navbar",
"notes": "Notes", "notes": "Notes",
"refresh": "Refresh button" "refresh": "Refresh button",
"hover": "Display on hover"
}, },
"font": { "font": {
"title": "Font", "title": "Font",

View File

@@ -220,7 +220,8 @@
"navbar": { "navbar": {
"title": "Navbar", "title": "Navbar",
"notes": "Notes", "notes": "Notes",
"refresh": "Refresh button" "refresh": "Refresh button",
"hover": "Display on hover"
}, },
"font": { "font": {
"title": "Font", "title": "Font",

View File

@@ -220,7 +220,8 @@
"navbar": { "navbar": {
"title": "Navbar", "title": "Navbar",
"notes": "Notes", "notes": "Notes",
"refresh": "Refresh button" "refresh": "Refresh button",
"hover": "Display on hover"
}, },
"font": { "font": {
"title": "Font", "title": "Font",

View File

@@ -220,7 +220,8 @@
"navbar": { "navbar": {
"title": "Navbar", "title": "Navbar",
"notes": "Notes", "notes": "Notes",
"refresh": "Refresh button" "refresh": "Refresh button",
"hover": "Display on hover"
}, },
"font": { "font": {
"title": "Font", "title": "Font",

View File

@@ -220,7 +220,8 @@
"navbar": { "navbar": {
"title": "Navbar", "title": "Navbar",
"notes": "Notes", "notes": "Notes",
"refresh": "Refresh button" "refresh": "Refresh button",
"hover": "Display on hover"
}, },
"font": { "font": {
"title": "Font", "title": "Font",