sweep-accents.mjs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // 票 15 实施(四):模式钮激活渐变、品牌标题渐变、状态点等遗留字面量 → 设计稿色板内值
  2. // 全部取自全稿色板(#01abea/#009de9/#0094d0/#33b3ed/#00b8ff/#b9e8ff/#c7f5ff/#27d17a/#c1d5ff)。
  3. import { readFileSync, writeFileSync } from 'node:fs'
  4. const edits = [
  5. // 一级模式按钮:active 渐变(旧 #2a8fd0/#1467a8/#0b4b83 → 设计蓝族)
  6. ['src/modules/cockpit/CockpitShell.vue', [
  7. ['linear-gradient(180deg, #2a8fd0 0%, #1467a8 55%, #0b4b83 100%)',
  8. 'linear-gradient(180deg, #01abea 0%, #009de9 55%, #0094d0 100%)'],
  9. ['rgba(34, 108, 168, 0.7)', 'rgba(1, 171, 234, 0.7)'],
  10. ['background: #cdf3ff;\n box-shadow: 0 0 10px #7fe0ff, 0 0 20px #4fd8ff;',
  11. 'background: #b9e8ff;\n box-shadow: 0 0 10px #00b8ff, 0 0 20px #01abea;'],
  12. // 品牌标题渐变(设计 title 渐变 #ffffff→#c7f5ff,尾停取色板 #33b3ed)
  13. ['linear-gradient(180deg, #ffffff 8%, #bfeaff 52%, #4fb6e8 100%)',
  14. 'linear-gradient(180deg, #ffffff 8%, #c7f5ff 52%, #33b3ed 100%)'],
  15. // 状态点 ok 绿(→ --lv4 同族)
  16. ['#35d6a4', '#27d17a'],
  17. ]],
  18. // 事件卡/工单时间线:语义底上的可读浅色文字(家族色相随语义色微调)
  19. ['src/modules/cockpit/components/EventDetailCard.vue', [['#8fe9c4', '#b8f2d4'], ['#ffb3bb', '#ffc2c9']]],
  20. ['src/modules/cockpit/components/WorkOrderTimeline.vue', [['#ffd9de', '#ffc2c9']]],
  21. ['src/modules/cockpit/services/mapService.js', [['#ffb3bb', '#ffc2c9']]],
  22. ]
  23. let total = 0
  24. for (const [file, pairs] of edits) {
  25. const src = readFileSync(file, 'utf8')
  26. let out = src
  27. let count = 0
  28. for (const [from, to] of pairs) {
  29. if (!out.includes(from)) {
  30. console.log(`MISS ${file}: ${from.slice(0, 60)}`)
  31. continue
  32. }
  33. out = out.split(from).join(to)
  34. count += 1
  35. }
  36. if (count) {
  37. writeFileSync(file, out)
  38. total += count
  39. console.log(`${file}: ${count}`)
  40. }
  41. }
  42. console.log(`\n合计 ${total} 处`)