Change login template to fit MUI principles

This commit is contained in:
lumijiez
2025-06-06 00:47:40 +03:00
parent 47f1b77584
commit 61ec568db1

View File

@@ -7,9 +7,14 @@
<title>Sign In | Imprink</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link href="https://fonts.cdnfonts.com/css/scanno-hanley-pro-sans" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<style>
* {
box-sizing: border-box;
}
body, html {
height: 100%;
margin: 0;
@@ -20,7 +25,8 @@
background-position: center;
background-repeat: no-repeat;
position: relative;
font-family: 'Scanno Hanley Pro Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
font-family: 'Roboto', sans-serif;
overflow: hidden;
}
body::before {
@@ -30,10 +36,11 @@
left: 0;
right: 0;
bottom: 0;
backdrop-filter: blur(8px);
background: linear-gradient(135deg,
rgba(108, 92, 231, 0.4),
rgba(0, 184, 148, 0.4)
backdrop-filter: blur(10px);
background: linear-gradient(120deg,
rgba(8, 181, 240, 1),
rgba(255, 213, 33, 1),
rgba(231, 0, 130, 1)
);
z-index: 0;
}
@@ -46,9 +53,12 @@
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
height: 100%;
position: relative;
height: 100vh;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 1;
padding: 0 5%;
max-width: 1400px;
@@ -69,6 +79,7 @@
.logo-section img {
width: 100%;
max-width: 600px;
filter: drop-shadow(0 8px 32px rgba(0, 0, 0, 0.2));
}
.login-section {
@@ -82,46 +93,47 @@
}
.login-box {
padding: 20px;
background-color: rgba(255, 255, 255, 0.9);
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1),
0 2px 8px rgba(0, 0, 0, 0.05),
inset 0 1px 1px rgba(255, 255, 255, 0.1),
0 0 20px rgba(108, 92, 231, 0.2),
0 0 40px rgba(0, 184, 148, 0.1);
border-radius: 20px;
padding: 32px;
background: #ffffff;
box-shadow: 0 24px 38px 3px rgba(0, 0, 0, 0.14),
0 9px 46px 8px rgba(0, 0, 0, 0.12),
0 11px 15px -7px rgba(0, 0, 0, 0.2);
border-radius: 8px;
width: 90%;
max-width: 400px;
min-width: 360px;
backdrop-filter: blur(12px);
border: 1px solid rgba(255, 255, 255, 0.3);
animation: fadeIn 0.5s ease-out;
max-height: 90vh;
overflow-y: auto;
position: relative;
}
.login-header {
text-align: center;
margin-bottom: 30px;
margin-bottom: 32px;
}
.login-header h3 {
font-family: 'Scanno Hanley Pro Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
font-size: 28px;
color: #2d3436;
margin: 15px 0 5px;
font-weight: 500;
font-family: 'Roboto', sans-serif;
font-size: 24px;
color: #212121;
margin: 16px 0 8px;
font-weight: 400;
letter-spacing: 0.15px;
}
.login-header h5 {
font-family: 'Scanno Hanley Pro Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
font-family: 'Roboto', sans-serif;
font-size: 14px;
color: #636e72;
font-weight: 500;
letter-spacing: 1px;
color: #757575;
font-weight: 400;
letter-spacing: 0.25px;
margin: 0;
text-transform: uppercase;
}
.login-header img {
width: 80%;
width: 70%;
animation: slideIn 0.8s ease-out forwards;
transform-origin: center;
}
@@ -131,33 +143,50 @@
}
#error-message {
font-family: 'Scanno Hanley Pro Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
font-family: 'Roboto', sans-serif;
display: none;
white-space: break-spaces;
background: #ffebee;
border: 1px solid #e57373;
color: #c62828;
border-radius: 4px;
padding: 12px 16px;
margin-bottom: 16px;
font-size: 14px;
}
#success-message {
font-family: 'Scanno Hanley Pro Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
font-family: 'Roboto', sans-serif;
display: none;
white-space: break-spaces;
background: #e8f5e8;
border: 1px solid #81c784;
color: #2e7d32;
border-radius: 4px;
padding: 12px 16px;
margin-bottom: 16px;
font-size: 14px;
}
.social-buttons {
display: flex;
justify-content: center;
gap: 15px;
margin: 20px 0;
gap: 8px;
margin: 24px 0;
flex-wrap: wrap;
}
.divider {
font-family: 'Scanno Hanley Pro Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
font-family: 'Roboto', sans-serif;
display: flex;
align-items: center;
text-align: center;
margin: 25px 0;
color: #636e72;
font-size: 13px;
letter-spacing: 0.5px;
margin: 24px 0;
color: #757575;
font-size: 12px;
letter-spacing: 0.4px;
text-transform: uppercase;
font-weight: 500;
}
.divider::before,
@@ -168,149 +197,166 @@
}
.divider::before {
margin-right: 15px;
margin-right: 16px;
}
.divider::after {
margin-left: 15px;
margin-left: 16px;
}
.social-btn {
width: 50px;
height: 50px;
border-radius: 12px;
width: 40px;
height: 40px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
border: 1px solid #e0e0e0;
background: white;
transition: all 0.3s ease;
border: none;
background: #fafafa;
transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
cursor: pointer;
padding: 0;
box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2),
0 4px 5px 0px rgba(0, 0, 0, 0.14),
0 1px 10px 0px rgba(0, 0, 0, 0.12);
}
.social-btn img {
width: 35px;
height: 35px;
width: 20px;
height: 20px;
object-fit: contain;
}
.social-btn:hover {
box-shadow: 0 4px 8px -2px rgba(0, 0, 0, 0.2),
0 7px 12px 1px rgba(0, 0, 0, 0.14),
0 2px 16px 1px rgba(0, 0, 0, 0.12);
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.btn-google:hover {
background: #DB4437;
border-color: #DB4437;
}
.btn-github:hover {
background: #333;
border-color: #333;
}
.btn-facebook:hover {
background: #4267B2;
border-color: #4267B2;
}
.btn-linkedin:hover {
background: #0077B5;
border-color: #0077B5;
}
.btn-windows:hover {
background: #00A4EF;
border-color: #00A4EF;
.social-btn:active {
box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2),
0 4px 5px 0px rgba(0, 0, 0, 0.14),
0 1px 10px 0px rgba(0, 0, 0, 0.12);
transform: translateY(0);
}
#link-signup-login {
font-family: 'Scanno Hanley Pro Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
font-family: 'Roboto', sans-serif;
cursor: pointer;
color: #6c5ce7;
color: #1976d2;
text-decoration: none;
font-weight: 500;
transition: all 0.2s ease;
transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
text-transform: uppercase;
font-size: 14px;
letter-spacing: 0.25px;
}
#link-signup-login:hover {
color: #5f4dd0;
color: #1565c0;
text-decoration: none;
}
#btn-signup {
background-color: #00b894;
background-color: #4caf50;
color: white;
border: none;
box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2),
0 4px 5px 0px rgba(0, 0, 0, 0.14),
0 1px 10px 0px rgba(0, 0, 0, 0.12);
}
#btn-signup:hover {
background-color: #00a884;
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(0, 184, 148, 0.2);
background-color: #43a047;
box-shadow: 0 4px 8px -2px rgba(0, 0, 0, 0.2),
0 7px 12px 1px rgba(0, 0, 0, 0.14),
0 2px 16px 1px rgba(0, 0, 0, 0.12);
}
.form-control {
font-family: 'Scanno Hanley Pro Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
font-family: 'Roboto', sans-serif;
max-width: 100%;
padding: 16px;
height: 40px;
border: 1.5px solid rgba(0, 0, 0, 0.08);
border-radius: 12px;
transition: all 0.2s ease;
padding: 16px 12px;
height: 56px;
border: 1px solid #e0e0e0;
border-radius: 4px;
transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
width: 100%;
font-size: 14px;
font-size: 16px;
background-color: #fff;
color: #2d3436;
color: #212121;
outline: none;
}
.form-control:focus {
border-color: #6c5ce7;
outline: none;
box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
border-color: #1976d2;
border-width: 2px;
box-shadow: none;
}
.form-control::placeholder {
font-family: 'Scanno Hanley Pro Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
color: #b2bec3;
font-family: 'Roboto', sans-serif;
color: #9e9e9e;
opacity: 1;
}
.form-group {
margin-bottom: 1.5rem;
margin-bottom: 20px;
position: relative;
}
.form-group label {
font-family: 'Scanno Hanley Pro Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
font-family: 'Roboto', sans-serif;
margin-bottom: 8px;
font-weight: 500;
color: #2d3436;
font-size: 14px;
font-weight: 400;
color: #757575;
font-size: 12px;
display: block;
letter-spacing: 0.3px;
letter-spacing: 0.4px;
text-transform: uppercase;
}
.btn {
font-family: 'Scanno Hanley Pro Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
padding: 14px 16px;
border-radius: 12px;
font-weight: 600;
transition: all 0.2s ease;
font-family: 'Roboto', sans-serif;
padding: 0 24px;
border-radius: 4px;
font-weight: 500;
transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
font-size: 14px;
height: auto;
letter-spacing: 0.3px;
height: 36px;
letter-spacing: 0.25px;
text-transform: uppercase;
min-width: 64px;
border: none;
cursor: pointer;
}
.btn-primary {
background-color: #6c5ce7;
border: none;
background-color: #1976d2;
color: white;
box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2),
0 4px 5px 0px rgba(0, 0, 0, 0.14),
0 1px 10px 0px rgba(0, 0, 0, 0.12);
}
.btn-primary:hover {
background-color: #5f4dd0;
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(108, 92, 231, 0.2);
background-color: #1565c0;
box-shadow: 0 4px 8px -2px rgba(0, 0, 0, 0.2),
0 7px 12px 1px rgba(0, 0, 0, 0.14),
0 2px 16px 1px rgba(0, 0, 0, 0.12);
}
.btn-primary:active {
background-color: #0d47a1;
box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2),
0 4px 5px 0px rgba(0, 0, 0, 0.14),
0 1px 10px 0px rgba(0, 0, 0, 0.12);
}
.btn-block {
width: 100%;
height: 48px;
}
@keyframes slideLeft {
@@ -350,11 +396,20 @@
}
@media (max-width: 992px) {
html, body {
overflow: hidden;
position: fixed;
width: 100%;
height: 100%;
}
.login-container {
flex-direction: column;
padding: 20px;
padding: 16px;
justify-content: center;
align-items: center;
position: fixed;
inset: 0;
}
.logo-section {
@@ -366,28 +421,78 @@
animation: none;
display: flex;
justify-content: center;
align-items: center;
flex: 1;
}
.login-box {
width: 100%;
max-width: 400px;
width: calc(100% - 32px);
max-width: 380px;
min-width: unset;
animation: none;
margin: 0 auto;
margin: 0;
padding: 24px;
max-height: calc(100vh - 32px);
overflow-y: auto;
}
.login-header {
margin-bottom: 24px;
}
.login-header .mobile-logo {
display: block;
width: 80%;
margin: 0 auto 20px auto;
width: 60%;
margin: 0 auto 16px auto;
}
.login-header h3 {
font-size: 20px;
margin: 12px 0 6px;
}
.form-group {
margin-bottom: 16px;
}
.social-buttons {
gap: 6px;
margin: 20px 0;
}
.social-btn {
width: 36px;
height: 36px;
}
.social-btn img {
width: 18px;
height: 18px;
}
.divider {
margin: 20px 0;
}
hr {
margin: 20px 0;
border-color: #e0e0e0;
}
}
@keyframes slideUp {
0% {
transform: translateY(50px);
@media (max-width: 480px) {
.login-box {
width: calc(100% - 16px);
padding: 20px;
}
100% {
transform: translateY(0);
.form-control {
padding: 14px 12px;
height: 52px;
}
.btn {
padding: 0 20px;
}
}
@@ -397,17 +502,26 @@
}
.forgot-password a {
font-family: 'Scanno Hanley Pro Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
color: #6c5ce7;
font-size: 13px;
font-family: 'Roboto', sans-serif;
color: #1976d2;
font-size: 12px;
text-decoration: none;
transition: all 0.2s ease;
transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
text-transform: uppercase;
letter-spacing: 0.4px;
font-weight: 500;
}
.forgot-password a:hover {
color: #5f4dd0;
color: #1565c0;
text-decoration: none;
}
hr {
border: none;
border-top: 1px solid #e0e0e0;
margin: 24px 0;
}
</style>
<body>
<div class="login-container">
@@ -419,7 +533,7 @@
<div class="login-header">
<img src="https://i.ibb.co/0RK5CM5Q/logo-light.png" class="img-fluid mobile-logo"/>
<h3>Welcome</h3>
<h5>PLEASE LOG IN</h5>
<h5>Please log in</h5>
</div>
<div id="error-message" class="alert alert-danger"></div>
<div id="success-message" class="alert alert-success"></div>
@@ -564,31 +678,38 @@
}
);
function login(e) {
function login(e) {
e.preventDefault();
var button = this;
var signupBtn = document.getElementById('btn-signup');
if (!signupBtn.classList.contains('invisible')) {
signup.call(signupBtn);
return;
}
var button = document.getElementById('btn-login');
var username = document.getElementById('email').value;
var password = document.getElementById('password').value;
button.disabled = true;
var request = () => {
webAuth.login({
webAuth.login({
realm: databaseConnection,
username: username,
password: password,
captcha: captcha.getValue()
}, function(err) {
}, function(err) {
if (err) displayError(err);
button.disabled = false;
});
});
};
if (triggerCaptcha) {
triggerCaptcha(request);
triggerCaptcha(request);
} else {
request();
request();
}
}
}
function toggleSignupLogin(e) {
e.preventDefault();
@@ -744,6 +865,7 @@
}
}
document.getElementById('btn-login').addEventListener('click', login);
document.getElementById('btn-google').addEventListener('click', loginWithGoogle);
document.getElementById('btn-github').addEventListener('click', loginWithGithub);
@@ -753,6 +875,7 @@
document.getElementById('btn-signup').addEventListener('click', signup);
document.getElementById('link-signup-login').addEventListener('click', toggleSignupLogin);
document.getElementById('forgot-password-link').addEventListener('click', forgotPassword);
document.querySelector('form').addEventListener('submit', login);
});
</script>
</body>