Git Product home page Git Product logo

sbt's Introduction

Social Buttons

Share your notes with beautiful social buttons.

View the demo at: http://lab.lepture.com/social/

Getting Started

This is a ready to use widget, include the assets, and everything will be ready:

<link rel="stylesheet" href="http://lab.lepture.com/social/dist/widget.css">
<div class="social-button" data-twitter="lepture"
    data-facebook="lepture" data-weibo="lepture"
    data-count="true" data-text="Build software better, together."
    data-url="https://github.com/"></div>
<script src="http://lab.lepture.com/social/dist/widget.js"></script>

Data API

The widget script will generate every elements that has the class name social-button.

  • data-twitter: fill with your twitter ID to enable twitter button
  • data-facebook: fill with your facebook ID to enable facebook button
  • data-weibo: fill with your weibo ID to enable weibo button
  • data-text: text content to be shout out
  • data-url: if not set, it will be current browsering location
  • data-count: if set to true, it will show tweet count when hovering

Advanced Data API

Here are the advanced data API, which you won't use in the daily life.

  • data-weibo-key: a weibo APP key for querying link count
  • data-image: a image url for weibo tweet
  • data-prefix: icon class prefix, default is icon-

The rest part of this documentation is for component.

Installation

Install with component(1):

$ component install lepture/social

API

var social = require('social')
social(el, options)

Options

  • twitter: if not set, data-twitter will be used
  • facebook: if not set, data-facebook will be used
  • weibo: if not set, data-weibo will be used
  • text: if not set, data-text will be used
  • url: if not set, data-url will be used
  • count: if not set, data-count will be used
  • weiboKey: if not set data-weibo-key will be used
  • image: if not set, data-image will be used
  • prefix: if not set, data-prefix will be used

View the DATA API part for more detail.

Notes

Component will download the script and stylesheet, but it will not download the fonts. Chances are that you are using icon fonts already, it would be better to combine all your icons in one font.

You can configure the icon class prefix with prefix option, the default prefix is icon-. Keep in mind, that you have icons for:

  • .icon-twitter
  • .icon-weibo
  • .icon-facebook

If you don't have any icon fonts. You can always download them from:

https://github.com/lepture/social/tree/master/dist/fonts

And this stylesheet:

https://github.com/lepture/social/blob/master/dist/style.css

License

MIT

sbt's People

Contributors

lepture avatar

Watchers

 avatar  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.