SPA Architecture
The website uses a modern SPA approach where:- Single entry point (
index.html) serves all routes - Dynamic component loading using the Load Basics system
- Client-side routing with clean URL management
- Progressive enhancement for optimal user experience
Key Architectural Decisions
No Framework
Pure vanilla JavaScript for zero bundle overhead and maximum control
Component-Based
Modular architecture with reusable, isolated components
Variable-Driven CSS
Design system using CSS custom properties instead of utility classes
Dynamic Loading
Smart component loading system that adjusts paths automatically
Directory Structure
The project follows a clear directory structure that separates concerns:Routing System
The website implements clean URLs using the Clean URLs utility (assets/scripts/clean-urls.js):
Clean URL Features
- Hash-free URLs: Intercepts hash links and maintains clean URLs
- Smooth scrolling: Preserves smooth scroll behavior without URL pollution
- Accessibility: Proper focus management for screen readers
- iOS compatible: Works seamlessly on Safari and mobile browsers
Component Loading Strategy
The Load Basics system (shared/components/load-basics/load-basics.js) provides intelligent component loading:
Load Basics Implementation
load-basics.js
State Management
The application uses a lightweight, event-driven state management approach:- No central store: Each component manages its own state
- Custom events: Components communicate via
CustomEventAPI - DOM as state: Leverages data attributes and CSS classes for state
- Global namespace: Carefully scoped global functions for cross-component access
Example: Navigation State
navigation-system.js
Performance Optimizations
GPU Acceleration
GPU Acceleration
Critical interactive elements use
transform: translateZ(0) to enable GPU acceleration:Lazy Loading
Lazy Loading
Components load on-demand rather than upfront, reducing initial bundle size.
CSS Variable Engine
CSS Variable Engine
Inline CSS variables reduce class bloat and enable dynamic styling without JavaScript.
Event Delegation
Event Delegation
Single event listeners on parent elements handle multiple child interactions efficiently.
Browser Compatibility
The architecture supports:- Modern browsers: Chrome, Firefox, Safari, Edge (latest versions)
- iOS Safari: Full compatibility with iOS-specific scroll behaviors
- Progressive enhancement: Core functionality works without JavaScript
- Reduced motion: Respects
prefers-reduced-motionfor accessibility
Next Steps
Design System
Learn about the variable-driven CSS design system
Components
Explore the component architecture and organization

