feat(editor): render persistent visual draft mode banner in preview mode
This commit is contained in:
@@ -6,6 +6,16 @@
|
||||
|
||||
console.log('[N&D Editor Bridge] Active on preview canvas');
|
||||
|
||||
// Optischer Hinweis-Banner im Bearbeitungsmodus
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const banner = document.createElement('div');
|
||||
banner.id = 'editor-preview-banner';
|
||||
banner.style.cssText = 'position: fixed; top: 0; left: 0; right: 0; z-index: 99999; background: #d97706; color: #0f172a; text-align: center; padding: 6px 12px; font-size: 12px; font-weight: 700; font-family: monospace; letter-spacing: 0.5px; box-shadow: 0 2px 10px rgba(0,0,0,0.3); pointer-events: none; opacity: 0.95;';
|
||||
banner.innerHTML = '🛠️ BEARBEITUNGSMODUS (VORSCHAU / ENTWURF) — Änderungen sind noch nicht live!';
|
||||
document.body.appendChild(banner);
|
||||
document.body.style.paddingTop = (document.body.style.paddingTop ? parseInt(document.body.style.paddingTop) + 30 : 30) + 'px';
|
||||
});
|
||||
|
||||
window.addEventListener('message', (event) => {
|
||||
const { type, payload } = event.data || {};
|
||||
|
||||
@@ -14,7 +24,7 @@
|
||||
const root = document.documentElement;
|
||||
if (payload.colors) {
|
||||
Object.entries(payload.colors).forEach(([key, val]) => {
|
||||
root.style.setProperty(`--${key}`, val as string);
|
||||
root.style.setProperty(`--${key}`, val);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -25,3 +35,4 @@
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user