This commit is contained in:
mileswa1q2
2023-11-05 23:42:04 +00:00
committed by GitHub
parent f47580cb9f
commit 6c6f60c858
5 changed files with 130 additions and 2 deletions
+81
View File
@@ -0,0 +1,81 @@
html {
height: 100%;
}
body {
height: 100%;
margin: 0;
font-family: Arial, Helvetica, sans-serif;
display: grid;
justify-items: center;
align-items: center;
background-color: #3a3a3a;
}
#main-holder {
width: 50%;
height: 70%;
display: grid;
justify-items: center;
align-items: center;
background-color: white;
border-radius: 7px;
box-shadow: 0px 0px 5px 2px black;
}
#login-error-msg-holder {
width: 100%;
height: 100%;
display: grid;
justify-items: center;
align-items: center;
}
#login-error-msg {
width: 23%;
text-align: center;
margin: 0;
padding: 5px;
font-size: 12px;
font-weight: bold;
color: #8a0000;
border: 1px solid #8a0000;
background-color: #e58f8f;
opacity: 0;
}
#error-msg-second-line {
display: block;
}
#login-form {
align-self: flex-start;
display: grid;
justify-items: center;
align-items: center;
}
.login-form-field::placeholder {
color: #3a3a3a;
}
.login-form-field {
border: none;
border-bottom: 1px solid #3a3a3a;
margin-bottom: 10px;
border-radius: 3px;
outline: none;
padding: 0px 0px 5px 5px;
}
#login-form-submit {
width: 100%;
padding: 7px;
border: none;
border-radius: 5px;
color: white;
font-weight: bold;
background-color: #3a3a3a;
cursor: pointer;
outline: none;
}
+30
View File
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login</title>
<link rel="stylesheet" href="/idk/login2.css">
<script defer src="/idk/login2.js"></script>
</head>
<body>
<main id="main-holder">
<h1 id="login-header">Login</h1>
<div id="login-error-msg-holder">
<p id="login-error-msg">Invalid username <span id="error-msg-second-line">and/or password</span></p>
</div>
<form id="login-form">
<input type="text" name="username" id="username-field" class="login-form-field" placeholder="Username">
<input type="password" name="password" id="password-field" class="login-form-field" placeholder="Password">
<input type="submit" value="Login" id="login-form-submit">
</form>
</main>
</body>
</html>
+17
View File
@@ -0,0 +1,17 @@
const loginForm = document.getElementById("login-form");
const loginButton = document.getElementById("login-form-submit");
const loginErrorMsg = document.getElementById("login-error-msg");
loginButton.addEventListener("click", (e) => {
e.preventDefault();
const username = loginForm.username.value;
const password = loginForm.password.value;
if (username === "user" && password === "web_dev") {
alert("You have successfully logged in.");
location.reload();
} else {
loginErrorMsg.style.opacity = 1;
}
})
+1 -1
View File
@@ -10,7 +10,7 @@
<a href="dino.html">dino games</a>
<a href="sonhgs.html">sonhgs</a>
<a href="credits.html">credits</a>
<a href="/login/login.html">login</a>
<a href="/idk/login2.html">login</a>
<a href="https://github.com/mileswolfallen2/funforyou-wedsite/releases/tag/3.0" target="_blank">offline</a>
<a href="/dextensify-master/dextensify-master/index2.html">unbloxer</a>
<a href="coment.html">contacting me</a>
+1 -1
View File
@@ -11,7 +11,7 @@
<div class="contaner">
<form class="form" id="login">
<h1 class="form__title">login</h1>
<div class="form__message form__meaaage--error">incorect yousernam or paswored.</div>
<div class="form__message form__meaaage--error"></div>
<div class="form__input-group">
<input type="text" class="form__input" autofocus placeholder="username or emall">
<div class="form__input-error-message">errer</div>