hopefully deployment is better than dev

This commit is contained in:
Timothy Pidashev
2022-01-08 16:32:53 -08:00
parent c9385a50b8
commit 074f13683a
6 changed files with 248 additions and 29 deletions

View File

@@ -5,6 +5,8 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet/less" type="text/css" href="css/login.less" />
<link rel="stylesheet" href="https://unpkg.com/aos@next/dist/aos.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
</head>
<body>
<div class="wrapper">
@@ -12,9 +14,9 @@
<h1>Login</h1>
<form class="form">
<input id="username" type="text" placeholder="Username">
<input id="password" type="password" placeholder="Password">
<button type="submit" id="login-button" onclick="validate()">Login</button>
<input data-aos="fade-right" id="username" type="text" placeholder="Username">
<input data-aos="fade-left" id="password" type="password" placeholder="Password">
<button data-aos="zoom-out" type="button" id="login-button">Login</button>
</form>
</div>
@@ -31,7 +33,47 @@
<li></li>
</ul>
</div>
<script src="js/less.js" data-env="production"></script>
<script src="https://unpkg.com/aos@next/dist/aos.js"></script>
<script>AOS.init(
{
once: false,
mirror: true,
anchorPlacement: 'top-bottom',
offset: 0,
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
setTimeout(function() { // delay the location.replace for one second for login animation
location.replace('assignments.html');
}, 1000);
} else {
// 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>
<script src="js/less.js" data-env="production"></script>
<!-- add login function -->
<script src="js/python/login.js"></script>
</html>