// ============================================ // 邀请函制作工具 - 全局配置文件 // 修改以下数值即可调整外观,无需改动代码 // ============================================ // // 多模板支持:通过 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;