Files
invitation-maker/js/config.js

71 lines
2.1 KiB
JavaScript
Raw Permalink 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.
// ============================================
// 邀请函制作工具 - 全局配置文件
// 修改以下数值即可调整外观,无需改动代码
// ============================================
//
// 多模板支持:通过 URL 查询参数 ?t=模板名 切换
// 例如:index.html?t=wedding
// 不传参数时使用 default 模板
var CONFIG = {
// 默认模板名(URL 未指定或找不到时使用)
defaultTemplate: 'default',
// ========== 所有模板 ==========
templates: {
// -------- 默认模板 --------
default: {
title: '通用邀请函',
bgImage: './images/default-bg.jpg',
inputs: [
{
id: "input1",
label: "企业",
left: 100,
top: 218.4,
fontWeight: 700,
placeholder: "请输入",
isLocked: false
},
{
id: "input2",
label: "嘉宾",
left: 100,
top: 261.4,
fontWeight: 700,
placeholder: "请输入",
isLocked: false
},
{
id: "input3",
label: "编号",
left: 100,
top: 308.1,
fontWeight: 700,
placeholder: "请输入",
isLocked: false
}
]
}
// -------- 在此下方添加更多模板 --------
// 用法:浏览器打开 index.html?t=wedding
//
,wedding: {
title: '婚礼邀请函',
bgImage: './images/wedding-bg.jpg',
inputs: [
{ id: "input1", label: "新郎", left: 50, top: 200, fontWeight: 700, placeholder: "请输入新郎名" },
{ id: "input2", label: "新娘", left: 50, top: 250, fontWeight: 700, placeholder: "请输入新娘名" },
{ id: "input3", label: "婚期", left: 50, top: 300, fontWeight: 700, placeholder: "请输入日期" }
]
}
}
};
// -------- 兼容旧代码(由 script.js 内部使用) --------
// 以下变量由 script.js 自动从 CONFIG 读取,无需手动修改
var ACTIVE_TEMPLATE = null;