feat: Sammlung mit Favoriten, Verlauf, Schemata, Export und Import
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
11
js/app.js
11
js/app.js
@@ -1,8 +1,8 @@
|
||||
import { initEingabe } from './eingabe.js';
|
||||
import { initPicker } from './picker.js';
|
||||
import { initHarmonien } from './harmonien.js';
|
||||
import { addFavorit, addColorToSchema, addToHistory, renderSammlung, exportCollection, importCollection } from './collection.js';
|
||||
|
||||
// Globaler State — aktive Farbe als { h, s, l } (HSL, 0-360, 0-100, 0-100)
|
||||
// state.color is read-only from outside — always use setColor() to update,
|
||||
// so that the colorChanged event is dispatched to all listening modules.
|
||||
export const state = {
|
||||
@@ -26,9 +26,14 @@ document.querySelectorAll('.tab-btn').forEach(btn => {
|
||||
});
|
||||
});
|
||||
|
||||
function addFavorit(hsl) { console.log('addFavorit', hsl); }
|
||||
function addColorToSchema(hsl) { console.log('addColorToSchema', hsl); }
|
||||
// Every color change goes into history
|
||||
document.addEventListener('colorChanged', (e) => addToHistory(e.detail));
|
||||
|
||||
initEingabe(addFavorit, addColorToSchema);
|
||||
initPicker(addFavorit, addColorToSchema);
|
||||
initHarmonien(addFavorit, addColorToSchema);
|
||||
|
||||
document.getElementById('sammlung-export-btn').addEventListener('click', exportCollection);
|
||||
document.getElementById('sammlung-import-btn').addEventListener('click', importCollection);
|
||||
|
||||
renderSammlung();
|
||||
|
||||
Reference in New Issue
Block a user