component-badge

1.2.0 • Public • Published

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.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.2.0
    4
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.2.0
    4
  • 1.1.2
    6
  • 1.1.0
    4
  • 1.0.1
    3
  • 1.0.0
    4

Package Sidebar

Install

npm i component-badge

Weekly Downloads

12

Version

1.2.0

License

MIT

Last publish

Collaborators

  • silvinci