Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Lobsters #143

Merged
merged 8 commits into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

> Lightweight, stylish, and ethical share buttons

- **Small.** Dependency-free. CSS+JS bundle is 7.5 kB minified and brotlied.
- **Small.** Dependency-free. CSS+JS bundle is under 7.7 KiB minified and brotlied.
- **Stylish.** Uses official vector logos and colours with no visual mess.
- **Ethical.** Embeds no tracking code. JS is required only for the setup.

Expand Down Expand Up @@ -96,7 +96,9 @@ names of which match the names of the social networks (or `copy-url`, for the
<a class="bluesky"></a>
<a class="facebook"></a>
<a class="fediverse"></a>
<a class="hackernews"></a>
<a class="linkedin"></a>
<a class="lobsters"></a>
<a class="mastodon"></a>
<!-- FB App ID is required for the Messenger button to function -->
<a class="messenger" data-fb-app-id="0123456789012345"></a>
Expand All @@ -114,6 +116,7 @@ names of which match the names of the social networks (or `copy-url`, for the
<a class="copy-url"></a>
<a class="email"></a>
<a class="print"></a>
<a class="web-share"></a>
</div>
```

Expand Down
Binary file modified assets/demo@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 13 additions & 9 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ <h2><code>&lt;a&gt;</code></h2>
<a class="fediverse"></a>
<a class="hackernews"></a>
<a class="linkedin"></a>
<a class="lobsters"></a>
<a class="mastodon"></a>
<a class="messenger" data-fb-app-id="3619024578167617"></a>
<a class="odnoklassniki"></a>
Expand Down Expand Up @@ -61,6 +62,7 @@ <h2><code>&lt;button&gt;</code></h2>
<button class="fediverse"></button>
<button class="hackernews"></button>
<button class="linkedin"></button>
<button class="lobsters"></button>
<button class="mastodon"></button>
<button class="messenger" data-fb-app-id="3619024578167617"></button>
<button class="odnoklassniki"></button>
Expand Down Expand Up @@ -93,6 +95,7 @@ <h2><code>&lt;a&gt;</code> with custom params</h2>
<a class="fediverse" data-s2f-instance="share2fedi.vercel.app"></a>
<a class="hackernews"></a>
<a class="linkedin"></a>
<a class="lobsters"></a>
<a class="mastodon" data-via="@NickKaramoff@fosstodon.org"></a>
<a class="messenger" data-fb-app-id="3619024578167617"></a>
<a class="odnoklassniki"></a>
Expand All @@ -115,29 +118,30 @@ <h2><code>&lt;a&gt;</code> with custom params</h2>
<section>
<h2>Specimen</h2>
<div class="shareon specimen">
<a class="bluesky"></a>
<a class="facebook">Share</a>
<a class="bluesky">Share</a>
<a class="facebook"></a>
<a class="fediverse"></a>
<a class="hackernews"></a>
<a class="linkedin"></a>
<a class="lobsters"></a>
<a class="mastodon">Toot</a>
<a class="messenger" data-fb-app-id="3619024578167617"></a>
<a class="odnoklassniki"></a>
<br />
<a class="odnoklassniki"></a>
<a class="pinterest">Pin</a>
<a class="pocket"></a>
<a class="reddit"></a>
<a class="teams"></a>
<a class="telegram">Send</a>
<a class="tumblr"></a>
<a class="telegram"></a>
<a class="tumblr">Post</a>
<a class="twitter"></a>
<a class="viber"></a>
<br />
<a class="vkontakte">Поделиться</a>
<a class="viber">Send</a>
<a class="vkontakte"></a>
<a class="whatsapp"></a>
<a class="copy-url"></a>
<a class="copy-url">Copy URL</a>
<a class="email"></a>
<a class="print">Print</a>
<a class="print"></a>
<a class="web-share"></a>
</div>
</section>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
},
"size-limit": [
{
"limit": "6.3 KiB",
"limit": "6.6 KiB",
"path": "./dist/shareon.min.css"
},
{
Expand Down
1 change: 1 addition & 0 deletions src/icons/lobsters.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions src/shareon.css
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,13 @@
background-image: url("icons/linkedin.svg");
}

.shareon > .lobsters {
background-color: #ac130d;
}
.shareon > .lobsters:before {
background-image: url("icons/lobsters.svg");
}

.shareon > .mastodon {
background-color: #6364ff;
}
Expand Down
3 changes: 2 additions & 1 deletion src/shareon.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ import "./shareon.css";
*/
const urlBuilderMap = {
bluesky: (d) => `https://bsky.app/intent/compose?text=${d.text || d.title}%0A%0A${d.url}`,
email: (d) => `mailto:?subject=${d.title}&body=${d.url}`,
facebook: (d) => `https://www.facebook.com/sharer/sharer.php?u=${d.url}${d.hashtags ? `&hashtag=%23${d.hashtags.split('%2C')[0]}` : ''}`,
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}` : ''}`,
email: (d) => `mailto:?subject=${d.title}&body=${d.url}`,
hackernews: (d) => `https://news.ycombinator.com/submitlink?u=${d.url}&t=${d.title}`,
linkedin: (d) => `https://www.linkedin.com/sharing/share-offsite/?url=${d.url}`,
lobsters: (d) => `https://lobste.rs/stories/new?url=${d.url}&title=${d.title}`,
mastodon: (d) => `https://toot.kytta.dev/?text=${d.title}%0D%0A${d.url}${d.text ? `%0D%0A%0D%0A${d.text}` : ''}${d.via ? `%0D%0A%0D%0A${d.via}` : ''}`,
messenger: (d) => `https://www.facebook.com/dialog/send?app_id=${d.fbAppId}&link=${d.url}&redirect_uri=${d.url}`,
odnoklassniki: (d) => `https://connect.ok.ru/offer?url=${d.url}&title=${d.title}${d.media ? `&imageUrl=${d.media}` : ''}`,
Expand Down
Loading