Skip to content

Commit a1a3e0f

Browse files
committed
feat: ✨ add toot component
1 parent b080462 commit a1a3e0f

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

src/lib/components/toot.svelte

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<script lang="ts">
2+
export let instance: string = ''
3+
export let username: string = ''
4+
export let tootId: string = ''
5+
</script>
6+
7+
<svelte:head>
8+
<script
9+
async
10+
src="https://mas.to/embed.js"
11+
charset="utf-8"
12+
></script>
13+
</svelte:head>
14+
15+
<div class="flex justify-center mb-12">
16+
<iframe
17+
title=""
18+
src={`https://${instance}/${
19+
username.slice(0, 1) === `@` ? username : `@` + username
20+
}/${tootId}/embed`}
21+
class="mastodon-embed"
22+
style="max-width: 100%; border: 0"
23+
width="400"
24+
allowfullscreen
25+
/>
26+
</div>

src/lib/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export { default as SimpleCast } from './components/simple-cast.svelte'
88
export { default as SoundCloud } from './components/sound-cloud.svelte'
99
export { default as Spotify } from './components/spotify.svelte'
1010
export { default as StackBlitz } from './components/stackblitz.svelte'
11+
export { default as Toot } from './components/toot.svelte'
1112
export { default as Tweet } from './components/tweet.svelte'
1213
export { default as Vimeo } from './components/vimeo.svelte'
1314
export { default as YouTube } from './components/you-tube.svelte'

0 commit comments

Comments
 (0)