Skip to content

Commit

Permalink
smaller embeds for tracks | yandex music
Browse files Browse the repository at this point in the history
  • Loading branch information
MZhuvka authored and yellowsink committed Nov 28, 2024
1 parent c6150e0 commit 147f78a
Showing 1 changed file with 36 additions and 16 deletions.
52 changes: 36 additions & 16 deletions plugins/more-embeds/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,43 @@ const iframeFromYandexMusicUrl = (path: string) =>
(
<iframe
allow="clipboard-write"
style={`border: none; width: 100%; max-width: 600px; height: ${
path.includes("album") || path.includes("artist") ? 450 : 210
style={`border: none; width: ${
(path.includes("album") && !path.includes("track")) ||
path.includes("artist")
? 100
: 33
}%; max-width: 600px; height: ${
(path.includes("album") && !path.includes("track")) ||
path.includes("artist")
? 450
: 180
}px;`}
width="100%"
height="210"
src={path.replace(
path.includes("/album")
? "/album/"
: path.includes("/artist")
? "/artist/"
: "/track/",
path.includes("/album")
? "/iframe/album/"
: path.includes("/artist")
? "/iframe/artist/"
: "/iframe/track/",
)}
width={`"${
(path.includes("album") && !path.includes("track")) ||
path.includes("artist")
? 100
: 33
}%"`}
height={`"${
(path.includes("album") && !path.includes("track")) ||
path.includes("artist")
? 450
: 180
}"`}
src={
path.replace(
path.includes("/album")
? "/album/"
: path.includes("/artist")
? "/artist/"
: "/track/",
path.includes("/album")
? "/iframe/album/"
: path.includes("/artist")
? "/iframe/artist/"
: "/iframe/track/",
) + "?lang=en"
}
/>
) as HTMLIFrameElement;

Expand Down

0 comments on commit 147f78a

Please sign in to comment.