diff --git a/glance-system/glance-helper.yaml b/glance-system/glance-helper.yaml index f92a505..7b2e8c5 100644 --- a/glance-system/glance-helper.yaml +++ b/glance-system/glance-helper.yaml @@ -64,7 +64,7 @@ data: return False @APP.get("/notes") - def notes_widget(key: str = "", user: str = "default", accent: str = "ffffff"): + def notes_widget(key: str = "", user: str = "default", accent: str = "ffffff", bgcolor: str = ""): """Serve the notes widget HTML page for a specific user with optional theme.""" expected_key = os.environ.get("GLANCE_HELPER_KEY", "") if key != expected_key: @@ -73,6 +73,8 @@ data: safe_user = re.sub(r'[^a-zA-Z0-9_-]', '', user) or "default" # Sanitize accent color (hex only, default to white) safe_accent = re.sub(r'[^a-fA-F0-9]', '', accent)[:6] or "ffffff" + # Sanitize bgcolor (hex only, default to dark purple matching Orsi's theme) + safe_bgcolor = re.sub(r'[^a-fA-F0-9]', '', bgcolor)[:6] or "2d1f3d" current_notes = load_notes(safe_user) escaped_notes = current_notes.replace("&", "&").replace("<", "<").replace(">", ">").replace('"', """) @@ -88,16 +90,15 @@ data: --accent-20: #{safe_accent}33; --accent-40: #{safe_accent}66; --accent-60: #{safe_accent}99; + --bgcolor: #{safe_bgcolor}; }} * {{ margin: 0; padding: 0; box-sizing: border-box; }} html, body {{ - background: transparent !important; + background: var(--bgcolor); height: 100%; }} body {{ - background: transparent; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; - height: 100vh; }} .container {{ display: flex; diff --git a/glance-system/glance-orsi.yaml b/glance-system/glance-orsi.yaml index 47cb418..6a8ebd3 100644 --- a/glance-system/glance-orsi.yaml +++ b/glance-system/glance-orsi.yaml @@ -593,7 +593,7 @@ data: widgets: - type: iframe css-class: iframe-no-tint - source: https://glance-helper.dooplex.hu/notes?key=oplQqnLnJK2vErRVYJpvVUcSDBOSbCHZSbsYY2bwSifgTMfT&user=orsi&accent=e292ff + source: source: https://glance-helper.dooplex.hu/notes?key=oplQqnLnJK2vErRVYJpvVUcSDBOSbCHZSbsYY2bwSifgTMfT&user=orsi&accent=e292ff&bgcolor=2d1f3d height: 250 title: Quick Notes - type: bookmarks