A custom webcomponent for avatars. Currently full support for Gravatar, facebook, twitter, google+ and skype avatars.
Install the component using Bower:
$ bower install bit-avatar --saveOr download as ZIP.
-
Import Web Components' polyfill:
<script src="bower_components/platform/platform.js"></script>
-
Import Custom Element:
<link rel="import" href="bower_components/bit-avatar/dist/bit-avatar.html">
-
Start using it!
<bit-avatar></bit-avatar>
| Attribute | Options | Default | Description |
|---|---|---|---|
user-id |
string | None | Gravatar: Email hash. Facebook: Facebook ID. Skype: Skype username. Twitter: Twitter username. Google+: Google ID. To find your Google ID, go to https://picasaweb.google.com/data/entry/api/user/XXX?alt=json where XXX is your Google username. Your ID will be at the bottom (gphoto$user). |
provider |
gravatar, facebook, google+, twitter, skype |
gravatar |
What provider to use when fetching the avatar. |
name |
string | '' | The name for the avatar user (alt-attribute) |
size |
int OR string (facebook: small, normal, large, square), (twitter: mini, normal, bigger, original) |
Facebook and twitter uses strings. Gravatar and google+ uses an int. Skype has no size options. Facebook sizes: small=80*auto, normal=100*auto, large=200*auto, square=50*50. Twitter sizes: mini=24*24, normal=48*48, bigger=73*73, original=original size. |
|
gravatar-rating |
g, pg, r, x |
None | See gravatar documentation (rating) for more information. |
gravatar-default |
404, mm, identicon, monsterid, wavatar, retro, blank, URL to custom default |
None | See gravatar documentation (default image) for more information. |
gravatar-force-default |
None | If this attribute is present, the default gravatar will be forced even if an avatar exists for that user. See gravatar documentation (force default) for more information. |
In order to run it locally you'll need to fetch some dependencies and a basic server setup.
-
$ [sudo] npm install -g bower grunt-cli
-
Install local dependencies:
$ bower install && npm install -
To test your project, start the development server and open
http://localhost:8000.$ grunt server
-
To build the distribution files before releasing a new version.
$ grunt build
-
To provide a live demo, send everything to
gh-pagesbranch.$ grunt deploy
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature - Commit your changes:
git commit -m 'Add some feature' - Push to the branch:
git push origin my-new-feature - Submit a pull request :D
For detailed changelog, check Releases.