design.json 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. {
  2. "schemaVersion": 2,
  3. "generatedAt": "2026-05-11T14:00:00+08:00",
  4. "title": "Design System: AI零售柜",
  5. "extensions": {
  6. "colorMeta": {
  7. "primary-yellow": {
  8. "role": "primary",
  9. "displayName": "Brand Yellow",
  10. "canonical": "#FFC107",
  11. "tonalRamp": [
  12. "#FFF8E1", "#FFECB3", "#FFE082", "#FFD54F",
  13. "#FFC107", "#FFB300", "#FFA000", "#FF8F00"
  14. ]
  15. },
  16. "neutral-ink": {
  17. "role": "neutral",
  18. "displayName": "Ink",
  19. "canonical": "#2C2C2C",
  20. "tonalRamp": [
  21. "#0A0A0A", "#1A1A1A", "#2C2C2C", "#404040",
  22. "#555555", "#8C8C8C", "#BDBDBD", "#EEEEEE"
  23. ]
  24. },
  25. "neutral-cream": {
  26. "role": "neutral",
  27. "displayName": "Cream",
  28. "canonical": "#FAFAFA",
  29. "tonalRamp": [
  30. "#E8E8E8", "#EEEEEE", "#F0F0F0", "#F5F5F5",
  31. "#FAFAFA", "#FCFCFC", "#FEFEFE", "#FFFFFF"
  32. ]
  33. }
  34. },
  35. "shadows": [
  36. { "name": "ambient", "value": "0 2rpx 8rpx rgba(0,0,0,0.04)", "purpose": "Subtle card grounding at rest." },
  37. { "name": "low", "value": "0 4rpx 16rpx rgba(0,0,0,0.06)", "purpose": "Default card elevation above cream background." },
  38. { "name": "mid", "value": "0 8rpx 32rpx rgba(0,0,0,0.08)", "purpose": "Elevated surfaces: login card, active modal." },
  39. { "name": "brand-glow", "value": "0 8rpx 24rpx rgba(255,193,7,0.25)", "purpose": "Scan button halo. The only colored shadow." }
  40. ],
  41. "motion": [
  42. { "name": "ease-fast", "value": "cubic-bezier(0.25, 0.1, 0.25, 1)", "purpose": "Micro-interactions, button state changes (150ms)." },
  43. { "name": "ease-standard", "value": "cubic-bezier(0.42, 0, 0.58, 1)", "purpose": "Page transitions, card entrances (300ms)." },
  44. { "name": "ease-enter", "value": "cubic-bezier(0, 0, 0.2, 1)", "purpose": "Slide-up entrances for modals and drawers." }
  45. ],
  46. "breakpoints": []
  47. },
  48. "components": [
  49. {
  50. "name": "Scan Button",
  51. "kind": "button",
  52. "refersTo": "button-primary",
  53. "description": "The hero button on the home page. 400rpx circle with Brand Yellow gradient, pulsing ripple, and brand-glow shadow.",
  54. "html": "<button class=\"ds-btn-scan\"><span class=\"ds-btn-scan-icon\">📷</span><span class=\"ds-btn-scan-text\">扫码开门</span></button>",
  55. "css": ".ds-btn-scan { width: 400rpx; height: 400rpx; border-radius: 50%; background: linear-gradient(135deg, #FFE082, #FFC107); border: none; box-shadow: 0 8rpx 24rpx rgba(255,193,7,0.25); display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; transition: transform 0.3s cubic-bezier(0.25,0.1,0.25,1), box-shadow 0.3s ease; } .ds-btn-scan:active { transform: scale(0.95); box-shadow: 0 4rpx 16rpx rgba(255,193,7,0.3); } .ds-btn-scan-icon { font-size: 80rpx; margin-bottom: 4rpx; } .ds-btn-scan-text { font-size: 40rpx; font-weight: 600; color: #1A1A1A; letter-spacing: 4rpx; }"
  56. },
  57. {
  58. "name": "Primary Action Button",
  59. "kind": "button",
  60. "refersTo": "button-primary",
  61. "description": "Full-width pill button for primary actions like '开门购物' or '立即开通'.",
  62. "html": "<button class=\"ds-btn-primary\">开门购物</button>",
  63. "css": ".ds-btn-primary { width: 100%; height: 108rpx; background: linear-gradient(135deg, #FFD700, #FFC107, #FFB300); border: none; border-radius: 54rpx; color: #1A1A1A; font-size: 36rpx; font-weight: 600; letter-spacing: 8rpx; box-shadow: 0 12rpx 40rpx rgba(255,193,7,0.35), 0 4rpx 16rpx rgba(255,193,7,0.2); transition: transform 0.3s cubic-bezier(0.25,0.1,0.25,1), box-shadow 0.3s ease; } .ds-btn-primary:active { transform: translateY(-4rpx) scale(1.02); box-shadow: 0 16rpx 48rpx rgba(255,193,7,0.45); }"
  64. },
  65. {
  66. "name": "Ghost Button",
  67. "kind": "button",
  68. "refersTo": "button-ghost",
  69. "description": "Secondary action alongside primary. White fill, light border, used for '返回' and cancel actions.",
  70. "html": "<button class=\"ds-btn-ghost\">返回</button>",
  71. "css": ".ds-btn-ghost { background: #FFFFFF; border: 2rpx solid #EEEEEE; border-radius: 32rpx; color: #8C8C8C; font-size: 28rpx; font-weight: 500; padding: 16rpx 32rpx; transition: background 0.15s ease; } .ds-btn-ghost:active { background: #FAFAFA; }"
  72. },
  73. {
  74. "name": "Menu Item",
  75. "kind": "custom",
  76. "refersTo": "menu-item",
  77. "description": "List row with icon, label, optional badge, and right-facing chevron. Used in 我的 and settings screens.",
  78. "html": "<div class=\"ds-menu-item\"><span class=\"ds-menu-icon\">📋</span><span class=\"ds-menu-label\">我的订单</span><span class=\"ds-menu-arrow\"></span></div>",
  79. "css": ".ds-menu-item { display: flex; align-items: center; padding: 24rpx 32rpx; background: #FFFFFF; border-bottom: 1rpx solid #EEEEEE; transition: background 0.15s ease; } .ds-menu-item:active { background: #FAFAFA; } .ds-menu-item:last-child { border-bottom: none; } .ds-menu-icon { width: 40rpx; height: 40rpx; margin-right: 24rpx; } .ds-menu-label { flex: 1; font-size: 28rpx; color: #2C2C2C; } .ds-menu-arrow { width: 16rpx; height: 16rpx; border-top: 2rpx solid #BDBDBD; border-right: 2rpx solid #BDBDBD; transform: rotate(45deg); }"
  80. },
  81. {
  82. "name": "Status Card",
  83. "kind": "card",
  84. "refersTo": "card-default",
  85. "description": "Card with status icon, title, and description. Used in shopping flow for door-open, shopping-done, and error states.",
  86. "html": "<div class=\"ds-status-card\"><div class=\"ds-status-icon success\">✓</div><div class=\"ds-status-title\">结算完成</div><div class=\"ds-status-desc\">您已成功购买以下商品</div></div>",
  87. "css": ".ds-status-card { background: #FFFFFF; border-radius: 24rpx; padding: 32rpx; box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06); text-align: center; } .ds-status-icon { width: 56rpx; height: 56rpx; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20rpx; font-size: 32rpx; color: #FFFFFF; font-weight: bold; } .ds-status-icon.success { background: linear-gradient(135deg, #00CC66, #00B359); box-shadow: 0 4rpx 12rpx rgba(0,204,102,0.3); } .ds-status-title { font-size: 34rpx; font-weight: 700; color: #2C2C2C; margin-bottom: 8rpx; } .ds-status-desc { font-size: 24rpx; color: #8C8C8C; }"
  88. },
  89. {
  90. "name": "Product Card",
  91. "kind": "card",
  92. "refersTo": "card-default",
  93. "description": "Product display card with image, name, price, and stock info. Used in cabinet product listing and order detail.",
  94. "html": "<div class=\"ds-product-card\"><div class=\"ds-product-img\">🥤</div><div class=\"ds-product-info\"><div class=\"ds-product-name\">可口可乐 330ml</div><div class=\"ds-product-price\">¥3.50</div></div></div>",
  95. "css": ".ds-product-card { display: flex; padding: 20rpx 24rpx; background: #FFFFFF; border-bottom: 1rpx solid #F5F5F5; } .ds-product-card:last-child { border-bottom: none; } .ds-product-img { width: 140rpx; height: 140rpx; background: #F5F5F5; border-radius: 12rpx; display: flex; align-items: center; justify-content: center; font-size: 52rpx; margin-right: 20rpx; flex-shrink: 0; } .ds-product-info { flex: 1; display: flex; flex-direction: column; justify-content: center; } .ds-product-name { font-size: 28rpx; color: #2C2C2C; font-weight: 500; line-height: 1.4; margin-bottom: 8rpx; } .ds-product-price { font-size: 32rpx; color: #F44336; font-weight: 700; }"
  96. }
  97. ],
  98. "narrative": {
  99. "northStar": "The Yellow Mark",
  100. "overview": "AI零售柜 is a consumer mini-program where the yellow accent works like a brand marker — instantly recognizable, like 美团's yellow or 闲鱼's yellow. The surface is clean and white, the yellow appears with purpose: a scan button, a selected state, a price. Its presence signals action; its absence signals rest. The system is built on restraint, not because less is more, but because every element must justify itself against the physical context: a user standing in front of a cabinet under bright office lights.",
  101. "keyCharacteristics": [
  102. "Yellow as brand marker, not surface decoration",
  103. "White-dominant backgrounds with warm tint",
  104. "Precision over abundance — every pixel is intentional",
  105. "Fast transitions that feel mechanical, not theatrical",
  106. "Physical-digital coherence: the phone UI mirrors the cabinet interaction"
  107. ],
  108. "rules": [
  109. {
  110. "name": "The One Yellow Rule",
  111. "body": "Brand Yellow appears on at most 30-40% of any given screen. It is the brand marker, not the brand blanket. When everything is yellow, nothing is.",
  112. "section": "colors"
  113. },
  114. {
  115. "name": "The White Canvas Rule",
  116. "body": "White (#FFFFFF) is the default card surface; Cream (#FAFAFA) is the default page background. The difference is subtle but structural — cards float on cream; content that belongs to the page sits directly on cream.",
  117. "section": "colors"
  118. },
  119. {
  120. "name": "The Scale Jump Rule",
  121. "body": "Adjacent text sizes differ by at least 1.25x. No 28rpx next to 30rpx; the scale skips intentionally: 22 → 24 → 28 → 32 → 36 → 48 → 56.",
  122. "section": "typography"
  123. },
  124. {
  125. "name": "The Shadow Has a Job Rule",
  126. "body": "Never use a shadow without answering: what does this elevation communicate? If the answer is 'looks nice,' remove it.",
  127. "section": "elevation"
  128. },
  129. {
  130. "name": "The Flat-By-Default Rule",
  131. "body": "Menu items, list rows, and non-interactive surfaces carry no shadow. Shadow = affordance, not decoration.",
  132. "section": "elevation"
  133. }
  134. ],
  135. "dos": [
  136. "Use Brand Yellow (#FFC107) exclusively for interactive elements: buttons, selected states, brand marks, and active indicators.",
  137. "Use White (#FFFFFF) for cards and Cream (#FAFAFA) for page backgrounds. The distinction creates structure without borders.",
  138. "Maintain at least 32rpx of breathing room around primary CTAs.",
  139. "Use the Shadow vocabulary intentionally: Ambient for at-rest cards, Brand Glow only for the primary CTA.",
  140. "Cap body text at 65-75 characters per line on the widest screen."
  141. ],
  142. "donts": [
  143. "Don't use Brand Yellow as a background fill on text-heavy surfaces. Yellow's job is signaling action, not hosting reading.",
  144. "Don't introduce a second accent color. Green, orange, red, and blue are functional signals; they are not decorative accents.",
  145. "Don't use nested cards. A card inside a card is always wrong.",
  146. "Don't use side-stripe borders (border-left/border-right > 1px) as colored accents.",
  147. "Don't use gradient text (background-clip: text). Solid colors only.",
  148. "Don't use glassmorphism, decorative blurs, or translucent overlays as a default aesthetic.",
  149. "Don't let the interface feel like a discount retail mini-program: no red flash-sale badges, no banner carousels, no cluttered grids of same-sized product cards."
  150. ]
  151. }
  152. }