Use this file to discover all available pages before exploring further.
Hector Portfolio ships with a first-class dark/light theme system built entirely on React context and the browser’s localStorage API. No third-party theme library is required — the entire mechanism lives in src/buttons/DarkModeProvider.jsx and works transparently for every component in the tree.
DarkModeProvider is the outermost wrapper in src/routes/App.jsx. Every route — Home, Projects, Blog, and BlogPost — inherits the current theme without any extra configuration.
DarkModeContext is created with React’s createContext(). Its value is the boolean isDarkMode, which defaults to true (dark mode on) when no saved preference exists in localStorage.
To avoid prop drilling the toggle handler, DarkModeProvider renders a hidden <input type="checkbox"> with id="input" inside the wrapper div. The onChange handler calls setIsDarkMode to flip the theme.
When isDarkMode is true, DarkModeProvider renders an additional <div className="bubbles"> at the bottom of the wrapper. This element provides the animated particle effect visible in dark mode. It is removed from the DOM entirely in light mode.
useDarkMode() returns undefined if called outside the DarkModeProvider tree. Make sure the component is rendered as a child (direct or nested) of DarkModeProvider.
SettingsModal (and the alternative SettingsButton) expose Light Mode and Dark Mode buttons to the user. Both components trigger the theme change by programmatically clicking the hidden checkbox rendered by DarkModeProvider: