Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/itorr/weibo-face
🧣「解析微博表情」微博表情解析替换
https://github.com/itorr/weibo-face
face javascript npm weibo
Last synced: 22 days ago
JSON representation
🧣「解析微博表情」微博表情解析替换
- Host: GitHub
- URL: https://github.com/itorr/weibo-face
- Owner: itorr
- License: mit
- Created: 2022-10-09T12:20:44.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-14T13:48:09.000Z (about 2 years ago)
- Last Synced: 2024-10-04T21:53:14.112Z (about 1 month ago)
- Topics: face, javascript, npm, weibo
- Language: JavaScript
- Homepage: https://lab.magiconch.com/weibo-face/
- Size: 1.09 MB
- Stars: 10
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 解析微博表情
## 安装
```bash
npm i weibo-face
```
或者
### 引用 CDN
例 [html/npm-cdn.html](https://lab.magiconch.com/weibo-face/npm-cdn.html)
[源代码](https://github.com/itorr/weibo-face/blob/main/html/npm-cdn.html#L46)## 使用
### 转换正文中表情成网页代码
```javascript
import { weiboFaceParse } from 'weibo-face'weiboFaceParse('好耶[太开心][鼓掌][嘻嘻]')
// '好耶'
```### 获取表情列表
```javascript
import { WeiboFaceByValues } from 'weibo-face'
// { value: url,... }Object.entries(WeiboFaceByValues)
// [ [value, url],... ]
```
## 建议的样式
```CSS
.weibo-face{
width: 18px;
height: 18px;
vertical-align: -4px;
margin: 0 1px;
}
```