- replace CRA scaffold with Next.js static export config - add app router pages: home, homelab, archive - add components: Nav, Footer, Hero, Skills, ProjectCard, ThemeScript - add ThemeContext for dark mode with FOUC prevention - add data layer: projects.ts, services.ts - update .gitignore for Next.js (ignore .next/, out/, next-env.d.ts) - add docs: handoff plan, homelab decisions, style reference
13 lines
498 B
TypeScript
13 lines
498 B
TypeScript
// Server component — renders a blocking inline script that sets the dark class
|
|
// on <html> before React hydrates, preventing flash of wrong theme.
|
|
export default function ThemeScript() {
|
|
const script = `
|
|
(function() {
|
|
var stored = localStorage.getItem('lerko96-dark-mode');
|
|
var dark = stored === null ? true : stored === 'true';
|
|
if (dark) document.documentElement.classList.add('dark');
|
|
})();
|
|
`;
|
|
return <script dangerouslySetInnerHTML={{ __html: script }} />;
|
|
}
|