Agregar soporte para tema claro/oscuro
This commit is contained in:
9
login.php
Executable file → Normal file
9
login.php
Executable file → Normal file
@@ -27,6 +27,7 @@ if (isset($_SESSION['user_id'])) {
|
||||
}
|
||||
|
||||
$error = '';
|
||||
$theme = $_COOKIE['theme'] ?? 'light';
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$username = $_POST['username'] ?? '';
|
||||
@@ -43,7 +44,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="es">
|
||||
<html lang="es" data-bs-theme="<?= $theme ?>">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
@@ -58,8 +59,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
[data-bs-theme="dark"] body {
|
||||
background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
|
||||
}
|
||||
.login-card {
|
||||
background: white;
|
||||
background: var(--bs-body-bg);
|
||||
border-radius: 15px;
|
||||
box-shadow: 0 10px 40px rgba(0,0,0,0.3);
|
||||
overflow: hidden;
|
||||
@@ -107,5 +111,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user