refactor: melhorias na interface de login e alertas, foco em mobile-first
This commit is contained in:
@@ -41,6 +41,13 @@ body {
|
|||||||
height: 35px;
|
height: 35px;
|
||||||
width: auto;
|
width: auto;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
|
object-fit: contain;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-logo {
|
||||||
|
height: 100px;
|
||||||
|
width: auto;
|
||||||
|
object-fit: contain;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-link {
|
.nav-link {
|
||||||
@@ -114,16 +121,33 @@ body {
|
|||||||
box-shadow: 0 0 0 0.2rem rgba(232, 0, 12, 0.25);
|
box-shadow: 0 0 0 0.2rem rgba(232, 0, 12, 0.25);
|
||||||
}
|
}
|
||||||
|
|
||||||
.alert-success {
|
.alert {
|
||||||
background-color: #28a745;
|
position: fixed;
|
||||||
color: white;
|
top: 1rem;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
z-index: 1050;
|
||||||
|
min-width: 300px;
|
||||||
|
max-width: 90%;
|
||||||
|
text-align: center;
|
||||||
|
backdrop-filter: blur(5px);
|
||||||
border: none;
|
border: none;
|
||||||
|
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
||||||
|
}
|
||||||
|
|
||||||
|
.alert-info {
|
||||||
|
background-color: rgba(255,255,255,0.9);
|
||||||
|
color: var(--secondary-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.alert-danger {
|
.alert-danger {
|
||||||
background-color: var(--primary-color);
|
background-color: var(--primary-color);
|
||||||
color: white;
|
color: white;
|
||||||
border: none;
|
}
|
||||||
|
|
||||||
|
.alert-success {
|
||||||
|
background-color: rgba(40, 167, 69, 0.9);
|
||||||
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Animações para feedback */
|
/* Animações para feedback */
|
||||||
@@ -142,6 +166,10 @@ body {
|
|||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.navbar-logo {
|
||||||
|
height: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
}
|
}
|
||||||
@@ -149,6 +177,12 @@ body {
|
|||||||
.card {
|
.card {
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.alert {
|
||||||
|
margin: 1rem;
|
||||||
|
width: calc(100% - 2rem);
|
||||||
|
max-width: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropdown-menu {
|
.dropdown-menu {
|
||||||
|
|||||||
@@ -3,13 +3,13 @@
|
|||||||
{% block title %}Login{% endblock %}
|
{% block title %}Login{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="row justify-content-center align-items-center min-vh-100">
|
<div class="row justify-content-center align-items-center min-vh-100 m-0">
|
||||||
<div class="col-md-6 col-lg-4">
|
<div class="col-md-6 col-lg-4 px-3">
|
||||||
<div class="card shadow-lg animate__animated animate__fadeIn">
|
<div class="card shadow-lg animate__animated animate__fadeIn">
|
||||||
<div class="card-body p-5">
|
<div class="card-body p-4 p-sm-5">
|
||||||
<div class="text-center mb-4">
|
<div class="text-center mb-4">
|
||||||
<img src="{{ url_for('static', filename='img/logo002-alpha.png') }}" alt="Logo OCI" class="mb-3 login-logo">
|
<img src="{{ url_for('static', filename='img/logo002-alpha.png') }}" alt="Logo OCI" class="login-logo">
|
||||||
<h2 class="card-title mb-4">Controles OCI</h2>
|
<h2 class="card-title mb-4 text-light">Controles OCI</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||||
@@ -23,44 +23,56 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
|
|
||||||
<form method="POST" action="{{ url_for('login') }}">
|
<form method="POST" action="{{ url_for('login') }}" class="needs-validation" novalidate>
|
||||||
<div class="mb-3">
|
<div class="form-floating mb-3">
|
||||||
<label for="email" class="form-label">Email</label>
|
<input type="email" class="form-control bg-dark text-light" id="email" name="email" placeholder="Email" required autofocus>
|
||||||
<div class="input-group">
|
<label for="email" class="text-light-50">Email</label>
|
||||||
<span class="input-group-text">
|
<div class="invalid-feedback text-light">
|
||||||
<i class="fas fa-envelope"></i>
|
Por favor, informe seu email.
|
||||||
</span>
|
|
||||||
<input type="email" class="form-control" id="email" name="email" required autofocus>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mb-4">
|
<div class="form-floating mb-4">
|
||||||
<label for="senha" class="form-label">Senha</label>
|
<input type="password" class="form-control bg-dark text-light" id="senha" name="senha" placeholder="Senha" required>
|
||||||
<div class="input-group">
|
<label for="senha" class="text-light-50">Senha</label>
|
||||||
<span class="input-group-text">
|
<div class="invalid-feedback text-light">
|
||||||
<i class="fas fa-lock"></i>
|
Por favor, informe sua senha.
|
||||||
</span>
|
|
||||||
<input type="password" class="form-control" id="senha" name="senha" required>
|
|
||||||
<button class="btn btn-outline-secondary" type="button" id="togglePassword">
|
|
||||||
<i class="fas fa-eye"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
|
<button class="btn btn-link text-light position-absolute end-0 top-50 translate-middle-y me-2" type="button" id="togglePassword">
|
||||||
|
<i class="fas fa-eye"></i>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="d-grid">
|
<div class="d-grid">
|
||||||
<button type="submit" class="btn btn-primary">
|
<button type="submit" class="btn btn-danger btn-lg">
|
||||||
<i class="fas fa-sign-in-alt me-2"></i>Entrar
|
<i class="fas fa-sign-in-alt me-2"></i>Entrar
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="text-center mt-4">
|
||||||
|
<small class="text-light">
|
||||||
|
Precisa de ajuda? Entre em contato com o administrador.
|
||||||
|
</small>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% block extra_js %}
|
{% block extra_js %}
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
// Form validation
|
||||||
|
const form = document.querySelector('form');
|
||||||
|
form.addEventListener('submit', function(event) {
|
||||||
|
if (!form.checkValidity()) {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
}
|
||||||
|
form.classList.add('was-validated');
|
||||||
|
});
|
||||||
|
|
||||||
// Toggle password visibility
|
// Toggle password visibility
|
||||||
const togglePassword = document.getElementById('togglePassword');
|
const togglePassword = document.getElementById('togglePassword');
|
||||||
const password = document.getElementById('senha');
|
const password = document.getElementById('senha');
|
||||||
@@ -84,23 +96,42 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.login-logo {
|
body {
|
||||||
height: 80px;
|
background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
|
||||||
width: auto;
|
min-height: 100vh;
|
||||||
margin-bottom: 1rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-floating > .form-control:focus ~ label,
|
.card {
|
||||||
.form-floating > .form-control:not(:placeholder-shown) ~ label {
|
background-color: rgba(45, 45, 45, 0.95);
|
||||||
color: var(--primary-color);
|
border: none;
|
||||||
|
border-radius: 15px;
|
||||||
|
backdrop-filter: blur(10px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-logo {
|
||||||
|
height: 100px;
|
||||||
|
width: auto;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
filter: drop-shadow(0 0 10px rgba(255,255,255,0.1));
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-control {
|
||||||
|
border: 1px solid rgba(255,255,255,0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-control:focus {
|
.form-control:focus {
|
||||||
|
background-color: var(--secondary-dark) !important;
|
||||||
border-color: var(--primary-color);
|
border-color: var(--primary-color);
|
||||||
box-shadow: 0 0 0 0.25rem rgba(232, 0, 12, 0.25);
|
box-shadow: 0 0 0 0.25rem rgba(232, 0, 12, 0.25);
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-primary {
|
.form-floating > .form-control:focus ~ label,
|
||||||
|
.form-floating > .form-control:not(:placeholder-shown) ~ label {
|
||||||
|
color: var(--primary-light);
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-danger {
|
||||||
background: var(--primary-color);
|
background: var(--primary-color);
|
||||||
border: none;
|
border: none;
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
@@ -108,11 +139,51 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||||||
letter-spacing: 0.5px;
|
letter-spacing: 0.5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-primary:hover {
|
.btn-danger:hover {
|
||||||
background: var(--primary-light);
|
background: var(--primary-light);
|
||||||
transform: translateY(-2px);
|
transform: translateY(-2px);
|
||||||
box-shadow: 0 4px 12px rgba(232, 0, 12, 0.25);
|
box-shadow: 0 4px 12px rgba(232, 0, 12, 0.25);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Mobile adjustments */
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.card {
|
||||||
|
margin: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-body {
|
||||||
|
padding: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-logo {
|
||||||
|
height: 80px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Alert adjustments */
|
||||||
|
.alert {
|
||||||
|
position: fixed;
|
||||||
|
top: 1rem;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
z-index: 1050;
|
||||||
|
min-width: 300px;
|
||||||
|
max-width: 90%;
|
||||||
|
text-align: center;
|
||||||
|
backdrop-filter: blur(5px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.alert-info {
|
||||||
|
background-color: rgba(255,255,255,0.9);
|
||||||
|
border: none;
|
||||||
|
color: var(--secondary-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.alert-danger {
|
||||||
|
background-color: var(--primary-color);
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user