/dynamic-favicon

Create dynamic favicon's with javascript and canvas

Primary LanguageJavaScript

Dynamic Favicon

Static favicon’s SUCK if you frequently use a lot of browser tabs for the same webservice/website. Such occurs

  • when opening ten tabs of the same webservice

  • for developers browsing the development, staging and live server

  • for webservices with subdomains for each account and you are logged into multiple Accounts at the same time

For me all of the above apply’s(in SalesKing) and i am sick of beeing lost in tabs(ation). So i finally hacked a tiny javascript to enable me and our users to customize their favicon’s

Usage

See favicon and js in page source: salesking.github.com/dynamic-favicon

RTFC .. as long as the docs are sparse :-)

Basics

The js creates a new header link containing a “blind” favicon. Above this base a customizable canvas image is rendered.

You can configure:

  • background png

  • text + color

  • text alignment

  • font

  • image border radius

Example

Setup with some custom options:

DynFav.txt_color = '#fff';
DynFav.txt = 'S';
DynFav.txt_x = 3;
DynFav.txt_y = 13;
DynFav.font = 'bold 13px Arial';
DynFav.change();

Size

License

MIT 2011 Georg Leciejewski