Skip to content

Commit

Permalink
Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
MuhammadAhmadAslam committed Jun 14, 2024
1 parent aef384d commit e135441
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 26 deletions.
27 changes: 15 additions & 12 deletions assets/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,23 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="dashborard.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@11.11.1/dist/sweetalert2.min.css">
</head>
<body>


<div>
<h1>Welcome</h1>
<button id="logout">LogOut</button>
</div>






<script src="app.js"></script>

<div>
<h1>Welcome</h1>
<button id="logout">LogOut</button>
</div>






<script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/2.1.2/sweetalert.min.js" integrity="sha512-AA1Bzp5Q0K1KanKKmvN/4d3IRKVlv9PYgwFPvm32nPO6QS8yH1HO7LbgB1pgiOxPtfeg5zEn2ba64MUcqJx6CA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/2.1.2/sweetalert.min.js" integrity="sha512-AA1Bzp5Q0K1KanKKmvN/4d3IRKVlv9PYgwFPvm32nPO6QS8yH1HO7LbgB1pgiOxPtfeg5zEn2ba64MUcqJx6CA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="logout.js"></script>
</body>
</html>
26 changes: 16 additions & 10 deletions assets/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@11.11.1/dist/sweetalert2.min.css">
<link href="https://cdn.jsdelivr.net/npm/@sweetalert2/theme-dark@4/dark.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.js"></script>
<style>
a{
text-decoration: none;
Expand All @@ -25,18 +28,21 @@
<label for="chk" aria-hidden="true">Login</label>
<input type="email" name="email" id="LoginEmailInput" placeholder="Email" >
<input type="password" name="pswd" placeholder="Password" id="loginPasswordInput">
<p id="text">Pleese Enter A Information On Input</p>
<button id="loginButton">Login</button>
</form>
</div>
</div>








<script src="login.js"></script>
</body>







<script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/2.1.2/sweetalert.min.js" integrity="sha512-AA1Bzp5Q0K1KanKKmvN/4d3IRKVlv9PYgwFPvm32nPO6QS8yH1HO7LbgB1pgiOxPtfeg5zEn2ba64MUcqJx6CA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/2.1.2/sweetalert.min.js" integrity="sha512-AA1Bzp5Q0K1KanKKmvN/4d3IRKVlv9PYgwFPvm32nPO6QS8yH1HO7LbgB1pgiOxPtfeg5zEn2ba64MUcqJx6CA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

<script src="login.js"></script>
</body>
</html>
10 changes: 10 additions & 0 deletions assets/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,21 @@ loginButton.addEventListener('click', (event) => {
event.preventDefault();
alert('Login successful');
window.location.href = 'dashboard.html'
Swal.fire({
position: "top-end",
icon: "success",
title: "You Are Regiesterd Successfully",
showConfirmButton: false,
timer: 1500
});
} else {
event.preventDefault();
console.log('Login failed');
forText.innerText = 'Please fill in this form'
}
});


// SignUpButton.addEventListener('click', function (event) {
// if (userName.value == '' || userEmail.value == '' || mobileNumber.value == '' || password.value == '') {
// forText.innerText = 'Please fill in this form'
Expand Down
4 changes: 4 additions & 0 deletions assets/logout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
let logout = document.getElementById('logout').addEventListener('click', (event) => {
event.preventDefault()
window.location.href = '../index.html'
})
8 changes: 6 additions & 2 deletions assets/signup.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ let loginPasswordInput = document.getElementById('loginPasswordInput')
let LoginEmailInput = document.getElementById('LoginEmailInput')
SignUpButton.addEventListener('click', function (event) {
if (userName.value == '' || userEmail.value == '' || mobileNumber.value == '' || password.value == '') {
event.preventDefault()
forText.innerText = 'Please fill in this form'
}else{
localStorage.setItem('User Name', userName.value);
Expand All @@ -21,8 +22,11 @@ if (userName.value == '' || userEmail.value == '' || mobileNumber.value == '' ||
mobileNumber.value = '';
password.value = '';
event.preventDefault();
window.open('assets/login.html');
window.location.href= 'assets/login.html'
// window.open('assets/login.html');
// window.location.assign('assets/login.html');
console.log('Sign up successful');
}
});
});


4 changes: 3 additions & 1 deletion assets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,6 @@ button:hover{
background: #6d44b8;
}


body {
font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;
}
4 changes: 3 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="assets/style.css">
<link href="https://cdn.jsdelivr.net/npm/@sweetalert2/theme-dark@4/dark.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.js"></script>
</head>
<body>

Expand All @@ -28,7 +30,7 @@




<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11.11.1/dist/sweetalert2.all.min.js"></script>
<script src="assets/signup.js"></script>
</body>
</html>

0 comments on commit e135441

Please sign in to comment.