🐘 Mastodon embed timeline

Light timeline

This example shows a timeline in light color:

It has been initialized with the following script:

        
  <script>
    const myTimeline01 = new MastodonTimeline({
      mtContainerId: "mt-container-01",
      defaultTheme: "light",
    });
  </script>
          
        

Dark timeline

This example shows a timeline in dark color:

It has been initialized with the following script:

        
  <script>
    const myTimeline02 = new MastodonTimeline({
      mtContainerId: "mt-container-02",
      defaultTheme: "dark",
    });
  </script>
          
        

Theme API

You can change your timeline color calling the function mtColorTheme()

          
  <button onclick="myTimeline01.mtColorTheme('dark')">
      Switch 1st timeline to dark theme
  </button>

  <button onclick="myTimeline02.mtColorTheme('light')">
      Switch 2nd timeline to light theme
  </button>