{"id":15611706,"url":"https://github.com/patrickvaler/st-gravatar-img","last_synced_at":"2026-01-07T14:51:21.411Z","repository":{"id":57369092,"uuid":"141479456","full_name":"patrickvaler/st-gravatar-img","owner":"patrickvaler","description":"Web Component to display Gravatar images","archived":false,"fork":false,"pushed_at":"2020-05-29T21:55:03.000Z","size":7552,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T14:08:55.391Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/patrickvaler.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-18T19:15:21.000Z","updated_at":"2018-08-08T22:58:05.000Z","dependencies_parsed_at":"2022-09-16T10:12:09.550Z","dependency_job_id":null,"html_url":"https://github.com/patrickvaler/st-gravatar-img","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickvaler%2Fst-gravatar-img","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickvaler%2Fst-gravatar-img/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickvaler%2Fst-gravatar-img/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickvaler%2Fst-gravatar-img/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patrickvaler","download_url":"https://codeload.github.com/patrickvaler/st-gravatar-img/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246200322,"owners_count":20739566,"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-03T06:07:05.612Z","updated_at":"2026-01-07T14:51:21.371Z","avatar_url":"https://github.com/patrickvaler.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# st-gravatar-img\n\n[![npm version](https://badge.fury.io/js/st-gravatar-img.svg)](http://badge.fury.io/js/st-gravatar-img)\n[![Build Status](https://travis-ci.org/patrickvaler/st-gravatar-img.svg?branch=master)](https://travis-ci.org/patrickvaler/st-gravatar-img)\n[![Dependency Status](https://david-dm.org/patrickvaler/st-gravatar-img/status.svg?style=flat)](https://david-dm.org/patrickvaler/st-gravatar-img)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n[![Greenkeeper badge](https://badges.greenkeeper.io/patrickvaler/st-gravatar-img.svg)](https://greenkeeper.io/)\n![Built With Stencil](https://img.shields.io/badge/-Built%20With%20Stencil-16161d.svg?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjIuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTIgNTEyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI%2BCjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI%2BCgkuc3Qwe2ZpbGw6I0ZGRkZGRjt9Cjwvc3R5bGU%2BCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00MjQuNywzNzMuOWMwLDM3LjYtNTUuMSw2OC42LTkyLjcsNjguNkgxODAuNGMtMzcuOSwwLTkyLjctMzAuNy05Mi43LTY4LjZ2LTMuNmgzMzYuOVYzNzMuOXoiLz4KPHBhdGggY2xhc3M9InN0MCIgZD0iTTQyNC43LDI5Mi4xSDE4MC40Yy0zNy42LDAtOTIuNy0zMS05Mi43LTY4LjZ2LTMuNkgzMzJjMzcuNiwwLDkyLjcsMzEsOTIuNyw2OC42VjI5Mi4xeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNDI0LjcsMTQxLjdIODcuN3YtMy42YzAtMzcuNiw1NC44LTY4LjYsOTIuNy02OC42SDMzMmMzNy45LDAsOTIuNywzMC43LDkyLjcsNjguNlYxNDEuN3oiLz4KPC9zdmc%2BCg%3D%3D\u0026colorA=16161d\u0026style=flat-square)\n\nA simple web component to display [gravatar] images based on [stencil].\n\nCheckout the [Demo] / [Demo with Editor].\n\n## Install this component\n\n### By cdn\n\n```html\n\u003cscript src=\"https://unpkg.com/st-gravatar-img@latest/dist/st-gravatar-img.js\"\u003e\u003c/script\u003e\n```\n\n### By npm (self hosted)\n\n```bash\nnpm install st-gravatar-img --save\n```\n\n```html\n\u003cscript src=\"node_modules/st-gravatar-img/dist/st-gravatar-img.js\"\u003e\u003c/script\u003e\n```\n\n## Use this component\n\n```html\n\u003c!-- by md5 hash of your email --\u003e\n\u003cst-gravatar-img hash=\"322b70sg015ith31u69b49cc1c81315f\"\u003e\u003c/st-gravatar-img\u003e\n\u003c!-- or by email --\u003e\n\u003cst-gravatar-img email=\"my@email.com\"\u003e\u003c/st-gravatar-img\u003e\n```\n\n## Attributes\n\n| Attribute | Type     | Default | Description                                                |\n| --------- | -------- | ------- | ---------------------------------------------------------- |\n| `hash`    | _string_ | _none_  | MD5 hash of your email (avoid to expose your email)        |\n| `email`   | _string_ | _none_  | Gravatar account email (**warning** email will be exposed) |\n| `size`    | _number_ | `120`   | Size (px) of the image                                     |\n\n## CSS Variables\n\n[CSS Variables][css-variables] can be used to style the web component:\n\n### Available variables\n\n| Attribute                      | Default | Description                                            |\n| ------------------------------ | ------- | ------------------------------------------------------ |\n| `--gravatar-img-border`        | _none_  | Defines `border` property of the `img` element         |\n| `--gravatar-img-border-radius` | _none_  | Defines `border-radiues` property of the `img` element |\n| `--gravatar-img-background`    | _none_  | Defines `background` property of the `img` element     |\n\n### Example usage\n\n```css\n:root {\n  --gravatar-img-border: 10px solid #a52525;\n  --gravatar-img-border-radius: 100%;\n  --gravatar-img-background: #a52525;\n}\n```\n\n## How to create a hash\n\nImages on [Gravatar] can be accessed by a `MD5` hash of your email address.\n\n### How to use `createHash` method\n\nThis web component offers the possibility to create a hash based on your email address by the exposed `createHash` method.\n\n```javascript\nlet gravatarImg = document.querySelector('st-gravatar-img');\n\n// method is available when component is ready\ngravatarImg.componentOnReady().then(() =\u003e {\n  // create hash\n  const hash = gravatarImg.createHash('my@email.ccom');\n  // now you can apply the hash on the web component\n  gravatarImg.setAttribute('hash', hash);\n});\n```\n\n[stencil]: https://stenciljs.com/\n[gravatar]: https://gravatar.com/\n[css-variables]: https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_variables\n[demo]: https://st-gravatar-img-vanilla-js.stackblitz.io/\n[demo with editor]: https://stackblitz.com/edit/st-gravatar-img-vanilla-js\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickvaler%2Fst-gravatar-img","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatrickvaler%2Fst-gravatar-img","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickvaler%2Fst-gravatar-img/lists"}