https://github.com/ttys026/wxapp-identicon
根据用户openID在小程序客户端随机生成SVG头像的插件.
https://github.com/ttys026/wxapp-identicon
javascript wxapp
Last synced: about 1 year ago
JSON representation
根据用户openID在小程序客户端随机生成SVG头像的插件.
- Host: GitHub
- URL: https://github.com/ttys026/wxapp-identicon
- Owner: ttys026
- License: mit
- Created: 2018-08-29T04:38:21.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-29T05:12:33.000Z (almost 8 years ago)
- Last Synced: 2025-03-15T04:49:07.334Z (over 1 year ago)
- Topics: javascript, wxapp
- Size: 67.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# wxapp-identIcon
根据用户openID在小程序客户端随机生成SVG头像的插件.
## 使用
1. clone project或者下载压缩包,因为小程序对代码量有<2M的要求,只需要拷贝dist目录下需要使用的Style到小程序目录中。
2. 在js文件中引用:
```
var IdentIcon = require('../../utils/githubStyle/index.js');
```
3. 在js文件中使用:
```
var data = IdentIcon('openID');
this.setData({image: data});
```
上述例子中openID也可以替换成任意字符串。
4.在wxml中插入图片:
```
```
## 截图
#### Github style:

#### Robohash Style:

## Credits
#### HashTool from https://github.com/emn178/js-sha256
#### Github style revised from https://github.com/stewartlord/identicon.js
#### Robohash style revised from https://github.com/nimiq/robohash