118 lines
4.2 KiB
HTML
118 lines
4.2 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}Login{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="row justify-content-center align-items-center min-vh-100">
|
|
<div class="col-md-6 col-lg-4">
|
|
<div class="card shadow-lg animate__animated animate__fadeIn">
|
|
<div class="card-body p-5">
|
|
<div class="text-center mb-4">
|
|
<img src="{{ url_for('static', filename='img/logo002-alpha.png') }}" alt="Logo OCI" class="mb-3 login-logo">
|
|
<h2 class="card-title mb-4">Controles OCI</h2>
|
|
</div>
|
|
|
|
{% 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 %}
|
|
|
|
<form method="POST" action="{{ url_for('login') }}">
|
|
<div class="mb-3">
|
|
<label for="email" class="form-label">Email</label>
|
|
<div class="input-group">
|
|
<span class="input-group-text">
|
|
<i class="fas fa-envelope"></i>
|
|
</span>
|
|
<input type="email" class="form-control" id="email" name="email" required autofocus>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mb-4">
|
|
<label for="senha" class="form-label">Senha</label>
|
|
<div class="input-group">
|
|
<span class="input-group-text">
|
|
<i class="fas fa-lock"></i>
|
|
</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>
|
|
|
|
<div class="d-grid">
|
|
<button type="submit" class="btn btn-primary">
|
|
<i class="fas fa-sign-in-alt me-2"></i>Entrar
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{% block extra_js %}
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
// Toggle password visibility
|
|
const togglePassword = document.getElementById('togglePassword');
|
|
const password = document.getElementById('senha');
|
|
|
|
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>
|
|
.login-logo {
|
|
height: 80px;
|
|
width: auto;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.form-floating > .form-control:focus ~ label,
|
|
.form-floating > .form-control:not(:placeholder-shown) ~ label {
|
|
color: var(--primary-color);
|
|
}
|
|
|
|
.form-control:focus {
|
|
border-color: var(--primary-color);
|
|
box-shadow: 0 0 0 0.25rem rgba(232, 0, 12, 0.25);
|
|
}
|
|
|
|
.btn-primary {
|
|
background: var(--primary-color);
|
|
border: none;
|
|
padding: 12px;
|
|
font-weight: 500;
|
|
letter-spacing: 0.5px;
|
|
}
|
|
|
|
.btn-primary:hover {
|
|
background: var(--primary-light);
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 4px 12px rgba(232, 0, 12, 0.25);
|
|
}
|
|
</style>
|
|
{% endblock %}
|
|
{% endblock %} |