mirror of
https://github.com/ivuorinen/everforest-resources.git
synced 2026-02-23 10:52:24 +00:00
feat: initial scaffold and generator
- Complete project structure with directories for all target platforms - Template system for CLI tools with color placeholder replacement - Working generator that processes templates for 6 theme variants - GitHub workflows for build, snapshots, commitlint, and cli-verify - Installer and verifier scripts for CLI tool deployment - Comprehensive documentation and specifications - Biome 2.x linting and formatting setup - Husky git hooks for pre-commit validation
This commit is contained in:
27
web/demo/demo.js
Normal file
27
web/demo/demo.js
Normal file
@@ -0,0 +1,27 @@
|
||||
// Everforest Demo JavaScript
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const themeControls = document.querySelectorAll('input[name="theme"]');
|
||||
const body = document.body;
|
||||
|
||||
// Theme switching functionality
|
||||
themeControls.forEach(control => {
|
||||
control.addEventListener('change', function() {
|
||||
const theme = this.value;
|
||||
|
||||
// Remove existing theme attributes
|
||||
body.removeAttribute('data-theme');
|
||||
|
||||
// Apply new theme
|
||||
if (theme !== 'auto') {
|
||||
body.setAttribute('data-theme', theme);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Initialize with auto theme
|
||||
const autoControl = document.querySelector('input[value="auto"]');
|
||||
if (autoControl) {
|
||||
autoControl.checked = true;
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user