How to customize your Transistor.fm Website with JS and CSS

The default Transistor.fm website is kinda ugly.

Here’s mine: https://swyx.transistor.fm/

Here’s how to customize your Transistor.fm website if you use Transistor. But also it’s a simple guide to do clientside customizations of almost any websit…


This content originally appeared on DEV Community and was authored by swyx

The default Transistor.fm website is kinda ugly.

Image description

Here's mine: https://swyx.transistor.fm/

Image description

Here's how to customize your Transistor.fm website if you use Transistor. But also it's a simple guide to do clientside customizations of almost any website whose code you don't control.

How To Video (3mins)

Code

Head HTML:

<script>
window.onload = function () {
  let el;
  if (document.location.pathname === "/episodes") {
    el = document.createElement("div");
    document
      .getElementsByClassName("site-content")[0]
      .parentNode.insertBefore(
        el,
        document.getElementsByClassName("site-content")[0]
      );
  } else {
    // assuming index page
    el = document.getElementsByClassName("site-first-episode")[0];
  }

  el.innerHTML = `
<iframe title="swyx mixtape embed" width="100%" height="390" frameborder="no" scrolling="no" seamless src="https://share.transistor.fm/e/learn-in-podcast/playlist/dark"></iframe>
`;
  el.id = "swyxembed";
};
function makeLive() {
  if (!document.getElementById("swyxembed")) window.onload();
  setTimeout(makeLive, 200);
}
setTimeout(makeLive, 200);
</script>

CSS:

.site-intro {
     font-size: 1.25rem;
     width: 60ch;
     margin: 0 auto;
}
 .site-credits {
     position: fixed;
     width: 100vw;
     bottom: 0;
}
 #site-footer {
     display: hidden 
}
 #swyxembed {
     padding: 2rem;
}
 .site-featured-episodes .site-episode {
     display: block;
}
 .site-episode {
     display: grid;
     grid-template-areas: "date title" "date desc";
     grid-template-rows: minmax(1rem, auto) 1fr;
     grid-template-columns: 10ch 1fr;
     grid-column-gap: 1rem;
     margin-bottom: 1rem;
}
 .site-episode time {
     grid-area: date 
}
 .site-episode time span {
     text-transform: none 
}
 .site-episode h2 {
     grid-area: title;
     font-size: 1.5rem 
}
 .site-episode .site-episode-summary {
     grid-area: desc 
}
 .site-episode nav {
     display: none;
}


This content originally appeared on DEV Community and was authored by swyx


Print Share Comment Cite Upload Translate Updates
APA

swyx | Sciencx (2021-12-03T07:58:15+00:00) How to customize your Transistor.fm Website with JS and CSS. Retrieved from https://www.scien.cx/2021/12/03/how-to-customize-your-transistor-fm-website-with-js-and-css/

MLA
" » How to customize your Transistor.fm Website with JS and CSS." swyx | Sciencx - Friday December 3, 2021, https://www.scien.cx/2021/12/03/how-to-customize-your-transistor-fm-website-with-js-and-css/
HARVARD
swyx | Sciencx Friday December 3, 2021 » How to customize your Transistor.fm Website with JS and CSS., viewed ,<https://www.scien.cx/2021/12/03/how-to-customize-your-transistor-fm-website-with-js-and-css/>
VANCOUVER
swyx | Sciencx - » How to customize your Transistor.fm Website with JS and CSS. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/12/03/how-to-customize-your-transistor-fm-website-with-js-and-css/
CHICAGO
" » How to customize your Transistor.fm Website with JS and CSS." swyx | Sciencx - Accessed . https://www.scien.cx/2021/12/03/how-to-customize-your-transistor-fm-website-with-js-and-css/
IEEE
" » How to customize your Transistor.fm Website with JS and CSS." swyx | Sciencx [Online]. Available: https://www.scien.cx/2021/12/03/how-to-customize-your-transistor-fm-website-with-js-and-css/. [Accessed: ]
rf:citation
» How to customize your Transistor.fm Website with JS and CSS | swyx | Sciencx | https://www.scien.cx/2021/12/03/how-to-customize-your-transistor-fm-website-with-js-and-css/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.