Based on @timoxley's idea and made for @ForbesLindesay's website
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
resources
test
.gitignore
.travis.yml
README.md
index.js
package.json

README.md

component badge Build Status

Based on @timoxley's idea and made for @ForbesLindesay's website

npm install component-badge


badge([count, [options]]) returns a String representing a SVG image.
count is the number shown under the logo ("1337 available"). If left out the subline comletely vanishes.
options is an object that takes these params including their default values.

  • scale: 1
  • subtitlePos: "bottom"
  • subtitleFill: "#939393"
  • backgroundFill: "none"
  • titleFill: "#000000"
  • circleFill: "#353535"
  • leftAnnulusFill: "#353535"
  • rightAnnulusFill: "#939393"

badge.load(path) loads a new template.
path is the path to the template to be loaded.

var badge = require("component-badge");

console.log(badge(1337, 1.5)); // <svg width="720px" height="180px">...

badge.load("./myNewLogo.svg");

Fun Fact: The vector graphic was generated by JavaScript.