Giter Club home page Giter Club logo

ez-share's Introduction

๐Ÿš€ ezShare - JavaScript Social Share Plugin

ezShare is a lightweight JavaScript plugin for easy sharing of content on various social media platforms.

Installation

You can install ezShare by including the JavaScript file in your project. You have two options:

  1. Download: You can download the JavaScript file from the GitHub repository and include it in your project manually.

  2. CDN: Alternatively, you can use the ezShare script directly from the CDN:

<script src="https://cdn.jsdelivr.net/gh/shakilahmed0369/ez-share/dist/ez-share.min.js"></script>

Usage

To activate ezShare, call the execute method after the DOM has loaded:

document.addEventListener("DOMContentLoaded", function() {
  ezShare.execute();
});

Available Platforms and Attributes

Platform Class Attributes Description
Facebook ez-facebook data-url, data-hashtags Share URL to Facebook. Optionally add hashtags. If no data-url, current URL will be used.
LinkedIn ez-linkedin data-url Share URL to LinkedIn. If no data-url, current URL will be used.
Pinterest ez-pinterest data-url, data-description, data-media Share URL to Pinterest. Optionally add description and media. If no data-url, current URL will be used.
Pocket ez-pocket data-url Save URL to Pocket for later reading. If no data-url, current URL will be used.
Reddit ez-reddit data-url, data-title Share URL to Reddit. Optionally add title. If no data-url, current URL will be used.
Telegram ez-telegram data-url, data-text Share URL to Telegram. Optionally add custom message. If no data-url, current URL will be used.
X ez-x data-url, data-text, data-via, data-hashtags Share URL to Twitter. Customize tweet text, source, and hashtags. If no data-url, current URL will be used.

Example

<!-- Use any HTML element (button, a, etc.) with appropriate classes and data attributes -->
<button class="ez-facebook" data-url="https://example.com/article" data-hashtags="news,technology">Share on Facebook</button>
<a href="#" class="ez-linkedin" data-url="https://example.com/article">Share on LinkedIn</a>
<div class="custom-button ez-pinterest" data-url="https://example.com/article" data-description="Check out this cool website!" data-media="https://example.com/image.jpg">Pin it on Pinterest</div>
<!-- Add buttons for other platforms as needed -->

Note

  • ezShare does not provide any predefined styles for the share buttons. Users have the freedom to style them according to their design preferences.
  • Ensure each button element has the appropriate class (ez-PLATFORM) and data attributes (data-url, data-description, etc.) for the desired platform and parameters.

ez-share's People

Contributors

shakilahmed0369 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.