0.3.4 • Published 8 years ago

initial-js v0.3.4

Weekly downloads
404
License
MIT
Repository
github
Last release
8 years ago

initial.js

Build Status

Simple jQuery plugin to make Gmail like text avatars for profile pictures. Credits: Original plugin and author https://github.com/judesfernando/initial.js

Browser compatibility

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

Usage

<img data-name="Steve" class="profile">
$('.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 characters to be shown in the picture.1
wordCountdata-word-countNumber of Words to be initialized in the picture.2
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
srcdata-srcImage url to load instead of initial text if availablenull

License

initial.js is MIT licensed. All credit to original author and contributors.