new css and functions
This commit is contained in:
@ -7,22 +7,21 @@
|
||||
<!-- Bootstrap CSS -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<style>
|
||||
/* ========== Tryb ciemny (dark-mode) ========== */
|
||||
body.dark-mode {
|
||||
background-color: #2b2b2b;
|
||||
background-color: #121212;
|
||||
color: #cccccc;
|
||||
}
|
||||
/* --- Nawigacja (Navbar) --- */
|
||||
body.dark-mode .navbar {
|
||||
background-color: #201f1f !important;
|
||||
background-color: #333 !important;
|
||||
color: #ffffff;
|
||||
}
|
||||
/* Nazwa aplikacji */
|
||||
body.dark-mode .navbar .navbar-brand {
|
||||
color: #ffffff !important;
|
||||
}
|
||||
body.dark-mode .navbar .navbar-brand,
|
||||
body.dark-mode .navbar .nav-link {
|
||||
color: #ffffff !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
/* Dropdown */
|
||||
/* --- Dropdown --- */
|
||||
body.dark-mode .dropdown-menu {
|
||||
background-color: #262626;
|
||||
color: #cccccc;
|
||||
@ -34,7 +33,7 @@
|
||||
body.dark-mode .dropdown-menu a:hover {
|
||||
background-color: #333333;
|
||||
}
|
||||
/* Przycisk zmiany hasła */
|
||||
/* --- Przyciski --- */
|
||||
body.dark-mode .btn-outline-light {
|
||||
color: #ffffff;
|
||||
border-color: #ffffff;
|
||||
@ -44,25 +43,19 @@
|
||||
background-color: #333333;
|
||||
border-color: #333333;
|
||||
}
|
||||
/* Stopka - poprawa czytelności tekstu */
|
||||
body.dark-mode .footer {
|
||||
background-color: #262626;
|
||||
/* Stopka */
|
||||
.dark-mode footer {
|
||||
background-color: #1e1e1e !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
body.dark-mode .footer .text-muted {
|
||||
color: #ffffff !important;
|
||||
}
|
||||
body.light-mode .navbar {
|
||||
background-color: #f8f9fa !important;
|
||||
color: #000;
|
||||
}
|
||||
body.light-mode .navbar .nav-link {
|
||||
color: #000 !important;
|
||||
}
|
||||
body.light-mode .footer {
|
||||
footer {
|
||||
background-color: #f8f9fa;
|
||||
color: #000;
|
||||
color: #212529;
|
||||
}
|
||||
/* Tabele w trybie ciemnym */
|
||||
|
||||
/* Alerty – pozostają bez zmian */
|
||||
.diff-add { color: green; }
|
||||
.diff-rem { color: red; }- Tabele --- */
|
||||
body.dark-mode table {
|
||||
background-color: #1a1a1a;
|
||||
color: #cccccc;
|
||||
@ -70,7 +63,11 @@
|
||||
body.dark-mode table thead {
|
||||
background-color: #333333;
|
||||
}
|
||||
/* Pola formularzy (globalnie oraz w tabelach) */
|
||||
body.dark-mode table td {
|
||||
background-color: #1a1a1a !important;
|
||||
color: #cccccc !important;
|
||||
}
|
||||
/* --- Elementy formularzy --- */
|
||||
body.dark-mode input,
|
||||
body.dark-mode textarea,
|
||||
body.dark-mode select,
|
||||
@ -91,7 +88,7 @@
|
||||
color: #cccccc;
|
||||
border-color: #777;
|
||||
}
|
||||
/* Vanilla‑DataTables (logi) w trybie ciemnym */
|
||||
/* --- DataTables --- */
|
||||
body.dark-mode .dataTable-wrapper input,
|
||||
body.dark-mode .dataTable-wrapper select,
|
||||
body.dark-mode .dataTable-wrapper .dataTable-info,
|
||||
@ -109,65 +106,77 @@
|
||||
background-color: #333333;
|
||||
border-color: #333333;
|
||||
}
|
||||
/* Stylizacja komórek tabeli */
|
||||
body.dark-mode table td {
|
||||
background-color: #1a1a1a !important;
|
||||
color: #cccccc !important;
|
||||
}
|
||||
/* Pola formularzy – upewniamy się, że tekst wpisywany ma jasny kolor */
|
||||
body.dark-mode input,
|
||||
body.dark-mode textarea,
|
||||
body.dark-mode select,
|
||||
body.dark-mode table input,
|
||||
body.dark-mode table textarea,
|
||||
body.dark-mode table select {
|
||||
background-color: #1a1a1a !important;
|
||||
color: #cccccc !important;
|
||||
border: 1px solid #555 !important;
|
||||
}
|
||||
body.dark-mode input:focus,
|
||||
body.dark-mode textarea:focus,
|
||||
body.dark-mode select:focus,
|
||||
body.dark-mode table input:focus,
|
||||
body.dark-mode table textarea:focus,
|
||||
body.dark-mode table select:focus {
|
||||
background-color: #1a1a1a !important;
|
||||
color: #cccccc !important;
|
||||
border-color: #777 !important;
|
||||
}
|
||||
/* Placeholder w trybie ciemnym */
|
||||
/* --- Inne elementy --- */
|
||||
body.dark-mode ::placeholder {
|
||||
color: #cccccc !important;
|
||||
opacity: 1;
|
||||
}
|
||||
/* Breadcrumb active - elementy aktywne nawigacji */
|
||||
body.dark-mode .breadcrumb-item.active {
|
||||
color: #cccccc !important;
|
||||
}
|
||||
/* Klasa .text-muted w trybie ciemnym */
|
||||
body.dark-mode .breadcrumb-item.active,
|
||||
body.dark-mode .text-muted {
|
||||
color: #cccccc !important;
|
||||
}
|
||||
/* Dostosowanie nagłówka kart typu bg-light (np. "Ostatnie zdarzenia") */
|
||||
body.dark-mode .card-header.bg-light {
|
||||
background-color: #333333 !important;
|
||||
color: #cccccc !important;
|
||||
}
|
||||
|
||||
body.dark-mode .list-group.list-group-flush .list-group-item {
|
||||
background-color: #141414 !important;
|
||||
color: #cccccc;
|
||||
border-bottom: 1px solid #333333;
|
||||
}
|
||||
|
||||
/* ========== Tryb jasny (light-mode) ========== */
|
||||
/* --- Nawigacja (Navbar) --- */
|
||||
body.light-mode .navbar {
|
||||
background-color: #ffffff !important;
|
||||
color: #333333;
|
||||
border-bottom: 1px solid #e0e0e0;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
padding: 0.5rem 1rem;
|
||||
}
|
||||
body.light-mode .navbar .nav-link {
|
||||
color: #333333 !important;
|
||||
padding: 0.5rem 1rem;
|
||||
transition: color 0.3s ease, background-color 0.3s ease;
|
||||
}
|
||||
body.light-mode .navbar .nav-link:hover {
|
||||
background-color: #f0f0f0;
|
||||
color: #007bff !important;
|
||||
border-radius: 4px;
|
||||
}
|
||||
/* --- Przyciski (dla niezalogowanych) --- */
|
||||
body.light-mode .navbar .btn {
|
||||
margin-left: 0.5rem;
|
||||
transition: background-color 0.3s ease, color 0.3s ease;
|
||||
}
|
||||
body.light-mode .navbar .btn-outline-primary:hover {
|
||||
background-color: #007bff;
|
||||
color: #ffffff;
|
||||
}
|
||||
/* --- Stopka --- */
|
||||
body.light-mode .footer {
|
||||
background-color: #ffffff;
|
||||
color: #333333;
|
||||
border-top: 1px solid #e0e0e0;
|
||||
padding: 20px 0;
|
||||
box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.05);
|
||||
text-align: center;
|
||||
}
|
||||
/* --- Responsywność --- */
|
||||
@media (max-width: 768px) {
|
||||
body.light-mode .navbar .nav-link {
|
||||
padding: 0.5rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
{% block extra_head %}{% endblock %}
|
||||
</head>
|
||||
<body class="d-flex flex-column min-vh-100">
|
||||
<nav class="navbar navbar-expand-lg">
|
||||
<div class="container-fluid">
|
||||
<a href="{{ url_for('index') }}" class="navbar-brand">RouterOS Update</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarContent" aria-controls="navbarContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarContent"
|
||||
aria-controls="navbarContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarContent">
|
||||
@ -177,7 +186,8 @@
|
||||
<a class="nav-link" href="{{ url_for('dashboard') }}">Dashboard</a>
|
||||
</li>
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="devicesDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="devicesDropdown" role="button"
|
||||
data-bs-toggle="dropdown" aria-expanded="false">
|
||||
Urządzenia
|
||||
</a>
|
||||
<ul class="dropdown-menu" aria-labelledby="devicesDropdown">
|
||||
@ -201,6 +211,7 @@
|
||||
<a class="nav-link" href="{{ url_for('settings') }}">Ustawienia</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
<ul class="navbar-nav ms-auto align-items-center">
|
||||
<li class="nav-item me-2">
|
||||
<div class="form-check form-switch">
|
||||
@ -208,14 +219,22 @@
|
||||
<label class="form-check-label" for="darkModeToggle">Tryb ciemny</label>
|
||||
</div>
|
||||
</li>
|
||||
{% if current_user.is_authenticated %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link btn btn-outline-light ms-2" href="{{ url_for('change_password') }}">Zmień hasło</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link btn btn-danger ms-2" href="{{ url_for('logout') }}">Wyloguj</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link btn btn-outline-primary ms-2" href="{{ url_for('login') }}">Zaloguj</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link btn btn-primary ms-2" href="{{ url_for('register') }}">Zarejestruj</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@ -232,32 +251,18 @@
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const darkModeToggle = document.getElementById('darkModeToggle');
|
||||
function updateTheme() {
|
||||
if (localStorage.getItem("darkMode") === "enabled") {
|
||||
document.body.classList.add("dark-mode");
|
||||
document.body.classList.remove("light-mode");
|
||||
darkModeToggle.checked = true;
|
||||
} else {
|
||||
document.body.classList.add("light-mode");
|
||||
document.body.classList.remove("dark-mode");
|
||||
darkModeToggle.checked = false;
|
||||
|
||||
function updatePrismTheme() {
|
||||
const prismLink = document.getElementById('prism-style');
|
||||
if (prismLink) {
|
||||
if (localStorage.getItem("darkMode") === "enabled") {
|
||||
prismLink.setAttribute('href', 'https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-okaidia.min.css');
|
||||
} else {
|
||||
prismLink.setAttribute('href', 'https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-coy.min.css');
|
||||
}
|
||||
}
|
||||
}
|
||||
darkModeToggle.addEventListener('change', function() {
|
||||
if (this.checked) {
|
||||
localStorage.setItem("darkMode", "enabled");
|
||||
} else {
|
||||
localStorage.setItem("darkMode", "disabled");
|
||||
}
|
||||
updateTheme();
|
||||
});
|
||||
updateTheme();
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const darkModeToggle = document.getElementById('darkModeToggle');
|
||||
function updateTheme() {
|
||||
if (localStorage.getItem("darkMode") === "enabled") {
|
||||
document.body.classList.add("dark-mode");
|
||||
@ -270,16 +275,7 @@
|
||||
}
|
||||
updatePrismTheme();
|
||||
}
|
||||
function updatePrismTheme() {
|
||||
const prismLink = document.getElementById('prism-style');
|
||||
if (prismLink) {
|
||||
if (localStorage.getItem("darkMode") === "enabled") {
|
||||
prismLink.setAttribute('href', 'https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-okaidia.min.css');
|
||||
} else {
|
||||
prismLink.setAttribute('href', 'https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-coy.min.css');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
darkModeToggle.addEventListener('change', function() {
|
||||
if (this.checked) {
|
||||
localStorage.setItem("darkMode", "enabled");
|
||||
@ -288,10 +284,10 @@
|
||||
}
|
||||
updateTheme();
|
||||
});
|
||||
|
||||
updateTheme();
|
||||
});
|
||||
</script>
|
||||
|
||||
{% block extra_scripts %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user