You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
358 lines
8.4 KiB
358 lines
8.4 KiB
export const emojiData = [
|
|
//笑脸
|
|
{
|
|
type: 'smiley',
|
|
name: '笑脸',
|
|
list: [
|
|
'😀',
|
|
'😁',
|
|
'😂',
|
|
'🤣',
|
|
'😃',
|
|
'😄',
|
|
'😅',
|
|
'😆',
|
|
'😉',
|
|
'😊',
|
|
'😋',
|
|
'😎',
|
|
'😍',
|
|
'😘',
|
|
'😗',
|
|
'😙',
|
|
'😚',
|
|
'🙂',
|
|
'🤗',
|
|
'🤩',
|
|
'🤔',
|
|
'🤨',
|
|
'😐',
|
|
'😑',
|
|
'😶',
|
|
'🙄',
|
|
'😏',
|
|
'😣',
|
|
'😥',
|
|
'😮',
|
|
'🤐',
|
|
'😯',
|
|
'😪',
|
|
'😫',
|
|
'😴',
|
|
'😌',
|
|
'😛',
|
|
'😜',
|
|
'😝',
|
|
'🤤',
|
|
'😒',
|
|
'😓',
|
|
'😔',
|
|
'😕',
|
|
'🙃',
|
|
'🤑',
|
|
'😲',
|
|
'🙁',
|
|
'😖',
|
|
'😞',
|
|
'😟',
|
|
'😤',
|
|
'😢',
|
|
'😭',
|
|
'😦',
|
|
'😧',
|
|
'😨',
|
|
'😩',
|
|
'🤯',
|
|
'😬',
|
|
'😰',
|
|
'😱',
|
|
'😳',
|
|
'🤪',
|
|
'😵',
|
|
'😡',
|
|
'😠',
|
|
'🤬',
|
|
'😷',
|
|
'🤒',
|
|
'🤕',
|
|
'🤢',
|
|
'🤮',
|
|
'🤧',
|
|
'😇',
|
|
'🤠',
|
|
'🤡',
|
|
'🤥',
|
|
'🤫',
|
|
'🤭',
|
|
'🧐',
|
|
'🤓',
|
|
'😈',
|
|
'👿',
|
|
'👹',
|
|
'👺',
|
|
'💀',
|
|
'👻',
|
|
'👽',
|
|
'🤖',
|
|
'💩',
|
|
],
|
|
},
|
|
//手势
|
|
{
|
|
type: 'gesture',
|
|
name: '手势',
|
|
list: [
|
|
'🤲',
|
|
'👐',
|
|
'🙌',
|
|
'👏',
|
|
'🤝',
|
|
'👍',
|
|
'👎',
|
|
'👊',
|
|
'🤛',
|
|
'🤜',
|
|
'🤞',
|
|
'🤟',
|
|
'🤘',
|
|
'👌',
|
|
'👈',
|
|
'👉',
|
|
'👆',
|
|
'👇',
|
|
'🤚',
|
|
'🖐',
|
|
'🖖',
|
|
'👋',
|
|
'🤙',
|
|
'💪',
|
|
// "🖕",
|
|
'🙏',
|
|
],
|
|
},
|
|
//人物
|
|
{
|
|
type: 'people',
|
|
name: '人物',
|
|
list: [
|
|
'👦',
|
|
'👧',
|
|
'👨',
|
|
'👩',
|
|
'👴',
|
|
'👵',
|
|
'👶',
|
|
'👱',
|
|
'👮',
|
|
'👲',
|
|
'👳',
|
|
'👷',
|
|
'👸',
|
|
'💂',
|
|
'🎅',
|
|
'👰',
|
|
'👼',
|
|
'💆',
|
|
'💇',
|
|
'🙍',
|
|
'🙎',
|
|
'🙅',
|
|
'🙆',
|
|
'💁',
|
|
'🙋',
|
|
'🙇',
|
|
'🙌',
|
|
'🙏',
|
|
'👤',
|
|
'👥',
|
|
'🚶',
|
|
'🏃',
|
|
'👯',
|
|
'💃',
|
|
'👫',
|
|
'👬',
|
|
'👭',
|
|
'💏',
|
|
'💑',
|
|
'👪',
|
|
],
|
|
},
|
|
//动物
|
|
{
|
|
type: 'animal',
|
|
name: '动物',
|
|
list: [
|
|
'🙈',
|
|
'🙉',
|
|
'🙊',
|
|
'🐵',
|
|
'🐒',
|
|
'🐶',
|
|
'🐕',
|
|
'🐩',
|
|
'🐺',
|
|
'🐱',
|
|
'😺',
|
|
'😸',
|
|
'😹',
|
|
'😻',
|
|
'😼',
|
|
'😽',
|
|
'🙀',
|
|
'😿',
|
|
'😾',
|
|
'🐈',
|
|
'🐯',
|
|
'🐅',
|
|
'🐆',
|
|
'🐴',
|
|
'🐎',
|
|
'🐮',
|
|
'🐂',
|
|
'🐃',
|
|
'🐄',
|
|
'🐷',
|
|
'🐖',
|
|
'🐗',
|
|
'🐽',
|
|
'🐏',
|
|
'🐑',
|
|
'🐐',
|
|
'🐪',
|
|
'🐫',
|
|
'🐘',
|
|
'🐭',
|
|
'🐁',
|
|
'🐀',
|
|
'🐹',
|
|
'🐰',
|
|
'🐇',
|
|
'🐻',
|
|
'🐨',
|
|
'🐼',
|
|
'🐾',
|
|
'🐔',
|
|
'🐓',
|
|
'🐣',
|
|
'🐤',
|
|
'🐥',
|
|
'🐦',
|
|
'🐧',
|
|
'🐸',
|
|
'🐊',
|
|
'🐢',
|
|
'🐍',
|
|
'🐲',
|
|
'🐉',
|
|
'🐳',
|
|
'🐋',
|
|
'🐬',
|
|
'🐟',
|
|
'🐠',
|
|
'🐡',
|
|
'🐙',
|
|
'🐚',
|
|
'🐌',
|
|
'🐛',
|
|
'🐜',
|
|
'🐝',
|
|
'🐞',
|
|
'🦋',
|
|
'🐁',
|
|
'🐂',
|
|
'🐅',
|
|
'🐇',
|
|
'🐉',
|
|
'🐍',
|
|
'🐎',
|
|
'🐐',
|
|
'🐒',
|
|
'🐓',
|
|
'🐕',
|
|
'🐖',
|
|
],
|
|
},
|
|
//其他
|
|
{
|
|
type: 'other',
|
|
name: '其他',
|
|
list: [
|
|
'🌹',
|
|
'🍀',
|
|
'🍎',
|
|
'💰',
|
|
'📱',
|
|
'🌙',
|
|
'🍁',
|
|
'🍂',
|
|
'🍃',
|
|
'🌷',
|
|
'💎',
|
|
'🔪',
|
|
'🔫',
|
|
'🏀',
|
|
'👄',
|
|
'👍',
|
|
'🔥',
|
|
'💘',
|
|
'💓',
|
|
'💔',
|
|
'💕',
|
|
'💖',
|
|
'💗',
|
|
'💙',
|
|
'💚',
|
|
'💛',
|
|
'💜',
|
|
'💝',
|
|
'💞',
|
|
'💟',
|
|
],
|
|
},
|
|
];
|
|
//emoji表情编码
|
|
export function utf16toEntities(str) {
|
|
const patt = /[\ud800-\udbff][\udc00-\udfff]/g; // 检测utf16字符正则
|
|
str = str.replace(patt, (char) => {
|
|
let H;
|
|
let L;
|
|
let code;
|
|
let s;
|
|
|
|
if (char.length === 2) {
|
|
H = char.charCodeAt(0); // 取出高位
|
|
L = char.charCodeAt(1); // 取出低位
|
|
code = (H - 0xd800) * 0x400 + 0x10000 + L - 0xdc00; // 转换算法
|
|
s = `&#${code};`;
|
|
} else {
|
|
s = char;
|
|
}
|
|
|
|
return s;
|
|
});
|
|
|
|
return str;
|
|
}
|
|
// 表情解码
|
|
export function entitiestoUtf16(strObj) {
|
|
const patt = /&#\d+;/g;
|
|
const arr = strObj.match(patt) || [];
|
|
|
|
let H;
|
|
let L;
|
|
let code;
|
|
|
|
for (let i = 0; i < arr.length; i += 1) {
|
|
code = arr[i];
|
|
code = code.replace('&#', '').replace(';', '');
|
|
// 高位
|
|
H = Math.floor((code - 0x10000) / 0x400) + 0xd800;
|
|
// 低位
|
|
L = ((code - 0x10000) % 0x400) + 0xdc00;
|
|
code = `&#${code};`;
|
|
const s = String.fromCharCode(H, L);
|
|
strObj = strObj.replace(code, s);
|
|
}
|
|
return strObj;
|
|
}
|