Merge branch 'various-css-fixes' into shigusegubu
* various-css-fixes: fix play-on-hover gifs issues fix preview spinner Refactor desktop navbar into a component, change layout to grid for better compatibility with search field and simpler CSS
This commit is contained in:
commit
41d08653b5
6 changed files with 27 additions and 6 deletions
|
@ -130,6 +130,7 @@ const setSettings = async ({ apiConfig, staticConfig, store }) => {
|
||||||
? 0
|
? 0
|
||||||
: config.logoMargin
|
: config.logoMargin
|
||||||
})
|
})
|
||||||
|
copyInstanceOption('logoLeft')
|
||||||
store.commit('authFlow/setInitialStrategy', config.loginMethod)
|
store.commit('authFlow/setInitialStrategy', config.loginMethod)
|
||||||
|
|
||||||
copyInstanceOption('redirectRootNoLogin')
|
copyInstanceOption('redirectRootNoLogin')
|
||||||
|
|
|
@ -67,6 +67,7 @@ export default {
|
||||||
logo () { return this.$store.state.instance.logo },
|
logo () { return this.$store.state.instance.logo },
|
||||||
sitename () { return this.$store.state.instance.name },
|
sitename () { return this.$store.state.instance.name },
|
||||||
hideSitename () { return this.$store.state.instance.hideSitename },
|
hideSitename () { return this.$store.state.instance.hideSitename },
|
||||||
|
logoLeft () { return this.$store.state.instance.logoLeft },
|
||||||
currentUser () { return this.$store.state.users.currentUser },
|
currentUser () { return this.$store.state.users.currentUser },
|
||||||
privateMode () { return this.$store.state.instance.private },
|
privateMode () { return this.$store.state.instance.private },
|
||||||
},
|
},
|
||||||
|
|
|
@ -4,10 +4,17 @@
|
||||||
display: grid;
|
display: grid;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
grid-template-rows: 50px;
|
grid-template-rows: 50px;
|
||||||
grid-template-columns: 2fr minmax(min-content, min-content) 2fr;
|
grid-template-columns: 2fr auto 2fr;
|
||||||
|
grid-template-areas: "sitename logo actions";
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
padding: 0 1.2em;
|
||||||
|
|
||||||
|
&.-logoLeft {
|
||||||
|
grid-template-columns: auto 2fr 2fr;
|
||||||
|
grid-template-areas: "logo sitename actions";
|
||||||
|
}
|
||||||
|
|
||||||
button {
|
button {
|
||||||
&, i[class*=icon-], svg {
|
&, i[class*=icon-], svg {
|
||||||
|
@ -36,6 +43,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.logo {
|
.logo {
|
||||||
|
grid-area: logo;
|
||||||
position: relative;
|
position: relative;
|
||||||
transition: opacity;
|
transition: opacity;
|
||||||
transition-timing-function: ease-out;
|
transition-timing-function: ease-out;
|
||||||
|
@ -75,8 +83,15 @@
|
||||||
color: var(--topBarLink, $fallback--link);
|
color: var(--topBarLink, $fallback--link);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sitename {
|
||||||
|
grid-area: sitename;
|
||||||
|
}
|
||||||
|
|
||||||
|
.actions {
|
||||||
|
grid-area: actions;
|
||||||
|
}
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
margin: 0 1.2em;
|
|
||||||
flex: 1;
|
flex: 1;
|
||||||
line-height: 50px;
|
line-height: 50px;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
|
|
|
@ -2,9 +2,10 @@
|
||||||
<nav
|
<nav
|
||||||
id="nav"
|
id="nav"
|
||||||
class="DesktopNav"
|
class="DesktopNav"
|
||||||
|
:class="{ '-logoLeft': logoLeft }"
|
||||||
@click="scrollToTop()"
|
@click="scrollToTop()"
|
||||||
>
|
>
|
||||||
<div class="item">
|
<div class="item sitename">
|
||||||
<router-link
|
<router-link
|
||||||
v-if="!hideSitename"
|
v-if="!hideSitename"
|
||||||
class="site-name"
|
class="site-name"
|
||||||
|
@ -14,8 +15,9 @@
|
||||||
{{ sitename }}
|
{{ sitename }}
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<router-link
|
||||||
class="logo"
|
class="logo"
|
||||||
|
:to="{ name: 'root' }"
|
||||||
:style="logoBgStyle"
|
:style="logoBgStyle"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
|
@ -26,8 +28,8 @@
|
||||||
:src="logo"
|
:src="logo"
|
||||||
:style="logoStyle"
|
:style="logoStyle"
|
||||||
>
|
>
|
||||||
</div>
|
</router-link>
|
||||||
<div class="item right mobile-hidden">
|
<div class="item right actions">
|
||||||
<search-bar
|
<search-bar
|
||||||
v-if="currentUser || !privateMode"
|
v-if="currentUser || !privateMode"
|
||||||
@toggled="onSearchBarToggled"
|
@toggled="onSearchBarToggled"
|
||||||
|
|
|
@ -30,6 +30,7 @@ const defaultState = {
|
||||||
logo: '/static/logo.png',
|
logo: '/static/logo.png',
|
||||||
logoMargin: '.2em',
|
logoMargin: '.2em',
|
||||||
logoMask: true,
|
logoMask: true,
|
||||||
|
logoLeft: false,
|
||||||
minimalScopesMode: false,
|
minimalScopesMode: false,
|
||||||
nsfwCensorImage: undefined,
|
nsfwCensorImage: undefined,
|
||||||
postContentType: 'text/plain',
|
postContentType: 'text/plain',
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
"logo": "/static/logo.svg",
|
"logo": "/static/logo.svg",
|
||||||
"logoMargin": ".1em",
|
"logoMargin": ".1em",
|
||||||
"logoMask": true,
|
"logoMask": true,
|
||||||
|
"logoLeft": false,
|
||||||
"minimalScopesMode": false,
|
"minimalScopesMode": false,
|
||||||
"nsfwCensorImage": "",
|
"nsfwCensorImage": "",
|
||||||
"postContentType": "text/plain",
|
"postContentType": "text/plain",
|
||||||
|
|
Loading…
Add table
Reference in a new issue