diff --git a/src/assets/css/3-base/_03-layout.css b/src/assets/css/3-base/_03-layout.css index 3b11ef5..7969f9f 100644 --- a/src/assets/css/3-base/_03-layout.css +++ b/src/assets/css/3-base/_03-layout.css @@ -9,5 +9,6 @@ flex-grow: 1; margin-right: auto; margin-left: auto; - max-width: 32rem; + max-width: calc(100% - 2rem); + width: 32rem; } diff --git a/src/assets/css/5-screens/capture.css b/src/assets/css/5-screens/capture.css index c0612e8..a8b8844 100644 --- a/src/assets/css/5-screens/capture.css +++ b/src/assets/css/5-screens/capture.css @@ -6,6 +6,7 @@ display: flex; flex-direction: column; flex-grow: 1; + max-width: 100%; } /* Progress bar diff --git a/src/assets/css/5-screens/download.css b/src/assets/css/5-screens/download.css index 029c3c9..847620d 100644 --- a/src/assets/css/5-screens/download.css +++ b/src/assets/css/5-screens/download.css @@ -6,6 +6,7 @@ display: flex; flex-direction: column; flex-grow: 1; + max-width: 100%; } .download-btn, diff --git a/src/views/capture.vue b/src/views/capture.vue index 01bc149..c7403ec 100644 --- a/src/views/capture.vue +++ b/src/views/capture.vue @@ -24,6 +24,12 @@ import { mapState } from 'vuex' export default { name: 'capture', + data () { + return { + loadListener: null, + resizeListener: null + } + }, components: { captureOptions, captureProgress, @@ -84,11 +90,21 @@ export default { }, mounted: function () { this.$refs.preview.srcObject = this.mediaStream - this.getpreviewcontainerSquare() - this.$refs.preview.addEventListener('resize', ev => { + + // On load + this.loadListener = this.$refs.preview.addEventListener('resize', () => { this.applyScaling() }, false) + // On window resize + this.resizeListener = window.addEventListener('resize', () => { + this.getpreviewcontainerSquare() + this.applyScaling() + }, false) + }, + destroyed: function () { + this.loadListener = null + this.resizeListener = null } } diff --git a/src/views/download.vue b/src/views/download.vue index 09887af..2de8424 100644 --- a/src/views/download.vue +++ b/src/views/download.vue @@ -5,7 +5,7 @@ -
+