refactor(StickerPanel): 提取常量和工具函数
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
import type { TextStickerPreset } from "../types"
|
||||
|
||||
export const EMOJI_LIST = [
|
||||
"😀",
|
||||
"😂",
|
||||
"🥰",
|
||||
"😎",
|
||||
"🤔",
|
||||
"😴",
|
||||
"🥳",
|
||||
"😭",
|
||||
"👍",
|
||||
"👎",
|
||||
"👏",
|
||||
"🙏",
|
||||
"💪",
|
||||
"🎉",
|
||||
"❤️",
|
||||
"💔",
|
||||
"🔥",
|
||||
"⭐",
|
||||
"💯",
|
||||
"✅",
|
||||
"❌",
|
||||
"⚠️",
|
||||
"📌",
|
||||
"🎯",
|
||||
"🏆",
|
||||
"💰",
|
||||
"📢",
|
||||
"💡",
|
||||
"🎨",
|
||||
"🎵",
|
||||
"📷",
|
||||
"🎬",
|
||||
]
|
||||
|
||||
export const TEXT_PRESET_STYLES: Record<TextStickerPreset, React.CSSProperties> = {
|
||||
title_bold: {
|
||||
fontSize: 32,
|
||||
fontWeight: 700,
|
||||
color: "#ffffff",
|
||||
textShadow: "0 2px 8px rgba(0,0,0,0.5)",
|
||||
},
|
||||
subtitle: {
|
||||
fontSize: 20,
|
||||
fontWeight: 500,
|
||||
color: "#ffffff",
|
||||
textShadow: "0 1px 4px rgba(0,0,0,0.5)",
|
||||
},
|
||||
caption: {
|
||||
fontSize: 14,
|
||||
fontWeight: 400,
|
||||
color: "#ffffff",
|
||||
textShadow: "0 1px 3px rgba(0,0,0,0.5)",
|
||||
},
|
||||
highlight: {
|
||||
fontSize: 24,
|
||||
fontWeight: 700,
|
||||
color: "#ffd700",
|
||||
textShadow: "0 2px 6px rgba(0,0,0,0.5)",
|
||||
},
|
||||
}
|
||||
|
||||
export const genStickerId = () => `sticker_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`
|
||||
Reference in New Issue
Block a user