Bootstaper Login
continuous-integration/drone/push Build is passing Details

ServeurDeTest
nathan boileau 2 years ago
parent e9fd0d832c
commit a44865aa93

@ -1,50 +1,27 @@
@font-face { /*Fonts CSS */
font-family: Centra;
src: url('../../assets/fonts/CentraNo2-Bold.ttf');
font-weight: 700;
}
@font-face { @font-face {
font-family: Centra; font-family: Fauna;
src: url('../../assets/fonts/CentraNo2-Regular.ttf'); src: url("../../assets/fonts/Fauna.ttf");
font-weight: 500;
} }
@font-face { @font-face {
font-family: Centra; font-family: Equinox;
src: url('../../assets/fonts/CentraNo2-Light.ttf'); src: url("../../assets/fonts/Equinox.otf");
font-weight: 400;
}
p, a, li, button, ul {
margin: 0;
padding: 0;
line-height: normal;
text-decoration: none !important;
}
a:hover {
text-decoration: none !important;
}
input:focus, textarea:focus, select:focus {
outline: none;
} }
/* End Fonts CSS */
body { body {
margin:0; min-height: 100vh;
padding:0; font-family: "Equinox", sans-serif;
font-family: 'Raleway', sans-serif !important; color: white;
}
.main{
background-image: url(../../assets/img/BackgroundLogIn.png);
scroll-behavior: smooth; scroll-behavior: smooth;
height: 100vh; height: 100vh;
background-image: url("../../assets/img/ImgMain2.png");
background-position: center center; background-position: center center;
background-color: #464646;
background-attachment: fixed; background-attachment: fixed;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: cover; background-size: cover;
background-color: #000;
} }
.login-box { .login-box {
@ -53,23 +30,15 @@ body {
left: 50%; left: 50%;
width: 400px; width: 400px;
padding: 40px; padding: 40px;
transform: translate(-50%, -50%);
background: rgba(0, 0, 0, 0.6); background: rgba(0, 0, 0, 0.6);
box-sizing: border-box; box-sizing: border-box;
box-shadow: 0 15px 25px rgba(0,0,0,.6); box-shadow: 0 15px 25px rgba(0, 0, 0, 0.6);
border-radius: 10px; border-radius: 10px;
} transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
.login-box h2 { -moz-transform: translate(-50%, -50%);
margin: 0 0 30px; -ms-transform: translate(-50%, -50%);
padding: 0; -o-transform: translate(-50%, -50%);
color: #fff;
text-transform: uppercase;
text-align: center;
}
.login-box .user-box {
position: relative;
} }
.login-box .user-box input { .login-box .user-box input {
@ -77,7 +46,6 @@ body {
padding: 10px 0; padding: 10px 0;
font-size: 16px; font-size: 16px;
color: #fff; color: #fff;
margin-bottom: 30px;
border: none; border: none;
border-bottom: 1px solid #fff; border-bottom: 1px solid #fff;
outline: none; outline: none;
@ -88,11 +56,14 @@ body {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
padding: 10px 0;
font-size: 16px; font-size: 16px;
color: #fff; color: #fff;
pointer-events: none; pointer-events: none;
transition: .5s; transition: 0.5s;
-webkit-transition: 0.5s;
-moz-transition: 0.5s;
-ms-transition: 0.5s;
-o-transition: 0.5s;
} }
.login-box .user-box input:focus ~ label, .login-box .user-box input:focus ~ label,
@ -103,10 +74,9 @@ body {
font-size: 12px; font-size: 12px;
} }
.login-box form a, .login-box form button { .login-box form a,
margin-left: 10px; .login-box form button {
position: relative; position: relative;
width: 120px;
display: inline-flex; display: inline-flex;
justify-content: center; justify-content: center;
padding: 10px 0px; padding: 10px 0px;
@ -117,33 +87,31 @@ body {
text-decoration: none; text-decoration: none;
text-transform: uppercase; text-transform: uppercase;
overflow: hidden; overflow: hidden;
transition: .5s; letter-spacing: 3px;
margin-top: 40px; transition: all 0.5s;
letter-spacing: 3px -webkit-transition: all 0.5s;
} -moz-transition: all 0.5s;
-ms-transition: all 0.5s;
.login-box form .right{ -o-transition: all 0.5s;
float: right;
margin-right: 10px;
} }
.login-box a:hover,
.login-box a:hover, .login-box button:hover { .login-box button:hover {
background: #6090d1; background: #6090d1;
color: #fff; color: #fff;
border-radius: 5px; border-radius: 5px;
box-shadow: 0 0 5px #6090d1, box-shadow: 0 0 5px #6090d1, 0 0 25px #6090d1, 0 0 50px #6090d1,
0 0 25px #6090d1,
0 0 50px #6090d1,
0 0 100px #6090d1; 0 0 100px #6090d1;
} }
.login-box a span, .login-box button span { .login-box a span,
.login-box button span {
position: absolute; position: absolute;
display: block; display: block;
} }
.login-box a span:nth-child(1), .login-box button span:nth-child(1) { .login-box a span:nth-child(1),
.login-box button span:nth-child(1) {
top: 0; top: 0;
left: -100%; left: -100%;
width: 100%; width: 100%;
@ -156,77 +124,71 @@ body {
0% { 0% {
left: -100%; left: -100%;
} }
50%,100% { 50%,
100% {
left: 100%; left: 100%;
} }
} }
.login-box a span:nth-child(2), .login-box button span:nth-child(2) { .login-box a span:nth-child(2),
.login-box button span:nth-child(2) {
top: -100%; top: -100%;
right: 0; right: 0;
width: 2px; width: 2px;
height: 100%; height: 100%;
background: linear-gradient(180deg, transparent, #6090d1); background: linear-gradient(180deg, transparent, #6090d1);
animation: btn-anim2 1s linear infinite; animation: btn-anim2 1s linear infinite;
animation-delay: .25s animation-delay: 0.25s;
} }
@keyframes btn-anim2 { @keyframes btn-anim2 {
0% { 0% {
top: -100%; top: -100%;
} }
50%,100% { 50%,
100% {
top: 100%; top: 100%;
} }
} }
.login-box a span:nth-child(3), .login-box button span:nth-child(3) { .login-box a span:nth-child(3),
.login-box button span:nth-child(3) {
bottom: 0; bottom: 0;
right: -100%; right: -100%;
width: 100%; width: 100%;
height: 2px; height: 2px;
background: linear-gradient(270deg, transparent, #6090d1); background: linear-gradient(270deg, transparent, #6090d1);
animation: btn-anim3 1s linear infinite; animation: btn-anim3 1s linear infinite;
animation-delay: .5s animation-delay: 0.5s;
} }
@keyframes btn-anim3 { @keyframes btn-anim3 {
0% { 0% {
right: -100%; right: -100%;
} }
50%,100% { 50%,
100% {
right: 100%; right: 100%;
} }
} }
.login-box a span:nth-child(4), .login-box button span:nth-child(4) { .login-box a span:nth-child(4),
.login-box button span:nth-child(4) {
bottom: -100%; bottom: -100%;
left: 0; left: 0;
width: 2px; width: 2px;
height: 100%; height: 100%;
background: linear-gradient(360deg, transparent, #6090d1); background: linear-gradient(360deg, transparent, #6090d1);
animation: btn-anim4 1s linear infinite; animation: btn-anim4 1s linear infinite;
animation-delay: .75s animation-delay: 0.75s;
} }
@keyframes btn-anim4 { @keyframes btn-anim4 {
0% { 0% {
bottom: -100%; bottom: -100%;
} }
50%,100% { 50%,
100% {
bottom: 100%; bottom: 100%;
} }
} }
.top{
display: flex;
}
.material-icons{
margin-bottom: 10%;
}
.top h2{
margin-left: 25%;
margin-top: 2% ;
}

@ -1,61 +0,0 @@
const form = document.getElementById('form');
const username = document.getElementById('username');
const password = document.getElementById('password');
form.addEventListener('submit', e => {
e.preventDefault();
checkInputs();
printForm();
});
const setErrorFor = (element, message) => {
const inputControl = element.parentElement;
inputControl.classList.add('error');
inputControl.classList.remove('success');
}
const setSuccessFor = (element) => {
const inputControl = element.parentElement;
inputControl.classList.add('success');
inputControl.classList.remove('error');
};
function checkInputs() {
// trim to remove the whitespaces
const usernameValue = username.value.trim();
const passwordValue = password.value.trim();
if (usernameValue === '') {
setErrorFor(username, 'Username cannot be blank');
}
else {
setSuccessFor(username);
}
if (passwordValue === '') {
setErrorFor(password, 'Password cannot be blank');
}
else if(passwordValue.length < 8) {
setErrorFor(password, 'Password must be at least 8 characters');
}
else {
setSuccessFor(password);
}
if (usernameValue === 'admin' && passwordValue === 'admin') {
window.location.href = 'http://localhost:8080/WEB/Welcome.html';
}
}
//Open a new blank page and print the usename and password
function printForm() {
var myWindow = window.open("", "MsgWindow", "width=200,height=100");
myWindow.document.write("Username: " + username.value + "<br>Password: " + password.value);
}

@ -1,38 +1,64 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="fr"> <html lang="fr">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="./View/src/CSS/LogSign.css"> <link
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> rel="stylesheet"
<script defer src="../../JS/Login.js"></script> href="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha1/css/bootstrap.min.css"
integrity="sha384-r4NyP46KrjDleawBgD5tp8Y7UzmLA05oM1iAEQ17CSuDqnUK2+k9luXQOfXJCJ4I"
crossorigin="anonymous"
/>
<script
src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
crossorigin="anonymous"
></script>
<script
src="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha1/js/bootstrap.min.js"
integrity="sha384-oesi62hOLfzrys4LxRF63OJCXdXDipiYWBnvTl9Y9/TRlw5xlKIEHpNyvvDShgf/"
crossorigin="anonymous"
></script>
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@48,400,0,0"
/>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"
/>
<link rel="stylesheet" href="./View/src/CSS/LogSign.css" />
<link
rel="stylesheet"
href="https://fonts.googleapis.com/icon?family=Material+Icons"
/>
<title>Login</title> <title>Login</title>
</head> </head>
<body> <body>
<div class="main"> <div class="container user-select-none">
<div class="login-box" id="form"> <div class="login-box col-12" id="form">
<div class="top"> <div class="row mb-4">
<h2>Sign up</h2> <h2 class="text-uppercase font-weight-bold text-center">Login</h2>
</div> </div>
<form action="index.php?action=login" method="POST"> <form action="index.php?action=login" method="POST">
<div class="user-box"> <div class="user-box mb-5 position-relative">
<input type="text" id="email" name="email" required=""> <input type="text" id="email" name="email" required="" />
<label>Email</label> <label class="py-1">Email</label>
</div> </div>
<div class="user-box"> <div class="user-box mb-3 position-relative">
<input type="password" id="password" name="password" required=""> <input type="password" id="password" name="password" required="" />
<label>Password</label> <label>Password</label>
</div> </div>
<div> <div class="d-flex justify-content-around mt-5">
<button class="left" type="submit"> <button class="py-2 px-3" type="submit">
<span></span> <span></span>
<span></span> <span></span>
<span></span> <span></span>
<span></span> <span></span>
Submit Submit
</button> </button>
<a href="index.php?action=goToSignUp" class="right"> <a href="index.php?action=goToSignUp" class="right py-2 px-3">
<span></span> <span></span>
<span></span> <span></span>
<span></span> <span></span>

Loading…
Cancel
Save