/** * MorphGuard Theme Picker Component * * A user interface for selecting and customizing themes, * with visualization of theme colors and preview functionality. */ class ThemePicker { constructor(containerSelector, options = {}) { this.container = document.querySelector(containerSelector); if (!this.container) { console.error(`Theme picker container not found: ${containerSelector}`); return; } // Default options this.options = { showColorSwatches: true, showPreview: true, allowCustomThemes: true, enableRealTimePreview: true, ...options }; // Get theme manager instance this.themeManager = window.morphGuardTheme; if (!this.themeManager) { console.error('Theme manager not found. Ensure dynamic_theme.js is loaded first.'); return; } // State this.selectedTheme = this.themeManager.currentTheme; this.customTheme = { ...this.themeManager.themes.light.variables }; this.previousTheme = null; // Initialize component this.init(); } /** * Initialize the theme picker component */ init() { // Create the component markup this.render(); // Attach event listeners this.attachEventListeners(); // Update display based on current theme this.updateDisplay(); } /** * Render the theme picker component */ render() { // Create container structure this.container.innerHTML = `
This is how content will appear with the selected theme.
Modify colors to create your own custom theme.