Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

PCGamer-Social/Mastodon-Activity-Embed

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mastodon-Activity-Embed

Dark Theme Screenshot

Now Support Light theme!!!

Light Theme Screenshot

Easy to display activities of your own instance.

How to Use

  • It needs Mastodon v2.1.2 or later, and Publish aggregate statistics about user activity must be enabled. (Please check administration panel.)
<div id="activity-embed">
</div>
<script>
    {
        // Config Begin.
        const domain = "YOUR-INSTANCE-DOMAIN";
        const showDomain = false;
        // Config End.
        const activityEmbed = document.getElementById("activity-embed");
        const isLight = document.querySelectorAll(`link[rel="stylesheet"]`)[1].href.match(/light/);
        let theme;
        if (isLight) {
            theme = "light";
        } else {
            theme = "dark";
        }
        const html = `<iframe src="https://pcgamer-social.github.io/Mastodon-Activity-Embed/embed.html?domain=${domain}&showDomain=${Number(showDomain)}&theme=${theme}" frameborder="0" scrolling="no"></iframe>`;
        activityEmbed.innerHTML = html;
    }
</script>
</div>
</div>
</div>

<style>
    .rich-formatting {
        line-height: 0;
        padding-right: 0;
    }

    #activity-embed iframe {
        width: 100%;
        height: 164px;
    }

    .column-fullwidth {
        grid-column: 1/3;
    }
</style>

<div class="column-fullwidth">
<div class="box-widget">
<div class="rich-formatting" style="line-height: 30px;" id="emoji-showcase">

<!-- YOUR CONTETS HERE -->

Please add this snippet to the beginning of a Custom extended information.

And set YOUR-INSTANCE-DOMAIN, and choose showDomain option.

If you set showDomain = true shows your instance domain. false is none.

Screenshot

If you want to run this on your own server, you can download to use it.

About

Easy to display activities of your own instance.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CSS 42.0%
  • JavaScript 36.7%
  • HTML 21.3%