GithubHelp home page GithubHelp logo

rapidwebltd / direct-share-buttons Goto Github PK

View Code? Open in Web Editor NEW
9.0 9.0 4.0 15 KB

A pure HTML & CSS implementation of interacting with social networks without the need of heavy JavaScript widgets.

License: MIT License

CSS 100.00%
social-networks social-media social-buttons css

direct-share-buttons's Introduction

Direct Share Buttons

Formerly known as Intent Social Icons

A pure HTML & CSS implementation on allowing your end users to interact with social networks from your site without any need of loading in heavy JavaScript-based widgets.

Installation

Dependencies

Via Bower

Simply run:

bower install direct-share-buttons

Via Manually

First download the direct-share-buttons.css in this repository and include it at the top of your page with the font awesome CDN link:

<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<link rel="stylesheet" href="direct-share-buttons.css">

(Or where you have saved the direct-share-buttons.css file...)

Next view the demo.html page to find suitable social share buttons and copy the code and you're done! :)

Examples & Usage

Circle Icons

Screenshot of Circle Direct Share Icons

<a href="//www.facebook.com/sharer/sharer.php?u=YOUR_URL" class="fa-stack fa-lg">
  <i class="fa fa-circle dsb-facebook fa-stack-2x"></i>
  <i class="fa fa-facebook fa-stack-1x dsb-white"></i>
</a>

<a href="//twitter.com/intent/tweet/?text=YOUR_TEXT&amp;url=YOUR_URL&amp;via=YOUR_TWITTER" class="fa-stack fa-lg">
  <i class="fa fa-circle dsb-twitter fa-stack-2x"></i>
  <i class="fa fa-twitter fa-stack-1x dsb-white"></i>
</a>

<a href="//plus.google.com/share?url=YOUR_URL" class="fa-stack fa-lg">
  <i class="fa fa-circle dsb-googleplus fa-stack-2x"></i>
  <i class="fa fa-google-plus fa-stack-1x dsb-white"></i>
</a>

<a href="javascript:void((function()%7Bvar%20e=document.createElement(&apos;script&apos;);e.setAttribute(&apos;type&apos;,&apos;text/javascript&apos;);e.setAttribute(&apos;charset&apos;,&apos;UTF-8&apos;);e.setAttribute(&apos;src&apos;,&apos;//assets.pinterest.com/js/pinmarklet.js?r=&apos;+Math.random()*99999999);document.body.appendChild(e)%7D)());" class="fa-stack fa-lg">
  <i class="fa fa-circle dsb-pinterest fa-stack-2x"></i>
  <i class="fa fa-pinterest-p fa-stack-1x dsb-white"></i>
</a>

<a href="//www.linkedin.com/shareArticle?url=YOUR_URL&amp;title=YOUR%20TITLE&amp;summary=YOUR%20SUMMARY" class="fa-stack fa-lg">
   <i class="fa fa-circle dsb-linkedin fa-stack-2x"></i>
   <i class="fa fa-linkedin fa-stack-1x dsb-white"></i>
</a>

Square Icons

Screenshot of Square Direct Share Icons

<a href="//www.facebook.com/sharer/sharer.php?u=YOUR_URL" class="fa-stack fa-lg">
  <i class="fa fa-square dsb-facebook fa-stack-2x"></i>
  <i class="fa fa-facebook fa-stack-1x dsb-white"></i>
</a>

<a href="//twitter.com/intent/tweet/?text=YOUR_TEXT&amp;url=YOUR_URL&amp;via=YOUR_TWITTER" class="fa-stack fa-lg">
  <i class="fa fa-square dsb-twitter fa-stack-2x"></i>
  <i class="fa fa-twitter fa-stack-1x dsb-white"></i>
</a>

<a href="//plus.google.com/share?url=YOUR_URL" class="fa-stack fa-lg">
  <i class="fa fa-square dsb-googleplus fa-stack-2x"></i>
  <i class="fa fa-google-plus fa-stack-1x dsb-white"></i>
</a>

<a href="javascript:void((function()%7Bvar%20e=document.createElement(&apos;script&apos;);e.setAttribute(&apos;type&apos;,&apos;text/javascript&apos;);e.setAttribute(&apos;charset&apos;,&apos;UTF-8&apos;);e.setAttribute(&apos;src&apos;,&apos;//assets.pinterest.com/js/pinmarklet.js?r=&apos;+Math.random()*99999999);document.body.appendChild(e)%7D)());" class="fa-stack fa-lg">
  <i class="fa fa-square dsb-pinterest fa-stack-2x"></i>
  <i class="fa fa-pinterest-p fa-stack-1x dsb-white"></i>
</a>

<a href="//www.linkedin.com/shareArticle?url=YOUR_URL&amp;title=YOUR%20TITLE&amp;summary=YOUR%20SUMMARY" class="fa-stack fa-lg">
   <i class="fa fa-square dsb-linkedin fa-stack-2x"></i>
   <i class="fa fa-linkedin fa-stack-1x dsb-white"></i>
</a>

Icons with Text

Screenshot of Direct Share Icons with text label

<a href="//www.facebook.com/sharer/sharer.php?u=YOUR_URL" class="dsb-btn dsb-facebook-bg dsb-white"><i class="fa fa-facebook"></i> Share</a>

<a href="//twitter.com/intent/tweet/?text=YOUR_TEXT&amp;url=YOUR_URL&amp;via=YOUR_TWITTER" class="dsb-btn dsb-twitter-bg dsb-white"><i class="fa fa-twitter"></i> Tweet</a>

<a href="//plus.google.com/share?url=YOUR_URL" class="dsb-btn dsb-googleplus-bg dsb-white"><i class="fa fa-google-plus"></i> Share</a>

<a href="javascript:void((function()%7Bvar%20e=document.createElement(&apos;script&apos;);e.setAttribute(&apos;type&apos;,&apos;text/javascript&apos;);e.setAttribute(&apos;charset&apos;,&apos;UTF-8&apos;);e.setAttribute(&apos;src&apos;,&apos;//assets.pinterest.com/js/pinmarklet.js?r=&apos;+Math.random()*99999999);document.body.appendChild(e)%7D)());" class="dsb-btn dsb-pinterest-bg dsb-white"><i class="fa fa-pinterest-p"></i> Pin It</a>

<a href="//www.linkedin.com/shareArticle?url=YOUR_URL&amp;title=YOUR%20TITLE&amp;summary=YOUR%20SUMMARY" class="dsb-btn dsb-linkedin-bg dsb-white"><i class="fa fa-linkedin"></i> Share</a>

Credits

Font Awesome - For the Social Network Logos

Danny van Kooten - For the insight into social network sharing

Jeremy Mansfield - For the insight into Pinterest functionality from URL

License

MIT

direct-share-buttons's People

Contributors

divineomega avatar ojdon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

direct-share-buttons's Issues

Rename project

Does anyone have a better name suggestion for the project? I used the word 'Intent' as that's what Twitter call the action which the buttons are linked to as otherwise they would of just had a generic name such as 'Social Share buttons'.

Any ideas?

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.