{"id":26685926,"url":"https://github.com/JosephSmith127/react-avatar-generator","last_synced_at":"2025-03-26T11:01:12.736Z","repository":{"id":34668888,"uuid":"164990482","full_name":"jsmmth/react-avatar-generator","owner":"jsmmth","description":"Generate fun kaleidoscope for user avatars.","archived":false,"fork":false,"pushed_at":"2022-12-03T20:47:33.000Z","size":531,"stargazers_count":69,"open_issues_count":13,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T01:35:40.905Z","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/jsmmth.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":"2019-01-10T04:35:45.000Z","updated_at":"2025-03-09T18:34:02.000Z","dependencies_parsed_at":"2023-01-15T08:31:00.077Z","dependency_job_id":null,"html_url":"https://github.com/jsmmth/react-avatar-generator","commit_stats":null,"previous_names":["jsmmth/react-avatar-generator","josephsmith127/react-avatar-generator"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsmmth%2Freact-avatar-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsmmth%2Freact-avatar-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsmmth%2Freact-avatar-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsmmth%2Freact-avatar-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsmmth","download_url":"https://codeload.github.com/jsmmth/react-avatar-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245641426,"owners_count":20648641,"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":"2025-03-26T11:01:12.142Z","updated_at":"2025-03-26T11:01:12.643Z","avatar_url":"https://github.com/jsmmth.png","language":"JavaScript","funding_links":[],"categories":["UI Components","\u003csummary\u003eUI Components\u003c/summary\u003e"],"sub_categories":["Form Components","Miscellaneous"],"readme":"# React Avatar Generator\nThis was inspired by an old website called LayerVault. You can see an example of how that used to look like [here](https://dribbble.com/shots/691265-Kaleidoscope-In-Production).\n\n## Getting Started\n- `yarn add react-avatar-generator` or `npm i react-avatar-generator`\n- `import AvatarGenerator from 'react-avatar-generator';`\n\n## Example Usage\n```\n\u003cAvatarGenerator\n  colors={['#333', '#222', '#ccc']}\n  backgroundColor=\"#000\"\n/\u003e\n```\n\nThis creates something like this:\n\n\u003cimg src=\"https://i.ibb.co/vDg9Trb/Screenshot-2019-01-10-at-04-34-51.png\" width=\"100\" /\u003e\n\nWith a little playing around with this component I found it quite easy to make something similar to what LayerVault originally had.\n\n\u003cimg src=\"https://i.ibb.co/0XmmV0s/Screen-Recording-2019-01-10-at-04-33-23.gif\" width=\"500\" /\u003e\n\n## Props\n| prop        | type            | default                   | options                   |\n| ------------ | --------------- | ---------------------- | ---------------------- |\n| width          | number           | 200              |              |\n| height        | number      | 200        |              |\n| mirrors       | number     | 3             |              |\n| zoom | number | 0.2 |              |\n| rotation       | number     | 0.3             |              |\n| fade       | number     | 1             |              |\n| opacity       | number     | 0.3             |              |\n| amount       | number     | 16             |              |\n| spacing       | number     | 20             |              |\n| wavelength       | number     | 2             |              |\n| sizing       | number     | 4             |              |\n| shape       | string     | 'circle'             | can be `circle`, `triangle` or `square`          |\n| backgroundColor       | string     | '#fff'             |              |\n| backgroundOpacity       | number     | 0.3             |              |\n| colors       | array     | []             |              |\n\n## Methods\n| prop        | type            | description                   |\n| ------------ | --------------- | ---------------------- |\n| randomize          | function           | Randomizes the kaleidoscope to have a new random pattern             |\n| isValidHex          | function           | Passing in a string will return true of false if that string is a valid hex, a helpful function to have when working with colors             |\n| getImageData          | function           | Calling this function returns the raw image/png data you can then use to save into a .png file.             |\n\n## Using Methods\n\n```\nclass CustomAvatarGenerator extends React.Component {\n  constructor(props) {\n    super(props);\n    this.avatarGenerator = null;\n  }\n  \n  randomize() {\n    this.avatarGenerator.randomize();\n  }\n  \n  render() {\n    return (\n      \u003cdiv\u003e\n        \u003cbutton onClick={this.randomize}\u003eRandomize\u003c/buttom\u003e\n        \u003cAvatarGenerator\n          ref={(el) =\u003e {\n            this.avatarGenerator = el;\n          }\n          colors={['#333', '#222', '#ccc']}\n          backgroundColor=\"#000\"\n        /\u003e\n      \u003c/div\u003e\n    );\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJosephSmith127%2Freact-avatar-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJosephSmith127%2Freact-avatar-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJosephSmith127%2Freact-avatar-generator/lists"}