2.0.3 • Published 8 years ago
badger.js v2.0.3
Badger
A library for displaying a list of "badges" with the dependency info of a project, similar to Google Chrome's chrome://credits page.
Table of Contents =================
What is it? ==========
A library for displaying a list of "badges" with the dependency info of a project, similar to Google Chrome's chrome://credits page.
Installation ============
NPM
npm install badger.js
Usage =====
Include badger.css in the head of your project:
<link rel="stylesheet" href="badger.css">
And badger.js in the head or body:
<script src="badger.js"></script>
In the HTML where you want the badges displayed place an element with class badger-container, like so:
<divclass="badger-container"></div>
And use something like this to create the badges:
<script type="text/javascript"><!--
function addBadgeData() {
var badges = [
/*
* Each badge must have a name, home, and license property.
* These will be used with the Badger.js template to create
* the badges for your project.
*/
{
name: "Badger",
home: "https://github.com/l3laze/Badger",
license: "https://github.com/l3laze/Badger/blob/master/LICENSE.md"
},
w3css = {
name: "W3.CSS",
home: "https://www.w3schools.com",
license: ""
},
{
name: "Font-Awesome",
home: "http://fontawesome.io/",
license: "http://fontawesome.io/license/"
}
],
badgerContainer = document.getElementsByClassName( "badger-container" )[ 0 ];
for( var b in badges ) {
badgerContainer.appendChild( craftBadge( badges[ b ]));
}
}
window.addEventListener( "DOMContentLoaded", addBadgeData );
--></script>
Change Log ==========