diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..1521c8b --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +dist diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..9fbf57e --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,6 @@ +module.exports = { + extends: ['airbnb-typescript/base'], + parserOptions: { + project: './tsconfig.json', + }, +}; diff --git a/.gitignore b/.gitignore index b512c09..355eaf1 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,5 @@ -node_modules \ No newline at end of file +dev +dist +.idea +node_modules +yarn-error.log diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..ad520d2 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,9 @@ +language: node_js +node_js: + - node + - lts/erbium + - lts/dubnium +cache: yarn + +install: yarn +script: yarn test diff --git a/README.md b/README.md index 8ae83ba..49c796a 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,87 @@ # shareon -Postal Horn emoji +Postal Horn emoji Lightweight, stylish and ethical share buttons. -- **Small.** Dependency-free. -- **Stylish.** Uses official vector logos and colors. -- **Ethical.** No tracking code is being embedded. +- **Small.** Dependency-free. CSS+JS bundle is only 3.15 KB minified and gzipped. +- **Stylish.** Uses official vector logos and colors with no visual mess. +- **Ethical.** No tracking code is being embedded. JS is used for quick setup only. + +shareon example + +---- +Observe the live demo here: [os.karamoff.dev/shareon](https://os.karamoff.dev/shareon) + +## Install + +Include the link to shareon's JS and CSS in your website: ```html - -
- -
+ + +``` - -
Share
+or install it via NPM use it in a JS file that you will bundle: + +```sh +npm install shareon +# or +yarn add shareon +``` + +```js +require('shareon'); +``` + +## Usage + +> shareon was heavily inspired by [Likely](https://ilyabirman.net/projects/likely/), + and has a backwards-compatible API (excluding themes and sizes). + +Create a container with class `shareon` and populate it with elements, whose +classes match the names of social networks: + +```html +
+ + + + + + +
+``` + +If you use ``, the buttons will get a `href`-attribute to them. In other cases +they will get a listener on `click` event, so you can use `