一个简洁好看的Github项目展示挂件GitHub-Repo-Widget.js

GitHub Repo Widget

Build Status npm npm npm

A good looking github repository widget to add to your website. Do not depends on jQuery or Other framework.

Drop this script on your page and it will build you a beautiful widget that displays the status of your GitHub Repositories.

What does it look like?

Widget Image

Browser Support

We do care about it.

IEChromeFirefoxOperaSafari
IE 8+ ✔Latest ✔Latest ✔Latest ✔Latest ✔

How do I use it?

Everwhere you want a widget to be placed, add the following markup:

<div class="github-widget" data-repo="hustcc/GitHub-Repo-Widget.js"></div>

Then include the javascript file somewhere after you've include jQuery:

<script type="text/javascript" src="GithubRepoWidget.min.js"></script>

That's it! All of the styling is included and image assets are pulled from GitHub.

This automatically handles the CSS styling as well by adding a script tag into the head of the document. This makes it really easy to add to page since there are no other dependencies. Also, the container is fluid so it fills whatever width is available.

All the usage is same with GitHub-jQuery-Repo-Widget.

Additional, you can Programmatic init the github repo div element and render it, e.g.

  • GithubRepoWidget.init(): init the repo Programmatic.

document.getElementById('github-repos').innerHTML = '<div class="github-widget" data-repo="hustcc/GitHub-Repo-Widget.js"></div>';

GithubRepoWidget.init();

Issues

The repo is base on:

What I hava done:

  1. Rewrite GitHub-jQuery-Repo-Widget, and remove jQuery, then get GitHub-Repo-Widget.js. Do not depends on jQuery or Other.

  2. Add a API to init repo Programmatic.

  3. Compress the image, then compress the file size. from 7.62kb to 5.41kb.

  4. Update demo/index.html and screenshot.png.

Welcome to push request and issue.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值