(function () { const fonts = { sans: { label: '现代黑体', stack: '"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif' }, serif: { label: '优雅宋体', stack: '"Songti SC","STSong","SimSun",serif' }, round: { label: '圆润黑体', stack: '"Yuanti SC","PingFang SC","Microsoft YaHei",sans-serif' }, latin: { label: '英文无衬线', stack: '"Helvetica Neue",Arial,sans-serif' }, latinSerif: { label: '英文衬线', stack: 'Georgia,"Times New Roman",serif' }, mono: { label: '等宽字体', stack: '"SF Mono",Menlo,Consolas,monospace' }, hand: { label: '手写体', stack: '"Bradley Hand","Segoe Print",cursive' } }; const products = [ { id: 'standup', name: '站立袋', en: 'STAND-UP POUCH', tagline: '会站立的货架主角', desc: '自带拉链与站立袋底,适合咖啡豆、零食、宠物粮与茶叶。密封性好,陈列稳定。', base: 3.6, mockColor: '#efe7d6', shape: 'standup', badge: '人气款', tags: ['可降解', '拉链封口'], features: ['自封拉链', '站立袋底', '可选排气阀'], pad: { l: 12, r: 12, t: 34, b: 18 }, sizes: [ { id: 's', label: 'S', w: 120, h: 180, mult: 0.9 }, { id: 'm', label: 'M', w: 140, h: 210, mult: 1 }, { id: 'l', label: 'L', w: 160, h: 240, mult: 1.12 }, { id: 'xl', label: 'XL', w: 180, h: 270, mult: 1.26 } ] }, { id: 'flatbottom', name: '平底袋', en: 'FLAT BOTTOM BAG', tagline: '货架上的高级感', desc: '方正的平底结构,容量大、站立稳。适合精品咖啡、谷物与礼盒装产品。', base: 4.2, mockColor: '#e9dfcc', shape: 'flatbottom', badge: '精品首选', tags: ['大容量', '平整印刷'], features: ['六边封合', '平底结构', '可加手提孔'], pad: { l: 12, r: 12, t: 32, b: 28 }, sizes: [ { id: 's', label: 'S', w: 120, h: 190, mult: 0.92 }, { id: 'm', label: 'M', w: 150, h: 220, mult: 1 }, { id: 'l', label: 'L', w: 170, h: 250, mult: 1.14 } ] }, { id: 'coffee', name: '咖啡袋', en: 'COFFEE POUCH', tagline: '锁住新鲜与风味', desc: '带单向排气阀与加厚铝膜,避光防潮。为精品咖啡与冷萃打造的专业袋型。', base: 3.9, mockColor: '#e8dcc4', shape: 'coffee', badge: '含排气阀', tags: ['避光', '单向阀'], features: ['单向排气阀', '加厚铝膜', '拉链密封'], pad: { l: 12, r: 12, t: 40, b: 16 }, sizes: [ { id: 's', label: 'S', w: 100, h: 250, mult: 0.95 }, { id: 'm', label: 'M', w: 120, h: 300, mult: 1 }, { id: 'l', label: 'L', w: 140, h: 350, mult: 1.18 } ] }, { id: 'kraft', name: '牛皮纸袋', en: 'KRAFT PAPER BAG', tagline: '自然的触感', desc: '原色牛皮纸与环保油墨,质感温润。适合烘焙、茶叶、杂货与手作品牌。', base: 3.0, mockColor: '#c49a68', shape: 'kraft', badge: '环保材质', tags: ['原色牛皮', '可回收'], features: ['食品级内层', '侧边风琴褶', '环保油墨'], pad: { l: 14, r: 14, t: 24, b: 14 }, sizes: [ { id: 's', label: 'S', w: 180, h: 240, mult: 0.94 }, { id: 'm', label: 'M', w: 220, h: 300, mult: 1 }, { id: 'l', label: 'L', w: 260, h: 350, mult: 1.15 } ] }, { id: 'mailer', name: '邮寄袋', en: 'MAILER BAG', tagline: '轻量、耐撕、好寄', desc: '轻量耐撕的邮寄包装,适合服饰、配件与小件电商。可定制整面单色印刷。', base: 2.2, mockColor: '#2b2926', shape: 'mailer', badge: '电商常用', tags: ['防水', '撕拉条'], features: ['自粘封口', '撕拉开袋', '防水耐撕'], pad: { l: 10, r: 10, t: 24, b: 14 }, sizes: [ { id: 's', label: 'S', w: 260, h: 330, mult: 0.9 }, { id: 'm', label: 'M', w: 310, h: 395, mult: 1 }, { id: 'l', label: 'L', w: 395, h: 455, mult: 1.16 } ] }, { id: 'garment', name: '服装袋', en: 'GARMENT BAG', tagline: '让衣服体面出门', desc: '半透明磨砂质感,配挂孔与自粘封口。适合服装、家纺与品牌工作室。', base: 1.9, mockColor: '#dcd8cd', shape: 'garment', badge: '小批量', tags: ['磨砂', '挂孔'], features: ['挂孔设计', '自粘封口', '磨砂质感'], pad: { l: 10, r: 10, t: 30, b: 10 }, sizes: [ { id: 's', label: 'S', w: 200, h: 300, mult: 0.92 }, { id: 'm', label: 'M', w: 260, h: 380, mult: 1 }, { id: 'l', label: 'L', w: 310, h: 420, mult: 1.14 } ] } ]; const materials = [ { id: 'matte', name: '哑光膜', desc: '细腻高级,触感柔和', mult: 1 }, { id: 'gloss', name: '亮光膜', desc: '色彩饱和,货架吸睛', mult: 1.05 }, { id: 'kraft', name: '再生牛皮', desc: '自然原色,环保质感', mult: 1.08 }, { id: 'compost', name: '可降解膜', desc: '植物基材料,可堆肥', mult: 1.18 } ]; const finishes = [ { id: 'none', name: '标准印刷', desc: '四色 / 专色', add: 0 }, { id: 'uv', name: '局部 UV', desc: '高光点缀', add: 0.35 }, { id: 'foil', name: '烫金 / 烫银', desc: '金属光泽', add: 0.6 }, { id: 'soft', name: '触感膜', desc: '丝绒手感', add: 0.25 } ]; const quantities = [ { value: 100, mult: 1 }, { value: 300, mult: 0.92 }, { value: 500, mult: 0.86 }, { value: 1000, mult: 0.8 } ]; const stickers = { leaf: { viewBox: '0 0 24 24', paths: [{ d: 'M20 3C11 3 4 8.5 4 16.5c0 2.2 1.3 3.5 3.5 3.5C15.5 20 21 13 20 3Z' }, { d: 'M4 21C7 15 11 10 17 6.5', stroke: true }] }, coffeeBean: { viewBox: '0 0 24 24', paths: [{ d: 'M19.5 4.5c-4-4-11-4-15 0s-4 11 0 15 11 4 15 0 4-11 0-15Z' }, { d: 'M6.5 17.5C10 14 14 10 17.5 6.5', stroke: true }] }, cup: { viewBox: '0 0 24 24', paths: [{ d: 'M5 8h13v6a6 6 0 0 1-6 6h-1a6 6 0 0 1-6-6V8Z' }, { d: 'M18 10h1.5a2.5 2.5 0 0 1 0 5H18' }, { d: 'M8 3v2M12 2v3M16 3v2', stroke: true }] }, star: { viewBox: '0 0 24 24', paths: [{ d: 'M12 2.5l2.9 6 6.6.9-4.8 4.6 1.2 6.5-5.9-3.2-5.9 3.2 1.2-6.5L2.5 9.4l6.6-.9 2.9-6Z' }] }, sparkle: { viewBox: '0 0 24 24', paths: [{ d: 'M12 2l1.8 6.2L20 10l-6.2 1.8L12 18l-1.8-6.2L4 10l6.2-1.8L12 2Z' }, { d: 'M19 16l.8 2.2L22 19l-2.2.8L19 22l-.8-2.2L16 19l2.2-.8L19 16Z' }] }, heart: { viewBox: '0 0 24 24', paths: [{ d: 'M12 21S3.5 15.5 3.5 9.5A4.5 4.5 0 0 1 12 7a4.5 4.5 0 0 1 8.5 2.5C20.5 15.5 12 21 12 21Z' }] }, wave: { viewBox: '0 0 24 24', paths: [{ d: 'M2 9c2.5-4 5-4 7.5 0s5 4 7.5 0 3.5-2.5 5 0v4c-2.5-4-5-4-7.5 0s-5 4-7.5 0-3.5-2.5-5 0V9Z' }] }, sun: { viewBox: '0 0 24 24', paths: [{ d: 'M12 16a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z' }, { d: 'M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4', stroke: true }] }, flower: { viewBox: '0 0 24 24', paths: [{ d: 'M12 12c-4-1-6-4-4.5-6.5S12 4 12 8c0-4 3-6 4.5-2.5S16 11 12 12Z' }, { d: 'M12 12c1 4 4 6 6.5 4.5S20 12 16 12c4 0 6-3 2.5-4.5S13 8 12 12Z' }, { d: 'M12 12c-1-4-4-6-6.5-4.5S4 12 8 12c-4 0-6 3-2.5 4.5S11 16 12 12Z' }, { d: 'M12 12c-4 1-6 4-4.5 6.5S12 20 12 16c0 4 3 6 4.5 2.5S16 13 12 12Z' }, { d: 'M12 12a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Z' }] }, paw: { viewBox: '0 0 24 24', paths: [{ d: 'M12 21c-3.5 0-6-2-6-4.5 0-2 2-3.5 4-4.5 2-.9 3.9 1 4 1s2-1.9 4-1c2 1 4 2.5 4 4.5 0 2.5-2.5 4.5-6 4.5Z' }, { d: 'M6 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM12 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM18 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z' }] }, arrow: { viewBox: '0 0 24 24', paths: [{ d: 'M4 12h15M13 6l6 6-6 6', stroke: true }] }, mountain: { viewBox: '0 0 24 24', paths: [{ d: 'M2 20l6.5-12L14 17l3-5 5 8H2Z' }, { d: 'M8.5 4l1.5 4 2-1.5', stroke: true }] }, wheat: { viewBox: '0 0 24 24', paths: [{ d: 'M12 22V8', stroke: true }, { d: 'M12 14c-3 0-4-2-4-4 2 0 4 1 4 4ZM12 17c-3 0-4-2-4-4 2 0 4 1 4 4ZM12 11c3 0 4-2 4-4-2 0-4 1-4 4ZM12 8c-3 0-4-2-4-4 2 0 4 1 4 4ZM12 5c3 0 4-1 4-3-2 0-4 1-4 3Z' }] }, bolt: { viewBox: '0 0 24 24', paths: [{ d: 'M13 2 4 14h6l-1 8 9-12h-6l1-8Z' }] } }; const templates = [ { id: 'citrus', name: '青柠气泡', category: '食品饮料', product: 'standup', tint: '#e5f2a3', bg: '#dcef83', front: [ { type: 'shape', shape: 'circle', x: 0.09, y: 0.11, w: 0.82, h: 0.5, fill: '#f9f5e6' }, { type: 'text', x: 0.13, y: 0.14, w: 0.74, text: 'LIME', font: 'latin', size: 0.2, weight: 800, color: '#1c3d2b', align: 'left', spacing: -0.03, lineHeight: 0.95 }, { type: 'text', x: 0.13, y: 0.31, w: 0.74, text: 'POP', font: 'latin', size: 0.2, weight: 800, color: 'none', stroke: '#1c3d2b', sw: 0.006, align: 'left', spacing: -0.03, lineHeight: 0.95 }, { type: 'text', x: 0.14, y: 0.54, w: 0.6, text: '青柠气泡水', font: 'sans', size: 0.052, weight: 600, color: '#1c3d2b', align: 'left', spacing: 0.04 }, { type: 'text', x: 0.14, y: 0.61, w: 0.6, text: 'SPARKLING WATER · 330ML', font: 'latin', size: 0.021, weight: 500, color: '#3f5a46', align: 'left', spacing: 0.02 }, { type: 'sticker', sticker: 'leaf', x: 0.67, y: 0.44, w: 0.19, color: '#ff5c2b' }, { type: 'badge', x: 0.58, y: 0.58, w: 0.33, text: '0 SUGAR · 0 SUGAR · ', color: '#ff5c2b', size: 0.026 }, { type: 'shape', shape: 'rect', x: 0, y: 0.88, w: 1, h: 0.12, fill: '#ff5c2b' }, { type: 'text', x: 0.07, y: 0.915, w: 0.86, text: 'TANGY & BRIGHT', font: 'latin', size: 0.03, weight: 700, color: '#fdf6e8', align: 'left', spacing: 0.04 } ], back: [ { type: 'text', x: 0.08, y: 0.08, w: 0.84, text: 'LIME POP', font: 'latin', size: 0.06, weight: 800, color: '#1c3d2b', align: 'left', spacing: 0.02 }, { type: 'text', x: 0.08, y: 0.17, w: 0.84, text: '配料:水、青柠汁、二氧化碳。冷藏后饮用风味更佳。', font: 'sans', size: 0.028, weight: 400, color: '#2c4a36', align: 'left', lineHeight: 1.7 }, { type: 'shape', shape: 'line', x: 0.08, y: 0.37, w: 0.84, h: 0, stroke: '#1c3d2b', sw: 0.002 }, { type: 'text', x: 0.08, y: 0.41, w: 0.84, text: '净含量 330ml · 请置于阴凉干燥处', font: 'sans', size: 0.022, color: '#2c4a36', align: 'left' }, { type: 'barcode', x: 0.08, y: 0.62, w: 0.5, h: 0.14, value: '6971234567890', color: '#1c3d2b' }, { type: 'text', x: 0.62, y: 0.7, w: 0.3, text: 'MADE IN CHINA', font: 'latin', size: 0.018, color: '#2c4a36', align: 'right', spacing: 0.02 } ] }, { id: 'morning', name: '晨光咖啡', category: '咖啡', product: 'coffee', tint: '#e8dcc3', bg: '#efe3cc', front: [ { type: 'shape', shape: 'circle', x: 0.27, y: 0.09, w: 0.46, h: 0.3, fill: '#1e3a2c' }, { type: 'sticker', sticker: 'sun', x: 0.4, y: 0.13, w: 0.2, color: '#f2a33a' }, { type: 'text', x: 0.08, y: 0.43, w: 0.84, text: 'MORNING', font: 'latin', size: 0.115, weight: 800, color: '#1e3a2c', align: 'center', spacing: 0.01 }, { type: 'text', x: 0.08, y: 0.53, w: 0.84, text: 'SLOW ROAST', font: 'latin', size: 0.028, weight: 600, color: '#1e3a2c', align: 'center', spacing: 0.14 }, { type: 'shape', shape: 'line', x: 0.3, y: 0.59, w: 0.4, h: 0, stroke: '#1e3a2c', sw: 0.002 }, { type: 'text', x: 0.08, y: 0.63, w: 0.84, text: '埃塞俄比亚 · 水洗处理', font: 'sans', size: 0.032, weight: 500, color: '#1e3a2c', align: 'center' }, { type: 'text', x: 0.08, y: 0.69, w: 0.84, text: '柑橘 / 茉莉 / 蜂蜜', font: 'sans', size: 0.024, weight: 400, color: '#51604f', align: 'center', spacing: 0.03 }, { type: 'sticker', sticker: 'coffeeBean', x: 0.1, y: 0.78, w: 0.08, color: '#b5653a' }, { type: 'text', x: 0.08, y: 0.8, w: 0.84, text: '250 g', font: 'latin', size: 0.028, weight: 700, color: '#1e3a2c', align: 'center', spacing: 0.1 }, { type: 'text', x: 0.08, y: 0.87, w: 0.84, text: 'ROASTED IN SMALL BATCHES', font: 'latin', size: 0.018, weight: 500, color: '#51604f', align: 'center', spacing: 0.08 } ], back: [ { type: 'text', x: 0.08, y: 0.07, w: 0.84, text: 'MORNING', font: 'latin', size: 0.05, weight: 800, color: '#1e3a2c', align: 'left', spacing: 0.02 }, { type: 'text', x: 0.08, y: 0.16, w: 0.84, text: '产地:埃塞俄比亚 古吉\n处理法:水洗\n烘焙度:浅烘\n风味:柑橘、茉莉、蜂蜜', font: 'sans', size: 0.026, weight: 400, color: '#2f4436', align: 'left', lineHeight: 1.6 }, { type: 'shape', shape: 'line', x: 0.08, y: 0.45, w: 0.84, h: 0, stroke: '#1e3a2c', sw: 0.002 }, { type: 'text', x: 0.08, y: 0.49, w: 0.84, text: '建议手冲水温 92°C,粉水比 1:15。\n开封后请密封冷藏,尽早饮用。', font: 'sans', size: 0.022, color: '#2f4436', align: 'left', lineHeight: 1.6 }, { type: 'barcode', x: 0.08, y: 0.67, w: 0.48, h: 0.12, value: '6971234567891', color: '#1e3a2c' }, { type: 'text', x: 0.08, y: 0.86, w: 0.84, text: 'POUCHLAB COFFEE ROASTERS', font: 'latin', size: 0.017, weight: 600, color: '#51604f', align: 'left', spacing: 0.06 } ] }, { id: 'bloom', name: '花间茶事', category: '茶', product: 'standup', tint: '#f3ddd3', bg: '#f6e6dd', front: [ { type: 'shape', shape: 'rect', x: 0.05, y: 0.05, w: 0.9, h: 0.9, fill: 'none', stroke: '#7a5343', sw: 0.0018 }, { type: 'sticker', sticker: 'flower', x: 0.41, y: 0.08, w: 0.18, color: '#c97b8a' }, { type: 'text', x: 0.1, y: 0.3, w: 0.8, text: '花间茶事', font: 'serif', size: 0.13, weight: 600, color: '#5b3b2e', align: 'center', spacing: 0.08 }, { type: 'text', x: 0.1, y: 0.44, w: 0.8, text: 'JASMINE GREEN TEA', font: 'latin', size: 0.022, weight: 500, color: '#7a5343', align: 'center', spacing: 0.1 }, { type: 'sticker', sticker: 'flower', x: 0.18, y: 0.52, w: 0.07, color: '#c97b8a' }, { type: 'text', x: 0.1, y: 0.55, w: 0.8, text: '一 盏 清 香', font: 'serif', size: 0.036, weight: 400, color: '#5b3b2e', align: 'center', spacing: 0.1 }, { type: 'sticker', sticker: 'flower', x: 0.75, y: 0.52, w: 0.07, color: '#c97b8a' }, { type: 'text', x: 0.1, y: 0.68, w: 0.8, text: '茉莉绿茶 · 手工窨制', font: 'sans', size: 0.027, weight: 400, color: '#7a5343', align: 'center', spacing: 0.04 }, { type: 'text', x: 0.1, y: 0.82, w: 0.8, text: '净含量 50g', font: 'sans', size: 0.022, weight: 400, color: '#7a5343', align: 'center' } ], back: [ { type: 'text', x: 0.1, y: 0.08, w: 0.8, text: '花间茶事', font: 'serif', size: 0.055, weight: 600, color: '#5b3b2e', align: 'center', spacing: 0.08 }, { type: 'text', x: 0.1, y: 0.2, w: 0.8, text: '配料:绿茶、茉莉花。\n冲泡建议:85°C 水温,3 分钟。', font: 'sans', size: 0.026, color: '#6a4436', align: 'left', lineHeight: 1.7 }, { type: 'shape', shape: 'line', x: 0.1, y: 0.36, w: 0.8, h: 0, stroke: '#7a5343', sw: 0.0015 }, { type: 'text', x: 0.1, y: 0.4, w: 0.8, text: '储存:避光、阴凉、干燥处密封保存。', font: 'sans', size: 0.02, color: '#6a4436', align: 'left', lineHeight: 1.7 }, { type: 'barcode', x: 0.1, y: 0.62, w: 0.46, h: 0.12, value: '6971234567892', color: '#5b3b2e' }, { type: 'text', x: 0.1, y: 0.87, w: 0.8, text: 'POUCHLAB TEA STUDIO', font: 'latin', size: 0.016, color: '#7a5343', align: 'center', spacing: 0.08 } ] }, { id: 'noir', name: '极简黑', category: '极简', product: 'coffee', tint: '#d9d5cc', bg: '#171513', front: [ { type: 'sticker', sticker: 'sparkle', x: 0.08, y: 0.07, w: 0.09, color: '#f4efe3' }, { type: 'text', x: 0.08, y: 0.2, w: 0.84, text: 'POUCHLAB', font: 'latin', size: 0.055, weight: 800, color: '#f4efe3', align: 'left', spacing: 0.02 }, { type: 'text', x: 0.08, y: 0.28, w: 0.84, text: 'ESSENTIAL SERIES / 01', font: 'mono', size: 0.018, color: '#a49c8e', align: 'left', spacing: 0.04 }, { type: 'shape', shape: 'line', x: 0.08, y: 0.34, w: 0.84, h: 0, stroke: '#5a554c', sw: 0.0015 }, { type: 'text', x: 0.08, y: 0.55, w: 0.84, text: 'LESS', font: 'latin', size: 0.16, weight: 700, color: '#f4efe3', align: 'left', spacing: -0.02 }, { type: 'text', x: 0.08, y: 0.68, w: 0.84, text: 'BUT BETTER', font: 'latin', size: 0.055, weight: 500, color: '#d8ef7a', align: 'left', spacing: 0.02 }, { type: 'text', x: 0.08, y: 0.83, w: 0.84, text: 'DARK ROAST · 250G', font: 'mono', size: 0.019, color: '#a49c8e', align: 'left', spacing: 0.06 } ], back: [ { type: 'text', x: 0.08, y: 0.08, w: 0.84, text: 'POUCHLAB', font: 'latin', size: 0.04, weight: 800, color: '#f4efe3', align: 'left', spacing: 0.02 }, { type: 'text', x: 0.08, y: 0.18, w: 0.84, text: 'DARK ROAST\n可可 / 焦糖 / 坚果', font: 'sans', size: 0.03, color: '#c9c1b4', align: 'left', lineHeight: 1.8 }, { type: 'shape', shape: 'line', x: 0.08, y: 0.37, w: 0.84, h: 0, stroke: '#5a554c', sw: 0.0015 }, { type: 'text', x: 0.08, y: 0.42, w: 0.84, text: '净含量 250g · 开封后请密封保存', font: 'sans', size: 0.021, color: '#a49c8e', align: 'left' }, { type: 'barcode', x: 0.08, y: 0.63, w: 0.5, h: 0.13, value: '6971234567893', color: '#f4efe3' }, { type: 'text', x: 0.08, y: 0.88, w: 0.84, text: 'MADE FOR THE QUIET ONES', font: 'mono', size: 0.015, color: '#7a7468', align: 'left', spacing: 0.06 } ] }, { id: 'woof', name: '汪汪零食', category: '宠物', product: 'standup', tint: '#bfe2f1', bg: '#bfe3f2', front: [ { type: 'shape', shape: 'circle', x: 0.55, y: 0.1, w: 0.38, h: 0.26, fill: '#ff7a45' }, { type: 'sticker', sticker: 'paw', x: 0.12, y: 0.1, w: 0.14, color: '#1d3f58' }, { type: 'text', x: 0.1, y: 0.26, w: 0.8, text: 'WOOF!', font: 'latin', size: 0.2, weight: 800, color: '#1d3f58', align: 'left', spacing: -0.01 }, { type: 'text', x: 0.11, y: 0.47, w: 0.8, text: '花生酱味 · 狗狗零食', font: 'sans', size: 0.042, weight: 600, color: '#1d3f58', align: 'left', spacing: 0.02 }, { type: 'text', x: 0.11, y: 0.54, w: 0.8, text: 'CRUNCHY TREATS FOR GOOD DOGS', font: 'latin', size: 0.019, weight: 600, color: '#3d6480', align: 'left', spacing: 0.03 }, { type: 'sticker', sticker: 'star', x: 0.78, y: 0.42, w: 0.1, color: '#ff7a45' }, { type: 'sticker', sticker: 'paw', x: 0.16, y: 0.63, w: 0.07, color: '#ff7a45' }, { type: 'sticker', sticker: 'paw', x: 0.72, y: 0.66, w: 0.05, color: '#ff7a45' }, { type: 'shape', shape: 'rect', x: 0, y: 0.86, w: 1, h: 0.14, fill: '#1d3f58' }, { type: 'text', x: 0.08, y: 0.9, w: 0.84, text: '100% NATURAL · 150G', font: 'latin', size: 0.025, weight: 700, color: '#fdf6e8', align: 'center', spacing: 0.05 } ], back: [ { type: 'text', x: 0.08, y: 0.07, w: 0.84, text: 'WOOF!', font: 'latin', size: 0.07, weight: 800, color: '#1d3f58', align: 'left' }, { type: 'text', x: 0.08, y: 0.19, w: 0.84, text: '配料:燕麦粉、花生酱、鸡蛋、椰子油。\n适用:3 个月以上犬只。', font: 'sans', size: 0.027, color: '#234a63', align: 'left', lineHeight: 1.7 }, { type: 'shape', shape: 'line', x: 0.08, y: 0.4, w: 0.84, h: 0, stroke: '#1d3f58', sw: 0.002 }, { type: 'text', x: 0.08, y: 0.46, w: 0.84, text: '喂食建议:小型犬每日 2–3 粒,\n中型犬每日 4–6 粒,配足量清水。', font: 'sans', size: 0.022, color: '#234a63', align: 'left', lineHeight: 1.7 }, { type: 'barcode', x: 0.08, y: 0.65, w: 0.48, h: 0.12, value: '6971234567894', color: '#1d3f58' }, { type: 'sticker', sticker: 'paw', x: 0.7, y: 0.66, w: 0.14, color: '#ff7a45' } ] }, { id: 'bakery', name: '麦田烘焙', category: '烘焙', product: 'kraft', tint: '#e2c69f', bg: '#d9b483', front: [ { type: 'sticker', sticker: 'wheat', x: 0.42, y: 0.08, w: 0.16, color: '#3a2a1a' }, { type: 'text', x: 0.1, y: 0.24, w: 0.8, text: 'BAKERY', font: 'latinSerif', size: 0.13, weight: 700, color: '#3a2a1a', align: 'center', spacing: 0.06 }, { type: 'text', x: 0.1, y: 0.38, w: 0.8, text: 'SOURDOUGH', font: 'latin', size: 0.032, weight: 600, color: '#4a3725', align: 'center', spacing: 0.18 }, { type: 'shape', shape: 'line', x: 0.24, y: 0.45, w: 0.52, h: 0, stroke: '#3a2a1a', sw: 0.002 }, { type: 'text', x: 0.1, y: 0.5, w: 0.8, text: '天然酵母 · 慢发酵', font: 'sans', size: 0.034, weight: 500, color: '#3a2a1a', align: 'center', spacing: 0.06 }, { type: 'text', x: 0.1, y: 0.58, w: 0.8, text: '每一口,都是麦田的味道', font: 'serif', size: 0.025, color: '#5a432c', align: 'center', spacing: 0.04 }, { type: 'badge', x: 0.61, y: 0.66, w: 0.28, text: 'HANDMADE · DAILY · ', color: '#3a2a1a', size: 0.024 }, { type: 'text', x: 0.1, y: 0.86, w: 0.8, text: 'NET WT. 400G', font: 'latin', size: 0.022, weight: 600, color: '#3a2a1a', align: 'center', spacing: 0.12 } ], back: [ { type: 'text', x: 0.08, y: 0.07, w: 0.84, text: 'BAKERY', font: 'latinSerif', size: 0.055, weight: 700, color: '#3a2a1a', align: 'left', spacing: 0.04 }, { type: 'text', x: 0.08, y: 0.2, w: 0.84, text: '配料:小麦粉、水、天然酵母、海盐。\n保存:常温 3 天,冷冻 30 天。', font: 'sans', size: 0.026, color: '#4a3725', align: 'left', lineHeight: 1.7 }, { type: 'shape', shape: 'line', x: 0.08, y: 0.42, w: 0.84, h: 0, stroke: '#3a2a1a', sw: 0.002 }, { type: 'text', x: 0.08, y: 0.48, w: 0.84, text: '食用前请充分加热。', font: 'sans', size: 0.022, color: '#4a3725', align: 'left' }, { type: 'barcode', x: 0.08, y: 0.64, w: 0.48, h: 0.12, value: '6971234567895', color: '#3a2a1a' } ] }, { id: 'glow', name: '柔光护肤', category: '美妆', product: 'flatbottom', tint: '#f0e8db', bg: '#f4eee3', front: [ { type: 'shape', shape: 'rect', x: 0.06, y: 0.05, w: 0.88, h: 0.9, fill: 'none', stroke: '#b9a88f', sw: 0.0015 }, { type: 'sticker', sticker: 'sparkle', x: 0.44, y: 0.1, w: 0.12, color: '#b9a88f' }, { type: 'text', x: 0.1, y: 0.3, w: 0.8, text: 'GLOW', font: 'latinSerif', size: 0.14, weight: 400, color: '#2d2a26', align: 'center', spacing: 0.16 }, { type: 'text', x: 0.1, y: 0.46, w: 0.8, text: 'DAILY MOISTURE', font: 'latin', size: 0.023, weight: 500, color: '#6b6256', align: 'center', spacing: 0.18 }, { type: 'shape', shape: 'line', x: 0.32, y: 0.53, w: 0.36, h: 0, stroke: '#b9a88f', sw: 0.0015 }, { type: 'text', x: 0.12, y: 0.58, w: 0.76, text: '柔光保湿精华', font: 'serif', size: 0.042, weight: 500, color: '#2d2a26', align: 'center', spacing: 0.08 }, { type: 'text', x: 0.12, y: 0.67, w: 0.76, text: '玻尿酸 · 神经酰胺 · 角鲨烷', font: 'sans', size: 0.021, color: '#6b6256', align: 'center', spacing: 0.02 }, { type: 'text', x: 0.12, y: 0.84, w: 0.76, text: '30 ML / 1.0 FL. OZ.', font: 'latin', size: 0.019, color: '#6b6256', align: 'center', spacing: 0.1 } ], back: [ { type: 'text', x: 0.1, y: 0.07, w: 0.8, text: 'GLOW', font: 'latinSerif', size: 0.045, weight: 400, color: '#2d2a26', align: 'center', spacing: 0.14 }, { type: 'text', x: 0.1, y: 0.2, w: 0.8, text: '成分:水、甘油、玻尿酸钠、神经酰胺 NP、角鲨烷。', font: 'sans', size: 0.024, color: '#514a41', align: 'left', lineHeight: 1.7 }, { type: 'text', x: 0.1, y: 0.34, w: 0.8, text: '用法:洁面后取 2–3 滴,轻拍至吸收。', font: 'sans', size: 0.022, color: '#514a41', align: 'left', lineHeight: 1.7 }, { type: 'shape', shape: 'line', x: 0.1, y: 0.47, w: 0.8, h: 0, stroke: '#b9a88f', sw: 0.0015 }, { type: 'barcode', x: 0.1, y: 0.64, w: 0.46, h: 0.12, value: '6971234567896', color: '#2d2a26' }, { type: 'text', x: 0.1, y: 0.88, w: 0.8, text: 'POUCHLAB SKIN', font: 'latin', size: 0.015, color: '#6b6256', align: 'center', spacing: 0.1 } ] }, { id: 'sunday', name: '周末市集', category: '零售', product: 'kraft', tint: '#f0c9a8', bg: '#f0c9a8', front: [ { type: 'text', x: 0.08, y: 0.08, w: 0.84, text: 'SUNDAY', font: 'latin', size: 0.105, weight: 800, color: '#2d3b2a', align: 'left', spacing: -0.01 }, { type: 'text', x: 0.08, y: 0.19, w: 0.84, text: 'MARKET', font: 'latin', size: 0.105, weight: 800, color: 'none', stroke: '#2d3b2a', sw: 0.0045, align: 'left', spacing: -0.01 }, { type: 'shape', shape: 'circle', x: 0.62, y: 0.06, w: 0.3, h: 0.22, fill: '#2d3b2a' }, { type: 'text', x: 0.62, y: 0.13, w: 0.3, text: 'EST. 2024', font: 'latin', size: 0.018, weight: 600, color: '#f0c9a8', align: 'center', spacing: 0.04 }, { type: 'sticker', sticker: 'leaf', x: 0.68, y: 0.2, w: 0.16, color: '#f0c9a8' }, { type: 'shape', shape: 'line', x: 0.08, y: 0.42, w: 0.84, h: 0, stroke: '#2d3b2a', sw: 0.002 }, { type: 'text', x: 0.08, y: 0.47, w: 0.84, text: '新鲜 · 当地 · 当季', font: 'sans', size: 0.042, weight: 600, color: '#2d3b2a', align: 'left', spacing: 0.06 }, { type: 'text', x: 0.08, y: 0.55, w: 0.84, text: 'FROM LOCAL GROWERS', font: 'latin', size: 0.02, weight: 500, color: '#4d5a48', align: 'left', spacing: 0.08 }, { type: 'shape', shape: 'rect', x: 0, y: 0.78, w: 1, h: 0.05, fill: '#2d3b2a' }, { type: 'text', x: 0.08, y: 0.87, w: 0.84, text: 'POUCHLAB × SUNDAY MARKET', font: 'latin', size: 0.018, weight: 600, color: '#2d3b2a', align: 'left', spacing: 0.03 } ], back: [ { type: 'text', x: 0.08, y: 0.08, w: 0.84, text: 'SUNDAY MARKET', font: 'latin', size: 0.045, weight: 800, color: '#2d3b2a', align: 'left', spacing: 0.02 }, { type: 'text', x: 0.08, y: 0.2, w: 0.84, text: '每周日 9:00 – 15:00\n城市广场 · 东侧入口', font: 'sans', size: 0.028, color: '#3e4b39', align: 'left', lineHeight: 1.7 }, { type: 'shape', shape: 'line', x: 0.08, y: 0.38, w: 0.84, h: 0, stroke: '#2d3b2a', sw: 0.002 }, { type: 'barcode', x: 0.08, y: 0.62, w: 0.48, h: 0.12, value: '6971234567897', color: '#2d3b2a' }, { type: 'text', x: 0.08, y: 0.87, w: 0.84, text: 'THANK YOU FOR SHOPPING SMALL', font: 'latin', size: 0.016, color: '#3e4b39', align: 'left', spacing: 0.05 } ] } ]; const nav = [ { label: '产品中心', href: '#products' }, { label: '设计工作室', href: '#studio' }, { label: '模板灵感', href: '#templates' }, { label: '工艺材质', href: '#craft' } ]; window.PL = window.PL || {}; window.PL.data = { fonts, products, materials, finishes, quantities, stickers, templates, nav }; window.PL.data.productById = function (id) { return products.find(function (p) { return p.id === id; }) || products[0]; }; window.PL.data.sizeOf = function (product, sizeId) { return product.sizes.find(function (s) { return s.id === sizeId; }) || product.sizes[Math.floor(product.sizes.length / 2)]; }; window.PL.data.templateById = function (id) { return templates.find(function (t) { return t.id === id; }) || null; }; window.PL.data.materialById = function (id) { return materials.find(function (m) { return m.id === id; }) || materials[0]; }; window.PL.data.finishById = function (id) { return finishes.find(function (f) { return f.id === id; }) || finishes[0]; }; window.PL.data.resolveSize = function (product, state) { if (state && state.sizeId === 'custom' && state.customSize) { const base = product.sizes[Math.floor(product.sizes.length / 2)]; const w = Math.max(30, Math.min(1200, Math.round(Number(state.customSize.w) || base.w))); const h = Math.max(30, Math.min(1600, Math.round(Number(state.customSize.h) || base.h))); const mult = Math.max(0.55, Math.min(2.6, (w * h) / (base.w * base.h))); return { id: 'custom', label: '自定义', w: w, h: h, mult: mult }; } return window.PL.data.sizeOf(product, state && state.sizeId); }; window.PL.data.quantityOf = function (v) { const n = Math.max(100, Math.round(Number(v) || 100)); const fixed = quantities.find(function (q) { return q.value === n; }); if (fixed) return fixed; let mult = 1; if (n >= 1000) mult = 0.8; else if (n >= 500) mult = 0.86; else if (n >= 300) mult = 0.92; return { value: n, mult: mult }; }; window.PL.data.price = function (state) { const product = window.PL.data.productById(state.productId); const size = window.PL.data.resolveSize(product, state); const material = window.PL.data.materialById(state.material); const finish = window.PL.data.finishById(state.finish); const qty = window.PL.data.quantityOf(state.qty); const unit = (product.base * size.mult * material.mult + finish.add) * qty.mult; const total = unit * qty.value; return { unit: Math.round(unit * 100) / 100, total: Math.round(total * 100) / 100, product: product, size: size, material: material, finish: finish, quantity: qty }; }; })();