SHARE
TWEET

Untitled

a guest May 26th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const left = document.querySelector(".left");
  2. const right = document.querySelector(".right");
  3. const container = document.querySelector(".container");
  4. var buttons = document.querySelectorAll(".button")
  5. var close = document.querySelectorAll(".close")
  6. console.log(close)
  7.  
  8. for(var i = 0; i < buttons.length; i++){
  9.   if(i == 0){
  10.     buttons[0].addEventListener("click", () =>{
  11.       document.querySelector("#bg-modal-signup").style.display = "flex";
  12.     });
  13.  
  14.   }else{
  15.     buttons[1].addEventListener("click", () =>{
  16.       document.querySelector("#bg-modal-login").style.display = "flex";
  17.     });
  18.  
  19.   }
  20. }
  21.  
  22. left.addEventListener("mouseenter", () => {
  23.   container.classList.add("hover-left");
  24. });
  25.  
  26. left.addEventListener("mouseleave", () => {
  27.   container.classList.remove("hover-left");
  28. });
  29.  
  30. right.addEventListener("mouseenter", () => {
  31.   container.classList.add("hover-right");
  32. });
  33.  
  34. right.addEventListener("mouseleave", () => {
  35.   container.classList.remove("hover-right");
  36. });
  37.  
  38.  
  39. for(var i = 0; i < close.length; i++){
  40.   if(i == 0){
  41.     close[0].addEventListener("click", () =>{
  42.       console.log("HIII")
  43.       document.querySelector("#bg-modal-login").style.display = "none";
  44.     });
  45.  
  46.   }else{
  47.     close[1].addEventListener("click", () =>{
  48.       document.querySelector("#bg-modal-signup").style.display = "none";
  49.     });
  50.  
  51.   }
  52. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top