From 29e14cddf2b6983df344e70aee3d0841cd714712 Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Wed, 6 Dec 2023 23:07:42 +0100 Subject: [PATCH 1/3] Add email button --- index.html | 4 ++++ src/icons/email.svg | 1 + src/shareon.css | 4 ++++ src/shareon.js | 1 + 4 files changed, 10 insertions(+) create mode 100644 src/icons/email.svg diff --git a/index.html b/index.html index bde6cca..67907ed 100644 --- a/index.html +++ b/index.html @@ -45,6 +45,7 @@ + @@ -67,6 +68,7 @@ + @@ -94,6 +96,7 @@ + @@ -118,6 +121,7 @@ Поделиться + Share diff --git a/src/icons/email.svg b/src/icons/email.svg new file mode 100644 index 0000000..c694920 --- /dev/null +++ b/src/icons/email.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/shareon.css b/src/shareon.css index 8339582..c5024d5 100644 --- a/src/shareon.css +++ b/src/shareon.css @@ -81,6 +81,10 @@ background-image: url("icons/copy-url-done.svg"); } +.shareon > .email:before { + background-image: url("icons/email.svg"); +} + .shareon > .facebook { background-color: #1877f2; } diff --git a/src/shareon.js b/src/shareon.js index d5ce29f..c8cfc50 100644 --- a/src/shareon.js +++ b/src/shareon.js @@ -18,6 +18,7 @@ import "./shareon.css"; */ const urlBuilderMap = { facebook: (d) => `https://www.facebook.com/sharer/sharer.php?u=${d.url}${d.hashtags? `&hashtag=%23${d.hashtags.split('%2C')[0]}` : ''}`, + email: (d) => `mailto:?subject=${d.title}&body=${d.url}`, linkedin: (d) => `https://www.linkedin.com/sharing/share-offsite/?url=${d.url}`, 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}`, From 90eb6d92c5fc912e9b008e856711e99399e850b1 Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Thu, 7 Dec 2023 00:07:24 +0100 Subject: [PATCH 2/3] Update README --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 895767e..968c07e 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ Shareon.init(); Create a container with class `shareon` and populate it with elements, class names of which match the names of the social networks (or `copy-url`, for the -'Copy URL' button: +'Copy URL' button): ```html
@@ -110,6 +110,7 @@ names of which match the names of the social networks (or `copy-url`, for the +
``` From 84b18b0371ac018d8aa3635a8f9d75aff66136f5 Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Thu, 7 Dec 2023 00:08:09 +0100 Subject: [PATCH 3/3] Update CHANGELOG --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 214692e..1e2eb76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Added + +- [#99](https://github.com/kytta/shareon/pull/99) + Email button + ## [2.3.0] - 2023-08-01 ### Added