Skip to content

Commit 1b690ee

Browse files
authored
Add button for Bluesky (#134)
2 parents ca0527e + 34e6ac0 commit 1b690ee

File tree

7 files changed

+27
-13
lines changed

7 files changed

+27
-13
lines changed

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
> Lightweight, stylish, and ethical share buttons
66
7-
- **Small.** Dependency-free. CSS+JS bundle is under 7.5 kB minified and brotlied.
7+
- **Small.** Dependency-free. CSS+JS bundle is 7.5 kB minified and brotlied.
88
- **Stylish.** Uses official vector logos and colours with no visual mess.
99
- **Ethical.** Embeds no tracking code. JS is required only for the setup.
1010

11-
<a href="https://shareon.js.org/"><img src="./assets/[email protected]" height="126" width="333" alt="Shareon demo screenshot"></a>
11+
<a href="https://shareon.js.org/"><img src="./assets/[email protected]" height="126" width="438" alt="Demo screenshot of all buttons Shareon supports"></a>
1212

1313
See the live demo at [shareon.js.org](https://shareon.js.org)
1414

@@ -93,6 +93,7 @@ names of which match the names of the social networks (or `copy-url`, for the
9393

9494
```html
9595
<div class="shareon">
96+
<a class="bluesky"></a>
9697
<a class="facebook"></a>
9798
<a class="fediverse"></a>
9899
<a class="linkedin"></a>
@@ -145,7 +146,7 @@ Apart from the URL and title, some networks support extra parameters:
145146
instance
146147
- add `data-media` to an Odnoklassniki, Pinterest, or VK button to customize
147148
the pinned picture
148-
- add `data-text` to a Mastodon, Telegram, Tumblr, Viber, or WhatsApp button to add
149+
- add `data-text` to a Bluesky, Mastodon, Telegram, Tumblr, Viber, or WhatsApp button to add
149150
custom message text
150151
- add `data-via` to a Mastodon, Tumblr, or Twitter button to mention a user
151152
- add `data-hashtags` to a Facebook, Tumblr, or Twitter button to include hashtags in the shared post.

assets/[email protected]

6.63 KB
Loading

index.html

+11-5
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ <h1>Shareon Demo Page</h1>
2929
<section>
3030
<h2><code>&lt;a&gt;</code></h2>
3131
<div class="shareon">
32+
<a class="bluesky"></a>
3233
<a class="facebook"></a>
3334
<a class="fediverse"></a>
3435
<a class="hackernews"></a>
@@ -55,6 +56,7 @@ <h2><code>&lt;a&gt;</code></h2>
5556
<section>
5657
<h2><code>&lt;button&gt;</code></h2>
5758
<div class="shareon">
59+
<button class="bluesky"></button>
5860
<button class="facebook"></button>
5961
<button class="fediverse"></button>
6062
<button class="hackernews"></button>
@@ -86,6 +88,7 @@ <h2><code>&lt;a&gt;</code> with custom params</h2>
8688
data-url="https://demo.shareon.js.org"
8789
data-text="hey check this out"
8890
>
91+
<a class="bluesky"></a>
8992
<a class="facebook"></a>
9093
<a class="fediverse" data-s2f-instance="share2fedi.vercel.app"></a>
9194
<a class="hackernews"></a>
@@ -105,34 +108,37 @@ <h2><code>&lt;a&gt;</code> with custom params</h2>
105108
<a class="whatsapp"></a>
106109
<a class="copy-url"></a>
107110
<a class="email"></a>
111+
<a class="print"></a>
108112
<a class="web-share"></a>
109113
</div>
110114
</section>
111115
<section>
112116
<h2>Specimen</h2>
113117
<div class="shareon specimen">
114-
<a class="facebook"></a>
118+
<a class="bluesky"></a>
119+
<a class="facebook">Share</a>
115120
<a class="fediverse"></a>
116121
<a class="hackernews"></a>
117122
<a class="linkedin"></a>
118123
<a class="mastodon">Toot</a>
119124
<a class="messenger" data-fb-app-id="3619024578167617"></a>
120125
<a class="odnoklassniki"></a>
121-
<a class="pinterest">Pin</a>
122126
<br />
127+
<a class="pinterest">Pin</a>
123128
<a class="pocket"></a>
124129
<a class="reddit"></a>
125130
<a class="teams"></a>
126-
<a class="telegram"></a>
131+
<a class="telegram">Send</a>
127132
<a class="tumblr"></a>
128-
<a class="twitter">Tweet</a>
133+
<a class="twitter"></a>
129134
<a class="viber"></a>
130135
<br />
131136
<a class="vkontakte">Поделиться</a>
132137
<a class="whatsapp"></a>
133138
<a class="copy-url"></a>
134139
<a class="email"></a>
135-
<a class="web-share">Share</a>
140+
<a class="print">Print</a>
141+
<a class="web-share"></a>
136142
</div>
137143
</section>
138144
</main>

package.json

+3-5
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,12 @@
110110
},
111111
"size-limit": [
112112
{
113-
"limit": "6.1 KiB",
114-
"path": "./dist/shareon.min.css",
115-
"brotli": true
113+
"limit": "6.3 KiB",
114+
"path": "./dist/shareon.min.css"
116115
},
117116
{
118117
"limit": "1.1 KiB",
119-
"path": "./dist/shareon.es.js",
120-
"brotli": true
118+
"path": "./dist/shareon.es.js"
121119
}
122120
],
123121
"publishConfig": {

src/icons/bluesky.svg

+1
Loading

src/shareon.css

+7
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@
7373
vertical-align: bottom;
7474
}
7575

76+
.shareon > .bluesky {
77+
background-color: #0285ff;
78+
}
79+
.shareon > .bluesky:before {
80+
background-image: url("icons/bluesky.svg");
81+
}
82+
7683
.shareon > .copy-url:before {
7784
background-image: url("icons/copy-url.svg");
7885
}

src/shareon.js

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import "./shareon.css";
1818
* }) => string}}
1919
*/
2020
const urlBuilderMap = {
21+
bluesky: (d) => `https://bsky.app/intent/compose?text=${d.text || d.title}%0A%0A${d.url}`,
2122
facebook: (d) => `https://www.facebook.com/sharer/sharer.php?u=${d.url}${d.hashtags ? `&hashtag=%23${d.hashtags.split('%2C')[0]}` : ''}`,
2223
fediverse: (d) => `https://${d.s2fInstance}/?text=${d.title}%0D%0A${d.url}${d.text ? `%0D%0A%0D%0A${d.text}` : ''}${d.via ? `%0D%0A%0D%0A${d.via}` : ''}`,
2324
email: (d) => `mailto:?subject=${d.title}&body=${d.url}`,

0 commit comments

Comments
 (0)