diff options
author | 2023-07-20 01:32:47 +0200 | |
---|---|---|
committer | 2023-07-20 05:02:47 +0530 | |
commit | d028830bc9e474115973bdc79fbac150bce054aa (patch) | |
tree | aaffbe1d08aebb96d8b8f1128e47648ebc89794a /recipes/skiff-mail | |
parent | Add Miro recipe (#392) (diff) | |
download | ferdium-recipes-d028830bc9e474115973bdc79fbac150bce054aa.tar.gz ferdium-recipes-d028830bc9e474115973bdc79fbac150bce054aa.tar.zst ferdium-recipes-d028830bc9e474115973bdc79fbac150bce054aa.zip |
Add Skiff Mail recipe (#391)
Diffstat (limited to 'recipes/skiff-mail')
-rw-r--r-- | recipes/skiff-mail/icon.svg | 1 | ||||
-rw-r--r-- | recipes/skiff-mail/index.js | 1 | ||||
-rw-r--r-- | recipes/skiff-mail/package.json | 9 | ||||
-rw-r--r-- | recipes/skiff-mail/webview.js | 17 |
4 files changed, 28 insertions, 0 deletions
diff --git a/recipes/skiff-mail/icon.svg b/recipes/skiff-mail/icon.svg new file mode 100644 index 0000000..f64997d --- /dev/null +++ b/recipes/skiff-mail/icon.svg | |||
@@ -0,0 +1 @@ | |||
<svg xmlns="http://www.w3.org/2000/svg" width="180" height="180" fill="none"><g clip-path="url(#a)"><rect width="180" height="180" fill="#EF5A3C" rx="52"/><path fill="#000" d="M106.13 34.22c5.45-.1 10.86 1 15.84 3.24a59.78 59.78 0 0 0-11.87-5.84 62.3 62.3 0 0 0-61.2 10.35c-.53.4-1.94 1.7-2.5 2.17-.55.46-1.82 1.72-2.3 2.32-.49.6-1.57 1.66-2.31 2.33-.74.68-1.64 1.93-2.12 2.54L38 53.5c-.44.61-1.45 2.12-1.87 2.73-.41.6-.7 1.14-.87 1.42-.19.27-.6.97-.72 1.16-.11.19-1.2 2.19-1.48 2.65-.27.47-1.1 2.33-1.43 2.98L30.56 67c0 .28-.83 2.33-.97 2.58s-.49 1.49-.67 2.1c-.4 1.16-.74 2.51-1.07 3.7-.18.71-.54 2.5-.7 3.23v.56a63.6 63.6 0 0 0 7.45 43.12 60 60 0 0 0 2.67 4.16c.33.5.9 1.33 1.27 1.8l1.34 1.77 2.13 2.5 2.3 2.33c.45.4 1.14 1.15 1.6 1.52l.83.72.2.16.21.16.42.36c.53.44 1.2.9 1.75 1.3l.44.3.46.3c.49.33 1.34.87 1.88 1.15.52.27.69.41.94.53l1.45.72c.47.23 1.07.49 1.5.67 1.09.45 2.31.84 3.33 1.21.6.14 1.24.36 1.84.52l1.6.35 1.61.28c1.86.27 3.73.41 5.61.42 4.58-.14 9.1-1.13 13.32-2.91a36.72 36.72 0 0 0 19.62-20.48l.4-1.03c0-.35.39-1.25.5-1.58.2-.84.5-1.84.67-2.67 0-.3.18-.78.23-1.08.27-1.6.45-3.23.53-4.86V109c-1.2 0-2.3-.17-3.55-.31a36.98 36.98 0 0 1-23.98-13.2 37.57 37.57 0 0 1 3.08-51.1 36.9 36.9 0 0 1 25.38-10.17h-.05Zm-52.1 94.76a45.57 45.57 0 0 1-4.04-3.86 57.4 57.4 0 0 1-12.14-20.05A57.75 57.75 0 0 1 41.1 59.2c3.65-7 8.7-13.16 14.84-18.11.45-.4 1.2-.91 1.66-1.26a56.2 56.2 0 0 1 5.77-3.8 55.27 55.27 0 0 1 20.78-6.72l2.69-.23h5.42l-2.7.21-2.68.35-2.65.44a56.17 56.17 0 0 0-22.36 9.47 56.7 56.7 0 0 0-16.35 18.04 57.31 57.31 0 0 0-4.26 47.56 56.2 56.2 0 0 0 9.83 17.17l.41.52.21.25.23.23a43.62 43.62 0 0 0 3.67 3.78 32.07 32.07 0 0 0 34.63 5.07 32.1 32.1 0 0 1-36.2-3.19Zm7.78-10.66-.41-.44-.24-.2-1.54-1.59a51.18 51.18 0 0 1-8.85-56.75c2.9-6.14 7-11.63 12.05-16.16a49.9 49.9 0 0 1 8.15-5.86c1.02-.56 2.31-1.24 3.33-1.77.4-.21.76-.32 1.13-.51a48.36 48.36 0 0 1 14.35-3.91c.65 0 1.8-.19 2.45-.21h1.85c1.85-.03 3.7.05 5.54.23a55 55 0 0 0-8.51.77 50.27 50.27 0 0 0-22.31 9.67 50.82 50.82 0 0 0-15.25 19.05 50.33 50.33 0 0 0 4.96 49.91c.4.49 1.04 1.42 1.45 1.91.7.86 1.57 1.9 2.31 2.72a27.7 27.7 0 0 0 33.75 6.33c-10.32 7.33-25.14 5.28-34.2-3.19Zm6.25-16.75a38.17 38.17 0 0 0 6.93 7.61 25.42 25.42 0 0 0 23.5 4.66 24.5 24.5 0 0 1-20.94-.61 29.11 29.11 0 0 1-8.75-6.65 44.55 44.55 0 0 1-5.64-52.45 44.08 44.08 0 0 1 12.57-13.77c.5-.37 1.3-.86 1.85-1.2 1.01-.68 2.3-1.33 3.3-1.91.99-.58 1.7-.84 2.47-1.17 4.66-2 9.64-3.13 14.7-3.37h4.3l1.59.14c.88 0 1.75.23 2.63.35h-4.76c-4.02.26-8 1.04-11.81 2.32a42.92 42.92 0 0 0-16.98 10.44A43.38 43.38 0 0 0 62.52 63a43.67 43.67 0 0 0 5.55 38.6v-.02Z"/><path fill="#000" d="M127.04 139.22c.5-.4 1.94-1.7 2.5-2.16l2.3-2.33 2.31-2.33c.54-.63 1.64-1.9 2.13-2.54l1.66-2.18c.44-.6 1.46-2.12 1.87-2.73l.88-1.42c.13-.18.6-.97.71-1.16.12-.18 1.2-2.16 1.45-2.65.26-.49 1.14-2.33 1.46-2.98.32-.65.76-1.8 1.09-2.54 0-.25.83-2.32.94-2.58.12-.25.5-1.49.7-2.1.39-1.16.73-2.5 1.06-3.7.18-.72.53-2.5.7-3.23v-.53c2.7-14.8.07-30.08-7.44-43.13a61.45 61.45 0 0 0-3.95-5.98l-1.34-1.74c-.46-.54-1.68-2.03-2.14-2.54-.47-.5-1.53-1.65-2.32-2.32-.4-.4-1.13-1.14-1.57-1.51l-.82-.7-.21-.2-.21-.16-.44-.34c-.5-.44-1.18-.91-1.73-1.3l-.46-.31-.44-.3c-.5-.32-1.34-.86-1.87-1.14-.53-.28-.7-.42-.95-.53l-1.45-.73-1.5-.67c-1.09-.44-2.31-.84-3.33-1.21l-1.84-.5-1.6-.36-1.61-.28a37.9 37.9 0 0 0-5.61-.42c-4.58.13-9.1 1.11-13.32 2.9a36.72 36.72 0 0 0-19.62 20.49l-.4 1.05c-.1.32-.38 1.23-.5 1.56-.23.83-.5 1.83-.67 2.67 0 .3-.18.77-.23 1.07-.3 1.63-.49 3.28-.58 4.94v2.02A36.52 36.52 0 0 1 96.77 83.8a37.1 37.1 0 0 1 10.22 26.78 38.39 38.39 0 0 1-5.14 17.61 38.02 38.02 0 0 1-12.7 13.15 37.64 37.64 0 0 1-35.26 2.52 62.36 62.36 0 0 0 73.16-4.63Zm-5.07-87.08a51.29 51.29 0 0 1 4.08 3.86 57.67 57.67 0 0 1 15.41 40.95 57.61 57.61 0 0 1-17.72 40c-.55.5-1.45 1.39-2.05 1.85l-1.06.89-.55.46-.26.21-1.38 1.05a57.12 57.12 0 0 1-5.82 3.77l-2.45 1.3a54.13 54.13 0 0 1-26.5 5.64 57.67 57.67 0 0 0 38.99-18.2 56.8 56.8 0 0 0 3.79-72.88c-.5-.71-1.14-1.43-1.67-2.08l-.41-.5-.2-.27-.22-.25a32.07 32.07 0 0 0-38.32-8.91 32.1 32.1 0 0 1 36.34 3.11Zm-9.23 9.3c.73.6 1.47 1.29 2.17 1.92a50.75 50.75 0 0 1 12.93 20.77 51.07 51.07 0 0 1-8.1 46.89 50.33 50.33 0 0 1-19.15 15.14l-1.15.48-.28.12-.3.12-.58.23c-.6.2-1.7.65-2.3.84a47.38 47.38 0 0 1-19.56 2.09c3.26-.06 6.5-.4 9.7-1.02a50.31 50.31 0 0 0 21.52-9.92 50.86 50.86 0 0 0 14.68-18.7 50.25 50.25 0 0 0-5.66-50.74c-.42-.58-1.04-1.3-1.48-1.86-.44-.55-1.36-1.53-1.99-2.33a27.71 27.71 0 0 0-33.32-5.77c9.76-6.98 23.77-5.58 32.89 1.84l-.02-.1Zm-24.7 83.34 1.91-.8 1.87-.92c.71-.35 1.57-.86 2.3-1.25l2.2-1.38a43.24 43.24 0 0 0 18.51-28.25 43.48 43.48 0 0 0-5.9-30.86l-1.14-1.72-1.22-1.65-1.3-1.63a31.86 31.86 0 0 0-4.33-4.33 25.46 25.46 0 0 0-23.45-4.65 25.02 25.02 0 0 1 24.86 2.81 34.77 34.77 0 0 1 6.44 6.05 44.38 44.38 0 0 1-1.96 59.22c-5 5.2-11.23 9.07-18.1 11.27a41.22 41.22 0 0 1-19.18 1.28c6.31.24 12.61-.82 18.5-3.1l-.01-.09Z"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h180v180H0z"/></clipPath></defs></svg> \ No newline at end of file | |||
diff --git a/recipes/skiff-mail/index.js b/recipes/skiff-mail/index.js new file mode 100644 index 0000000..dd41f72 --- /dev/null +++ b/recipes/skiff-mail/index.js | |||
@@ -0,0 +1 @@ | |||
module.exports = Ferdium => Ferdium; | |||
diff --git a/recipes/skiff-mail/package.json b/recipes/skiff-mail/package.json new file mode 100644 index 0000000..1193c82 --- /dev/null +++ b/recipes/skiff-mail/package.json | |||
@@ -0,0 +1,9 @@ | |||
1 | { | ||
2 | "id": "skiff-mail", | ||
3 | "name": "Skiff Mail", | ||
4 | "version": "1.0.0", | ||
5 | "license": "MIT", | ||
6 | "config": { | ||
7 | "serviceURL": "https://app.skiff.com/mail/inbox" | ||
8 | } | ||
9 | } | ||
diff --git a/recipes/skiff-mail/webview.js b/recipes/skiff-mail/webview.js new file mode 100644 index 0000000..522b062 --- /dev/null +++ b/recipes/skiff-mail/webview.js | |||
@@ -0,0 +1,17 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | ||
4 | return obj && obj.__esModule ? obj : { default: obj }; | ||
5 | } | ||
6 | |||
7 | module.exports = Ferdium => { | ||
8 | const getMessages = () => { | ||
9 | const element = document.querySelector('div[href="/mail/inbox"]'); | ||
10 | const matches = element.textContent.match(/\d+/); | ||
11 | const unreadCount = Ferdium.safeParseInt(matches ? matches[0] : 0); | ||
12 | Ferdium.setBadge(unreadCount); | ||
13 | }; | ||
14 | Ferdium.loop(getMessages); | ||
15 | |||
16 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
17 | }; | ||