Commit 9ac71a08 authored by Joel Collins's avatar Joel Collins
Browse files

Added stream flash animation on capture. Closes #43

parent 37dcc2c7
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -224,6 +224,9 @@ export default {
      // Send move request
      axios.post(this.captureApiUri, params)
        .then(response => { 
          // Flash the stream (capture animation)
          this.$root.$emit('globalFlashStream')
          // Update the global capture list
          this.$root.$emit('globalUpdateCaptureList')
        })
        .catch(error => {
+13 −0
Original line number Diff line number Diff line
@@ -40,6 +40,10 @@ export default {
			console.log(`Toggling preview to ${state}`)
			this.previewRequest(state)
		})
    // A global signal listener to flash the stream element
    this.$root.$on('globalFlashStream', (state) => {
			this.flashStream()
		})

		// Mutation observer
		this.sizeObserver = new ResizeObserver(entries => {
@@ -85,6 +89,15 @@ export default {

			// Emit a signal to move, acted on by panelNavigate.vue
			this.$root.$emit('globalMoveEvent', xSteps, ySteps, 0, false)

			this.flashStream()
		},
		
		flashStream: function() {
			let element = this.$refs.streamDisplay
			element.classList.remove("uk-animation-fade");
			element.offsetHeight; /* trigger reflow */
			element.classList.add("uk-animation-fade");
		},

		handleResize: function(event) {