Advertisement
Guest User

Untitled

a guest
Aug 5th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html>
  2. <head>
  3. <title> Login </title>
  4.  
  5. <script type="text/javascript">
  6.  
  7. //vars
  8.  
  9. var user = prompt("What is your username?" , "Username");
  10. var pass = prompt("Enter your Password : ", "Password");
  11.  
  12. //end vars
  13.  
  14. //functions
  15.  
  16. function doWelcome()
  17. {
  18.     document.write("Welcome " + user)
  19.     document.write("!")
  20.     document.bgColor='green'
  21. }
  22.  
  23. function doNoentry()
  24. {
  25.     if (user == "joe")
  26.     {
  27.         document.write("Incorrect Password");
  28.     }
  29.    
  30.     else if (user == "john")
  31.     {
  32.         document.write("Incorrect Password");
  33.     }
  34.     else if (user == "1337")
  35.     {
  36.         document.write("Incorrect Password");
  37.     }
  38.     else
  39.     {
  40.         document.write("Wrong UserName / Password");
  41.     }  
  42. }
  43.  
  44. function doFail()
  45. {
  46.     document.write("R U Dum? Enter something you noob");
  47. }
  48. //end fucntions
  49.  
  50. //main
  51.  
  52. function doMain()
  53. {
  54.     if (user=="joe" && pass=="321")
  55.     {
  56.         doWelcome();
  57.     }
  58.    
  59.     else if(user=="john" && pass=="123")
  60.     {
  61.         doWelcome();
  62.     }
  63.    
  64.     else if(user=="" && pass=="")
  65.     {
  66.         doFail();
  67.     }
  68.    
  69.     else if(user=="1337" && pass=="1337")
  70.     {
  71.         document.write(" You Iz soooo 1337!!11!!");
  72.     }
  73.  
  74.     else
  75.     {
  76.         doNoentry();
  77.         lightning();
  78.     }
  79. }  
  80.  
  81. //Lighting script
  82. var flash=0
  83. function lightning()
  84. {flash=flash+1;
  85. if(flash==1){document.bgColor='white'; setTimeout("lightning()",100);}
  86. if(flash==2){document.bgColor='black'; setTimeout("lightning()",90);}
  87. if(flash==3){document.bgColor='red'; setTimeout("lightning()",85);}
  88. if(flash==4){document.bgColor='blue'; setTimeout("lightning()",80);}
  89. if(flash==5){document.bgColor='purple'; setTimeout("lightning()",75);}
  90. if(flash==6){document.bgColor='white'; setTimeout("lightning()",70);}
  91. if(flash==7){document.bgColor='black'; setTimeout("lightning()",65);}
  92. if(flash==8){document.bgColor='red'; setTimeout("lightning()",60);}
  93. if(flash==9){document.bgColor='blue'; setTimeout("lightning()",50);}
  94. if(flash==10){document.bgColor='purple'; setTimeout("lightning()",40);}
  95. if(flash==11){document.bgColor='black'; setTimeout("lightning()",30);}
  96. if(flash==12){document.bgColor='white'; setTimeout("lightning()",25);}
  97. if(flash==13){document.bgColor='red'; setTimeout("lightning()",20);}
  98. if(flash==14){document.bgColor='blue'; setTimeout("lightning()",10);}
  99. if(flash==15){document.bgColor='purple'; setTimeout("lightning()",5);}
  100. if(flash==16){document.bgColor='white'; setTimeout("lightning()",1);}
  101. if(flash==17){document.bgColor='black'; setTimeout("lightning()",1);}
  102. if(flash==18){document.bgColor='blue'; setTimeout("lightning()",1);}
  103. if(flash==19){document.bgColor='purple'; setTimeout("lightning()",1);}
  104. if(flash==20){flash=0; setTimeout("lightning()",100);}
  105. }
  106.  
  107. doMain();
  108.  
  109.  
  110. </script>
  111. </head>
  112. <body>
  113.  
  114.  
  115.  
  116. </body>
  117.  
  118. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement