Add Login CEF
This commit is contained in:
93
Client/Login/login.html
Normal file
93
Client/Login/login.html
Normal file
@@ -0,0 +1,93 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
<script src="Dependences/jquery-3.3.1.min.js"></script>
|
||||
<script src="Dependences/bootstrap-3.3.7/js/bootstrap.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="login-page" style="padding: 10% 0 0;">
|
||||
<div class="form">
|
||||
<h2 id="playerName"></h2>
|
||||
<div class="isa_error">
|
||||
ERROR TEXT
|
||||
</div>
|
||||
<div class="register-form form-l">
|
||||
<input type="text" placeholder="Benutzername" id="usernameInputRegister" />
|
||||
<input type="password" placeholder="Passwort" id="passwordInputRegister" />
|
||||
<input type="password" placeholder="Passwort wiederholen" id="passwordRepeatInputRegister" />
|
||||
<button id="registerBtn">Erstellen</button><br /><br />
|
||||
<button class="quitBtn">Server verlassen</button>
|
||||
<p class="message">Bereits registriert? <a href="#">Logg dich ein</a></p>
|
||||
</div>
|
||||
<div class="login-form form-l">
|
||||
<input type="text" placeholder="Benutzername" id="usernameInputLogin" />
|
||||
<input type="password" placeholder="Passwort" id="passwordInputLogin" />
|
||||
<button id="loginBtn">Einloggen</button><br /><br />
|
||||
<button class="quitBtn">Server verlassen</button>
|
||||
<p class="message">Nicht registriert? <a href="#">Erstelle einen Account</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function () {
|
||||
resourceCall("RequestDisplayname");
|
||||
});
|
||||
|
||||
$('.message a').click(function () {
|
||||
$('.form-l').animate({ height: "toggle", opacity: "toggle" }, "slow");
|
||||
});
|
||||
|
||||
$('#registerBtn').click(function () {
|
||||
var password = $('#passwordInputRegister').val();
|
||||
var passwordRepeat = $('#passwordRepeatInputRegister').val();
|
||||
|
||||
if (password === "" || passwordRepeat === "") {
|
||||
showError("Mindestens ein Passwort Feld ist leer!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (password !== passwordRepeat) {
|
||||
showError("Die beiden Passwörter stimmen nicht überein!")
|
||||
return;
|
||||
}
|
||||
|
||||
if (password.length < 8) {
|
||||
showError("Das Passwort muss mindestens 8 Zeichen lang sein");
|
||||
return;
|
||||
}
|
||||
|
||||
resourceCall("Register", password, passwordRepeat);
|
||||
});
|
||||
|
||||
$('#loginBtn').click(function () {
|
||||
var password = $('#passwordInputLogin').val();
|
||||
|
||||
if (password === "") {
|
||||
showError("Du musst ein Passwort angeben!");
|
||||
return;
|
||||
}
|
||||
|
||||
resourceCall("Login", password);
|
||||
});
|
||||
|
||||
$('.quitBtn').click(function () {
|
||||
resourceCall("Quit");
|
||||
});
|
||||
|
||||
function showError(error) {
|
||||
$('.isa_error').html(error);
|
||||
$('.isa_error').slideDown();
|
||||
}
|
||||
|
||||
function SendDisplayname(name) {
|
||||
$("h2#playerName").text(name);
|
||||
}
|
||||
</script>
|
||||
<script src="login.js" type="text/javascript"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user