Stackedit/src/components/ButtonBar.vue

79 lines
2.2 KiB
Vue
Raw Normal View History

2017-07-23 18:42:08 +00:00
<template>
<div class="button-bar">
<div class="button-bar__inner button-bar__inner--top">
2017-10-07 11:22:24 +00:00
<div class="button-bar__button" :class="{ 'button-bar__button--on': localSettings.showNavigationBar }" @click="toggleNavigationBar()" v-title="'Toggle navigation bar'">
2017-07-23 18:42:08 +00:00
<icon-navigation-bar></icon-navigation-bar>
</div>
2017-10-07 11:22:24 +00:00
<div class="button-bar__button" :class="{ 'button-bar__button--on': localSettings.showSidePreview }" @click="toggleSidePreview()" v-title="'Toggle side preview'">
2017-07-23 18:42:08 +00:00
<icon-side-preview></icon-side-preview>
</div>
2017-10-07 11:22:24 +00:00
<div class="button-bar__button" @click="toggleEditor(false)" v-title="'Reader mode'">
2017-07-25 08:19:39 +00:00
<icon-eye></icon-eye>
</div>
2017-07-23 18:42:08 +00:00
</div>
<div class="button-bar__inner button-bar__inner--bottom">
2017-10-07 11:22:24 +00:00
<div class="button-bar__button" :class="{ 'button-bar__button--on': localSettings.focusMode }" @click="toggleFocusMode()" v-title="'Toggle focus mode'">
<icon-target></icon-target>
</div>
2017-10-07 11:22:24 +00:00
<div class="button-bar__button" :class="{ 'button-bar__button--on': localSettings.scrollSync }" @click="toggleScrollSync()" v-title="'Toggle scroll sync'">
<icon-scroll-sync></icon-scroll-sync>
</div>
2017-10-07 11:22:24 +00:00
<div class="button-bar__button" :class="{ 'button-bar__button--on': localSettings.showStatusBar }" @click="toggleStatusBar()" v-title="'Toggle status bar'">
2017-07-23 18:42:08 +00:00
<icon-status-bar></icon-status-bar>
</div>
</div>
</div>
</template>
<script>
import { mapGetters, mapActions } from 'vuex';
2017-07-23 18:42:08 +00:00
export default {
computed: mapGetters('data', [
'localSettings',
2017-07-23 18:42:08 +00:00
]),
methods: mapActions('data', [
2017-07-23 18:42:08 +00:00
'toggleNavigationBar',
'toggleEditor',
'toggleSidePreview',
'toggleStatusBar',
'toggleFocusMode',
'toggleScrollSync',
2017-07-23 18:42:08 +00:00
]),
};
</script>
<style lang="scss">
.button-bar {
position: absolute;
width: 100%;
height: 100%;
}
.button-bar__inner {
position: absolute;
}
.button-bar__inner--bottom {
bottom: 0;
}
.button-bar__button {
cursor: pointer;
color: rgba(0, 0, 0, 0.2);
width: 26px;
height: 26px;
padding: 2px;
margin: 3px 0;
&:hover {
color: rgba(0, 0, 0, 0.4);
}
}
.button-bar__button--on {
color: rgba(0, 0, 0, 0.4);
}
</style>