Library to make your web page shareable fast and easy in all the majors social networks.

Overview

SocialShareJS

This is a simple libray 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.

See the demo here: https://assisfery.github.io/SocialShareJS/index.html

CDN repository: https://www.jsdelivr.com/package/gh/assisfery/SocialShareJS

Install

Just include the social-share.css and social-share.js files.

<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/assisfery/[email protected]/social-share.min.css">
<script src="https://cdn.jsdelivr.net/gh/assisfery/[email protected]/social-share.min.js"></script>

Dependences

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.

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/js/all.min.js"></script>

Get Started

To have the social share buttons just put the class ss-box in one or more of you containers

<div class="ss-box"></div>

Selected Social

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>

Change Link

For defaults the SocialShareJs put the atual 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>

Custom Query String

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>

Responsive check

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>

Customizations

Hide Social Network Name

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>
Rounded buttons

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>
Flat buttons

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>
Pill buttons

If you want to make button with pill shape effect just include the class ss-pill in ss-box container.

<div class="ss-box ss-pill"></div>
Button with Shadows

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>
Hide Icons

If you dont want to show the icons of Social Network just include data-ss-icon attribute with value false.

<div class="ss-box" data-ss-icon="false"></div>
Change Icons

If you want to change the icon class of any Social Network to another icon of you preference or icon of others packages just include the data-ss-icon-class with value social_name1: icon_class1, social_name2: iconclass2

for example:

include data-ss-icon-class="facebook:fab fa-facebook-messenger,email:fas fa-sms" so it will put the icon fab fa-facebook-messenger instead the facebook default icon and it will put the icon fas fa-sms instead the email default icon.

<div class="ss-box" data-ss-social="facebook, email" data-ss-icon-class="facebook:fab fa-facebook-messenger,email:fas fa-sms"></div>

Hover Effects

Grow

Include ss-grow in your container to make button grow when the mouse is hover.

<div class="ss-box ss-grow" data-ss-social="facebook"></div>
Shrink

Include ss-shrink in your container to make button shrink when the mouse is hover.

<div class="ss-box ss-shrink" data-ss-social="facebook"></div>
Rotate

Include ss-rotate in your container to make button rotate when the mouse is hover.

<div class="ss-box ss-rotate" data-ss-social="facebook"></div>
Float

Include ss-float in your container to make button float when the mouse is hover.

<div class="ss-box ss-float" data-ss-social="facebook"></div>

JavaScript Utils

If you want to create a share box in JavaScript you can use the follow function.

SocialShare.createShareBox(_elements, _link = null, _socials =  null, _showIcon = true, _showContent = true, _clearContainer = true);
  • _elements - the dom elements where the socials buttons will be created
  • _link - the link/content will be shared, by default will be the current window location
  • _showIcon - the social button icon will be presented or not
  • _showContent - the social button name/label will be presented or not
  • _clearContainer - clear or not the elements before create the buttons

For example

SocialShare.createShareBox("#newShareBox", "https://github.com/assisfery/SocialShareJS", "facebook, twitter, email, sms, viber");
Just Move On...

If you want to customize the share buttons like you want just do it adding css effect in your code.

.ss-btn {
  /* your code */
}
You might also like...

A library for boolean aliases to help you make your code more confusing and make your coworkers hate you.

yup-nope A library for boolean aliases to help you make your code more confusing and make your coworkers hate you. Installation Using npm: npm install

Dec 10, 2022

The awesomebooks project is a simple list, but separated into 3 parts and given a retro feel. The main page is where we can add books, and on another page we can see the list, and remove items. There is also a "contact-us" page.

Awesome Books This is the restructured version of the famous awesome-books project! Here you can find JavaScript broken into modules, using import-exp

Nov 15, 2022

Complete, flexible, extensible and easy to use page transition library for your static web.

Complete, flexible, extensible and easy to use page transition library for your static web.

We're looking for maintainers! Complete, flexible, extensible and easy to use page transition library for your static web. Here's what's new in v2. Ch

