Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Abhishek029/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
TicTacToe/.vs
TicTacToe/packages/
TicTacToe/TicTacToe/obj/
TicTacToe/TicTacToe/bin/
94 changes: 94 additions & 0 deletions Abhishek029/Login.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<!DOCTYPE html>
<html>
<head>
<title>PLAYER LOGIN</title>
<link rel="stylesheet" type="text/css" href="main.css">
</head>
<body>

<div class="container" >
<div class="box1">
<h1>TIC TAC TOE LOGIN PAGE</h1>
<br>
<script
src="https://code.jquery.com/jquery-3.3.1.js"
integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60="
crossorigin="anonymous"></script>


<label class="label"> User Id </label> <br>
<input type="text" id='Id' placeholder='Id'> <br> <br>

<label class="label"> Username </label> <br>
<input type="text" id='Username' placeholder='Username'> <br> <br>

<label class="label">Password </label> <br>
<input type="Password" id='Password' placeholder='Password'>
<br> <br>
<button class="button" onclick="getDetails()">Login</button>

<button class="button" onclick="reset()">Reset</button>
<br> <br>

<a href="Signup.html" target="_blank"> Create New Account</a>



<script type="text/javascript">

function reset(){

document.getElementById('Username').value="";
document.getElementById('Password').value="";
}



var Data={};
function getDetails(){
var id=document.getElementById('Id').value;
var Url='http://localhost:54713/api/Accounts/'+id;

$.ajax({
url:Url ,
type: 'GET',
dataType: 'json',
success: function(res){
console.log(res);
Data= res;
validate();
}
});

}


function validate(){

if (document.getElementById('Username').value==Data['Username'] && document.getElementById('Password').value==Data['Pass'])
{
location.href='TicTac.html'
alert('Login Successful');

}

else if(document.getElementById('Username').value=='' && document.getElementById('Password').value=='')
{
alert('Fields cant be Empty');
}

else alert(' Id and Password Do not Match');







}
</script>
</div>
</div>
</body>

</html>
83 changes: 83 additions & 0 deletions Abhishek029/Signup.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<!DOCTYPE html>
<html>
<head>
<title>New Player Signup</title>
<link rel="stylesheet" type="text/css" href="main.css">
</head>
<body>

<div class="container">
<div class="box1">
<h1> Create New Player</h1>
<br>
<label class="label">Enter Your Username</label>
<br>
<input type='text' id='Username' placeholder='Username'>
<br><br>
<label class="label">Enter Your Password</label>
<br>
<input type='Password' id='Password' placeholder=' Password'>
<br><br>
<label class="label">Confirm Your Password</label>
<br>
<input type='Password' id='RePass' placeholder=' Confirm Password'>
<br><br>
<label class="label">Choose a Hint (Optional)</label>
<br>
<input type='text' placeholder=' Hint (Optional)'>
<br><br>
<button class="button" onclick="alertSuccess() ">Create Account</button>

<script
src="https://code.jquery.com/jquery-3.3.1.js"
integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60="
crossorigin="anonymous"></script>

<script type="text/javascript">

function SaveAccount(){
var Username= document.getElementById("Username").value;
var Pass= document.getElementById("Password").value;
var obj={

"Username":Username,
"Pass":Pass
};
$.ajax({
url: 'http://localhost:54713/api/Accounts',
type: 'POST',
dataType: 'json',
data:obj,
success: function(data){
console.log(data);

}

})
}

function alertSuccess(){

if(document.getElementById('Password').value==document.getElementById('RePass').value)
{
location.href='Login.html';
SaveAccount();
alert('Account Created Successfully. Redirecting to Login Page.');
}


else if(document.getElementById('Password').value!=document.getElementById('RePass').value)
{
alert('Passwords Do Not Match');
}



}

</script>
</div>
</div>

</body>
</html>
Loading