Skip to content

Commit ecdb9b9

Browse files
committed
fix: compact Spotify embeds and hide redundant caption
- Reduce Spotify embed height from 352px to 152px for compact player - Hide title and description for Spotify (already shown in player) - Fix CSS selector to use data-embed-type attribute
1 parent c4ebe71 commit ecdb9b9

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

internal/assets/css/screen.css

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,8 +1033,7 @@ body {
10331033
}
10341034

10351035
/* Spotify embed styles */
1036-
iframe[src*="spotify.com"],
1037-
iframe[src*="open.spotify.com"] {
1036+
[data-embed-type="spotify"] iframe {
10381037
max-width: 800px !important;
10391038
width: 100% !important;
10401039
height: 152px !important;
@@ -1044,8 +1043,7 @@ iframe[src*="open.spotify.com"] {
10441043
box-shadow: var(--shadow-sm);
10451044
}
10461045

1047-
.item iframe[src*="spotify.com"],
1048-
.item iframe[src*="open.spotify.com"] {
1046+
.item [data-embed-type="spotify"] iframe {
10491047
margin: var(--space-2) 0 !important;
10501048
padding: 0 !important;
10511049
}

internal/templates/views/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@
282282

283283
// Text Content - skip for GIPHY (title is redundant with the gif)
284284
previewHTML += '<div class="og-content">';
285-
if (title && provider !== "GIPHY") {
285+
if (title && provider !== "GIPHY" && provider !== "Spotify") {
286286
// Route through IRC link handler for click tracking if ircId is available
287287
var titleHref = buildIrcLinkUrl(ircId, clickSig) || escapeHtml(url);
288288
previewHTML +=
@@ -292,7 +292,7 @@
292292
escapeHtml(title) +
293293
"</a></div>";
294294
}
295-
if (description && provider !== "GIPHY") {
295+
if (description && provider !== "GIPHY" && provider !== "Spotify") {
296296
if (description.length > 300) {
297297
description = description.substring(0, 300) + "...";
298298
}
@@ -373,7 +373,7 @@
373373
iframe.srcdoc = iframeContent;
374374

375375
if (isSpotify) {
376-
iframe.style.height = '352px';
376+
iframe.style.height = '152px';
377377
container.setAttribute('data-embed-type', 'spotify');
378378
} else if (isReddit) {
379379
// Start with reasonable height, will auto-resize

0 commit comments

Comments
 (0)