feat(notes): liens internes, onglet Réseau, living blocks et consentement IA
Rend les liens entre notes visibles et persistants (sync NoteLink au save, auto-save, graphe réseau rafraîchi), ajoute living blocks, Memory Echo, recherche globale, consentement IA explicite et consolide les prototypes design en architectural-grid. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
42
memento-note/public/scripts/theme-init.js
Normal file
42
memento-note/public/scripts/theme-init.js
Normal file
@@ -0,0 +1,42 @@
|
||||
(function () {
|
||||
try {
|
||||
var root = document.documentElement;
|
||||
var fallback = root.getAttribute('data-server-theme') || 'light';
|
||||
var defaultAccent = root.getAttribute('data-server-accent') || '#A47148';
|
||||
var stored = localStorage.getItem('theme-preference');
|
||||
var raw = stored || fallback;
|
||||
if (raw === 'slate') raw = 'light';
|
||||
var allowed = {
|
||||
light: 1,
|
||||
dark: 1,
|
||||
auto: 1,
|
||||
sepia: 1,
|
||||
midnight: 1,
|
||||
rose: 1,
|
||||
green: 1,
|
||||
lavender: 1,
|
||||
sand: 1,
|
||||
ocean: 1,
|
||||
sunset: 1,
|
||||
blue: 1,
|
||||
};
|
||||
var theme = allowed[raw] ? raw : 'light';
|
||||
root.classList.remove('dark');
|
||||
root.removeAttribute('data-theme');
|
||||
if (theme === 'auto') {
|
||||
if (window.matchMedia('(prefers-color-scheme: dark)').matches) root.classList.add('dark');
|
||||
} else if (theme === 'dark') {
|
||||
root.classList.add('dark');
|
||||
} else if (theme === 'light') {
|
||||
/* :root papier */
|
||||
} else {
|
||||
root.setAttribute('data-theme', theme);
|
||||
if (theme === 'midnight') root.classList.add('dark');
|
||||
}
|
||||
var accentStored = localStorage.getItem('accent-color');
|
||||
var effectiveAccent = accentStored || defaultAccent;
|
||||
root.style.setProperty('--color-brand-accent', effectiveAccent);
|
||||
} catch (e) {
|
||||
console.error('Theme script error', e);
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user