From f3db0d2c298564c629e3490be16c402f15859651 Mon Sep 17 00:00:00 2001 From: Camerin Figueroa Date: Thu, 16 Jun 2022 20:08:21 -0400 Subject: [PATCH] Intro - Fixed Some Bugs Fixed top arrow fading when changing topics Fixed bug where intro is empty when clicking too fast --- src/components/Intro.js | 11 ++++++++--- src/components/css/Intro.css | 6 +++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/components/Intro.js b/src/components/Intro.js index 214a9f7..d35e8f1 100644 --- a/src/components/Intro.js +++ b/src/components/Intro.js @@ -17,6 +17,7 @@ class Intro extends React.Component { prevLoc: -1, currLoc: 0, nextLoc: 1, + moving: false, }; } @@ -43,11 +44,12 @@ class Intro extends React.Component { */ // Up Arrow - if (input === "up" && this.state.currLoc > 0) { + if (input === "up" && !this.state.moving && this.state.currLoc > 0 ) { // Activate animation going to next topic this.setState({ prev: 'current top', + moving: true }); // Wait 900 ms until the transition is finished @@ -67,16 +69,18 @@ class Intro extends React.Component { this.setState({ // remove notrans from each div prev: 'previous', prevLoc: prevloc, + moving: false, }); }, 75); }, 900); - } else if (input === "down" && this.state.nextLoc < this.topics.length) { + } else if (input === "down" && !this.state.moving && this.state.nextLoc < this.topics.length) { // Activate transition going to previous topic this.setState({ //curr: 'previous', - next: 'current' + next: 'current', + moving: true, }); // wait 900 ms before placing all topics into correct divs @@ -96,6 +100,7 @@ class Intro extends React.Component { this.setState({ next: 'next', nextLoc: nextloc, + moving: false, }); }, 75); }, 900); diff --git a/src/components/css/Intro.css b/src/components/css/Intro.css index 52fd752..0bcb979 100644 --- a/src/components/css/Intro.css +++ b/src/components/css/Intro.css @@ -56,7 +56,7 @@ } .intro .top { - z-index: 11 !important; + z-index: 11; } .notrans { @@ -96,4 +96,8 @@ .intro .navbutton.bottom { margin-top: auto; +} + +.intro .navbutton.top { + z-index: 14; } \ No newline at end of file