Files
darkwave/components/header/main.tsx
AderKonstantin 5f4b2cf1d5 feat: Implement theme switcher in header
This commit introduces a theme switcher component in the header, allowing users to toggle between light and dark modes. The changes include:

- Added a new `ThemeSwitcher` component in `components/header/theme-switcher.tsx` that handles the theme switching logic and UI.
- Integrated the `ThemeSwitcher` component into the `HeaderToolbar` component.
- Updated the global CSS file (`app/globals.css`) to include styles for the light mode.
- Initialized the theme based on user's previous preference or system preference.
- Saved the user's theme preference in the browser's local storage for persistence.

These changes provide a better user experience by allowing users to switch between light and dark modes, which can improve readability and accessibility, especially in different lighting conditions.
2025-03-26 20:58:40 +03:00

41 lines
1.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import searchPic from '@/public/search.svg';
import Image from "next/image";
import Link from "next/link";
import AnimatedLink from '../animatedLink';
import HeaderToolbar from "../header/toolbar";
export default function MainHeader() {
return (
<header className="flex flex-col">
<div className="flex flex-row mt-12 mb-22">
<ul className="w-full flex flex-row justify-between items-baseline list-none">
<li className="text-4xl">
<AnimatedLink href="https://blog.aderk.tech/en">
aderk.tech
</AnimatedLink>
</li>
<li className="text-6xl flex items-center justify-center filter brightness-0 invert">
<Link href="#">
<Image
src={searchPic}
alt="search"
width={32}
height={32}
/>
</Link>
</li>
</ul>
</div>
<div className="text-2xl mb-20">
<p className="leading-10">
Hello. I am is a programmer, hacker, and gamer. Love comics, coding, read books. There I am posting articles about science and another staff, thats im like.
</p>
</div>
<HeaderToolbar />
</header>
);
}