From ec306a80ae9c8d13fe64de5a3d0ce69bdcb63841 Mon Sep 17 00:00:00 2001 From: Kevin Ngo Date: Sat, 13 Oct 2018 08:57:27 -0700 Subject: [PATCH] toggle off trail / bad beats when not playing --- src/components/trail.js | 4 ++++ src/index.html | 18 ++++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/components/trail.js b/src/components/trail.js index 51cfcde..395aa0d 100644 --- a/src/components/trail.js +++ b/src/components/trail.js @@ -63,6 +63,10 @@ AFRAME.registerComponent('trail', { this.enabledTime = this.el.sceneEl.time; this.mesh.visible = false; } + + if (oldData.enabled && !this.data.enabled) { + this.mesh.visible = false; + } }, tock: function (time, delta) { diff --git a/src/index.html b/src/index.html index eb70bd1..eb64277 100644 --- a/src/index.html +++ b/src/index.html @@ -89,14 +89,14 @@ - + animation__posz="property: object3D.position.z; to: -8; startEvents: beatwrong; easing: easeOutQuart; dur: 4000" + animation__alpha="property: components.material.material.opacity; from: 1; to: 0; startEvents: beatwrong; easing: easeOutQuart; dur: 4000"> - - - - - + + + + + +