minor polish

This commit is contained in:
Timothy Pidashev
2022-01-08 16:48:15 -08:00
parent 074f13683a
commit 3c371383d5
2 changed files with 4 additions and 27 deletions

View File

@@ -1,9 +0,0 @@
function login(username, password) {
if (username == 'student' && password == 'student.23264') {
setTimeout(function() { // delay the location.replace for one second for login animation
location.replace('assignments.html');
}, 1000);
} else {
return false;
}
}

View File

@@ -44,12 +44,14 @@
duration: 800
});
</script>
<script src="js/python/login.js"></script>
<script>
$("#login-button").click(function(event){
// check if username and password are filled in
if($("#username").val() == "student" && $("#password").val() == "student.23264"){
// if the username and password are correct, redirect to the admin page
$('form').fadeOut(500);
$('.wrapper').addClass('form-success');
setTimeout(function() { // delay the location.replace for one second for login animation
location.replace('assignments.html');
}, 1000);
@@ -57,23 +59,7 @@
// if the username and password are incorrect, add a shake animation to the form
$(".wrapper").addClass("form-error");
}
event.preventDefault();
$('form').fadeOut(500);
$('.wrapper').addClass('form-success');
});
</script>
<!-- <script>
function validate() {
var username = document.getElementById("username").value;
var password = document.getElementById("password").value;
if (username == "" || password == "") {
alert("Please fill in all fields");
} else {
login(username, password);
}
}
</script> -->
</body>
</html>