mirror of
https://codeberg.org/yeentown/barkey
synced 2024-11-30 05:23:09 +00:00
Go to top
This commit is contained in:
parent
7ec9b03990
commit
41e657b64e
2 changed files with 35 additions and 17 deletions
|
@ -2,13 +2,13 @@
|
||||||
<div class="nav">
|
<div class="nav">
|
||||||
<ul>
|
<ul>
|
||||||
<template v-if="$store.getters.isSignedIn">
|
<template v-if="$store.getters.isSignedIn">
|
||||||
<li class="home" :class="{ active: $route.name == 'index' }">
|
<li class="home" :class="{ active: $route.name == 'index' }" @click="goToTop">
|
||||||
<router-link to="/">
|
<router-link to="/">
|
||||||
%fa:home%
|
%fa:home%
|
||||||
<p>%i18n:@home%</p>
|
<p>%i18n:@home%</p>
|
||||||
</router-link>
|
</router-link>
|
||||||
</li>
|
</li>
|
||||||
<li class="deck" :class="{ active: $route.name == 'deck' }">
|
<li class="deck" :class="{ active: $route.name == 'deck' }" @click="goToTop">
|
||||||
<router-link to="/deck">
|
<router-link to="/deck">
|
||||||
%fa:columns%
|
%fa:columns%
|
||||||
<p>%i18n:@deck% <small>(beta)</small></p>
|
<p>%i18n:@deck% <small>(beta)</small></p>
|
||||||
|
@ -82,6 +82,14 @@ export default Vue.extend({
|
||||||
|
|
||||||
game() {
|
game() {
|
||||||
(this as any).os.new(MkGameWindow);
|
(this as any).os.new(MkGameWindow);
|
||||||
|
},
|
||||||
|
|
||||||
|
goToTop(e: HTMLElement) {
|
||||||
|
if (e.classList.contains('active'))
|
||||||
|
window.scrollTo({
|
||||||
|
top: 0,
|
||||||
|
behavior: 'smooth'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -9,6 +9,9 @@
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<x-nav/>
|
<x-nav/>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="center">
|
||||||
|
<div class="icon" @click="goToTop"></div>
|
||||||
|
</div>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<x-search/>
|
<x-search/>
|
||||||
<x-account v-if="$store.getters.isSignedIn"/>
|
<x-account v-if="$store.getters.isSignedIn"/>
|
||||||
|
@ -42,6 +45,14 @@ export default Vue.extend({
|
||||||
XPost,
|
XPost,
|
||||||
XClock,
|
XClock,
|
||||||
},
|
},
|
||||||
|
methods: {
|
||||||
|
goToTop() {
|
||||||
|
window.scrollTo({
|
||||||
|
top: 0,
|
||||||
|
behavior: 'smooth'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.$store.commit('setUiHeaderHeight', 48);
|
this.$store.commit('setUiHeaderHeight', 48);
|
||||||
|
|
||||||
|
@ -142,13 +153,14 @@ root(isDark)
|
||||||
max-width 1300px
|
max-width 1300px
|
||||||
margin 0 auto
|
margin 0 auto
|
||||||
|
|
||||||
&:before
|
> .center
|
||||||
content ""
|
margin auto
|
||||||
|
> .icon
|
||||||
position absolute
|
position absolute
|
||||||
top 0
|
top 0
|
||||||
left 0
|
left 0
|
||||||
display block
|
display block
|
||||||
width 100%
|
width 48px
|
||||||
height 48px
|
height 48px
|
||||||
background-image isDark ? url('/assets/desktop/header-icon.dark.svg') : url('/assets/desktop/header-icon.light.svg')
|
background-image isDark ? url('/assets/desktop/header-icon.dark.svg') : url('/assets/desktop/header-icon.light.svg')
|
||||||
background-size 24px
|
background-size 24px
|
||||||
|
@ -157,11 +169,9 @@ root(isDark)
|
||||||
opacity 0.3
|
opacity 0.3
|
||||||
|
|
||||||
> .left
|
> .left
|
||||||
margin 0 auto 0 0
|
|
||||||
height 48px
|
height 48px
|
||||||
|
|
||||||
> .right
|
> .right
|
||||||
margin 0 0 0 auto
|
|
||||||
height 48px
|
height 48px
|
||||||
|
|
||||||
> *
|
> *
|
||||||
|
|
Loading…
Reference in a new issue