<!DOCTYPE html>
<!--
/*************************************************************
* This script is developed by Arturs Sosins aka ar2rsawseen, http://webcodingeasy.com
* Feel free to distribute and modify code, but keep reference to its creator
*
* Initial Avatar class creates avatars for users from user initials.
* It creates a hash from the user's name and generates a background color based on it.
* Then it gets a complimentary color for the text, and calculates text size and position
* based on the font and length of initials.
* This package can output binary image data, or apply image to existing img element
* or create new img element
*
* For more information, examples and online documentation visit:
* http://webcodingeasy.com/JS-classes/Create-avatar-from-user-initials
**************************************************************/
-->
<html>
<head>
</head>
<body>
<p><img id='test' src=''/></p>
<script type='text/javascript' src='initialAvatar.js'></script>
<script type='text/javascript'>
var av = new initialAvatar("Arturs Sosins");
document.getElementById("test").src = av.getData();
</script>
</body>
</html>
|