mirror of
https://github.com/timmypidashev/web.git
synced 2026-04-14 19:13:51 +00:00
minor polish
This commit is contained in:
@@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
20
login.html
20
login.html
@@ -44,12 +44,14 @@
|
|||||||
duration: 800
|
duration: 800
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<script src="js/python/login.js"></script>
|
|
||||||
<script>
|
<script>
|
||||||
$("#login-button").click(function(event){
|
$("#login-button").click(function(event){
|
||||||
|
|
||||||
// check if username and password are filled in
|
// check if username and password are filled in
|
||||||
if($("#username").val() == "student" && $("#password").val() == "student.23264"){
|
if($("#username").val() == "student" && $("#password").val() == "student.23264"){
|
||||||
// if the username and password are correct, redirect to the admin page
|
// 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
|
setTimeout(function() { // delay the location.replace for one second for login animation
|
||||||
location.replace('assignments.html');
|
location.replace('assignments.html');
|
||||||
}, 1000);
|
}, 1000);
|
||||||
@@ -57,23 +59,7 @@
|
|||||||
// if the username and password are incorrect, add a shake animation to the form
|
// if the username and password are incorrect, add a shake animation to the form
|
||||||
$(".wrapper").addClass("form-error");
|
$(".wrapper").addClass("form-error");
|
||||||
}
|
}
|
||||||
|
|
||||||
event.preventDefault();
|
|
||||||
|
|
||||||
$('form').fadeOut(500);
|
|
||||||
$('.wrapper').addClass('form-success');
|
|
||||||
});
|
});
|
||||||
</script>
|
</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>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Reference in New Issue
Block a user