213 lines
5.6 KiB
HTML
213 lines
5.6 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}Login{% endblock %}
|
|
|
|
{% block navbar %}{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="alert-container">
|
|
{% with messages = get_flashed_messages(with_categories=true) %}
|
|
{% if messages %}
|
|
{% for category, message in messages %}
|
|
<div class="alert alert-{{ category }} alert-dismissible fade show" role="alert">
|
|
{{ message }}
|
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
|
</div>
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% endwith %}
|
|
</div>
|
|
|
|
<div class="login-container">
|
|
<div class="login-content">
|
|
<div class="login-header">
|
|
<img src="{{ url_for('static', filename='img/logo001-alpha.png') }}" alt="Logo OCI" class="login-logo">
|
|
<h4 class="login-title">Controles OCI</h4>
|
|
</div>
|
|
|
|
<form method="POST" action="{{ url_for('login') }}" class="needs-validation" novalidate>
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
|
<div class="form-floating mb-3">
|
|
<input type="text" class="form-control" id="email" name="email" placeholder="Email ou Usuário" required>
|
|
<label for="email">Email ou Usuário</label>
|
|
<div class="invalid-feedback">
|
|
Por favor, informe seu email ou nome de usuário.
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-floating mb-3 position-relative">
|
|
<input type="password" class="form-control" id="password" name="password" placeholder="Senha" required>
|
|
<label for="password">Senha</label>
|
|
<div class="invalid-feedback">
|
|
Por favor, informe sua senha.
|
|
</div>
|
|
<button class="btn btn-link text-secondary position-absolute end-0 top-50 translate-middle-y me-2" type="button" id="togglePassword">
|
|
<i class="fas fa-eye"></i>
|
|
</button>
|
|
</div>
|
|
|
|
<div class="form-floating mb-4">
|
|
<input type="text" class="form-control" id="otp" name="otp" placeholder="Código OTP" required>
|
|
<label for="otp">Código OTP</label>
|
|
<div class="invalid-feedback">
|
|
Por favor, informe o código OTP.
|
|
</div>
|
|
</div>
|
|
|
|
<div class="d-grid">
|
|
<button type="submit" class="btn btn-lg login-button">
|
|
<i class="fas fa-sign-in-alt me-2"></i>Entrar
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
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
|
|
const togglePassword = document.getElementById('togglePassword');
|
|
const password = document.getElementById('password');
|
|
|
|
togglePassword.addEventListener('click', function() {
|
|
const type = password.getAttribute('type') === 'password' ? 'text' : 'password';
|
|
password.setAttribute('type', type);
|
|
this.querySelector('i').classList.toggle('fa-eye');
|
|
this.querySelector('i').classList.toggle('fa-eye-slash');
|
|
});
|
|
|
|
// Auto-hide alerts after 5 seconds
|
|
const alerts = document.querySelectorAll('.alert');
|
|
alerts.forEach(alert => {
|
|
setTimeout(() => {
|
|
const bsAlert = new bootstrap.Alert(alert);
|
|
bsAlert.close();
|
|
}, 5000);
|
|
});
|
|
});
|
|
</script>
|
|
|
|
<style>
|
|
body {
|
|
background: var(--primary-color);
|
|
min-height: 100vh;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 1rem;
|
|
margin: 0;
|
|
}
|
|
|
|
.login-container {
|
|
width: 100%;
|
|
max-width: 800px;
|
|
margin: auto;
|
|
background: #ffffff;
|
|
border-radius: 1rem;
|
|
box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
|
|
overflow: hidden;
|
|
}
|
|
|
|
.login-content {
|
|
padding: 2rem;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
}
|
|
|
|
.login-header {
|
|
text-align: center;
|
|
margin-bottom: 2rem;
|
|
}
|
|
|
|
.login-logo {
|
|
height: 50px;
|
|
width: auto;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.login-title {
|
|
color: #343a40;
|
|
font-weight: 600;
|
|
margin: 0;
|
|
}
|
|
|
|
form {
|
|
width: 100%;
|
|
max-width: 400px;
|
|
}
|
|
|
|
.form-floating > .form-control {
|
|
border: 1px solid #dee2e6;
|
|
border-radius: 0.5rem;
|
|
}
|
|
|
|
.form-floating > .form-control:hover {
|
|
border-color: rgba(220, 53, 69, 0.3);
|
|
}
|
|
|
|
.form-floating > .form-control:focus {
|
|
border-color: rgba(220, 53, 69, 0.5);
|
|
box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.15);
|
|
}
|
|
|
|
.form-floating > label {
|
|
padding: 1rem 0.75rem;
|
|
}
|
|
|
|
.login-button {
|
|
background-color: #0d6efd;
|
|
border-color: #0d6efd;
|
|
color: white;
|
|
border-radius: 0.5rem;
|
|
padding: 0.75rem 1.5rem;
|
|
font-weight: 500;
|
|
transition: all 0.2s ease-in-out;
|
|
}
|
|
|
|
.login-button:hover,
|
|
.login-button:focus,
|
|
.login-button:active {
|
|
background-color: #0b5ed7;
|
|
border-color: #0b5ed7;
|
|
color: white;
|
|
transform: translateY(-1px);
|
|
}
|
|
|
|
@media (min-width: 768px) {
|
|
.login-container {
|
|
display: flex;
|
|
align-items: stretch;
|
|
}
|
|
|
|
.login-content {
|
|
padding: 3rem;
|
|
}
|
|
|
|
.login-logo {
|
|
height: 60px;
|
|
}
|
|
}
|
|
|
|
@media (max-width: 767px) {
|
|
.login-container {
|
|
margin: 1rem;
|
|
}
|
|
|
|
.login-content {
|
|
padding: 1.5rem;
|
|
}
|
|
}
|
|
</style>
|
|
{% endblock %}
|