{"id":17498127,"url":"https://github.com/moox/gravatar-lazyload","last_synced_at":"2025-12-23T19:30:44.624Z","repository":{"id":7282125,"uuid":"8596637","full_name":"MoOx/gravatar-lazyload","owner":"MoOx","description":"A tiny standalone script to lazyload some Gravatar (from html attributes, without \u003cimg\u003e)","archived":false,"fork":false,"pushed_at":"2014-01-08T06:13:41.000Z","size":123,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-19T19:40:17.190Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MoOx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-03-06T05:34:15.000Z","updated_at":"2014-01-08T06:13:41.000Z","dependencies_parsed_at":"2022-08-19T03:00:55.704Z","dependency_job_id":null,"html_url":"https://github.com/MoOx/gravatar-lazyload","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoOx%2Fgravatar-lazyload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoOx%2Fgravatar-lazyload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoOx%2Fgravatar-lazyload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoOx%2Fgravatar-lazyload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MoOx","download_url":"https://codeload.github.com/MoOx/gravatar-lazyload/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239707798,"owners_count":19684134,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-19T16:04:09.375Z","updated_at":"2025-12-23T19:30:39.317Z","avatar_url":"https://github.com/MoOx.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gravatar Lazyload\n\n\u003e Gravatar script that allow you to (lazy) load some gravatars on your webpage without using `\u003cimg\u003e`.\n\n_No javascript dependency. Less than 1Kb compressed + gzipped_\n\nYou just need to include `gravatar.js` script, and add a `data-email` or `data-email-md5` attribute on elements having `gravatar`, `gravatar-before` or `gravatar-after` class.\nThis elements will be or have`:before`/`:after` pseudo elements with the gravatar in it.\n\nGravatar are added after `window.load` fired (to make a sort of lazy load).\n\n## TODO\n\n+ lazyload when the gravatar will appear on the viewport, not just after window.load.\n\n## Installation\n\n*Remember you need to include all scripts added to your page (using your own solution: simple `\u003cscript\u003e`s, or using you favorite assets manager - grunt.js, require.js...)*\n\n**Note: MD5.js is optional (not needed if you directly use data-email-md5 attribute - *recommanded method*).**\n\n## Usage\n\nInclude `gravatar.js` in your page and optionally `lib/md5.js` \u0026 two polyfills (`addEventListener` + `getElementsByClassName`) if you want old browsers support.\nNote that I advise you [aight.js](https://github.com/shawnbot/aight) to find  nice polyfills in it, instead of the polyfills I gave.\n\nTo trigger the JavaScript you need to add a classname to the element. You can use `gravatar`, `gravatar-before` or `gravatar-after` depending on where you want the Gravatar to be added.\n\nThat's it.\n\n## Options\n\nIf you want to change default options, you can just create (before including the `gravatar.js` script) the javascript object `gravatarOptions`.\nHere are default values:\n\n```js\nvar gravatarOptions = {\n    size: 48, // can be from 1 to 512\n    rating: 'PG', // Gravatar rating values: G | PG | R | X - see Gravatar doc for more info\n    defaultImage: ''; // Default Gravatar url if the user don't have one. Can be an url or a Gravatar value like 404 | mm | identicon | monsterid | wavatar\n    propertyUsed: 'background-image', // Can be `background-image`, `background`, or `content` since the value is an `url(…)`\n    addDimensions: true, //  true or false (add width \u0026 height). Usefull if you use background property. In this case, remember to add content: \"\";\n    pseudoDisplay: 'inline-block', // CSS display property used for pseudo elements. Can be `block` or `inline-block` (inline is not advised...) or `null\n}\n```\n\n*Note: `gravatar` class is incompatible with `propertyUsed: 'content'` since this property is only for pseudo elements.*\n\n**Alternatively, you can specify some options for each element with html attributes, using `data-gravatar-size`, `data-gravatar-rating`, `data-gravatar-defaultImage`**\n\n## Credits\n\nBased on [an original idea](http://darcyclarke.me/development/quick-tip-get-gravatar-images-from-emails-with-javascript/) of [@darcyclarke](https://github.com/darcyclarke) \u0026 [@chriscoyier](https://github.com/chriscoyier)\n\n## License\n\nReleased under [MIT Licence](http://moox.mit-license.org/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoox%2Fgravatar-lazyload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoox%2Fgravatar-lazyload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoox%2Fgravatar-lazyload/lists"}