spock-rock game with Javascript
Rock-paper-scissors-lizard-spock game is a more complicated game. The rule below:
CODE Github
HTML
computer container is the same pattern. but no event .
And the result text shows everytime run event.
CSS
set the header border-radius seperately.
select all the DOM
With Switch to find out which is been selected , then change the sytle and the text.
Falling animation Confetti.js
When won,startConfetti()
When lost or tie,stopConfetti(),removeConfetti()
Reset the score,choice and text when click the reset button and also initial at the page refresh.
combine all the function in checkResult(), and call it at select() function at first.
Reset the score,choice and text when click the reset button and also initial at the page refresh.
combine all the function in checkResult(), and call it at select() function at first.