30 lines
1.4 KiB
JavaScript
30 lines
1.4 KiB
JavaScript
/** 与 server/pkg/weblive/danmaku.go allowedGifts 的 id 保持一致 */
|
|
/** 四大件(火箭/跑车/飞机/嘉年华)须保留且排在前列;其余为扩展礼物 */
|
|
export const LIVE_GIFTS = [
|
|
{ id: 'rocket', label: '火箭', emoji: '🚀', tier: 'big' },
|
|
{ id: 'sports_car', label: '跑车', emoji: '🏎️', tier: 'big' },
|
|
{ id: 'plane', label: '飞机', emoji: '✈️', tier: 'big' },
|
|
{ id: 'carnival', label: '嘉年华', emoji: '🎡', tier: 'big' },
|
|
{ id: 'rose', label: '玫瑰', emoji: '🌹', tier: 'normal' },
|
|
{ id: 'heart', label: '爱心', emoji: '❤️', tier: 'normal' },
|
|
{ id: 'star', label: '星星', emoji: '⭐', tier: 'normal' },
|
|
{ id: 'clap', label: '鼓掌', emoji: '👏', tier: 'normal' },
|
|
{ id: 'cake', label: '蛋糕', emoji: '🎂', tier: 'normal' },
|
|
{ id: 'crown', label: '皇冠', emoji: '👑', tier: 'normal' },
|
|
{ id: 'fireworks', label: '礼花', emoji: '🎆', tier: 'normal' },
|
|
{ id: 'gift_box', label: '礼盒', emoji: '🎁', tier: 'normal' },
|
|
{ id: 'beer', label: '干杯', emoji: '🍻', tier: 'normal' },
|
|
{ id: 'mic', label: '麦克风', emoji: '🎤', tier: 'normal' }
|
|
]
|
|
|
|
const BIG_IDS = new Set(LIVE_GIFTS.filter((g) => g.tier === 'big').map((g) => g.id))
|
|
|
|
export function liveGiftEmoji(id) {
|
|
const g = LIVE_GIFTS.find((x) => x.id === id)
|
|
return g ? g.emoji : '🎁'
|
|
}
|
|
|
|
export function liveGiftTier(id) {
|
|
return BIG_IDS.has(id) ? 'big' : 'normal'
|
|
}
|