feat: personal engineering portfolio with routing, theme toggle, and responsive design

- React + TypeScript + Vite + React Router v6
- Dark/light/system theme toggle (fixed cycle from 'system' state)
- Multi-page SPA: Home, About, Experience, Projects, Engineering, Contact
- Responsive layout with mobile menu
- Data-driven sections (profile, skills, experience, projects)
- CSS Modules-compatible with CSS variables for theming
- Accessibility: skip-link, ARIA labels, keyboard navigation
This commit is contained in:
dong.nguyen committed 2026-10-06 11:42:11 +07:00
1 parent 0273f555de
commit 7e42bd8017
38 files changed
+2921 -358

No files matched your search

+234 -82
View File
@@ -1,111 +1,263 @@
/* Theme variables — Dark mode (default) */
:root {
--text: #6b6375;
--text-h: #08060d;
--bg: #fff;
--border: #e5e4e7;
--code-bg: #f4f3ec;
--accent: #aa3bff;
--accent-bg: rgba(170, 59, 255, 0.1);
--accent-border: rgba(170, 59, 255, 0.5);
--social-bg: rgba(244, 243, 236, 0.5);
--shadow:
rgba(0, 0, 0, 0.1) 0 10px 15px -3px, rgba(0, 0, 0, 0.05) 0 4px 6px -2px;
--bg-primary: #0a0a0a;
--bg-surface: #141414;
--bg-elevated: #1a1a1a;
--text-primary: #f0f0f0;
--text-secondary: #a0a0a0;
--text-muted: #666666;
--accent: #60a5fa;
--accent-hover: #93c5fd;
--accent-active: #3b82f6;
--border: #2a2a2a;
--shadow: rgba(0, 0, 0, 0.3);
--code-bg: #1a1a2e;
--success: #34d399;
--error: #f87171;
--sans: system-ui, 'Segoe UI', Roboto, sans-serif;
--heading: system-ui, 'Segoe UI', Roboto, sans-serif;
--mono: ui-monospace, Consolas, monospace;
--sans: 'Inter', system-ui, -apple-system, sans-serif;
--mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
font: 18px/145% var(--sans);
letter-spacing: 0.18px;
color-scheme: light dark;
color: var(--text);
background: var(--bg);
--max-wide: 1200px;
--max-content: 800px;
--max-narrow: 600px;
--radius-sm: 4px;
--radius-md: 6px;
--radius-lg: 8px;
--transition-fast: 150ms ease;
--transition-normal: 200ms ease;
--transition-slow: 300ms ease;
font-size: 16px;
line-height: 1.6;
color: var(--text-primary);
background: var(--bg-primary);
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
@media (max-width: 1024px) {
font-size: 16px;
}
}
/* Light mode */
:root[data-theme='light'] {
--bg-primary: #ffffff;
--bg-surface: #f5f5f5;
--bg-elevated: #ffffff;
--text-primary: #0a0a0a;
--text-secondary: #404040;
--text-muted: #808080;
--accent: #2563eb;
--accent-hover: #3b82f6;
--accent-active: #1d4ed8;
--border: #e0e0e0;
--shadow: rgba(0, 0, 0, 0.1);
--code-bg: #f0f0ff;
--success: #059669;
--error: #dc2626;
}
/* System theme */
@media (prefers-color-scheme: dark) {
:root {
--text: #9ca3af;
--text-h: #f3f4f6;
--bg: #16171d;
--border: #2e303a;
--code-bg: #1f2028;
--accent: #c084fc;
--accent-bg: rgba(192, 132, 252, 0.15);
--accent-border: rgba(192, 132, 252, 0.5);
--social-bg: rgba(47, 48, 58, 0.5);
--shadow:
rgba(0, 0, 0, 0.4) 0 10px 15px -3px, rgba(0, 0, 0, 0.25) 0 4px 6px -2px;
}
#social .button-icon {
filter: invert(1) brightness(2);
:root:not([data-theme='light']) {
--bg-primary: #0a0a0a;
--bg-surface: #141414;
--bg-elevated: #1a1a1a;
--text-primary: #f0f0f0;
--text-secondary: #a0a0a0;
--text-muted: #666666;
--accent: #60a5fa;
--accent-hover: #93c5fd;
--accent-active: #3b82f6;
--border: #2a2a2a;
--shadow: rgba(0, 0, 0, 0.3);
--code-bg: #1a1a2e;
--success: #34d399;
--error: #f87171;
}
}
#root {
width: 1126px;
max-width: 100%;
margin: 0 auto;
text-align: center;
border-inline: 1px solid var(--border);
min-height: 100svh;
display: flex;
flex-direction: column;
@media (prefers-color-scheme: light) {
:root:not([data-theme='dark']) {
--bg-primary: #ffffff;
--bg-surface: #f5f5f5;
--bg-elevated: #ffffff;
--text-primary: #0a0a0a;
--text-secondary: #404040;
--text-muted: #808080;
--accent: #2563eb;
--accent-hover: #3b82f6;
--accent-active: #1d4ed8;
--border: #e0e0e0;
--shadow: rgba(0, 0, 0, 0.1);
--code-bg: #f0f0ff;
--success: #059669;
--error: #dc2626;
}
}
/* Reset */
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
html {
scroll-behavior: smooth;
}
body {
margin: 0;
font-family: var(--sans);
min-height: 100vh;
overflow-x: hidden;
}
h1,
h2 {
font-family: var(--heading);
font-weight: 500;
color: var(--text-h);
#root {
min-height: 100vh;
display: flex;
flex-direction: column;
}
/* Typography */
h1, h2, h3, h4, h5, h6 {
color: var(--text-primary);
font-weight: 600;
line-height: 1.2;
}
h1 {
font-size: 56px;
letter-spacing: -1.68px;
margin: 32px 0;
@media (max-width: 1024px) {
font-size: 36px;
margin: 20px 0;
}
}
h2 {
font-size: 24px;
line-height: 118%;
letter-spacing: -0.24px;
margin: 0 0 8px;
@media (max-width: 1024px) {
font-size: 20px;
}
}
p {
margin: 0;
font-size: clamp(32px, 5vw, 64px);
letter-spacing: -0.02em;
}
code,
.counter {
font-family: var(--mono);
display: inline-flex;
border-radius: 4px;
color: var(--text-h);
h2 {
font-size: clamp(24px, 4vw, 40px);
letter-spacing: -0.01em;
}
h3 {
font-size: 24px;
}
p {
color: var(--text-secondary);
line-height: 1.7;
}
a {
color: var(--accent);
text-decoration: none;
transition: color var(--transition-fast);
}
a:hover {
color: var(--accent-hover);
}
a:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
border-radius: 2px;
}
code {
font-size: 15px;
line-height: 135%;
padding: 4px 8px;
font-family: var(--mono);
font-size: 0.9em;
background: var(--code-bg);
padding: 2px 6px;
border-radius: var(--radius-sm);
}
pre {
font-family: var(--mono);
font-size: 14px;
background: var(--code-bg);
padding: 16px;
border-radius: var(--radius-md);
border: 1px solid var(--border);
overflow-x: auto;
line-height: 1.5;
}
pre code {
background: none;
padding: 0;
}
/* Utilities */
.container-wide {
max-width: var(--max-wide);
margin: 0 auto;
padding: 0 24px;
}
.container-content {
max-width: var(--max-content);
margin: 0 auto;
padding: 0 24px;
}
.container-narrow {
max-width: var(--max-narrow);
margin: 0 auto;
padding: 0 24px;
}
.section {
padding: 80px 0;
}
@media (max-width: 768px) {
.section {
padding: 48px 0;
}
}
/* Scroll reveal animation */
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.animate-in {
animation: fadeInUp var(--transition-slow) ease forwards;
}
/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
}
/* Skip link */
.skip-link {
position: absolute;
top: -100%;
left: 16px;
padding: 8px 16px;
background: var(--accent);
color: white;
border-radius: var(--radius-md);
z-index: 10000;
font-weight: 500;
}
.skip-link:focus {
top: 16px;
}