From 95bc368ebb28318ef3baf91ace1bc7e28a74fd2c Mon Sep 17 00:00:00 2001 From: Matthias Puchstein Date: Sun, 13 Jul 2025 02:41:21 +0200 Subject: [PATCH] added dark theme support for logo text in `Overview` and `ChipOverview`, included new `logotext_dark.svg`, and implemented a theme observer; updated `ChipCard` navigation logic for correct routing Signed-off-by: Matthias Puchstein --- src/assets/logotext_dark.svg | 21 ++++++++++++++++ src/components/ChipCard.tsx | 2 +- src/pages/ChipOverview.tsx | 35 ++++++++++++++++++++++++++- src/pages/Overview.tsx | 46 ++++++++++++++++++++++++++++++++---- 4 files changed, 97 insertions(+), 7 deletions(-) create mode 100644 src/assets/logotext_dark.svg diff --git a/src/assets/logotext_dark.svg b/src/assets/logotext_dark.svg new file mode 100644 index 0000000..61204fe --- /dev/null +++ b/src/assets/logotext_dark.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + REMind + + diff --git a/src/components/ChipCard.tsx b/src/components/ChipCard.tsx index 01c4cff..acac260 100644 --- a/src/components/ChipCard.tsx +++ b/src/components/ChipCard.tsx @@ -3,7 +3,7 @@ import {NavLink} from 'react-router-dom'; export const ChipCard: React.FC = () => { return ( -
{ + // Initialize theme state + const updateThemeState = () => { + const theme = document.documentElement.getAttribute('data-theme'); + setIsDarkTheme(theme === 'dark'); + }; + + // Set initial state + updateThemeState(); + + // Create observer to watch for theme changes + const observer = new MutationObserver(mutations => { + mutations.forEach(mutation => { + if (mutation.attributeName === 'data-theme') { + updateThemeState(); + } + }); + }); + + // Start observing + observer.observe(document.documentElement, {attributes: true}); + + // Cleanup + return () => observer.disconnect(); + }, []); return (
{/* Floating Background Elements */}
@@ -36,7 +65,11 @@ export default function ChipOverview() {
- REMind Logo and Text + {isDarkTheme ? ( + REMind Logo and Text + ) : ( + REMind Logo and Text + )}

Bahnbrechende Traumtechnologie

diff --git a/src/pages/Overview.tsx b/src/pages/Overview.tsx index 27ff4d9..783764a 100644 --- a/src/pages/Overview.tsx +++ b/src/pages/Overview.tsx @@ -15,10 +15,39 @@ import { FaVrCardboard, } from 'react-icons/fa'; import {HiSparkles} from 'react-icons/hi'; -import logotext from "../assets/logotext.svg"; import {NavLink} from 'react-router-dom'; +import {useEffect, useState} from 'react'; +import logotext from '../assets/logotext.svg' +import logotext_dark from '../assets/logotext_dark.svg' export default function Overview() { + const [isDarkTheme, setIsDarkTheme] = useState(false); + + useEffect(() => { + // Initialize theme state + const updateThemeState = () => { + const theme = document.documentElement.getAttribute('data-theme'); + setIsDarkTheme(theme === 'dark'); + }; + + // Set initial state + updateThemeState(); + + // Create observer to watch for theme changes + const observer = new MutationObserver(mutations => { + mutations.forEach(mutation => { + if (mutation.attributeName === 'data-theme') { + updateThemeState(); + } + }); + }); + + // Start observing + observer.observe(document.documentElement, {attributes: true}); + + // Cleanup + return () => observer.disconnect(); + }, []); return (
{/* Floating Background Elements */}
@@ -37,7 +66,11 @@ export default function Overview() {
- REMind Logo and Text + {isDarkTheme ? ( + REMind Logo and Text + ) : ( + REMind Logo and Text + )}

Träume analysieren, Gesellschaft verstehen

@@ -55,7 +88,8 @@ export default function Overview() {

- {/* Main Features Grid - Dreamy Cards */} + {/* Main Features Grid - Dreamy Cards */ + }
{/* KI-Traumdeutung */}
- {/* Dreamy Workflow Section */} + {/* Dreamy Workflow Section */ + }
@@ -218,7 +253,8 @@ export default function Overview() {
- {/* Dreamy CTA Section */} + {/* Dreamy CTA Section */ + }