-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
79 lines (67 loc) · 2.14 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Embed The Fed</title>
<link rel="stylesheet" href="https://unpkg.com/mvp.css">
<style>
details {
border: 1px solid black;
padding: 1rem;
}
fed-embed:where(:defined):where(:not(.styled)) {
padding: 0 1rem;
margin-top: 1rem;
background: rgba(0,0,0,0.05);
}
</style>
</head>
<body>
<main>
<h1>Embed The Fed</h1>
<p>All it takes is a single javascript file & one new element in your markup to embed any fediverse feed you want!</p>
<code><script src="https://cdn.jsdelivr.net/gh/andy-blum/fed-embed/dist/fed-embed.min.js"><script></code>
<hr>
<h2>Get all posts by a user</h2>
<code><fed-embed data-user="https://mastodon.social/@mastodon"></fed-embed></code>
<details>
<summary>Demo</summary>
<fed-embed data-user="https://mastodon.social/@mastodon"></fed-embed>
</details>
<hr>
<h2>Get a single post</h2>
<code><fed-embed data-post="https://mastodon.social/@Mastodon/5258563"></fed-embed></code>
<details>
<summary>Demo</summary>
<fed-embed data-post="https://mastodon.social/@Mastodon/5258563"></fed-embed>
</details>
<hr>
<h2>Style it however you want</h2>
<code style="white-space:break-spaces;">
fed-embed.styled {
border: 10px dashed orange;
background: darkviolet;
color: white;
text-transform: uppercase;
font-weight: bolder;
}
<fed-embed class="styled" data-post="https://mastodon.social/@Mastodon/5258563"></fed-embed>
</code>
<details>
<summary>Demo</summary>
<style>
fed-embed.styled {
border: 10px dashed orange;
background: darkviolet;
color: white;
text-transform: uppercase;
font-weight: bolder;
}
</style>
<fed-embed class="styled" data-post="https://mastodon.social/@Mastodon/5258563"></fed-embed>
</details>
</main>
<script src="./dist/fed-embed.min.js"></script>
</body>
</html>