Skip to content

Instantly share code, notes, and snippets.

@Potherca
Last active June 14, 2024 10:37
Show Gist options
  • Save Potherca/df268b3aef3a4cfe2ed9daf92083df8b to your computer and use it in GitHub Desktop.
Save Potherca/df268b3aef3a4cfe2ed9daf92083df8b to your computer and use it in GitHub Desktop.
Bookmarklet for Pinguin Radio

This gist contains JS code that can be used as a bookmarklet to change the new (awesome!) Pinguin Radio website to only display the audio player.

Before

Screenshot at 2023-03-15

After

Screenshot at 2023-03-15

javascript: document.title = document.querySelector(".stream-title").textContent;PinguinRadioObserver = new MutationObserver(function() {document.title = document.querySelector(".stream-title").textContent});PinguinRadioObserver.observe(document.querySelector(".stream-title"), {characterData: true,childList: true,subtree: true});Object.entries({".audio-player":"position:relative; top:0; left:0; width:100%; height:100%; text-align:center; max-width:none;",".container":"width:100%;",".controls":"bottom:7em; left:calc(50% - 5em);",".main-container":"display:none;",".mat-drawer":"display:none;",".pinguin-name":"font-size:80%;",".sidenav-chat":"display:none;",".sidenav-container":"background:black; margin:0; width:100%;",".stream-title":"font-size:6vw; height:100%; display:flex; align-items:center; flex-direction:column; justify-content:center; white-space:initial;margin:0; width:100%;",".stream-item img":"height:100%; width:100%; opacity:0.35;",".stream-item a":"height:100%; width:100%",}).forEach(([selector, style]) => document.querySelector(selector).style = style);
document.title = document.querySelector(".stream-title").textContent;
PinguinRadioObserver = new MutationObserver(function() {
document.title = document.querySelector(".stream-title").textContent
});
PinguinRadioObserver.observe(document.querySelector(".stream-title"), {
characterData: true,
childList: true,
subtree: true
});
Object.entries({
".audio-player":"position:relative; top:0; left:0; width:100%; height:100%; text-align:center; max-width:none;",
".container":"width:100%;",
".controls":"bottom:7em; left:calc(50% - 5em);",
".main-container":"display:none;",
".mat-drawer":"display:none;",
".pinguin-name":"font-size:80%;",
".sidenav-chat":"display:none;",
".sidenav-container":"background:black; margin:0; width:100%;",
".stream-title":"font-size:6vw; height:100%; display:flex; align-items:center; flex-direction:column; justify-content:center; white-space:initial;margin:0; width:100%;",
".stream-item img":"height:100%; width:100%; opacity:0.35;",
".stream-item a":"height:100%; width:100%",
}).forEach(([selector, style]) => document.querySelector(selector).style = style);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment