Coder Social home page Coder Social logo

theamanstark / avatar.js.blogger Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 3.0 153 KB

Javascript package with around 28 distinct styles for assigning randomly generated avatars to users commenting on blogspot-based sites.

Home Page: https://avatarjs.blogspot.com

License: MIT License

avatar avatar-generator avatar-maker avatar-placeholder avatars blogger blogger-api blogspot theamanstark avatarjs

avatar.js.blogger's Introduction

Avatar.js: Blogger Edition

AvatarJs

Demo :- Click Here



# Available Avatar Styles ๐ŸŽจ

Copy your desired avatar art style code name from here and paste it into config.js at avatarStyle.


adventurer
adventurer
adventurer-neutral
adventurer-neutral
avataaars
avataaars
avataaars-neutral
avataaars-neutral
big-ears
big-ears
big-ears-neutral
big-ears-neutral
big-smile
big-smile
bottts
bottts
bottts-neutral
bottts-neutral
croodles
croodles
croodles-neutral
croodles-neutral
fun-emoji
fun-emoji
icons
icons
identicon
identicon
initials
initials
lorelei
lorelei
lorelei-neutral
lorelei-neutral
micah
micah
miniavs
miniavs
notionists
notionists
notionists-neutral
notionists-neutral
open-peeps
open-peeps
personas
personas
pixel-art
pixel-art
pixel-art-neutral
pixel-art-neutral
rings
rings
shapes
shapes
thumbs
thumbs


# Documentation

  1. 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>
  2. 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.

  3. When setRandomAvatarForAll = true, the code will assign the randomly generated avatar to every person who has commented on your article; however, if setRandomAvatarForAll = false, the avatar will be allocated exclusively to those who do not have a profile picture.


# Note :- If you're using the Plus Ui blogger theme, just ignore this. This message is for users who want to use this code on a blogger template other than Plus Ui; if so, you must change all of the CSS selectors in the config to match your site's comment box CSS selector. Please read the comments in the config to see which CSS selector is for which element.

avatar.js.blogger's People

Contributors

theamanstark avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.