Skip to content

Commit

Permalink
Update main.js
Browse files Browse the repository at this point in the history
  • Loading branch information
michojekunle authored Jun 6, 2023
1 parent e26bafd commit f266c1d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,24 +61,24 @@ const generateAdvice = () => {
}

// Added event Listener that listens for a click event on the dice Button
diceButton.addEventListener('click', () => {
showSlideshow = false;
diceButton.addEventListener('click', () => {
showSlideshow = !showSlideshow;
audio.pause();
slideShow.classList.remove('animate-pulse');

// Add Shadow && Animation to the button
diceButton.classList.remove('shadow-3xl');
diceButton.classList.remove('shadow-neonGreen');
diceButton.classList.remove('animate-pulse');

//Generate Advice
generateAdvice();
// Generate Advice if slideshow is not going on
if(!showSlideshow) {
generateAdvice();
}
});

//Added Event Listener to listen for slideshow event on click of the slideshow button
slideShow.addEventListener('click', () => {
showSlideshow = !showSlideshow;
slideShow.classList.toggle('animate-pulse');//Added pulse animation whenever the slideshow button is clicked

// Add Shadow && Animation to the button
diceButton.classList.toggle('shadow-3xl');
Expand Down

0 comments on commit f266c1d

Please sign in to comment.