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