shareon/index.html

246 lines
7.2 KiB
HTML
Executable File
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!DOCTYPE html>
<html lang="en-GB">
<head>
<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."
/>
<meta
name="keywords"
content="share buttons, sharing, social networks, share via, share on"
/>
<meta name="author" content="Nikita Karamov" />
<title>Shareon Lightweight, stylish, and ethical share buttons</title>
<meta property="og:title" content="Shareon" />
<meta property="og:url" content="https://shareon.js.org/" />
<meta property="og:image" content="https://shareon.js.org/banner.png" />
<meta
property="o:description"
content="Lightweight, stylish, and ethical share buttons"
/>
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:creator" content="@KyttaWasHere" />
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/awsm.css/dist/awsm.min.css"
/>
<link
href="https://cdn.jsdelivr.net/npm/shareon@2/dist/shareon.min.css"
rel="stylesheet"
/>
<script
src="https://cdn.jsdelivr.net/npm/shareon@2/dist/shareon.iife.js"
defer
init
></script>
<!-- fixes for awsm.css -->
<style>
.shareon > a:hover {
color: #fff;
}
button:not([disabled]):hover {
border: none;
}
</style>
<link rel="icon" href="/favicon.ico" sizes="any" />
<link rel="icon" href="/icon.svg" type="image/svg+xml" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<link rel="manifest" href="/site.webmanifest" />
</head>
<body>
<header>
<p>
<img
src="./icon.svg"
alt="Shareon logo — the Postal Horn emoji"
width="64"
height="64"
/>
</p>
<h1>Shareon</h1>
<p>Lightweight, stylish, and ethical share buttons</p>
<nav>
<ul>
<li>
<a href="https://www.npmjs.com/package/shareon">npm</a>
</li>
<li>
<a href="https://github.com/kytta/shareon">source code</a>
</li>
</ul>
</nav>
</header>
<main>
<article>
<h2>
<a id="what-is-it" href="#what-is-it" aria-hidden="true"></a>
What is it?
</h2>
<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"></a>
<a class="linkedin"></a>
<a class="mastodon" data-via="@kytta@fosstodon.org"></a>
<a class="messenger" data-fb-app-id="3619024578167617"></a>
<a class="odnoklassniki"></a>
<a class="pinterest"></a>
<a class="pocket"></a>
<a class="reddit"></a>
<a class="telegram"></a>
<a class="twitter" data-via="KyttaWasHere"></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 only 6 KB gzipped code (JS+CSS),
</li>
<li>
<b>stylish</b>, using official vector logos and colours with no
visual mess, and
</li>
<li>
<b>ethical</b>, since they do not insert any pesky tracking code.
</li>
</ul>
<p>
The whole JavaScript code is quick and simple: it only populates the
buttons with share links. This makes Shareon the perfect choice for
your blog, news site, or project page!
</p>
</article>
<article>
<h2>
<a id="install" href="#install" aria-hidden="true"></a>
Install
</h2>
<p>Simply load the needed files from the CDN:</p>
<pre><code>&lt;link
href="https://cdn.jsdelivr.net/npm/shareon@2/dist/shareon.min.css"
rel="stylesheet"
&gt;
&lt;script
src="https://cdn.jsdelivr.net/npm/shareon@2/dist/shareon.iife.js"
defer
init
&gt;&lt;/script&gt;</code></pre>
<aside>
<p>
Want other options? Check the
<a href="https://github.com/kytta/shareon/#install"
>extended docs</a
>
on GitHub!
</p>
</aside>
<p>or install it via NPM and bundle it in a JS file:</p>
<pre><code>import * as Shareon from "shareon";
import "shareon/css";
Shareon.init();</code></pre>
</article>
<article>
<h2>
<a id="usage" href="#usage" aria-hidden="true"></a>
Usage
</h2>
<p>
Create a container with class <code>shareon</code> and populate it
with elements, class names of which match the names of the social
networks:
</p>
<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;
&lt;/div&gt;</code></pre>
<div class="shareon">
<a class="facebook"></a>
<a class="linkedin"></a>
<a class="mastodon"></a>
<a class="messenger" data-fb-app-id="3619024578167617"></a>
<a class="odnoklassniki"></a>
<a class="pinterest"></a>
<a class="pocket"></a>
<button class="reddit"></button>
<button class="telegram"></button>
<button class="twitter"></button>
<button class="viber"></button>
<button class="vkontakte"></button>
<button class="whatsapp"></button>
</div>
<p>
You can customize the shared URL and page title with
<code>data-</code> attributes:
</p>
<pre><code>&lt;div class="shareon" data-url="https://custom.url/for-this-page"&gt;
&lt;a class="facebook" data-title="Custom Facebook title"&gt;&lt;/a&gt;
&lt;a class="twitter" data-title="Custom Twitter title"&gt;&lt;/a&gt;
&lt;/div&gt;</code></pre>
<p>
Read more in the
<a href="https://github.com/kytta/shareon/#usage">README</a>
on GitHub!
</p>
</article>
</main>
<footer>
<p>
Copyright © 20202022
<a href="https://www.kytta.dev/">Nikita Karamov</a>
<br />
Licenced under the MIT License.
</p>
<p>
Website built with
<a href="https://igoradamenko.github.io/awsm.css/index.html"
>awsm.css</a
>
</p>
</footer>
</body>
</html>