Jan 2, 2023

Math magicians is a website for all fans of mathematics. It is a Single Page App (SPA) that allows users to make simple calculations and read a random math-related quote. Build with React.js

Math magicians is a website for all fans of mathematics. It is a Single Page App (SPA) that allows users to make simple calculations and read a random math-related quote. Build with React.js

Math Magicians Math magicians is a website for all fans of mathematics. It is a Single Page App (SPA) that allows users to make simple calculations an

Mar 23, 2022

"Math magicians" is a website for all fans of mathematics. It is a Single Page App (SPA) that allows users to make simple calculations and read random math-related quotes. Its built using react

Math Magician "Math magicians" is a website for all fans of mathematics. It is a Single Page App (SPA) that allows users to make simple calculations a

Feb 23, 2022

Module 03 project: Math magicians is a website for all fans of mathematics. It is a Single Page App (SPA) that allows users to Make simple calculations and Read a random math-related quote.

Math-magicians Math magicians is a website for all fans of mathematics. It is a Single Page App (SPA) that allows users to Make simple calculations an

Sep 26, 2022

Math magicians" is a website for all fans of mathematics. It is a Single Page App (SPA) that allows users to: Make simple calculations and Read a random math-related quote.

Capstone project / FilmTube This is the final project of the moduel 2. we build a series page using an API to display all the series on the main page

Aug 23, 2022

"Math magicians" is a website for all fans of mathematics. It is a Single Page App (SPA) that allows users to make simple calculations and read a random math-related quote.

Math magicians "Math magicians" is a website for all fans of mathematics. It is a Single Page App (SPA) that allows users to: Make simple calculations

Aug 26, 2022
Releases(1.4)
Owner
Assis Ferreira
admirer of technologies and everything it can bring to our civilization ([email protected])
Assis Ferreira
A social media platform aimed to capture the essence of all popular, existing social media platforms

Social Fuel Reimagining Social Media, step by step ?? About A social media platform aimed to capture the essence of all popular, existing social media

HariHaran 6 Feb 12, 2022
MySQL meets Jupyter notebooks. Grasp provides a new way to learn and write SQL, by providing a coding-notebook style with runnable blocks, markdown documentation, and shareable notebooks. ✨

A New Way to Write & Learn SQL Report Bug · Request Feature Table of Contents About The Project Built With Getting Started Prerequisites Installation

Lakshya 7 Sep 1, 2022
An ESLint shareable configuration that used in our projects.

eslint-config An ESLint shareable configuration that used in our projects. Install npm install -D @rahagia/eslint-config or with yarn yarn add -D @rah

Organisasi Bahagia 5 Apr 18, 2022
An ESLint shareable configuration that used in our projects.

eslint-config An ESLint shareable configuration that used in our projects. Install npm install -D @clytage-pkg/eslint-config or with yarn yarn add -D

Clytage 6 Nov 17, 2022
My custom shareable eslint configs...

My shared dx Structure . └── packages └── eslint-config-bases Packages Name Description Version @belgattitude/eslint-config-bases Opinionated esl

Sébastien Vanvelthem 4 Dec 15, 2022
Hackathon for Social Good 2022 and use your superpowers to create a solution for the social good.

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

Laura Diaz 3 Jun 27, 2022
Solve travel woes and grow networks!

RouteBuddies Solve travel woes and grow networks! You can be guaranteed an easy, comfortable and safe journey, while getting to interact with variety

null 5 May 26, 2022
A small and simple stress testing tool for Ethereum-compatible blockchain networks

Overview pandoras-box is a small transaction stress testing tool, part of any Ethereum client developer's toolkit. It is made for Ethereum-compatible

Trapesys 6 Aug 30, 2022
Graphs/networks turned into tables

(IMP NOTE FOR CONTRIBUTORS: PLEASE DON'T FORMAT THE CODE, IT'S DIFFICULT FOR ME TO FIND THE CHANGES. THANK YOU!) Graph to Table You must have seen gra

null 12 Oct 20, 2022