diff --git a/src/index.ts b/src/index.ts index ddbbc70..2cc1f15 100644 --- a/src/index.ts +++ b/src/index.ts @@ -13,6 +13,7 @@ interface PublishPreset { type UrlBuilder = (data: PublishPreset) => string; const NETWORKS: { [name: string]: UrlBuilder } = { + facebook: (d) => `https://www.facebook.com/sharer/sharer.php?u=${d.url}`, telegram: (d) => `https://telegram.me/share/url?url=${d.url}${d.extra.text ? `&text=${d.extra.text}` : ''}`, twitter: (d) => `https://twitter.com/intent/tweet?url=${d.url}&text=${d.title}${d.extra.via ? `&via=${d.extra.via}` : ''}`, whatsapp: (d) => `whatsapp://send?text=${d.title}%0D%0A${d.url}${d.extra.text ? `%0D%0A%0D%0A${d.extra.text}` : ''}`, diff --git a/src/style.scss b/src/style.scss index 26dcbbc..84f9f20 100644 --- a/src/style.scss +++ b/src/style.scss @@ -66,6 +66,14 @@ $width: $button-size - 2*$padding-hor; } + &.facebook { + background-color: #1877F2; + + &::before { + background-image: url("data:image/svg+xml,%3Csvg fill='%23fff' viewBox='0 2 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16.671 15.469L17.203 12h-3.328V9.749c0-.949.465-1.874 1.956-1.874h1.513V4.922s-1.374-.235-2.686-.235c-2.741 0-4.533 1.662-4.533 4.669V12H7.078v3.469h3.047V24h3.75v-8.531h2.796z'/%3E%3C/svg%3E"); + } + } + &.telegram { background-color: #27A7E5;