shareon/docs/index.html

145 lines
5.4 KiB
HTML
Raw Permalink Normal View History

2020-03-25 11:45:04 -04:00
<!DOCTYPE html>
<html lang="en">
<head>
2021-07-29 11:03:57 -04:00
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Lightweight, stylish and ethical share buttons for popular social networks">
<meta name="keywords" content="share buttons, sharing, social networks, share via, share on">
<meta name="author" content="Nikita Karamov">
2021-07-29 11:03:57 -04:00
<title>shareon Lightweight, stylish and ethical share buttons</title>
2020-03-25 11:45:04 -04:00
2021-07-29 11:03:57 -04:00
<meta property="og:title" content="shareon">
<meta property="og:url" content="https://shareon.js.org">
<meta property="og:image" content="https://raw.githubusercontent.com/NickKaramoff/shareon/main/assets/banner.png">
<meta property="og:description" content="Lightweight, stylish and ethical share buttons for popular social networks">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:creator" content="@NickKaramoff">
2021-07-29 11:03:57 -04:00
<link rel="stylesheet" href="https://cdn.jsdelivr.net/combine/npm/modern-normalize@1.1.0,npm/simpledotcss@1.0.1,npm/shareon@1.6.2/dist/shareon.min.css">
<script src="https://cdn.jsdelivr.net/npm/shareon@1.6.2/dist/shareon.min.js" defer></script>
<link rel="icon" href="/favicon.ico">
<link rel="icon" href="/icon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
2021-07-29 11:03:57 -04:00
<link rel="manifest" href="/site.webmanifest">
2020-03-25 11:45:04 -04:00
</head>
<body>
2021-07-29 11:03:57 -04:00
<header>
<h1>shareon &#128239;</h1>
<p>Lightweight, stylish and ethical share buttons</p>
<nav>
<a href="https://www.npmjs.com/package/shareon" target="_blank">
npm
</a>
<a href="https://github.com/NickKaramoff/shareon" target="_blank">
GitHub
</a>
</nav>
</header>
<main>
<section>
<p>
shareon are share buttons for popular social networks.
</p>
<div class="shareon"
data-title="shareon — lightweight, stylish and ethical share buttons"
style="text-align: center">
<a class="facebook">Share</a>
<a class="linkedin"></a>
<a class="mastodon" data-via="@NickKaramoff@fosstodon.org">Toot</a>
<a class="messenger" data-fb-app-id="3619024578167617"></a>
<a class="odnoklassniki"></a>
<a class="pinterest">Pin</a>
<br>
<a class="pocket"></a>
<a class="reddit"></a>
<a class="telegram"></a>
<a class="twitter" data-via="NickKaramoff"></a>
<a class="viber"></a>
<a class="vkontakte">Отправить</a>
<a class="whatsapp"></a>
</div>
<p>
Unlike many other share buttons, shareon are:
</p>
<ul>
<li><b>lightweight</b>, clocking in at around 7&nbsp;KB gzipped</li>
<li><b>stylish</b>, by having no visual features other than official colours and logos</li>
<li><b>ethical</b>, since they do not insert any pesky tracking code</li>
</ul>
<p>
Upon initialization, shareon just populates the buttons with generated URLS. The speed and easy customization make shareon the perfect choice for your blog, news site, or project page!
</p>
</section>
<section>
<h2>Get started</h2>
<ol>
<li>
Include the links to shareon's JS and CSS in your website:
<pre><code>&lt;link href="https://cdn.jsdelivr.net/npm/shareon@2/shareon.css"
2020-03-25 20:43:21 -04:00
rel="stylesheet"&gt;
2021-07-29 11:03:57 -04:00
&lt;script type="module"
src="https://cdn.jsdelivr.net/npm/shareon@2"&gt;&lt;/script&gt;</code></pre>
</li>
<li>
Create a container with class <code>shareon</code> and populate it with elements, whose classes match the names of the social networks:
<pre><code>&lt;div class="shareon"&gt;
&lt;a class="facebook"&gt;&lt;/a&gt;
&lt;a class="linkedin"&gt;&lt;/a&gt;
&lt;a class="mastodon"&gt;&lt;/a&gt;
&lt;!-- FB App ID is required for the Messenger button to function --&gt;
&lt;a class="messenger" data-fb-app-id="0123456789012345"&gt;&lt;/a&gt;
&lt;a class="odnoklassniki"&gt;&lt;/a&gt;
&lt;a class="pinterest"&gt;&lt;/a&gt;
&lt;a class="pocket"&gt;&lt;/a&gt;
&lt;a class="reddit"&gt;&lt;/a&gt;
&lt;a class="telegram"&gt;&lt;/a&gt;
&lt;a class="twitter"&gt;&lt;/a&gt;
&lt;a class="viber"&gt;&lt;/a&gt;
&lt;a class="vkontakte"&gt;&lt;/a&gt;
&lt;a class="whatsapp"&gt;&lt;/a&gt;
2020-03-25 20:43:21 -04:00
&lt;/div&gt;</code></pre>
2021-07-29 11:03:57 -04:00
</li>
<li>
Refine your buttons with extra parameters:
<ul>
<li>add <code>data-url</code> to any button to change the shared URL</li>
<li>add <code>data-title</code> to any button to change the shared title</li>
<li>you <strong>MUST</strong> add <code>data-fb-app-id</code> to the FB Messenger button to make sharing even possible</li>
<li>add <code>data-media</code> to an Odnoklassniki, Pinterest, or VK button to customize the pinned picture</li>
<li>add <code>data-text</code> to a WhatsApp, Mastodon, Telegram, or Viber button to add custom message text</li>
<li>add <code>data-via</code> to a Twitter or Mastodon button to mention a user</li>
</ul>
Use extra parameters on the whole container or on the specific buttons:
<pre><code>&lt;div class="shareon" data-url="https://example.com"&gt;
&lt;a class="whatsapp" data-title="Custom WhatsApp title"&gt;&lt;/a&gt;
&lt;a class="twitter" data-title="Custom Twitter title"&gt;&lt;/a&gt;
2020-03-25 20:43:21 -04:00
&lt;/div&gt;</code></pre>
2021-07-29 11:03:57 -04:00
</li>
<li>
Go to the <a href="https://github.com/NickKaramoff/shareon#readme">GitHub repo</a> for more detailed documentation!
</li>
</ol>
</section>
</main>
<footer>
<p>
shareon was created by <a href="https://karamoff.dev/" target="_blank">Nikita Karamov</a> and is licenced under BSD-3-Clause
</p>
</footer>
2020-03-25 11:45:04 -04:00
</body>
2020-03-25 20:43:21 -04:00
</html>