Skip to content
This repository has been archived by the owner on Aug 16, 2020. It is now read-only.

buschtoens/component-badge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published