diff --git a/website/src/js/channel-preview.jsc b/website/src/js/channel-preview.jsc index 728a893762..9cacb13dcb 100644 --- a/website/src/js/channel-preview.jsc +++ b/website/src/js/channel-preview.jsc @@ -114,10 +114,32 @@ const STYLE = ` font-weight: 600; cursor: pointer; text-decoration: none; - display: inline-block; + display: inline-flex; + align-items: center; + gap: 5px; font-family: inherit; } +.simplex-preview-join-btn svg { + width: 14px; + height: 14px; + flex-shrink: 0; +} + +.simplex-preview-join-btn .simplex-logo-light-bg { + display: none; +} + +.simplex-preview-container.simplex-scheme-dark .simplex-preview-join-btn .simplex-logo-dark-bg, +.dark .simplex-preview-container.simplex-scheme-site .simplex-preview-join-btn .simplex-logo-dark-bg { + display: none; +} + +.simplex-preview-container.simplex-scheme-dark .simplex-preview-join-btn .simplex-logo-light-bg, +.dark .simplex-preview-container.simplex-scheme-site .simplex-preview-join-btn .simplex-logo-light-bg { + display: inline; +} + .simplex-preview-join-btn:hover { background: var(--sp-link-hover); } @@ -685,6 +707,18 @@ function tailSvg() { return ''; } +function simplexLogoSvg() { + var darkBg = '' + + '' + + '' + + ''; + var lightBg = '' + + '' + + '' + + ''; + return darkBg + lightBg; +} + const FILE_ICON_SVG = ``; const VOICE_ICON_SVG = ``; @@ -855,7 +889,7 @@ function renderHeader(channel, channelLink, subscriberCount) { if (channelLink) { const btn = document.createElement('a'); btn.className = 'simplex-preview-join-btn'; - btn.textContent = 'Join'; + btn.innerHTML = simplexLogoSvg() + 'Join'; btn.href = channelLink; header.appendChild(btn); }