forked from zhongyidian/super_video
feat: 添加 Husky 和 commit 限制配置
This commit is contained in:
commit
27e0c23b3f
125 files changed
+5760
No files matched your search
@@ -0,0 +1,114 @@
|
||||
//访问静态图片
|
||||
export const getStaticImage = (path: string) => {
|
||||
try {
|
||||
// 确保路径以正确的格式结尾
|
||||
const imagePath =
|
||||
path.endsWith('.png') ||
|
||||
path.endsWith('.jpg') ||
|
||||
path.endsWith('.jpeg') ||
|
||||
path.endsWith('.gif') ||
|
||||
path.endsWith('.svg') ||
|
||||
path.endsWith('.webp')
|
||||
? `../assets/images/${path}`
|
||||
: `../assets/images/${path}.png`
|
||||
|
||||
return new URL(imagePath, import.meta.url).href
|
||||
} catch (error) {
|
||||
console.error('Failed to load image:', path, error)
|
||||
return ''
|
||||
}
|
||||
}
|
||||
|
||||
// 获取背景图片的专用函数
|
||||
export const getBackgroundImage = (path: string) => {
|
||||
const imageUrl = getStaticImage(path)
|
||||
return imageUrl ? `url(${imageUrl})` : 'none'
|
||||
}
|
||||
|
||||
// 预定义的图片路径常量
|
||||
export const IMAGE_PATHS = {
|
||||
HOME_BG: 'home/guide/bg',
|
||||
ACTION_BG: 'home/action/bg',
|
||||
GUIDE_DRAGON_BG: 'components/dragon-bg',
|
||||
GUIDE_PERSON: 'components/person',
|
||||
AI_TOOLS: 'home/ai工具组镜头',
|
||||
SKILL_TREE: 'home/技能树-按钮',
|
||||
|
||||
//action
|
||||
ACTION: {
|
||||
FOOTER_BTN: 'home/action/footer-btn',
|
||||
FOOTER_BG: 'home/action/footer-bg',
|
||||
DOWN: 'home/action/down',
|
||||
SKILLS_BTN: 'home/action/skills-btn',
|
||||
// 模块按钮
|
||||
MODULE_BTN1: 'home/action/btn1',
|
||||
MODULE_BTN2: 'home/action/btn2',
|
||||
MODULE_BTN3: 'home/action/btn3',
|
||||
SELECTED_BTN1: 'home/action/selected-btn1',
|
||||
SELECTED_BTN2: 'home/action/selected-btn2',
|
||||
SELECTED_BTN3: 'home/action/selected-btn3',
|
||||
VIDEO1: 'home/action/video1',
|
||||
VIDEO2: 'home/action/video2',
|
||||
VIDEO3: 'home/action/video3'
|
||||
},
|
||||
|
||||
//按钮
|
||||
BUTTONS: {
|
||||
BACK: 'home/按钮/返回',
|
||||
NEXT: 'home/按钮/下一步',
|
||||
START: 'home/按钮/开始',
|
||||
COMPLETE: 'home/按钮/完成',
|
||||
CANCEL: 'home/按钮/取消',
|
||||
//继续 continue
|
||||
CONTINUE: 'components/continue',
|
||||
//跳过 escape
|
||||
ESCAPE: 'components/escape',
|
||||
//课程框架
|
||||
COURSE_FRAME: 'home/guide/kc-btn',
|
||||
//操作指引
|
||||
OPERATE_GUIDE: 'home/guide/cz-btn',
|
||||
//开始拍摄
|
||||
START_FILMING: 'home/guide/action-btn'
|
||||
},
|
||||
// ai工具组镜头按钮
|
||||
AI_TOOLS_BUTTONS: {
|
||||
BACK: 'home/ai工具组镜头/返回',
|
||||
NEXT: 'home/ai工具组镜头/下一步',
|
||||
START: 'home/ai工具组镜头/开始',
|
||||
COMPLETE: 'home/ai工具组镜头/完成',
|
||||
CANCEL: 'home/ai工具组镜头/取消'
|
||||
},
|
||||
// 新手导航相关
|
||||
NEWBIE_GUIDE: {
|
||||
THREE_ELEMENTS: 'home/新手导航/三大基础要素',
|
||||
UP_BUTTON: 'home/新手导航/上拉按钮',
|
||||
DOWN_BUTTON: 'home/新手导航/下拉按钮',
|
||||
LIGHT: 'home/新手导航/光',
|
||||
COMPLETED: 'home/新手导航/完成新手导航后开放',
|
||||
MASK: 'home/新手导航/新手导航下层遮罩',
|
||||
UNSELECTED: 'home/新手导航/新手导航未选中',
|
||||
BAR_BG: 'home/新手导航/新手导航栏-底板',
|
||||
SELECTED: 'home/新手导航/新手导航选中高亮',
|
||||
PANEL: 'home/新手导航/新手导航面板',
|
||||
COMPOSITION: 'home/新手导航/构图',
|
||||
NODE_COMPLETED: 'home/新手导航/节点-已完成',
|
||||
NODE_CURRENT: 'home/新手导航/节点-当前节点',
|
||||
NODE_LOCKED: 'home/新手导航/节点-未解锁',
|
||||
CAMERA_MOVEMENT: 'home/新手导航/运镜',
|
||||
PROGRESS_LIGHT: 'home/新手导航/进度条-亮',
|
||||
PROGRESS_DARK: 'home/新手导航/进度条-暗'
|
||||
},
|
||||
// 模块区域相关
|
||||
MODULE_AREA: {
|
||||
CAMERA: 'home/模块区域/摄像头',
|
||||
DISPLAY: 'home/模块区域/显示屏',
|
||||
CAMERA_UNSELECTED: 'home/模块区域/未选中模块时摄像头',
|
||||
NORMAL_BG: 'home/模块区域/正常模式底图',
|
||||
SELECTED_VLOG: 'home/模块区域/选中区域-vlog',
|
||||
SELECTED_THIRD: 'home/模块区域/选中区域-第三模块',
|
||||
SELECTED_SECOND: 'home/模块区域/选中区域-第二模块',
|
||||
POPUP_VLOG: 'home/模块区域/选中弹出-vlog'
|
||||
},
|
||||
// 节点数字
|
||||
NODE_NUMBERS: Array.from({ length: 10 }, (_, i) => `home/节点数字/${i}`)
|
||||
} as const
|
||||
Reference in new issue
Block a user