Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2020
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var box = document.querySelector("div");
  2. var btn = document.querySelector("button");
  3. var trail = document.getElementById("dot");
  4. var trail2 = document.getElementById("dot2");
  5. var trail3 = document.getElementById("dot3");
  6. var lineTrail = document.getElementById("line");
  7.  
  8. function teleport(){
  9.   var btnWidth = btn.clientWidth;
  10.   var btnHeight = btn.clientHeight;
  11.   var width = box.offsetWidth;
  12.   var height = box.offsetHeight;
  13.  
  14. var h = height - btnHeight;
  15. var w = width - btnWidth;
  16.  
  17.   let topL = Math.floor(Math.random() * h) + 1  + "px"
  18.   let leftLRaw = Math.floor(Math.random() * w) + 1;
  19.   let radius = Math.floor(Math.random() * 100) + 1 + "px"
  20.   let leftL = leftLRaw + "px";
  21. btn.style.top = topL
  22. btn.style.left = leftL
  23. btn.style.borderRadius= radius;
  24.  
  25. var trailLeft = leftLRaw + 40 + "px";
  26.  
  27. trail.style.top = btn.style.top;
  28. trail.style.left =trailLeft;
  29.  
  30. trail2.style.top = btn.style.top;
  31. trail2.style.left =trailLeft;
  32.  
  33. trail3.style.top = btn.style.top;
  34. trail3.style.left =trailLeft;
  35.  
  36.  
  37. };
  38.  
  39. transform = false;
  40. beyondPlusUtlra = false;
  41. deku = false;
  42. bakugo= false;
  43. todoroki = false;
  44.  
  45. document.body.addEventListener("keyup", function(ev){
  46. if(ev.keyCode == 32 && transform == false){
  47.   btn.style.transition = "0.1s";
  48.   box.style.background= "linear-gradient(to bottom right,#FFDF1B , #EDB900)";
  49.   btn.innerHTML= "PLUS ULTRA";
  50.   btn.style.fontWeight="bold";
  51.   btn.style.boxShadow = "6px 6px rgba(230,56,39,0.8)"
  52.   btn.style.color= "#eee"
  53.   trail.style.display="none";
  54.   trail2.style.display="none";
  55.   trail3.style.display="none";
  56.   setInterval (teleport, 250)
  57.   transform = true;
  58. }else if (transform == true){
  59.    btn.style.transition = "0s";
  60.    btn.innerHTML= "BEYOND PLUS ULTRA";
  61.     btn.style.boxShadow = "12px 12px rgba(230,56,39,0.9)"
  62.     btn.style.fontFamily = "cursive";
  63.     setInterval (teleport, 200);
  64.     transform = null;
  65.     beyondPlusUtlra = true;
  66. }else if (beyondPlusUtlra == true){
  67.   btn.innerHTML= "Deku";
  68.   box.style.backgroundImage= "url(https://c.wallhere.com/photos/59/0f/Izuku_Midoriya_Boku_no_Hero_Academia_anime_boys_simple_background_anime-1549891.jpg!d)";
  69.   box.style.backgroundSize = "cover";
  70.   box.style.backgroundRepeat= "repeat-y";
  71.   btn.style.transition = "0.5s";
  72.   btn.style.background="#fff"
  73.   btn.style.color="#1d1d1d"
  74.    btn.style.boxShadow = "6px 6px rgba(41, 241, 195, 0.9)"
  75.    beyondPlusUtlra = null;
  76.    deku = true;
  77. }else if (deku == true){
  78.    btn.innerHTML= "Bakugo";
  79.   box.style.backgroundImage= "url(https://img5.goodfon.com/wallpaper/nbig/5/1e/pixiv-id-12056696-boku-no-hero-academia-bakugou-katsuki-baku.jpg)";
  80.   box.style.backgroundSize = "cover";
  81.   box.style.backgroundRepeat= "repeat-y";
  82.   btn.style.transition = "0.6s";
  83.   btn.style.background="black"
  84.   btn.style.color="#ddd";
  85.    btn.style.boxShadow = "7px 7px rgba(217, 30, 24, 1)";
  86.    setInterval(teleport, 150)
  87.    deku = null;
  88.    bakugo = true;
  89. }else if (bakugo == true){
  90.     btn.innerHTML= "Todoroki";
  91.   box.style.backgroundImage= "url(https://i.pinimg.com/originals/f3/ce/6b/f3ce6b400cb9247dffee7a58bcd56c54.png)";
  92.   box.style.backgroundSize = "cover";
  93.   box.style.backgroundRepeat= "repeat-y";
  94.   btn.style.transition = "0.4s";
  95.   btn.style.background="lightblue"
  96.   btn.style.color="darkblue";
  97.    btn.style.boxShadow = "7px 7px rgba(248, 148, 6, 1)";
  98.    setInterval(teleport, 350000)
  99.    bakugo = null;
  100.    todoroki = null;
  101. }
  102. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement