This is a simple library to make your web page shareable fast and easy.
Its allow to include the social share link of the major social network to your page.
Github repository: https://github.com/assisfery/SocialShareJS
CDN repository: https://www.jsdelivr.com/package/gh/assisfery/SocialShareJS
Just include the social-share.css and social-share.js files.
<link rel="stylesheet" href="social-share.css"> <script src="social-share.js"></script>
Those files are hosted on CDN JSDelivr.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/assisfery/SocialShareJS@master/social-share.min.css"> <script src="https://cdn.jsdelivr.net/gh/assisfery/SocialShareJS@master/social-share.min.js"></script>
Or download them in: https://cdn.jsdelivr.net/gh/assisfery/SocialShareJS/
The SocialShareJS don't dependents of none library, but its uses the FontAwesome 5 Fonts, so make sure you have included it in your web page.
<script src="https://kit.fontawesome.com/a076d05399.js"></script>
To have the social share buttons just put the class ss-box in one or more of you containers
<div class="ss-box"></div>
If you want to select specifics social share network just add the data-ss-social attribute in your container.
<div class="ss-box" data-ss-social="facebook, pinterest"></div>
For defaults the SocialShareJs put the current page location as share link but you can change it just including the data-ss-link attribute in your container.
<div class="ss-box" data-ss-link="https://www.google.com/"></div>
In some of social network shares you could want to put a query string available just to specific social network,
so to do that just include
data-ss-NAME_OF_SOCIAL_MEDIA = "key1:value1, key2:value2" attribute,
for example
include data-ss-messenger = "app_id:123456", so it will include the query string &app_id=123456 in
messenger share link, or
include data-ss-email = "subject:SocialShareJS is amazing", it will include the query string
&subject=Email Subject in
email share link.
<div class="ss-box" data-ss-social="messenger, pinterest, email" data-ss-messenger="app_id: 123456" data-ss-email="subject:SocialShareJS is amazing"></div>
Some of buttons (like: share native ,messenger, viber and sms) perhaps
not work on desktop OS, but its works in mobile OS like Android and IOS, so may be necessary
to show that buttons only in mobile screen.
To solve that problem you could include the class ss-responsive on
your container.
<div class="ss-box ss-responsive"></div>
If you want to show just the icons without the name of Social Network just include data-ss-content attribute with value false.
<div class="ss-box" data-ss-content="false"></div>
If you want to make button with circle shape just include the class ss-circle in ss-box container.
<div class="ss-box ss-circle" data-ss-content="false"></div>
If you want to make button without rounded border just include the class ss-flat in ss-box container.
<div class="ss-box ss-flat"></div>
If you want to put shadow in button just include the class ss-shadow in ss-box container.
<div class="ss-box ss-shadow"></div>
Grow when the mouse is hover.
<div class="ss-box ss-grow" data-ss-social="facebook"></div>
Shrink when the mouse is hover.
<div class="ss-box ss-shrink" data-ss-social="facebook"></div>
Rotate when the mouse is hover.
<div class="ss-box ss-rotate" data-ss-social="facebook"></div>
Float when the mouse is hover.
<div class="ss-box ss-float" data-ss-social="facebook"></div>
If you want to customize the share buttons like you want just do it adding css effect in your code.
.ss-btn{ /*your code*/ }