Demo :- Click Here
-
Just add these two JavaScript's in your site above
</body>
<script>/*<![CDATA[*/ // The css selectors used here are from plus ui blogger theme, so if you are using a different theme you need to change the selectors accordingly. const config = { usernameSelector: '.cmHr .n bdi', // The selector for the username element commentSelector: '.c', // The selector for the comment element (the element that contains the username and the timestamp) timestampSelector: '.d.dtTm', // The selector for the timestamp element timestampAttribute: 'data-datetime', // The attribute for the timestamp profilePicSelector: '.cmAv .im', // The selector for the profile picture element setRandomAvatarForAll: true, // When true it will set a random avatar for all the users in the comment section, when false it will only set avatars for users who don't have a profile picture avatarStyle: 'thumbs' // Choose the avatar style, examples :- bottts }; /*]]>*/</script>
<!-- This will load the avatar.js only on posts and pages --> <b:if cond='data:view.isSingleItem'> <script src='https://theamanstark.com/cdn/blogger/avatar.js/v1.0/av.min.js'></script> </b:if>
-
To select the avatar art style of your choice, enter the code name at
avatarStyle
in the config, for example,const config = { avatarStyle: 'thumbs', };
To see each art style in action, go to the demo site :- click here. -
When
setRandomAvatarForAll = true
, the code will assign the randomly generated avatar to every person who has commented on your article; however, ifsetRandomAvatarForAll = false
, the avatar will be allocated exclusively to those who do not have a profile picture.