first commit

This commit is contained in:
2026-05-22 18:44:46 -03:00
parent eaea57b7e9
commit 0fb351a3e2
40 changed files with 4746 additions and 71 deletions
+7
View File
@@ -0,0 +1,7 @@
/** Public assets in `public/` — filenames must match deployed files. */
const LOGO_LIGHT = '/logo-light.png';
const LOGO_DARK = '/logo-dark.png';
export function rivusLogoSrc(isDark: boolean): string {
return isDark ? LOGO_DARK : LOGO_LIGHT;
}
+14
View File
@@ -0,0 +1,14 @@
export type SectionId =
| 'services'
| 'adaptivework'
| 'process'
| 'whyus'
| 'contact';
export const NAV_SECTIONS: { id: SectionId; labelKey: `nav.${string}` }[] = [
{ id: 'services', labelKey: 'nav.services' },
{ id: 'adaptivework', labelKey: 'nav.adaptivework' },
{ id: 'process', labelKey: 'nav.process' },
{ id: 'whyus', labelKey: 'nav.whyus' },
{ id: 'contact', labelKey: 'nav.contact' },
];
+30
View File
@@ -0,0 +1,30 @@
export const THEME_STORAGE_KEY = 'rivus-theme';
export type StoredTheme = 'light' | 'dark';
export function getStoredTheme(): StoredTheme | null {
const raw = localStorage.getItem(THEME_STORAGE_KEY);
if (raw === 'light' || raw === 'dark') return raw;
return null;
}
export function resolveDark(stored: string | null, prefersDark: boolean): boolean {
if (stored === 'dark') return true;
if (stored === 'light') return false;
return prefersDark;
}
export function applyTheme(isDark: boolean): void {
document.documentElement.dataset.theme = isDark ? 'dark' : 'light';
}
export function readEffectiveDark(): boolean {
return document.documentElement.dataset.theme === 'dark';
}
export function toggleStoredTheme(): boolean {
const nextDark = !readEffectiveDark();
localStorage.setItem(THEME_STORAGE_KEY, nextDark ? 'dark' : 'light');
applyTheme(nextDark);
return nextDark;
}