diff --git a/assets/desktop/icon.png b/assets/desktop/icon.png index f12d360..a338a46 100644 Binary files a/assets/desktop/icon.png and b/assets/desktop/icon.png differ diff --git a/src/native/window.ts b/src/native/window.ts index d3975c4..e848181 100644 --- a/src/native/window.ts +++ b/src/native/window.ts @@ -138,6 +138,8 @@ export function createMainWindow() { ) { event.preventDefault(); mainWindow.webContents.reload(); + } else if (input.key === "F12") { + mainWindow.webContents.toggleDevTools(); } }); @@ -241,6 +243,44 @@ function injectBranding(wc: Electron.WebContents) { }); } + function replaceSvgWithLogo(svg) { + var box = svg.getBoundingClientRect(); + if (box.height > 0 && box.height < 48) { svg.parentNode.removeChild(svg); return; } + var size = '96px'; + var wrap = document.createElement('div'); + wrap.style.cssText = 'display:flex;align-items:center;justify-content:center;width:100%;'; + var img = document.createElement('img'); + img.src = LOGO; + img.alt = 'Sanctum'; + img.style.cssText = 'width:' + size + ';height:' + size + ';object-fit:contain;flex-shrink:0;'; + img.dataset.sanctumPatched = '1'; + wrap.appendChild(img); + svg.parentNode.replaceChild(wrap, svg); + } + + function patchSVGs() { + document.querySelectorAll('svg').forEach(function(svg) { + if (svg.dataset.sanctumPatched) return; + // Match the Revolt wordmark SVG by its unique path data fingerprint + var paths = svg.querySelectorAll('path'); + for (var i = 0; i < paths.length; i++) { + var d = paths[i].getAttribute('d') || ''; + if (d.includes('M478.909') || d.includes('M5.063') || d.includes('Revolt')) { + replaceSvgWithLogo(svg); + return; + } + } + // Also catch any wide wordmark-style SVG in an auth/login container + var parent = svg.closest('[class*="logo"],[class*="Logo"],[class*="brand"],[class*="Brand"],[class*="wordmark"],[class*="Wordmark"],[class*="auth"],[class*="login"],[class*="splash"],[class*="Landing"]'); + if (parent) { + var box = svg.getBoundingClientRect(); + if (box.width > 80 && box.width / (box.height || 1) > 2) { + replaceSvgWithLogo(svg); + } + } + }); + } + function patchText(root) { var walker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT); var node; @@ -262,6 +302,7 @@ function injectBranding(wc: Electron.WebContents) { function patch(root) { patchImages(); + patchSVGs(); patchText(root || document.body); patchTitle(); }