diff --git a/src/App.vue b/src/App.vue index 53ed662e..85d43cc0 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,6 +1,19 @@ - + + + + + + + OpenFlexure Microscope + + + + + Width: {{ window.width }} + + @@ -19,9 +32,51 @@ import panelLeft from './components/panelLeft.vue' // Export main app export default { name: 'app', + components: { 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, + } + } } + } @@ -42,4 +97,18 @@ body, html { height: 100% } +.overlay-panel { + position: fixed; + z-index: 99; +} + +#overlay-toggle { + width: 30px; + height: 30px; + position: fixed; + right: 0; + margin: 20px; + z-index: 999 +} + diff --git a/src/components/paneConnectComponents/hostInput.vue b/src/components/paneConnectComponents/hostInput.vue index cd3011cb..e3cb633b 100644 --- a/src/components/paneConnectComponents/hostInput.vue +++ b/src/components/paneConnectComponents/hostInput.vue @@ -65,6 +65,5 @@ export default { diff --git a/src/components/panelLeft.vue b/src/components/panelLeft.vue index 26bad493..0fbe2382 100644 --- a/src/components/panelLeft.vue +++ b/src/components/panelLeft.vue @@ -1,5 +1,5 @@ - + @@ -7,7 +7,7 @@ - + @@ -28,12 +28,12 @@ export default {