No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

coursefail.js 746B

123456789101112131415161718192021222324
  1. // select elements
  2. let buttons = document.getElementById("buttons")
  3. let text = document.getElementById("text")
  4. let counter_p = 1
  5. let childs = []
  6. function handleDisplayText(event){
  7. if (event.keyCode == 32 || event.keyCode == 13){
  8. if (counter_p < text.childElementCount-1){
  9. text.children[counter_p].style.cssText = "animation : fade 2s forwards"
  10. counter_p += 1
  11. } else {
  12. text.children[counter_p].children[0].style.cssText = "animation : fade-reverse 1s forwards"
  13. text.children[counter_p].children[1].style.cssText = "animation : none"
  14. buttons.style.cssText = "animation : fade 2s forwards"
  15. }
  16. }
  17. }
  18. document.addEventListener("keypress",handleDisplayText)