This project visualizes component connections and pin mappings with a beautiful, interactive interface. The dark mode feature provides users with a comfortable viewing experience in low-light environments.
- Toggle Switch: Intuitive UI toggle in the header for switching between light and dark themes
- Persistent Preference: User's theme choice is saved in localStorage and restored on page reload
- Smooth Transitions: All theme changes animate smoothly with CSS transitions
- Comprehensive Theming: All UI elements adapt to the selected theme using CSS variables
.
├── index.html # Main HTML structure with theme toggle UI
├── styles.css # Complete CSS with light/dark theme variables
├── app.js # Connection visualization logic
├── dark-mode.js # Dark mode toggle functionality
└── README.md # This file
The application uses CSS custom properties (variables) to manage theme colors:
Light Mode Colors:
- Background gradients: Purple/blue tones (#667eea, #764ba2)
- Card backgrounds: White
- Text: Dark gray (#333, #666)
Dark Mode Colors:
- Background gradients: Dark navy tones (#1a1a2e, #16213e)
- Card backgrounds: Deep blue (#0f3460)
- Text: Light gray (#e8e8e8, #b0b0b0)
The dark mode toggle:
- Checks localStorage for saved theme preference on page load
- Applies the saved theme immediately
- Listens for toggle switch clicks
- Updates the HTML
data-themeattribute - Saves the new preference to localStorage
- Updates toggle UI (icon and text)
- Click the theme toggle switch in the top-right corner
- The interface will smoothly transition between light and dark modes
- Your preference is automatically saved and will be remembered on your next visit
Adding New Themed Elements:
.your-element {
background: var(--card-bg);
color: var(--text-primary);
}Modifying Theme Colors:
Edit the CSS variables in styles.css:
:root {
--card-bg: white; /* Light mode */
}
[data-theme="dark"] {
--card-bg: #0f3460; /* Dark mode */
}- Modern browsers with CSS custom properties support
- localStorage support required for preference persistence
- Fallback to light mode if localStorage is unavailable
- Toggle switch changes visual state when clicked
- Theme changes apply to all UI elements
- Theme preference persists after page reload
- Smooth transitions between themes
- Responsive design works in both themes
- Toggle UI updates correctly (icon and text)
- Chrome/Edge (Chromium)
- Firefox
- Safari
- Mobile browsers
- High contrast ratios maintained in both themes
- User preference respected and persisted
- Smooth transitions avoid jarring changes
- Toggle is keyboard accessible
- System theme detection (prefers-color-scheme)
- Additional theme options (e.g., high contrast, custom colors)
- Theme scheduling (auto-switch based on time)
- Export/import theme preferences
Developed by the Frontend Developer Agent for feature DM-001 Branch: feature-dm-001