0.3.0 • Published 5 years ago

@onehilltech/initial.js v0.3.0

Weekly downloads
1
License
-
Repository
-
Last release
5 years ago

initial.js

Simple jQuery plugin to make Gmail like text avatars for profile pictures.


Demo

Browser compatibility

  • Chrome
  • Firefox
  • Opera 9+
  • Safari 3.2+
  • iOS Safari 3.2+
  • Android Browser 3+

Usage

Markup

<img data-name="Steve" data-color="#85e0ce" class="profile"/>

jQuery code

$('.profile').initial();

Options

Below options can be overridden with data-attributes inside the image element. Refer to the "data-attribute" column for related data-attribute for each option

Optiondata-attributeDescriptionDefault
namedata-nameName of the user which the profile picture should be generatedName
heightdata-heightHeight of the picture100
widthdata-widthWidth of the picture100
charCountdata-char-countNumber of characherts to be shown in the picture.1
textColordata-text-colorColor of the text#ffffff
fontSizedata-font-sizeFont size of the character(s)60
fontWeightdata-font-weightFont weight of the character(s)400
radiusdata-radiusRounded corners0
seeddata-seedNumber to randomize the background color0
colordata-colorBackground color of the profile picture that should be generatednull