data.js 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447
  1. (function () {
  2. const fonts = {
  3. sans: { label: '现代黑体', stack: '"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif' },
  4. serif: { label: '优雅宋体', stack: '"Songti SC","STSong","SimSun",serif' },
  5. round: { label: '圆润黑体', stack: '"Yuanti SC","PingFang SC","Microsoft YaHei",sans-serif' },
  6. latin: { label: '英文无衬线', stack: '"Helvetica Neue",Arial,sans-serif' },
  7. latinSerif: { label: '英文衬线', stack: 'Georgia,"Times New Roman",serif' },
  8. mono: { label: '等宽字体', stack: '"SF Mono",Menlo,Consolas,monospace' },
  9. hand: { label: '手写体', stack: '"Bradley Hand","Segoe Print",cursive' }
  10. };
  11. const products = [
  12. {
  13. id: 'standup',
  14. name: '站立袋',
  15. en: 'STAND-UP POUCH',
  16. tagline: '会站立的货架主角',
  17. desc: '自带拉链与站立袋底,适合咖啡豆、零食、宠物粮与茶叶。密封性好,陈列稳定。',
  18. base: 3.6,
  19. mockColor: '#efe7d6',
  20. shape: 'standup',
  21. badge: '人气款',
  22. tags: ['可降解', '拉链封口'],
  23. features: ['自封拉链', '站立袋底', '可选排气阀'],
  24. pad: { l: 12, r: 12, t: 34, b: 18 },
  25. sizes: [
  26. { id: 's', label: 'S', w: 120, h: 180, mult: 0.9 },
  27. { id: 'm', label: 'M', w: 140, h: 210, mult: 1 },
  28. { id: 'l', label: 'L', w: 160, h: 240, mult: 1.12 },
  29. { id: 'xl', label: 'XL', w: 180, h: 270, mult: 1.26 }
  30. ]
  31. },
  32. {
  33. id: 'flatbottom',
  34. name: '平底袋',
  35. en: 'FLAT BOTTOM BAG',
  36. tagline: '货架上的高级感',
  37. desc: '方正的平底结构,容量大、站立稳。适合精品咖啡、谷物与礼盒装产品。',
  38. base: 4.2,
  39. mockColor: '#e9dfcc',
  40. shape: 'flatbottom',
  41. badge: '精品首选',
  42. tags: ['大容量', '平整印刷'],
  43. features: ['六边封合', '平底结构', '可加手提孔'],
  44. pad: { l: 12, r: 12, t: 32, b: 28 },
  45. sizes: [
  46. { id: 's', label: 'S', w: 120, h: 190, mult: 0.92 },
  47. { id: 'm', label: 'M', w: 150, h: 220, mult: 1 },
  48. { id: 'l', label: 'L', w: 170, h: 250, mult: 1.14 }
  49. ]
  50. },
  51. {
  52. id: 'coffee',
  53. name: '咖啡袋',
  54. en: 'COFFEE POUCH',
  55. tagline: '锁住新鲜与风味',
  56. desc: '带单向排气阀与加厚铝膜,避光防潮。为精品咖啡与冷萃打造的专业袋型。',
  57. base: 3.9,
  58. mockColor: '#e8dcc4',
  59. shape: 'coffee',
  60. badge: '含排气阀',
  61. tags: ['避光', '单向阀'],
  62. features: ['单向排气阀', '加厚铝膜', '拉链密封'],
  63. pad: { l: 12, r: 12, t: 40, b: 16 },
  64. sizes: [
  65. { id: 's', label: 'S', w: 100, h: 250, mult: 0.95 },
  66. { id: 'm', label: 'M', w: 120, h: 300, mult: 1 },
  67. { id: 'l', label: 'L', w: 140, h: 350, mult: 1.18 }
  68. ]
  69. },
  70. {
  71. id: 'kraft',
  72. name: '牛皮纸袋',
  73. en: 'KRAFT PAPER BAG',
  74. tagline: '自然的触感',
  75. desc: '原色牛皮纸与环保油墨,质感温润。适合烘焙、茶叶、杂货与手作品牌。',
  76. base: 3.0,
  77. mockColor: '#c49a68',
  78. shape: 'kraft',
  79. badge: '环保材质',
  80. tags: ['原色牛皮', '可回收'],
  81. features: ['食品级内层', '侧边风琴褶', '环保油墨'],
  82. pad: { l: 14, r: 14, t: 24, b: 14 },
  83. sizes: [
  84. { id: 's', label: 'S', w: 180, h: 240, mult: 0.94 },
  85. { id: 'm', label: 'M', w: 220, h: 300, mult: 1 },
  86. { id: 'l', label: 'L', w: 260, h: 350, mult: 1.15 }
  87. ]
  88. },
  89. {
  90. id: 'mailer',
  91. name: '邮寄袋',
  92. en: 'MAILER BAG',
  93. tagline: '轻量、耐撕、好寄',
  94. desc: '轻量耐撕的邮寄包装,适合服饰、配件与小件电商。可定制整面单色印刷。',
  95. base: 2.2,
  96. mockColor: '#2b2926',
  97. shape: 'mailer',
  98. badge: '电商常用',
  99. tags: ['防水', '撕拉条'],
  100. features: ['自粘封口', '撕拉开袋', '防水耐撕'],
  101. pad: { l: 10, r: 10, t: 24, b: 14 },
  102. sizes: [
  103. { id: 's', label: 'S', w: 260, h: 330, mult: 0.9 },
  104. { id: 'm', label: 'M', w: 310, h: 395, mult: 1 },
  105. { id: 'l', label: 'L', w: 395, h: 455, mult: 1.16 }
  106. ]
  107. },
  108. {
  109. id: 'garment',
  110. name: '服装袋',
  111. en: 'GARMENT BAG',
  112. tagline: '让衣服体面出门',
  113. desc: '半透明磨砂质感,配挂孔与自粘封口。适合服装、家纺与品牌工作室。',
  114. base: 1.9,
  115. mockColor: '#dcd8cd',
  116. shape: 'garment',
  117. badge: '小批量',
  118. tags: ['磨砂', '挂孔'],
  119. features: ['挂孔设计', '自粘封口', '磨砂质感'],
  120. pad: { l: 10, r: 10, t: 30, b: 10 },
  121. sizes: [
  122. { id: 's', label: 'S', w: 200, h: 300, mult: 0.92 },
  123. { id: 'm', label: 'M', w: 260, h: 380, mult: 1 },
  124. { id: 'l', label: 'L', w: 310, h: 420, mult: 1.14 }
  125. ]
  126. }
  127. ];
  128. const materials = [
  129. { id: 'matte', name: '哑光膜', desc: '细腻高级,触感柔和', mult: 1 },
  130. { id: 'gloss', name: '亮光膜', desc: '色彩饱和,货架吸睛', mult: 1.05 },
  131. { id: 'kraft', name: '再生牛皮', desc: '自然原色,环保质感', mult: 1.08 },
  132. { id: 'compost', name: '可降解膜', desc: '植物基材料,可堆肥', mult: 1.18 }
  133. ];
  134. const finishes = [
  135. { id: 'none', name: '标准印刷', desc: '四色 / 专色', add: 0 },
  136. { id: 'uv', name: '局部 UV', desc: '高光点缀', add: 0.35 },
  137. { id: 'foil', name: '烫金 / 烫银', desc: '金属光泽', add: 0.6 },
  138. { id: 'soft', name: '触感膜', desc: '丝绒手感', add: 0.25 }
  139. ];
  140. const quantities = [
  141. { value: 100, mult: 1 },
  142. { value: 300, mult: 0.92 },
  143. { value: 500, mult: 0.86 },
  144. { value: 1000, mult: 0.8 }
  145. ];
  146. const stickers = {
  147. 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 }] },
  148. 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 }] },
  149. 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 }] },
  150. 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' }] },
  151. 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' }] },
  152. 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' }] },
  153. 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' }] },
  154. 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 }] },
  155. 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' }] },
  156. 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' }] },
  157. arrow: { viewBox: '0 0 24 24', paths: [{ d: 'M4 12h15M13 6l6 6-6 6', stroke: true }] },
  158. 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 }] },
  159. 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' }] },
  160. bolt: { viewBox: '0 0 24 24', paths: [{ d: 'M13 2 4 14h6l-1 8 9-12h-6l1-8Z' }] }
  161. };
  162. const templates = [
  163. {
  164. id: 'citrus',
  165. name: '青柠气泡',
  166. category: '食品饮料',
  167. product: 'standup',
  168. tint: '#e5f2a3',
  169. bg: '#dcef83',
  170. front: [
  171. { type: 'shape', shape: 'circle', x: 0.09, y: 0.11, w: 0.82, h: 0.5, fill: '#f9f5e6' },
  172. { 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 },
  173. { 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 },
  174. { 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 },
  175. { 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 },
  176. { type: 'sticker', sticker: 'leaf', x: 0.67, y: 0.44, w: 0.19, color: '#ff5c2b' },
  177. { type: 'badge', x: 0.58, y: 0.58, w: 0.33, text: '0 SUGAR · 0 SUGAR · ', color: '#ff5c2b', size: 0.026 },
  178. { type: 'shape', shape: 'rect', x: 0, y: 0.88, w: 1, h: 0.12, fill: '#ff5c2b' },
  179. { 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 }
  180. ],
  181. back: [
  182. { 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 },
  183. { 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 },
  184. { type: 'shape', shape: 'line', x: 0.08, y: 0.37, w: 0.84, h: 0, stroke: '#1c3d2b', sw: 0.002 },
  185. { type: 'text', x: 0.08, y: 0.41, w: 0.84, text: '净含量 330ml · 请置于阴凉干燥处', font: 'sans', size: 0.022, color: '#2c4a36', align: 'left' },
  186. { type: 'barcode', x: 0.08, y: 0.62, w: 0.5, h: 0.14, value: '6971234567890', color: '#1c3d2b' },
  187. { 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 }
  188. ]
  189. },
  190. {
  191. id: 'morning',
  192. name: '晨光咖啡',
  193. category: '咖啡',
  194. product: 'coffee',
  195. tint: '#e8dcc3',
  196. bg: '#efe3cc',
  197. front: [
  198. { type: 'shape', shape: 'circle', x: 0.27, y: 0.09, w: 0.46, h: 0.3, fill: '#1e3a2c' },
  199. { type: 'sticker', sticker: 'sun', x: 0.4, y: 0.13, w: 0.2, color: '#f2a33a' },
  200. { 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 },
  201. { 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 },
  202. { type: 'shape', shape: 'line', x: 0.3, y: 0.59, w: 0.4, h: 0, stroke: '#1e3a2c', sw: 0.002 },
  203. { type: 'text', x: 0.08, y: 0.63, w: 0.84, text: '埃塞俄比亚 · 水洗处理', font: 'sans', size: 0.032, weight: 500, color: '#1e3a2c', align: 'center' },
  204. { 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 },
  205. { type: 'sticker', sticker: 'coffeeBean', x: 0.1, y: 0.78, w: 0.08, color: '#b5653a' },
  206. { 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 },
  207. { 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 }
  208. ],
  209. back: [
  210. { 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 },
  211. { 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 },
  212. { type: 'shape', shape: 'line', x: 0.08, y: 0.45, w: 0.84, h: 0, stroke: '#1e3a2c', sw: 0.002 },
  213. { 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 },
  214. { type: 'barcode', x: 0.08, y: 0.67, w: 0.48, h: 0.12, value: '6971234567891', color: '#1e3a2c' },
  215. { 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 }
  216. ]
  217. },
  218. {
  219. id: 'bloom',
  220. name: '花间茶事',
  221. category: '茶',
  222. product: 'standup',
  223. tint: '#f3ddd3',
  224. bg: '#f6e6dd',
  225. front: [
  226. { type: 'shape', shape: 'rect', x: 0.05, y: 0.05, w: 0.9, h: 0.9, fill: 'none', stroke: '#7a5343', sw: 0.0018 },
  227. { type: 'sticker', sticker: 'flower', x: 0.41, y: 0.08, w: 0.18, color: '#c97b8a' },
  228. { 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 },
  229. { 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 },
  230. { type: 'sticker', sticker: 'flower', x: 0.18, y: 0.52, w: 0.07, color: '#c97b8a' },
  231. { 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 },
  232. { type: 'sticker', sticker: 'flower', x: 0.75, y: 0.52, w: 0.07, color: '#c97b8a' },
  233. { 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 },
  234. { type: 'text', x: 0.1, y: 0.82, w: 0.8, text: '净含量 50g', font: 'sans', size: 0.022, weight: 400, color: '#7a5343', align: 'center' }
  235. ],
  236. back: [
  237. { 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 },
  238. { 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 },
  239. { type: 'shape', shape: 'line', x: 0.1, y: 0.36, w: 0.8, h: 0, stroke: '#7a5343', sw: 0.0015 },
  240. { type: 'text', x: 0.1, y: 0.4, w: 0.8, text: '储存:避光、阴凉、干燥处密封保存。', font: 'sans', size: 0.02, color: '#6a4436', align: 'left', lineHeight: 1.7 },
  241. { type: 'barcode', x: 0.1, y: 0.62, w: 0.46, h: 0.12, value: '6971234567892', color: '#5b3b2e' },
  242. { 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 }
  243. ]
  244. },
  245. {
  246. id: 'noir',
  247. name: '极简黑',
  248. category: '极简',
  249. product: 'coffee',
  250. tint: '#d9d5cc',
  251. bg: '#171513',
  252. front: [
  253. { type: 'sticker', sticker: 'sparkle', x: 0.08, y: 0.07, w: 0.09, color: '#f4efe3' },
  254. { 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 },
  255. { 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 },
  256. { type: 'shape', shape: 'line', x: 0.08, y: 0.34, w: 0.84, h: 0, stroke: '#5a554c', sw: 0.0015 },
  257. { 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 },
  258. { 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 },
  259. { 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 }
  260. ],
  261. back: [
  262. { 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 },
  263. { 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 },
  264. { type: 'shape', shape: 'line', x: 0.08, y: 0.37, w: 0.84, h: 0, stroke: '#5a554c', sw: 0.0015 },
  265. { type: 'text', x: 0.08, y: 0.42, w: 0.84, text: '净含量 250g · 开封后请密封保存', font: 'sans', size: 0.021, color: '#a49c8e', align: 'left' },
  266. { type: 'barcode', x: 0.08, y: 0.63, w: 0.5, h: 0.13, value: '6971234567893', color: '#f4efe3' },
  267. { 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 }
  268. ]
  269. },
  270. {
  271. id: 'woof',
  272. name: '汪汪零食',
  273. category: '宠物',
  274. product: 'standup',
  275. tint: '#bfe2f1',
  276. bg: '#bfe3f2',
  277. front: [
  278. { type: 'shape', shape: 'circle', x: 0.55, y: 0.1, w: 0.38, h: 0.26, fill: '#ff7a45' },
  279. { type: 'sticker', sticker: 'paw', x: 0.12, y: 0.1, w: 0.14, color: '#1d3f58' },
  280. { 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 },
  281. { 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 },
  282. { 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 },
  283. { type: 'sticker', sticker: 'star', x: 0.78, y: 0.42, w: 0.1, color: '#ff7a45' },
  284. { type: 'sticker', sticker: 'paw', x: 0.16, y: 0.63, w: 0.07, color: '#ff7a45' },
  285. { type: 'sticker', sticker: 'paw', x: 0.72, y: 0.66, w: 0.05, color: '#ff7a45' },
  286. { type: 'shape', shape: 'rect', x: 0, y: 0.86, w: 1, h: 0.14, fill: '#1d3f58' },
  287. { 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 }
  288. ],
  289. back: [
  290. { type: 'text', x: 0.08, y: 0.07, w: 0.84, text: 'WOOF!', font: 'latin', size: 0.07, weight: 800, color: '#1d3f58', align: 'left' },
  291. { 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 },
  292. { type: 'shape', shape: 'line', x: 0.08, y: 0.4, w: 0.84, h: 0, stroke: '#1d3f58', sw: 0.002 },
  293. { 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 },
  294. { type: 'barcode', x: 0.08, y: 0.65, w: 0.48, h: 0.12, value: '6971234567894', color: '#1d3f58' },
  295. { type: 'sticker', sticker: 'paw', x: 0.7, y: 0.66, w: 0.14, color: '#ff7a45' }
  296. ]
  297. },
  298. {
  299. id: 'bakery',
  300. name: '麦田烘焙',
  301. category: '烘焙',
  302. product: 'kraft',
  303. tint: '#e2c69f',
  304. bg: '#d9b483',
  305. front: [
  306. { type: 'sticker', sticker: 'wheat', x: 0.42, y: 0.08, w: 0.16, color: '#3a2a1a' },
  307. { 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 },
  308. { 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 },
  309. { type: 'shape', shape: 'line', x: 0.24, y: 0.45, w: 0.52, h: 0, stroke: '#3a2a1a', sw: 0.002 },
  310. { 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 },
  311. { type: 'text', x: 0.1, y: 0.58, w: 0.8, text: '每一口,都是麦田的味道', font: 'serif', size: 0.025, color: '#5a432c', align: 'center', spacing: 0.04 },
  312. { type: 'badge', x: 0.61, y: 0.66, w: 0.28, text: 'HANDMADE · DAILY · ', color: '#3a2a1a', size: 0.024 },
  313. { 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 }
  314. ],
  315. back: [
  316. { 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 },
  317. { 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 },
  318. { type: 'shape', shape: 'line', x: 0.08, y: 0.42, w: 0.84, h: 0, stroke: '#3a2a1a', sw: 0.002 },
  319. { type: 'text', x: 0.08, y: 0.48, w: 0.84, text: '食用前请充分加热。', font: 'sans', size: 0.022, color: '#4a3725', align: 'left' },
  320. { type: 'barcode', x: 0.08, y: 0.64, w: 0.48, h: 0.12, value: '6971234567895', color: '#3a2a1a' }
  321. ]
  322. },
  323. {
  324. id: 'glow',
  325. name: '柔光护肤',
  326. category: '美妆',
  327. product: 'flatbottom',
  328. tint: '#f0e8db',
  329. bg: '#f4eee3',
  330. front: [
  331. { type: 'shape', shape: 'rect', x: 0.06, y: 0.05, w: 0.88, h: 0.9, fill: 'none', stroke: '#b9a88f', sw: 0.0015 },
  332. { type: 'sticker', sticker: 'sparkle', x: 0.44, y: 0.1, w: 0.12, color: '#b9a88f' },
  333. { 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 },
  334. { 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 },
  335. { type: 'shape', shape: 'line', x: 0.32, y: 0.53, w: 0.36, h: 0, stroke: '#b9a88f', sw: 0.0015 },
  336. { 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 },
  337. { type: 'text', x: 0.12, y: 0.67, w: 0.76, text: '玻尿酸 · 神经酰胺 · 角鲨烷', font: 'sans', size: 0.021, color: '#6b6256', align: 'center', spacing: 0.02 },
  338. { 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 }
  339. ],
  340. back: [
  341. { 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 },
  342. { 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 },
  343. { 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 },
  344. { type: 'shape', shape: 'line', x: 0.1, y: 0.47, w: 0.8, h: 0, stroke: '#b9a88f', sw: 0.0015 },
  345. { type: 'barcode', x: 0.1, y: 0.64, w: 0.46, h: 0.12, value: '6971234567896', color: '#2d2a26' },
  346. { 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 }
  347. ]
  348. },
  349. {
  350. id: 'sunday',
  351. name: '周末市集',
  352. category: '零售',
  353. product: 'kraft',
  354. tint: '#f0c9a8',
  355. bg: '#f0c9a8',
  356. front: [
  357. { 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 },
  358. { 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 },
  359. { type: 'shape', shape: 'circle', x: 0.62, y: 0.06, w: 0.3, h: 0.22, fill: '#2d3b2a' },
  360. { 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 },
  361. { type: 'sticker', sticker: 'leaf', x: 0.68, y: 0.2, w: 0.16, color: '#f0c9a8' },
  362. { type: 'shape', shape: 'line', x: 0.08, y: 0.42, w: 0.84, h: 0, stroke: '#2d3b2a', sw: 0.002 },
  363. { 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 },
  364. { 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 },
  365. { type: 'shape', shape: 'rect', x: 0, y: 0.78, w: 1, h: 0.05, fill: '#2d3b2a' },
  366. { 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 }
  367. ],
  368. back: [
  369. { 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 },
  370. { 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 },
  371. { type: 'shape', shape: 'line', x: 0.08, y: 0.38, w: 0.84, h: 0, stroke: '#2d3b2a', sw: 0.002 },
  372. { type: 'barcode', x: 0.08, y: 0.62, w: 0.48, h: 0.12, value: '6971234567897', color: '#2d3b2a' },
  373. { 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 }
  374. ]
  375. }
  376. ];
  377. const nav = [
  378. { label: '产品中心', href: '#products' },
  379. { label: '设计工作室', href: '#studio' },
  380. { label: '模板灵感', href: '#templates' },
  381. { label: '工艺材质', href: '#craft' }
  382. ];
  383. window.PL = window.PL || {};
  384. window.PL.data = { fonts, products, materials, finishes, quantities, stickers, templates, nav };
  385. window.PL.data.productById = function (id) {
  386. return products.find(function (p) { return p.id === id; }) || products[0];
  387. };
  388. window.PL.data.sizeOf = function (product, sizeId) {
  389. return product.sizes.find(function (s) { return s.id === sizeId; }) || product.sizes[Math.floor(product.sizes.length / 2)];
  390. };
  391. window.PL.data.templateById = function (id) {
  392. return templates.find(function (t) { return t.id === id; }) || null;
  393. };
  394. window.PL.data.materialById = function (id) {
  395. return materials.find(function (m) { return m.id === id; }) || materials[0];
  396. };
  397. window.PL.data.finishById = function (id) {
  398. return finishes.find(function (f) { return f.id === id; }) || finishes[0];
  399. };
  400. window.PL.data.resolveSize = function (product, state) {
  401. if (state && state.sizeId === 'custom' && state.customSize) {
  402. const base = product.sizes[Math.floor(product.sizes.length / 2)];
  403. const w = Math.max(30, Math.min(1200, Math.round(Number(state.customSize.w) || base.w)));
  404. const h = Math.max(30, Math.min(1600, Math.round(Number(state.customSize.h) || base.h)));
  405. const mult = Math.max(0.55, Math.min(2.6, (w * h) / (base.w * base.h)));
  406. return { id: 'custom', label: '自定义', w: w, h: h, mult: mult };
  407. }
  408. return window.PL.data.sizeOf(product, state && state.sizeId);
  409. };
  410. window.PL.data.quantityOf = function (v) {
  411. const n = Math.max(100, Math.round(Number(v) || 100));
  412. const fixed = quantities.find(function (q) { return q.value === n; });
  413. if (fixed) return fixed;
  414. let mult = 1;
  415. if (n >= 1000) mult = 0.8;
  416. else if (n >= 500) mult = 0.86;
  417. else if (n >= 300) mult = 0.92;
  418. return { value: n, mult: mult };
  419. };
  420. window.PL.data.price = function (state) {
  421. const product = window.PL.data.productById(state.productId);
  422. const size = window.PL.data.resolveSize(product, state);
  423. const material = window.PL.data.materialById(state.material);
  424. const finish = window.PL.data.finishById(state.finish);
  425. const qty = window.PL.data.quantityOf(state.qty);
  426. const unit = (product.base * size.mult * material.mult + finish.add) * qty.mult;
  427. const total = unit * qty.value;
  428. return {
  429. unit: Math.round(unit * 100) / 100,
  430. total: Math.round(total * 100) / 100,
  431. product: product,
  432. size: size,
  433. material: material,
  434. finish: finish,
  435. quantity: qty
  436. };
  437. };
  438. })();