Bug Fixing, buttons nicht sichtbar im hellen modus, Logout zu weit rechts. Von hell auf dunkel standard
This commit is contained in:
@@ -1,22 +1,24 @@
|
|||||||
// src/components/LightDarkToggle.jsx
|
import { useEffect, useState } from 'react';
|
||||||
|
import '../css/lightDarkToggle.css';
|
||||||
|
|
||||||
function LightDarkToggle() {
|
function LightDarkToggle() {
|
||||||
const toggleTheme = () => {
|
const [darkMode, setDarkMode] = useState(() => {
|
||||||
const body = document.body;
|
return localStorage.getItem('theme') === 'light' ? false : true;
|
||||||
const currentTheme = body.classList.contains('dark') ? 'dark' : 'light';
|
});
|
||||||
|
|
||||||
if (currentTheme === 'dark') {
|
useEffect(() => {
|
||||||
body.classList.remove('dark');
|
const mode = darkMode ? 'dark' : 'light';
|
||||||
body.classList.add('light');
|
document.body.classList.remove('light', 'dark');
|
||||||
} else {
|
document.body.classList.add(mode);
|
||||||
body.classList.remove('light');
|
localStorage.setItem('theme', mode);
|
||||||
body.classList.add('dark');
|
}, [darkMode]);
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<button className="navbar-btn" onClick={toggleTheme}>
|
<button
|
||||||
🌓 Wechsel Theme
|
className="toggle-button"
|
||||||
|
onClick={() => setDarkMode(prev => !prev)}
|
||||||
|
>
|
||||||
|
{darkMode ? '🌞 Hell' : '🌙 Dunkel'}
|
||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ function LoginForm() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div className="main-content">
|
||||||
<h2>Login</h2>
|
<h2>Login</h2>
|
||||||
<input
|
<input
|
||||||
value={username}
|
value={username}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ function Md5Tool() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div className="main-content">
|
||||||
<h2>MD5 Hasher</h2>
|
<h2>MD5 Hasher</h2>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ function ToolOverview() {
|
|||||||
const role = localStorage.getItem('role');
|
const role = localStorage.getItem('role');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div className="main-content">
|
||||||
<h2>Tool-Übersicht</h2>
|
<h2>Tool-Übersicht</h2>
|
||||||
<p>Wähle ein Tool aus:</p>
|
<p>Wähle ein Tool aus:</p>
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
.main-content {
|
||||||
|
padding-top: 60px; /* Entspricht der Höhe deiner NavBar */
|
||||||
|
}
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
font-family: 'Arial', sans-serif;
|
font-family: 'Arial', sans-serif;
|
||||||
transition: background 0.3s, color 0.3s;
|
transition: background 0.3s, color 0.3s;
|
||||||
|
|||||||
@@ -1,14 +1,24 @@
|
|||||||
/* buttons.css */
|
|
||||||
button {
|
button {
|
||||||
background-color: var(--button-bg);
|
padding: 10px 20px;
|
||||||
color: white;
|
|
||||||
border: none;
|
border: none;
|
||||||
padding: 0.8rem 1.2rem;
|
border-radius: 5px;
|
||||||
border-radius: 6px;
|
margin: 5px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: background-color 0.3s ease;
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
body:not(.dark-mode) button {
|
||||||
|
background-color: #f0f0f0;
|
||||||
|
color: #333;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.dark-mode button {
|
||||||
|
background-color: #444;
|
||||||
|
color: #fff;
|
||||||
|
border: 1px solid #888;
|
||||||
}
|
}
|
||||||
|
|
||||||
button:hover {
|
button:hover {
|
||||||
background-color: var(--button-hover);
|
background-color: #ccc;
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,13 @@
|
|||||||
.navbar {
|
.navbar {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 10px 20px;
|
height: 60px;
|
||||||
|
background-color: var(--navbar-bg);
|
||||||
display: flex;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
background-color: var(--background-color);
|
padding: 0 20px; /* vorher evtl. nur 10px oder weniger */
|
||||||
z-index: 1000;
|
z-index: 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user