Added sidebar toggle
This commit is contained in:
parent
5ca9e3d053
commit
79f094066e
3 changed files with 75 additions and 7 deletions
71
src/App.vue
71
src/App.vue
|
|
@ -1,6 +1,19 @@
|
||||||
<template>
|
<template>
|
||||||
<div id="app">
|
<div id="app">
|
||||||
<panelLeft/>
|
<div v-bind:class="responsiveToggleButton" id="overlay-toggle">
|
||||||
|
<a href="" class="uk-icon-button" uk-icon="menu" uk-toggle="target: .toggle-hidden; animation: uk-animation-slide-left-small, uk-animation-slide-left-small" ></a>
|
||||||
|
</div>
|
||||||
|
<div uk-grid class="uk-height-1-1" margin=0>
|
||||||
|
<div v-bind:class="responsivePanelLeft" class="toggle-hidden uk-card uk-card-default uk-card-body uk-padding-remove-top uk-padding-remove-right uk-width-auto uk-height-1-1">
|
||||||
|
<div class="uk-card-header">
|
||||||
|
<h3 class="uk-card-title"><b>OpenFlexure</b> Microscope</h3>
|
||||||
|
</div>
|
||||||
|
<panelLeft/>
|
||||||
|
</div>
|
||||||
|
<div class="uk-width-expand">
|
||||||
|
<div class="uk-card uk-card-default uk-card-body uk-height-1-1">Width: {{ window.width }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -19,9 +32,51 @@ import panelLeft from './components/panelLeft.vue'
|
||||||
// Export main app
|
// Export main app
|
||||||
export default {
|
export default {
|
||||||
name: 'app',
|
name: 'app',
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
panelLeft
|
panelLeft
|
||||||
|
},
|
||||||
|
|
||||||
|
data: function () {
|
||||||
|
return {
|
||||||
|
window: {
|
||||||
|
width: 0,
|
||||||
|
height: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
created: function () {
|
||||||
|
window.addEventListener('resize', this.handleResize)
|
||||||
|
this.handleResize();
|
||||||
|
},
|
||||||
|
|
||||||
|
beforeDestroy: function () {
|
||||||
|
window.removeEventListener('resize', this.handleResize)
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
handleResize: function(event) {
|
||||||
|
this.window.width = window.innerWidth;
|
||||||
|
this.window.height = window.innerHeight;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
// Stylises the hostname input box based on connection status
|
||||||
|
responsivePanelLeft: function () {
|
||||||
|
return {
|
||||||
|
//'uk-hidden': this.window.width<850,
|
||||||
|
'overlay-panel': this.window.width<850
|
||||||
|
}
|
||||||
|
},
|
||||||
|
responsiveToggleButton: function () {
|
||||||
|
return {
|
||||||
|
//'uk-hidden': this.window.width>=850,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -42,4 +97,18 @@ body, html {
|
||||||
height: 100%
|
height: 100%
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.overlay-panel {
|
||||||
|
position: fixed;
|
||||||
|
z-index: 99;
|
||||||
|
}
|
||||||
|
|
||||||
|
#overlay-toggle {
|
||||||
|
width: 30px;
|
||||||
|
height: 30px;
|
||||||
|
position: fixed;
|
||||||
|
right: 0;
|
||||||
|
margin: 20px;
|
||||||
|
z-index: 999
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,5 @@ export default {
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
.host-input {
|
.host-input {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
width: 300px
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div id="panelLeft">
|
<div id="panelLeft" class="uk-margin-remove uk-padding-remove">
|
||||||
<ul class="uk-flex-center" uk-tab>
|
<ul class="uk-flex-center" uk-tab>
|
||||||
<li><a href="#" uk-switcher-item="connect" uk-icon="server" uk-tooltip="Connect"></a></li>
|
<li><a href="#" uk-switcher-item="connect" uk-icon="server" uk-tooltip="Connect"></a></li>
|
||||||
<li><a href="#" uk-switcher-item="navigate" uk-icon="location" uk-tooltip="Navigate"></a></li>
|
<li><a href="#" uk-switcher-item="navigate" uk-icon="location" uk-tooltip="Navigate"></a></li>
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
<li><a href="#" uk-switcher-item="plugins" uk-icon="git-fork" uk-tooltip="Plugins"></a></li>
|
<li><a href="#" uk-switcher-item="plugins" uk-icon="git-fork" uk-tooltip="Plugins"></a></li>
|
||||||
<li><a href="#" uk-switcher-item="settings" uk-icon="settings" uk-tooltip="Configure"></a></li>
|
<li><a href="#" uk-switcher-item="settings" uk-icon="settings" uk-tooltip="Configure"></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="uk-switcher uk-margin">
|
<ul class="uk-switcher uk-padding-small panel-content">
|
||||||
<li><paneConnect/></li>
|
<li><paneConnect/></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -28,12 +28,12 @@ export default {
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
#panelLeft {
|
#panelLeft {
|
||||||
width: 300px;
|
|
||||||
height:100%;
|
height:100%;
|
||||||
padding: 0 20px 0 20px;
|
|
||||||
background-color: #fafafa
|
|
||||||
}
|
}
|
||||||
.uk-tab {
|
.uk-tab {
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
}
|
}
|
||||||
|
.panel-content {
|
||||||
|
width: 300px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue