Files
OpenIsle/frontend_nuxt/utils/reactions.js
2025-09-02 11:45:35 +08:00

39 lines
1.3 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const toCdnUrl = (emoji) => {
const codepoints = Array.from(emoji)
.map((c) => c.codePointAt(0).toString(16))
.join('_')
// 国外镜像有点小卡 (=゚ω゚)ノ, 国内大部分地区访问时会触发 SNI 封锁 / DNS 污染
// return `https://fonts.gstatic.com/s/e/notoemoji/latest/${codepoints}/emoji.svg`
// loli.net即字节系开源社区 mirror比如 jsDelivr 中国优化节点背后的 CDN 体系). 不会被墙
return `https://gstatic.loli.net/s/e/notoemoji/latest/${codepoints}/emoji.svg`
}
export const reactionEmojiMap = {
LIKE: toCdnUrl('❤️'),
SMILE: toCdnUrl('😁'),
DISLIKE: toCdnUrl('👎'),
RECOMMEND: toCdnUrl('👏'),
CONGRATULATIONS: toCdnUrl('🎉'),
ANGRY: toCdnUrl('😡'),
FLUSHED: toCdnUrl('😳'),
STAR_STRUCK: toCdnUrl('🤩'),
ROFL: toCdnUrl('🤣'),
HOLDING_BACK_TEARS: toCdnUrl('🥹'),
MIND_BLOWN: toCdnUrl('🤯'),
POOP: toCdnUrl('💩'),
CLOWN: toCdnUrl('🤡'),
SKULL: toCdnUrl('☠️'),
FIRE: toCdnUrl('🔥'),
EYES: toCdnUrl('👀'),
FROWN: toCdnUrl('☹️'),
HOT: toCdnUrl('🥵'),
EAGLE: toCdnUrl('🦅'),
SPIDER: toCdnUrl('🕷️'),
BAT: toCdnUrl('🦇'),
CHINA: toCdnUrl('🇨🇳'),
USA: toCdnUrl('🇺🇸'),
JAPAN: toCdnUrl('🇯🇵'),
KOREA: toCdnUrl('🇰🇷'),
}