dsh-design-studio 1.4.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/README.en.md +11 -10
  2. package/README.md +17 -16
  3. package/THIRD_PARTY_NOTICES.md +108 -0
  4. package/assets/art/README.md +102 -0
  5. package/assets/art/brand-mark.webp +0 -0
  6. package/assets/art/check-clean.webp +0 -0
  7. package/assets/art/coach-markup.webp +0 -0
  8. package/assets/art/drop-file.webp +0 -0
  9. package/assets/art/empty-components.webp +0 -0
  10. package/assets/art/empty-data.webp +0 -0
  11. package/assets/art/empty-error.webp +0 -0
  12. package/assets/art/empty-frames.webp +0 -0
  13. package/assets/art/empty-history.webp +0 -0
  14. package/assets/art/empty-market.webp +0 -0
  15. package/assets/art/empty-notes.webp +0 -0
  16. package/assets/art/empty-search.webp +0 -0
  17. package/assets/art/empty-tokens.webp +0 -0
  18. package/assets/art/empty-works.webp +0 -0
  19. package/assets/art/guide-icon.webp +0 -0
  20. package/assets/art/kind-app.webp +0 -0
  21. package/assets/art/kind-desktop.webp +0 -0
  22. package/assets/art/kind-diagram.webp +0 -0
  23. package/assets/art/kind-dshplugin.webp +0 -0
  24. package/assets/art/kind-email.webp +0 -0
  25. package/assets/art/kind-embedded.webp +0 -0
  26. package/assets/art/kind-framed.webp +0 -0
  27. package/assets/art/kind-miniprogram.webp +0 -0
  28. package/assets/art/kind-poster.webp +0 -0
  29. package/assets/art/kind-slides.webp +0 -0
  30. package/assets/art/kind-tablet.webp +0 -0
  31. package/assets/art/kind-web.webp +0 -0
  32. package/assets/art/placeholder-inspire-img.webp +0 -0
  33. package/assets/art/wait-creating.webp +0 -0
  34. package/assets/motion/ai-capsule.html +124 -0
  35. package/assets/motion/ai-glow-input.html +112 -0
  36. package/assets/motion/balance-odometer.html +112 -0
  37. package/assets/motion/bottom-sheet.html +149 -0
  38. package/assets/motion/brightness-pill.html +114 -0
  39. package/assets/motion/comet-ring.html +95 -0
  40. package/assets/motion/copy-morph.html +116 -0
  41. package/assets/motion/cube-grid.html +103 -0
  42. package/assets/motion/day-night.html +120 -0
  43. package/assets/motion/dial-knob.html +130 -0
  44. package/assets/motion/dock-magnify.html +118 -0
  45. package/assets/motion/download-ring.html +135 -0
  46. package/assets/motion/expand-card.html +137 -0
  47. package/assets/motion/flip-card.html +100 -0
  48. package/assets/motion/hold-pay.html +137 -0
  49. package/assets/motion/holo-card.html +130 -0
  50. package/assets/motion/keycap.html +92 -0
  51. package/assets/motion/like-jelly.html +88 -0
  52. package/assets/motion/liquid-progress.html +113 -0
  53. package/assets/motion/liquid-segment.html +127 -0
  54. package/assets/motion/live-capsule.html +144 -0
  55. package/assets/motion/marker-highlight.html +94 -0
  56. package/assets/motion/marquee-logos.html +110 -0
  57. package/assets/motion/otp-code.html +111 -0
  58. package/assets/motion/password-eye.html +136 -0
  59. package/assets/motion/ruler-slider.html +140 -0
  60. package/assets/motion/search-expand.html +81 -0
  61. package/assets/motion/send-fly.html +121 -0
  62. package/assets/motion/skeleton-shine.html +124 -0
  63. package/assets/motion/star-rate.html +98 -0
  64. package/assets/motion/success-check.html +114 -0
  65. package/assets/motion/suggest-chips.html +134 -0
  66. package/assets/motion/swipe-row.html +126 -0
  67. package/assets/motion/tabbar-bounce.html +92 -0
  68. package/assets/motion/tactile-controls.html +89 -0
  69. package/assets/motion/text-scramble.html +173 -0
  70. package/assets/motion/toast-stack.html +115 -0
  71. package/assets/motion/token-stream.html +106 -0
  72. package/assets/motion/voice-orb.html +144 -0
  73. package/assets/showcase/alley-noodles-1.webp +0 -0
  74. package/assets/showcase/alley-noodles-2.webp +0 -0
  75. package/assets/showcase/alley-noodles-3.webp +0 -0
  76. package/assets/showcase/autumn-sale-1.webp +0 -0
  77. package/assets/showcase/bold-folio-1.webp +0 -0
  78. package/assets/showcase/bold-folio-2.webp +0 -0
  79. package/assets/showcase/book-club-1.webp +0 -0
  80. package/assets/showcase/book-club-2.webp +0 -0
  81. package/assets/showcase/book-club-3.webp +0 -0
  82. package/assets/showcase/flower-order-1.webp +0 -0
  83. package/assets/showcase/little-painter-1.webp +0 -0
  84. package/assets/showcase/little-painter-2.webp +0 -0
  85. package/assets/showcase/moon-fair-1.webp +0 -0
  86. package/assets/showcase/nail-booking-1.webp +0 -0
  87. package/assets/showcase/nail-booking-2.webp +0 -0
  88. package/assets/showcase/nail-booking-3.webp +0 -0
  89. package/assets/showcase/night-run-1.webp +0 -0
  90. package/assets/showcase/paw-diary-1.webp +0 -0
  91. package/assets/showcase/paw-diary-2.webp +0 -0
  92. package/assets/showcase/paw-diary-3.webp +0 -0
  93. package/assets/showcase/pixel-planet-1.webp +0 -0
  94. package/assets/showcase/pixel-planet-2.webp +0 -0
  95. package/assets/showcase/pixel-planet-3.webp +0 -0
  96. package/assets/showcase/pocket-ledger-1.webp +0 -0
  97. package/assets/showcase/pocket-ledger-2.webp +0 -0
  98. package/assets/showcase/shiftloom-1.webp +0 -0
  99. package/assets/showcase/shiftloom-2.webp +0 -0
  100. package/assets/showcase/slow-breath-1.webp +0 -0
  101. package/assets/showcase/slow-breath-2.webp +0 -0
  102. package/assets/showcase/slow-breath-3.webp +0 -0
  103. package/assets/showcase/slow-trip-1.webp +0 -0
  104. package/assets/showcase/slow-trip-2.webp +0 -0
  105. package/assets/showcase/slow-trip-3.webp +0 -0
  106. package/assets/showcase/slow-weekly-1.webp +0 -0
  107. package/assets/showcase/stay-confirm-1.webp +0 -0
  108. package/assets/showcase/stove-recipes-1.webp +0 -0
  109. package/assets/showcase/stove-recipes-2.webp +0 -0
  110. package/assets/showcase/strobewatch-1.webp +0 -0
  111. package/assets/showcase/strobewatch-2.webp +0 -0
  112. package/assets/showcase/tapeworks-1.webp +0 -0
  113. package/assets/showcase/tapeworks-2.webp +0 -0
  114. package/assets/showcase/tea-brand-pitch-1.webp +0 -0
  115. package/assets/showcase/tea-brand-pitch-2.webp +0 -0
  116. package/assets/showcase/tea-brand-pitch-3.webp +0 -0
  117. package/assets/showcase/time-bookshop-1.webp +0 -0
  118. package/assets/showcase/time-bookshop-2.webp +0 -0
  119. package/assets/showcase/water-journey-1.webp +0 -0
  120. package/assets/showcase/water-journey-2.webp +0 -0
  121. package/assets/showcase/water-journey-3.webp +0 -0
  122. package/assets/showcase/weekend-go-1.webp +0 -0
  123. package/assets/showcase/weekend-go-2.webp +0 -0
  124. package/assets/showcase/weekend-go-3.webp +0 -0
  125. package/assets/showcase/winter-soup-1.webp +0 -0
  126. package/assets/showcase/year-review-1.webp +0 -0
  127. package/assets/showcase/year-review-2.webp +0 -0
  128. package/assets/showcase/year-review-3.webp +0 -0
  129. package/lib/annotations.js +1 -1
  130. package/lib/browser.js +3 -1
  131. package/lib/bundle.js +8 -3
  132. package/lib/canvthumb.js +9 -6
  133. package/lib/client.js +7623 -2788
  134. package/lib/components.js +4 -2
  135. package/lib/core.js +763 -133
  136. package/lib/design-page-settings.js +48 -0
  137. package/lib/design-scope.js +36 -0
  138. package/lib/design-transactions.js +259 -0
  139. package/lib/drop-folder.js +25 -0
  140. package/lib/edits.js +125 -8
  141. package/lib/embedded/lvgl_shot.c +133 -0
  142. package/lib/embedded/qml_shot.py +66 -0
  143. package/lib/embedded-shot.js +400 -0
  144. package/lib/embedded-trust.js +76 -0
  145. package/lib/fonts.js +30 -21
  146. package/lib/frames.js +23 -23
  147. package/lib/gallery/css.js +9 -2
  148. package/lib/gallery/market-routes.js +23 -7
  149. package/lib/gallery/pack.js +25 -8
  150. package/lib/gallery/policy.js +6 -4
  151. package/lib/gallery/routes.js +255 -83
  152. package/lib/gallery/submit.js +285 -57
  153. package/lib/gallery/use.js +13 -4
  154. package/lib/handoff-embedded.js +1182 -0
  155. package/lib/handoff.js +212 -71
  156. package/lib/history.js +393 -43
  157. package/lib/htmlpack.js +35 -14
  158. package/lib/impl.js +3 -0
  159. package/lib/index.js +662 -137
  160. package/lib/inspire.js +73 -26
  161. package/lib/kinds.js +11 -2
  162. package/lib/look.js +45 -25
  163. package/lib/mock.js +41 -4
  164. package/lib/motion.js +90 -0
  165. package/lib/page-settings.js +103 -0
  166. package/lib/picker.js +348 -70
  167. package/lib/rules.js +85 -0
  168. package/lib/serve.js +154 -15
  169. package/lib/showcase.json +22 -0
  170. package/lib/styles.js +16 -7
  171. package/lib/system.js +19 -8
  172. package/lib/tool.js +2 -1
  173. package/lib/tweaks.js +146 -9
  174. package/lib/works.js +151 -19
  175. package/locale/annotations/en.json +2 -2
  176. package/locale/annotations/zh.json +2 -2
  177. package/locale/auto/en.json +1 -1
  178. package/locale/auto/zh.json +1 -1
  179. package/locale/en.json +1 -1
  180. package/locale/offline/en.json +1 -1
  181. package/locale/offline/zh.json +2 -2
  182. package/locale/tool/zh.json +1 -1
  183. package/locale/zh.json +1 -1
  184. package/package.json +3 -2
  185. package/skills/ui-design/SKILL.md +59 -47
  186. package/skills/ui-design/frames/dsh/frame.json +1 -1
  187. package/skills/ui-design/references/app.md +29 -2
  188. package/skills/ui-design/references/components.md +1 -1
  189. package/skills/ui-design/references/desktop.md +1 -1
  190. package/skills/ui-design/references/dshplugin.md +12 -12
  191. package/skills/ui-design/references/embedded.md +40 -0
  192. package/skills/ui-design/references/frames.md +20 -20
  193. package/skills/ui-design/references/miniprogram.md +2 -2
  194. package/skills/ui-design/references/mock.md +16 -0
  195. package/skills/ui-design/references/poster.md +2 -1
  196. package/skills/ui-design/references/tweaks.md +17 -0
  197. package/skills/ui-design/tokens.css +19 -5
package/README.en.md CHANGED
@@ -15,7 +15,7 @@
15
15
 
16
16
  </div>
17
17
 
18
- **Design Studio** is a DeepSeek Harness (DSH) plugin. Say what you want to make, and the model's web pages, app screens, mini programs, desktop apps, posters, slides, mind maps and roadmaps appear one by one on a canvas in the right sidebar, inside phone, browser or app-window frames. Click the direction you like, or click whatever looks off and add a sentence, and the model edits it.
18
+ **Design Studio** is a DeepSeek Harness (DSH) plugin. Say what you want to make, and the model's web pages, app screens, mini programs, desktop apps, posters, slides, mind maps and roadmaps appear one by one on a canvas in the right sidebar, inside phone, browser or app-window device frames. Click the direction you like, or click whatever looks off and add a sentence, and the model edits it.
19
19
 
20
20
  ![Demo: one sentence → three directions → pick one for the full set → click to edit](assets/demo.gif)
21
21
 
@@ -31,27 +31,28 @@ If DSH can't reach the npm registry, it falls back to a mirror in China. To upda
31
31
 
32
32
  ## Quick start
33
33
 
34
- 1. In Design mode, say what to make, for example "Design a member app for a neighborhood gym". You can also type it in the big box on the studio's home page: pick a type and a style and press ↑ (Tab fills in an example when the box is empty).
34
+ 1. In Design mode, say what to make, for example "Design a member app for a neighborhood gym". You can also click **New** on the studio's home page, pick a type, click **Add to chat**, and add a sentence before you send.
35
35
  2. The model asks two or three questions, then lays out three directions side by side. Click **✓ Use this take** next to the title of the one you like and send it; the model builds the rest.
36
- 3. To change something, click **Select** on the island at the bottom (or press V), then the element, type "bigger" or "make it red", and send.
36
+ 3. To change something, click **Edit elements** in the toolbar at the bottom, then the element, type "bigger" or "make it red", and send.
37
37
 
38
38
  ## What it does
39
39
 
40
- - **The 1.0 interface:** a title bar on top (Page setup, screens, Share, Export, Build as code) and an island at the bottom (Ask or run a command, Select, Text, Style, Draw, Play, Look, Check). One panel at a time: a drawer on a narrow sidebar, a card on the right with DSH full screen. ⇧⌘K (Ctrl+Shift+K on Windows) opens the command palette, V T S P R L C switch tools, and the motion is a soft aurora.
40
+ - **The 2.0 interface:** the studio has three pages. **Home** shows your recent designs; click **New** and pick a type to start. **Library** has templates, styles, motion components and design systems; **Try on** a style to see it on your design right away, and **Add to chat** puts what you picked into the input so you can add a sentence and send. **Mine** keeps your designs, favorites and brands. The toolbar under the canvas is the same height as the chat input and lines up with it, and stays on one row however narrow the sidebar gets; Versions and zoom then move into the **⋯** menu at the top right. Text edits, style changes and page setup all undo and redo (⌘Z / ⇧⌘Z); changed values get a dot, and one click restores the original. A two-step tour greets you the first time, and pages and popovers move with soft transitions.
41
+ - **Embedded screens:** pick **Embedded screen** under New to design for small screens on microcontrollers and embedded Linux, with common screen sizes ready to pick. Turn the design into LVGL (C) or Qt Quick / QML code; the plugin compiles it, renders it and compares it with the design screen by screen, and exports icons in the format the code needs.
41
42
  - **Pick from three directions:** three different first screens side by side, then the full set in the one you pick. Any single screen can also get two alternative takes.
42
- - **Click to edit:** click an element or drag over an area, and a small chip lands in the input (hover it for details); just add how to change it. Markup, style changes, style cards and check lists land as chips too, not walls of text. The model still gets the full location and styles. Changed spots flash in the preview. You can also draw circles, arrows and notes right on the page and hand the marked-up screenshot to the model, or copy it to paste elsewhere. Adjust style can apply a change to every screen at once, and when you edit a design by hand in the sidebar, the model is told before its next step so it won't undo your edits.
43
- - **Open what you have:** home + › Open HTML… picks an HTML file, or drop an HTML file or folder onto the sidebar (desktop app); you can also type a path or a dev-server port.
43
+ - **Click to edit:** click an element or drag over an area, and a small chip lands in the input (hover it for details); just add how to change it. Annotations, style changes, style cards and check lists land as chips too, not walls of text. The model still gets the full location and styles. Changed spots flash in the preview. You can also draw circles, arrows and notes right on the page and hand the marked-up screenshot to the model, or copy it to paste elsewhere. Adjust style can apply a change to every screen at once, and when you edit a design by hand in the sidebar, the model is told before its next step so it won't undo your edits.
44
+ - **Open what you have:** + in the studio's top bar › Open HTML… picks an HTML file, or drop an HTML file or folder onto the sidebar (desktop app); you can also type a path or a dev-server port.
44
45
  - **Design check:** one click finds overflowing text, low contrast, small tap targets and tiny text, marked right on the page. In Design mode the model also checks its own work and fixes what it finds.
45
46
  - **Clickable prototypes:** back arrows marked `data-back` go back to wherever you came from; the different looks of one page (empty list, with data, paid) are states in one file instead of extra screens, switchable next to the screen name on the canvas, and checked and exported state by state. The design check also points out a shared part that is styled differently on different screens (#30).
46
47
  - **Mock data:** ask for a prototype whose clicks really change things and survive page changes, and the model writes `mock.json` as the data source and binds the pages to it: "Accept offer" switches the whole app to its on-site stage, clocking in updates the time, and it all stays across pages and reloads; a global stage or role changes every page at once. **Data** in the bottom bar opens the data as a tree: edit any value, reset it, or save it as the initial data. The HTML demo carries the data too, with a Reset data button (#30).
47
48
  - **Versions and compare:** every turn is saved; drag a slider to compare, and go back to any version.
48
- - **Export and share:** Export makes showcase images, PDF and PowerPoint (links between screens still work), and designs with hundreds of screens export in full (up to 1000). Share has a clickable HTML demo that opens with a double-click (device frame included, ready to send to a client), a temporary public link (beta; opens in WeChat or any browser, closes after 2 hours), and a QR code to see it on your phone at real size. Slides and posters larger than the default canvas now use the page's real size. You can also set it by adding `WIDTHxHEIGHT` after the type, for example `<meta name="dsh-design" content="slides 1440x810">`. Export options let you pick the page size (16:9, 4:3, A3 landscape or custom), what each page shows (one screen, full page or a set height) and two screens per page. If anything would be cut off, you get a checklist first, with a one-click fix that fits the canvas to the content.
49
- - **Diagrams:** mind maps, technical route charts (the kind in grant proposals and theses), product roadmaps and system architecture diagrams. Lines, branches and arrows are laid out for you and re-flow when you change text or add nodes; colors follow the design style, and a high-resolution PNG or PDF export drops straight into Word or PowerPoint. For grant-proposal and final-report frameworks, the model first lists how the parts relate (which problem maps to which task) for you to confirm, then draws labelled arrows between the blocks, in a bold 3D-gradient "proposal" style by default or after a reference image you give it.
49
+ - **Export and share:** Export makes showcase images, PDF and PowerPoint (links between screens still work), and designs with hundreds of screens export in full (up to 1000). Share has a clickable HTML demo that opens with a double-click (device frame included, ready to send to a client), a temporary online link (beta; opens in WeChat or any browser, closes after 2 hours), and Phone preview, a QR code to see it on your phone at real size. Slides and posters larger than the default size now use the page's real size. You can also set it by adding `WIDTHxHEIGHT` after the type, for example `<meta name="dsh-design" content="slides 1440x810">`. Export options let you pick the page size (16:9, 4:3, A3 landscape or custom), the capture (current viewport, full-length page or a set height) and two screens per page. If anything would be cut off, you get a checklist first, with a one-click fix that fits the size to the content.
50
+ - **Diagrams:** mind maps, technical route charts (the kind in grant proposals and theses), product roadmaps and system architecture diagrams. Roadmaps & diagrams sits right on the home page type row; pick it and a second row offers Technical roadmap (grant proposal), Research framework, Architecture, Mind map and Product roadmap, each with its own example. Lines, branches and arrows are laid out for you and re-flow when you change text or add nodes; colors follow the design style, and a high-resolution PNG or PDF export drops straight into Word or PowerPoint. For grant-proposal and final-report frameworks, the model first lists how the parts relate (which problem maps to which task) for you to confirm, then draws labelled arrows between the blocks, in a bold 3D-gradient "proposal" style by default or after a reference image you give it.
50
51
  - **DSH plugins:** design a plugin inside the real DSH desktop frame (left sidebar entry, settings section, session tab or right sidebar panel, in light and dark). Only the plugin area is designed, so you see exactly how it looks once installed; the design check warns if the frame gets changed.
51
- - **Gallery, My designs, Inspiration:** three tabs on the home page. My designs has everything you've designed (and your saved frames, which you can rename or delete); Inspiration holds saved references and styles; the Gallery has templates, design systems and style cards others shared, and "Start from this" copies one for you to keep editing. Submit your own with Share › Submit to gallery: it's checked, zipped and submitted, and listed once reviewed. The gallery catalog comes from npm mirrors and is used only when its signature and checksums match; to keep it offline, turn on "Design library offline" on the Plugins page.
52
+ - **Library and sharing:** some of the templates, design systems and styles in Library come from other people; **Use template** copies a template for you to keep editing. Submit your own from Mine › Designs: open a card's ⋯ menu and choose Submit to gallery; it's checked, zipped and submitted, and listed once reviewed. The gallery catalog comes from npm mirrors and is used only when its signature and checksums match; to keep it offline, turn on "Design library offline" on the Plugins page.
52
53
  - **Your brand, and real code:** give a site URL to extract a brand design system and design with it from then on; turn a finished design into React / Vue / HTML (mini programs straight into uni-app or native WeChat code, HBuilderX projects included), compared screen by screen against the design.
53
54
  - **Built-in photo library:** for designs that rely on photos (hotels, food, cafes, fitness, beauty, fashion, education, travel), the model uses real-looking photos instead of only drawing illustrations. About 8 MB is downloaded the first time it is needed. All of them are AI-generated placeholders, so replace them with real photos before launch.
54
- - **Built-in font library:** click a font row in the Look panel to pick from 18 free, commercially usable fonts (Noto Sans / Serif SC, Smiley Sans, the ZCOOL family, brush and running-script calligraphy, plus Latin faces such as Inter). The page updates at once; saving copies the font files into the design folder, so exports and remote viewing keep them. You can also just ask the model, e.g. "use brush calligraphy for the headline". About 19 MB is downloaded the first time it is needed.
55
+ - **Built-in font library:** click a font row in the Theme panel to pick from 18 free, commercially usable fonts (Noto Sans / Serif SC, Smiley Sans, the ZCOOL family, brush and running-script calligraphy, plus Latin faces such as Inter). The page updates at once; saving copies the font files into the design folder, so exports and remote viewing keep them. You can also just ask the model, e.g. "use brush calligraphy for the headline". About 19 MB is downloaded the first time it is needed.
55
56
  - **Real components:** parts repeated across screens (tab bars, top bars, cards) live as components in `components/`, and each screen uses them as `<c-name>`. Change one component and every screen using it follows; exports are still plain HTML that opens offline. The model pulls out components on its own when it builds several screens, and can convert an existing design too; a broken component shows as a red box in the preview, and the check says exactly where.
56
57
  - **A style that fits the subject:** when you have not chosen a style, the model first picks a style card for the subject (colors, fonts, corner radius) and builds with it, so a homestay app, a bubble-tea shop and a review deck no longer all come out beige. If you name a style or colors, it follows yours.
57
58
  - **Business annotations (experimental, off by default):** turn on "Business annotations" under Design Studio on the Plugins page, and the model also writes `annotations.json` with the rules, states and edge cases the UI does not show. Numbered markers appear on the page and cards in the sidebar, and clicking either one finds the other. Code handoff passes the rules on to developers (#15).
package/README.md CHANGED
@@ -15,7 +15,7 @@
15
15
 
16
16
  </div>
17
17
 
18
- **设计工作台**是 DeepSeek Harness(DSH)的插件:说一句要做什么,模型做的网页、App 界面、小程序、桌面软件、海报、幻灯片、思维导图和路线图在右边画布上一屏屏长出来,套着手机、浏览器或软件窗口外框。看中哪个方向点一下,哪里不对点一下说一句,模型就照着改。
18
+ **设计工作台**是 DeepSeek Harness(DSH)的插件:说一句要做什么,模型做的网页、App 界面、小程序、桌面软件、海报、幻灯片、思维导图和路线图在右边画布上一屏屏长出来,套着手机、浏览器或软件窗口的设备框。看中哪个方向点一下,哪里不对点一下说一句,模型就照着改。
19
19
 
20
20
  ![演示:一句话 → 三个方向 → 挑一个做全套 → 点一下改](assets/demo.gif)
21
21
 
@@ -25,36 +25,37 @@
25
25
  2. **装好后点「立即启用」**。插件默认是关的,不点不生效。
26
26
  3. 新建会话,模式选「设计模式」。不用重启 DSH。
27
27
 
28
- **需要什么**:DSH 桌面版、网页版都能用,Mac、Windows 都行。「设计体检」要电脑上装着 Chrome 或 Edge。
28
+ **需要什么**:DSH 桌面版、网页版都能用,Mac、Windows 都行。「设计检查」要电脑上装着 Chrome 或 Edge。
29
29
 
30
30
  连不上 npm 时 DSH 会自动换国内镜像。更新:DSH 0.2.2 起,在「插件」页点开它,点「更新到 …」;更老的 DSH 先卸载,再添加一次。新版发布后大约一天,按包名才装得到;急的话卸载后填发布包地址 `https://github.com/OrderG-X/dsh-design-studio/releases/latest/download/dsh-design-studio.tgz`(要能连上 GitHub),不过这样装的以后不能点更新。
31
31
 
32
32
  ## 三步上手
33
33
 
34
- 1. 在设计模式里说一句要做什么,比如「帮我设计一个社区健身房的会员 App」。也可以直接在设计台首页的大输入框里说:挑个类型、风格,点 ↑ 就发出去(没写字时按 Tab 用例子)。
34
+ 1. 在设计模式里说一句要做什么,比如「帮我设计一个社区健身房的会员 App」。也可以在设计台首页点「新建」,选个类型,点「加入对话」,再补一句发出去。
35
35
  2. 模型先问两三个问题,再出三个方向并排在画布上。看中哪个,点它标题旁的「✓ 用这版」,发出去,模型接着做全套。
36
- 3. 哪里不对,点底下灵动条的「选择」(或按 V),再点那个元素,接着说「字大一点」「换成红色」,发出去。
36
+ 3. 哪里不对,点底下工具条的「编辑元素」,再点那个元素,接着说「字大一点」「换成红色」,发出去。
37
37
 
38
38
  ## 能做什么
39
39
 
40
- - **1.0 新界面**:顶上一行标题栏(页面设置、换屏、分享、导出、转成代码),底下一条灵动条(说一句或输命令、选择、改字、调样式、画笔、试用、外观、体检),面板一次只开一个,窄栏是抽屉、DSH 全屏时在右边。⇧⌘K(Windows 是 Ctrl+Shift+K)开命令面板,V T S P R L C 一键切工具;动效换成柔和的极光。
40
+ - **2.0 新界面**:设计台分三页。「首页」放最近的设计,点「新建」选类型就开始;「素材库」里有模板、风格、动效组件和设计系统,风格能「试穿」当场换上看效果,挑中的点「加入对话」放进输入框,补一句再发;「我的」放做过的设计、收藏和品牌。画布底下的工具条和输入条一样高、左右对齐,侧栏再窄也只排一行,版本和缩放这时挪进右上角「⋯」。改字、改样式、页面设置都能撤销和重做(⌘Z / ⇧⌘Z),改过的地方标一个圆点,点一下「恢复为」原来的值。第一次打开有两步引导,换页、弹层都加了柔和的动效。
41
+ - **嵌入式屏幕**:新建里选「嵌入式屏幕」,给单片机、嵌入式 Linux 的小屏做界面,常用屏幕尺寸直接选;做好转成 LVGL(C)或 Qt Quick / QML 代码,插件自己编译出图,和设计稿逐屏比对,图标也能导出成代码要的格式。
41
42
  - **三个方向挑着做**:先出三个风格不同的首屏并排比,挑中再做全套;单独一屏也能「再出两版」。
42
- - **点一下就改**:点元素或框一块区域,输入框里出现一个小标签(悬停看详情),你只要补一句怎么改;标注、调样式、风格、体检清单这些放进输入框的也都是小标签,不再是一大段字;发出去模型拿到完整的位置和样式。改过的地方在预览里闪一下。也能直接在页面上画圈、画箭头、写字,拼成一张图交给模型,或者复制下来贴到别处。调样式可以「各屏一起改」;你在右侧栏亲手改过的地方,模型下一步会先知道,不会改回去。
43
- - **打开已有的页面**:首页输入框左边的「+」→「打开 HTML…」选一个,或把 HTML 文件 / 文件夹拖进右侧栏就能预览(桌面版);也能输路径或开发服务器端口。
44
- - **设计体检**:一键查文字溢出、对比度不够、按钮太小、字太小,问题直接标在页面上;模型做完也会自己查一遍再改。
45
- - **点得动的原型**:返回按钮写上 `data-back` 就「从哪来回哪去」;同一个页面的几种样子(空列表 / 有数据 / 已付款)写成状态,不用另做一屏,画布上屏名旁边就能切,体检、导出每个状态都算;共用部件在各屏写得不一样时,体检会提醒(#30)。
43
+ - **点一下就改**:点元素或框一块区域,输入框里出现一个小标签(悬停看详情),你只要补一句怎么改;标注、样式、风格、检查清单这些放进输入框的也都是小标签,不再是一大段字;发出去模型拿到完整的位置和样式。改过的地方在预览里闪一下。也能直接在页面上画圈、画箭头、写字,拼成一张图交给模型,或者复制下来贴到别处。「样式」里可以「各屏一起改」;你在右侧栏亲手改过的地方,模型下一步会先知道,不会改回去。
44
+ - **打开已有的页面**:设计台顶栏的「+」→「打开 HTML…」选一个,或把 HTML 文件 / 文件夹拖进右侧栏就能预览(桌面版);也能输路径或开发服务器端口。
45
+ - **设计检查**:一键查文字溢出、对比度不够、按钮太小、字太小,问题直接标在页面上;模型做完也会自己查一遍再改。
46
+ - **点得动的原型**:返回按钮写上 `data-back` 就「从哪来回哪去」;同一个页面的几种样子(空列表 / 有数据 / 已付款)写成状态,不用另做一屏,画布上屏名旁边就能切,检查、导出每个状态都算;共用部件在各屏写得不一样时,检查会提醒(#30)。
46
47
  - **模拟数据**:说「点了要真的变、换页还在」,模型会写一份 `mock.json` 当数据源,页面绑在上面——点「接受 Offer」整个 App 切到在项、打卡后时间变了,换页、刷新都还在;阶段、角色这种全局的东西一处改所有页一起变。底部「数据」打开就是一棵数据树:随手改、一键重置、存成初始数据;HTML 演示也带着数据和「重置数据」按钮(#30)。
47
48
  - **版本和对比**:每轮自动存一版,左右拖动对比,随时回到任意一版。
48
- - **导出和分享**:标题栏「导出」出展示图、PDF、PPT(屏和屏之间的跳转照样能点),几百屏的设计也全部导出(最多 1000 屏);「分享」里有双击就能开的 HTML 演示(带外壳、点得动,发给客户直接看)、临时公网链接(实验,微信里点开就能看,2 小时自动关),扫码在手机上按真机尺寸看。页面比默认画幅大的幻灯片、海报,画幅自动跟页面走;也可以在类型后面跟 `宽x高` 指定,比如 `<meta name="dsh-design" content="slides 1440x810">`。导出选项里可以选版面(16:9、4:3、A3 横向、自定义)、每页取景(一屏、整页、指定高度)和每页拼 2 屏;有内容会被裁时,导出前先给一张清单,可以一键按内容改画幅。
49
- - **图表**:思维导图、技术路线图(申报书、开题报告那种)、产品路线图、系统架构图。连线、分叉、箭头自动排好,改字、加节点自己重排;配色跟着设计风格走,导出高清 PNG 或 PDF 贴进 Word / PPT。申报书、结题报告的框架图先帮你理清「哪个问题对应哪项内容」请你确认再画,版块之间画出带关系词的箭头;默认是立体渐变的「申报书炫酷样式」,也能照你给的参考图画。
50
- - **DSH 插件**:给 DSH 做插件界面时,四周直接套上 DSH 桌面端的外框(左侧栏入口、设置分区、会话标签页、右侧栏面板四个位置,浅色、深色都有),只设计插件那一块,一眼看出装进 DSH 是什么样;外框被改了体检会提醒。
51
- - **市场、我的作品、灵感**:首页顶上三个页签。以前做过的设计(还有自己存的外框,能改名、删除)在「我的作品」,收的参考图和风格在「灵感」;「市场」里逛大家分享的模板、设计系统和风格卡,点「用这个开始」复制一份接着改。自己做的从「分享」›「投稿到市场」交上去,查过打成 zip,审过就上架。市场目录从 npm 镜像取,签了名、核对过才用;不想让它联网,在插件页打开「设计库不联网」。
49
+ - **导出和分享**:标题栏「导出」出展示图、PDF、PPT(屏和屏之间的跳转照样能点),几百屏的设计也全部导出(最多 1000 屏);「分享」里有双击就能开的 HTML 演示(带设备框、点得动,发给客户直接看)、临时的在线链接(测试版,微信里点开就能看,2 小时自动关),还有「手机预览」扫码在手机上按真机尺寸看。页面比默认尺寸大的幻灯片、海报,尺寸自动跟页面走;也可以在类型后面跟 `宽x高` 指定,比如 `<meta name="dsh-design" content="slides 1440x810">`。导出选项里可以选版面(16:9、4:3、A3 横向、自定义)、截取方式(当前可见区域、完整长页、自定义高度)和每页拼 2 屏;有内容会被裁时,导出前先给一张清单,可以一键按内容改尺寸。
50
+ - **路线图与导图**:思维导图、技术路线图(申报书、开题报告那种)、产品路线图、系统架构图。首页类型行里直接选「路线图与导图」,下面再点具体哪种:技术路线图(申报书)、研究框架图、架构图、思维导图、产品路线图,示例跟着换。连线、分叉、箭头自动排好,改字、加节点自己重排;配色跟着设计风格走,导出高清 PNG 或 PDF 贴进 Word / PPT。申报书、结题报告的框架图先帮你理清「哪个问题对应哪项内容」请你确认再画,版块之间画出带关系词的箭头;默认是立体渐变的「申报书炫酷样式」,也能照你给的参考图画。
51
+ - **DSH 插件**:给 DSH 做插件界面时,四周直接套上 DSH 桌面端的外壳(左侧栏入口、设置分区、会话标签页、右侧栏面板四个位置,浅色、深色都有),只设计插件那一块,一眼看出装进 DSH 是什么样;外壳被改了检查会提醒。
52
+ - **素材库和投稿**:「素材库」里的模板、设计系统、风格有一部分来自大家分享,模板点「复制模板使用」复制一份接着改。自己做的在「我的」›「设计」里点卡片的「⋯」›「投稿到市场」交上去,查过打成设计包,审过就上架。市场目录从 npm 镜像取,签了名、核对过才用;不想让它联网,在插件页打开「素材库不联网」。
52
53
  - **照品牌风格做、转成代码**:给官网地址,提一套品牌设计系统,以后都照它做;做好的设计转成 React / Vue / HTML,小程序直接转成 uni-app 或原生小程序代码(HBuilderX 建的项目也认得出),逐屏和设计稿比对。
53
54
  - **自带照片库**:民宿酒店、餐饮、奶茶咖啡、健身、美妆、服饰、教育、旅行风景这些靠照片说话的设计,模型会直接用上照片,不再只画插画。第一次用到时下载约 8 MB。都是 AI 生成的示意图,上线前请换成真实照片。
54
- - **自带字体库**:外观面板里点字体那行,就能从 18 款免费可商用字体里挑(思源黑体 / 宋体、得意黑、站酷系列、毛笔楷书、行书,加上 Inter 等英文字体),页面马上换,保存后字体文件放进设计目录,导出、远程看都带着。也可以直接跟模型说「标题用毛笔字」。第一次用到时下载约 19 MB。
55
- - **真组件**:几屏重复的部分(标签栏、顶栏、卡片)写成 `components/` 里的组件,各屏用 `<c-名>` 引用;改一个组件,用到它的屏一起变,导出的成品照样是普通 HTML、离线能开。新做好几屏时模型会自己抽组件,也可以让它把老设计改成组件;组件写错了预览里画红框、体检说清在哪。
55
+ - **自带字体库**:主题面板里点字体那行,就能从 18 款免费可商用字体里挑(思源黑体 / 宋体、得意黑、站酷系列、毛笔楷书、行书,加上 Inter 等英文字体),页面马上换,保存后字体文件放进设计目录,导出、远程看都带着。也可以直接跟模型说「标题用毛笔字」。第一次用到时下载约 19 MB。
56
+ - **真组件**:几屏重复的部分(标签栏、顶栏、卡片)写成 `components/` 里的组件,各屏用 `<c-名>` 引用;改一个组件,用到它的屏一起变,导出的成品照样是普通 HTML、离线能开。新做好几屏时模型会自己抽组件,也可以让它把老设计改成组件;组件写错了预览里画红框、检查说清在哪。
56
57
  - **按题材挑风格**:没定风格时,模型先按题材挑一张风格卡(配色、字体、圆角)再动手,民宿、奶茶店、复盘幻灯片不再都是一个米色调;你自己说了风格或配色就照你的。
57
- - **业务标注(试验,默认关)**:在「插件」页的设计工作台里打开「业务标注」,模型做设计时同时写一份 `annotations.json`,记界面上看不出来的规则、状态和边界。页面上出编号,右侧栏列卡片,点哪边都能定位到另一边;转成代码时这些规则一起交给开发(#15)。
58
+ - **需求说明(试验,默认关)**:在「插件」页的设计工作台里打开「需求说明」,模型做设计时同时写一份 `annotations.json`,记界面上看不出来的规则、状态和边界。页面上出编号,右侧栏列卡片,点哪边都能定位到另一边;转成代码时这些规则一起交给开发(#15)。
58
59
 
59
60
  全部功能、工具参数和安全设计见[完整功能](https://github.com/OrderG-X/dsh-design-studio/blob/main/docs/功能详解.md);开发和测试见[开发说明](https://github.com/OrderG-X/dsh-design-studio/blob/main/docs/开发.md)。
60
61
 
@@ -0,0 +1,108 @@
1
+ # Third-party notices
2
+
3
+ 设计台首页「组件库」里有几个动效组件是照下面这些开源项目改写的(assets/motion/)。每个组件文件开头的注释也写了出处。
4
+
5
+ Some motion components in assets/motion/ are adapted from the open-source projects below. Each adapted file also names its source in a header comment.
6
+
7
+ ## Magic UI
8
+
9
+ - Source: https://github.com/magicuidesign/magicui
10
+ - Used in: dock-magnify.html (Dock), marquee-logos.html (Marquee)
11
+
12
+ ```
13
+ MIT License
14
+
15
+ Copyright (c) Magic UI
16
+
17
+ Permission is hereby granted, free of charge, to any person obtaining a copy
18
+ of this software and associated documentation files (the "Software"), to deal
19
+ in the Software without restriction, including without limitation the rights
20
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
21
+ copies of the Software, and to permit persons to whom the Software is
22
+ furnished to do so, subject to the following conditions:
23
+
24
+ The above copyright notice and this permission notice shall be included in all
25
+ copies or substantial portions of the Software.
26
+
27
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
28
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
29
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
30
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
31
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
32
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33
+ SOFTWARE.
34
+ ```
35
+
36
+ ## SpinKit
37
+
38
+ - Source: https://github.com/tobiasahlin/SpinKit
39
+ - Used in: cube-grid.html (Grid)
40
+
41
+ ```
42
+ The MIT License (MIT)
43
+
44
+ Copyright (c) 2020 Tobias Ahlin
45
+
46
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
47
+ this software and associated documentation files (the "Software"), to deal in
48
+ the Software without restriction, including without limitation the rights to
49
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
50
+ the Software, and to permit persons to whom the Software is furnished to do so,
51
+ subject to the following conditions:
52
+
53
+ The above copyright notice and this permission notice shall be included in all
54
+ copies or substantial portions of the Software.
55
+
56
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
57
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
58
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
59
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
60
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
61
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
62
+ ```
63
+
64
+ ## Vaul
65
+
66
+ - Source: https://github.com/emilkowalski/vaul
67
+ - Used in: bottom-sheet.html
68
+
69
+ ```
70
+ MIT License
71
+
72
+ Copyright (c) 2023 Emil Kowalski
73
+
74
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
75
+
76
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
77
+
78
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
79
+ ```
80
+
81
+ ## Sonner
82
+
83
+ - Source: https://github.com/emilkowalski/sonner
84
+ - Used in: toast-stack.html
85
+
86
+ ```
87
+ MIT License
88
+
89
+ Copyright (c) 2023 Emil Kowalski
90
+
91
+ Permission is hereby granted, free of charge, to any person obtaining a copy
92
+ of this software and associated documentation files (the "Software"), to deal
93
+ in the Software without restriction, including without limitation the rights
94
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
95
+ copies of the Software, and to permit persons to whom the Software is
96
+ furnished to do so, subject to the following conditions:
97
+
98
+ The above copyright notice and this permission notice shall be included in all
99
+ copies or substantial portions of the Software.
100
+
101
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
102
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
103
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
104
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
105
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
106
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
107
+ SOFTWARE.
108
+ ```
@@ -0,0 +1,102 @@
1
+ # DSH Design Studio 2.0 — Art Assets (`assets/art/`)
2
+
3
+ 本目录存放「设计工作台」插件 2.0 的统一风格美术素材,用于替换 `lib/client.js` 中用代码/SVG 绘制的装饰性视觉(空状态插画、新建类型卡片图标、占位与拖拽提示、等待屏装饰、标注引导插图、品牌标志等)。
4
+
5
+ 总览对比图(浅色底 + 深色底双排带标签):[`_overview.png`](./_overview.png)
6
+
7
+ ---
8
+
9
+ ## 1. 美术风格规范(Clean Flat Studio · 2D 扁平正视图)
10
+
11
+ - **整体气质**:纯粹 **2D 扁平插画(2D Flat)**,采用 **0° 正视图(无透视、无 3D、无磨砂玻璃、无投影)**,以圆角几何、统一简洁线条与克制色块构成,低饱和度,与 iOS / macOS 质感界面高度协调。
12
+ - **直观表达内容**:
13
+ - **新建类型图标(12 张)**直接画出每种产物最直观的结构特征(App 竖屏顶栏+卡片+底栏、小程序右上胶囊按钮、网页浏览器+导航+横幅、竖版海报+大标题块、16:9 幻灯片+图表、节点连线导图、带侧栏应用里的插件面板、虚线自定义外壳、横屏平板网格、带窗控与侧栏的桌面软件、带仪表盘的嵌入式小屏、头图+段落+按钮的邮件正文版式)。
14
+ - **空状态与引导插画(15 张)**以简洁平面物件一眼传达场景语义(空白画板+加号、虚线外框+标尺、文档+带叉放大镜、空模板橱窗、页面+警示三角、色板+滑块、叠页+回溯时钟、便签板+评论气泡、表格+数据库、虚线槽+组件件、清单+通过盾牌、虚线相框+上传箭头、虚线落区+文件夹、模块化拼装屏、画笔圈选标注)。
15
+ - **线条与色彩结构**:
16
+ - **统一描边**:中等明度石板蓝灰(`#5A687E`–`#6E7E96`)圆角线框,线宽一致,无手绘抖动、无渐变高光。
17
+ - **界面底面**:冷调浅雾灰(`#F4F7FB` / `#E8EEF6` / `#D8E1EE`)而非纯白,保证在浅色底不融底、深色底不刺眼。
18
+ - **低饱和点缀色**:与 `lib/client.js` 主题令牌同源,克制用于核心视觉焦点。
19
+ - **深浅双主题两用原则(透明底单文件)**:
20
+ - 全部 29 张素材均为**透明底 RGBA WebP**,边缘经纯白去污染(un-premultiply)处理,无白边毛刺;一套素材直接兼容浅色(`#FAF9F6` / `#FFFFFF` / `#F2F1EC`)与深色(`#111112` / `#1A1A1D` / `#202024`)双主题,全套已通过 `_overview.png` 深浅双底色实测。
21
+ - **内容红线**:
22
+ - **零文字**:所有素材均不含任何文字、字母、数字或伪字形,文字由代码渲染以支持中英切换。
23
+ - **零品牌/人像**:不包含任何真实品牌 Logo、第三方应用标志或人物形象。
24
+
25
+ ---
26
+
27
+ ## 2. 统一色板(与 `lib/client.js` CSS_A 对齐)
28
+
29
+ | 色彩角色 | 美术色值 | 对应 `client.js` 主题变量 | 用途 |
30
+ | --- | --- | --- | --- |
31
+ | 主调柔靛紫(Periwinkle Indigo) | `#6C84F0` / `#D4DDFB` | `--dd-acc` (`#2563eb` / `#6ea8ff`), `--dd-c1` (`#8a70ff`) | 品牌标志、主视觉焦点、按钮、选中与核心模块 |
32
+ | 清透天青(Cerulean Sky) | `#56B2E6` / `#D0ECFA` | `--dd-c2` (`#38b4f5` / `#5cc8ff`) | 网页横幅、数据、文件夹、回溯箭头与辅助色块 |
33
+ | 柔薄荷绿(Soft Mint) | `#4DC29D` / `#CCF0E4` | `--dd-c3` (`#3fd9ae`), `--dd-ok` (`#0c9a72`) | 小程序主卡、体检通过盾牌、开关组件与成功态 |
34
+ | 暖杏桃色(Muted Peach) | `#EB9F78` / `#FBE0D0` | `--dd-c4` (`#ff9d6c`), `--dd-warn` (`#ffb547`) | 海报主图、评论气泡、滑块与次焦点点缀 |
35
+ | 柔珊瑚红(Soft Coral) | `#E06E77` | `--dd-err` (`#d6303c` / `#ff6b6b`) | 加载失败警示三角、画笔圈选标注 |
36
+ | 中性结构灰(Slate & Mist) | `#5A687E` / `#D8E1EE` / `#F4F7FB` | `--dd-s2` / `--dd-t3` | 统一描边、设备壳体、卡片底面与占位线条 |
37
+
38
+ ---
39
+
40
+ ## 3. 素材清单与 `lib/client.js` 替换位置
41
+
42
+ 共 **29 张**透明底 2D 扁平 WebP 素材(总计 **165.1 KB**,单张 **3.5–13.5 KB**,均远低于单张 ≤ 40 KB、总计 ≤ 600 KB 上限)。
43
+
44
+ ### 3.1 品牌标志与引导大图标(2 张 · 128×128 @2x)
45
+
46
+ | 文件名 | 替换 `lib/client.js` 位置(函数 / 类名 / 大致行号) | 深浅色用法 | 尺寸(@2x) | 体积 |
47
+ | --- | --- | --- | --- | --- |
48
+ | `brand-mark.webp` | `HomeBar` `.ddp-homebar .mk`(L12582)与 `PreviewTab` 顶栏 `logo` `.dd-logo`(L16710),替换 `I.spark`「✦」按钮 | 透明底两用 | 128×128(显示 30×30) | 11.3 KB |
49
+ | `guide-icon.webp` | `GuideIcon`(L5685–5687,侧栏引导页大图标) | 透明底两用 | 128×128(显示 32×32) | 7.1 KB |
50
+
51
+ ### 3.2 新建面板类型卡片图标(12 张 · 96×96 @2x)
52
+
53
+ 均用于替换 `NewDesignForm` `.ddp-newsheet .new-kinds button` 图标(`kindArt` L5682–5684),同时复用于无缩略图回退和收藏项缺图占位。
54
+
55
+ | 文件名 | 对应类型 | 画面内容 | 深浅色用法 | 尺寸(@2x) | 体积 |
56
+ | --- | --- | --- | --- | --- | --- |
57
+ | `kind-app.webp` | App(`app`) | 手机竖屏 + 顶栏 + 双卡片 + 底部标签栏 | 透明底两用 | 96×96(显示 44×44) | 4.1 KB |
58
+ | `kind-miniprogram.webp` | 小程序(`miniprogram`) | 手机竖屏 + 顶部胶囊按钮 + 绿卡与列表 | 透明底两用 | 96×96(显示 44×44) | 4.0 KB |
59
+ | `kind-web.webp` | 网页(`web`) | 浏览器窗口 + 地址栏/导航 + 大图横幅 + 双列 | 透明底两用 | 96×96(显示 44×44) | 5.3 KB |
60
+ | `kind-poster.webp` | 海报(`poster`) | 竖版海报 + 顶部大标题色块 + 几何风景主图 | 透明底两用 | 96×96(显示 44×44) | 5.6 KB |
61
+ | `kind-slides.webp` | 幻灯片(`slides`) | 16:9 演示页 + 标题要点 + 三柱图表 | 透明底两用 | 96×96(显示 44×44) | 4.8 KB |
62
+ | `kind-diagram.webp` | 路线图与导图(`diagram`) | 根节点向右连线分叉至三色节点 | 透明底两用 | 96×96(显示 44×44) | 5.5 KB |
63
+ | `kind-dshplugin.webp` | DSH 插件(`dshplugin`) | 带侧栏应用窗口 + 高亮右侧插件面板 | 透明底两用 | 96×96(显示 44×44) | 5.1 KB |
64
+ | `kind-framed.webp` | 自定义外壳(`framed`) | 虚线外框与角标 + 居中屏幕卡 | 透明底两用 | 96×96(显示 44×44) | 4.9 KB |
65
+ | `kind-tablet.webp` | 平板(`tablet`) | 横屏平板外壳 + 2×2 四色网格内容 | 透明底两用 | 96×96(显示 44×44) | 4.3 KB |
66
+ | `kind-desktop.webp` | 桌面软件(`desktop`) | 三色窗控按钮 + 左侧导航栏 + 工作区 | 透明底两用 | 96×96(显示 44×44) | 5.0 KB |
67
+ | `kind-embedded.webp` | 嵌入式屏幕(`embedded`) | 带螺丝孔硬件边框 + 深色屏内半圆仪表与指示条 | 透明底两用 | 96×96(显示 44×44) | 5.7 KB |
68
+ | `kind-email.webp` | 邮件(`email`) | 邮件顶栏 + 头图横幅 + 段落线 + 行动按钮 | 透明底两用 | 96×96(显示 44×44) | 4.4 KB |
69
+
70
+ ### 3.3 空状态、占位、拖拽、等待屏与引导插画(15 张 · 240×180 @2x)
71
+
72
+ 均用于 `Empty`、`emptyBox` 及各面板空/通过/拖拽/等待/引导区域。
73
+
74
+ | 文件名 | 使用位置 | 画面内容 | 深浅色用法 | 尺寸(@2x) | 体积 |
75
+ | --- | --- | --- | --- | --- | --- |
76
+ | `empty-works.webp` | `WorksTab` 作品为空 | 叠放空白画板 + 虚线新建卡 + 加号徽章 | 透明底两用 | 240×180(显示 120–184px 宽) | 6.0 KB |
77
+ | `empty-frames.webp` | `WorksTab` 外壳为空 | 虚线设备框 + 四角裁切标 + 标尺 + 比例屏 | 透明底两用 | 240×180(显示 120–184px 宽) | 5.3 KB |
78
+ | `empty-search.webp` | 各页搜索无结果 | 空白列表页 + 带叉放大镜 | 透明底两用 | 240×180(显示 96–160px 宽) | 5.1 KB |
79
+ | `empty-market.webp` | `MarketTab` 模板/系统空状态 | 条纹遮阳棚橱窗 + 两个虚线空模板位 | 透明底两用 | 240×180(显示 120–184px 宽) | 6.9 KB |
80
+ | `empty-error.webp` | 加载失败/出错空状态与画布加载失败 | 空白页面 + 柔珊瑚警示三角叹号 | 透明底两用 | 240×180(显示 96–184px 宽) | 3.6 KB |
81
+ | `empty-tokens.webp` | `LookPanel` 风格/滑块/变量为空 | 三枚色板卡 + 双滑块面板 | 透明底两用 | 240×180(显示 104–176px 宽) | 4.3 KB |
82
+ | `empty-history.webp` | `HistoryPanel` 无历史版本与缺图占位 | 叠放页面卡 + 逆时针回溯时钟 | 透明底两用 | 240×180(显示 88–176px 宽) | 5.1 KB |
83
+ | `empty-notes.webp` | `AnnotPanel` 无需求说明 | 虚线清单写字板 + 暖桃色评论气泡 | 透明底两用 | 240×180(显示 104–176px 宽) | 3.5 KB |
84
+ | `empty-data.webp` | `DataPanel` 无模拟数据 | 空数据表格 + 三层数据库图标 | 透明底两用 | 240×180(显示 104–176px 宽) | 3.6 KB |
85
+ | `empty-components.webp` | `RulesPanel` 组件墙、`SystemsPanel`、`InspireTab` 回退 | 虚线空组件槽 + 开关/按钮/卡片三件套 | 透明底两用 | 240×180(显示 44–176px 宽) | 7.5 KB |
86
+ | `check-clean.webp` | `CheckPanel` 体检无问题 | 清单卡片 + 柔薄荷对勾盾牌与星芒 | 透明底两用 | 240×180(显示 104–176px 宽) | 4.7 KB |
87
+ | `placeholder-inspire-img.webp` | `InspireTab` 参考图上传占位与拖入图片蒙层 | 虚线风景相框 + 向上箭头上传徽章 | 透明底两用 | 240×180(显示 112–160px 宽) | 7.8 KB |
88
+ | `drop-file.webp` | `PreviewTab` 拖入 HTML/文件夹/`.zip` 蒙层 | 虚线落区框 + 打开的文件夹 + 向下箭头落入文档 | 透明底两用 | 240×180(显示 112–160px 宽) | 13.5 KB |
89
+ | `wait-creating.webp` | `PreviewTab` 首屏生成等待态 | 界面线框 + 模块化色块拼入 + 星芒 | 透明底两用 | 240×180(显示 160×120) | 4.4 KB |
90
+ | `coach-markup.webp` | `MarkLayer` 画笔标注首次引导卡 | 页面卡片 + 柔珊瑚椭圆圈选 + 倾斜马克笔 | 透明底两用 | 240×180(显示 112×84) | 6.5 KB |
91
+
92
+ ---
93
+
94
+ ## 4. 建议保持代码绘制的视觉项
95
+
96
+ 以下视觉与实时数据、动态尺寸或流式动效强绑定,**不建议**替换为静态图片:
97
+
98
+ 1. **实时动态等待光标 `GhostDraw` 与流光状态环 `.dd-orb` / `.dd-au` / `.dd-swp`**:按模型 `pulse` 和生成进度 `--at` 实时驱动,建议保留代码动效,仅在首屏尚无草稿流或开启减弱动效时用 `wait-creating.webp` 补位。
99
+ 2. **自定义外壳卡片预览 `.ddp-frm .fw`**:需按每个外壳真实的 `--r: w / h` 动态展示横竖比例,静态图无法体现不同设备的纵横比差异。
100
+ 3. **画布设备外框与系统窗控(`Device` / `.ddp-win` / `.ddp-cap`)、连线箭头 `.ddp-flows`、二维码 `QrCode`**:均为运行时动态几何,必须由代码绘制。
101
+ 4. **市场设计系统色板条 `.asset-system .palette` 与风格小样卡 `StyleSample`**:直接渲染各套设计真实色值与排版样式。
102
+ 5. **功能性线性 UI 小图标(`I.*` 14–18px 工具坞、菜单、关闭 `×`、`HeaderButton`)**:需跟随 `currentColor` 实时切换禁用/悬停/激活态。
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,124 @@
1
+ <!doctype html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <title>灵光胶囊</title>
7
+ <script type="application/json" id="meta">{"id":"ai-capsule","zh":"灵光胶囊","en":"Aura Capsule","cat":"ai","desc":"胶囊随状态弹性伸缩,推演时边缘流转虹彩光环与声波条","desc_en":"The capsule stretches with each state; an iridescent ring and sound bars flow while it reasons","needs":"js","play":"press","hint":"点一下切换","hint_en":"Tap to switch","source":null,"prompt":"AI 灵光胶囊:高 48px 胶囊在待命 116px、推演 152px、完成 126px 间以弹簧(600ms)弹性伸缩。推演态点亮旋转虹彩边框,光球内跳动三根声波条并伴文字扫光;完成态收缩回弹、光球绽放星芒并扩散细环。按下压扁 0.94。颜色读 --color-surface / --color-text / --color-primary / --color-line,减少动效定格推演态。","prompt_en":"Aura capsule: a 48px-tall pill springs between 116px idle, 152px reasoning and 126px done (600ms linear() spring). Reasoning: rotating iridescent conic border, three bouncing sound bars in the orb, text shimmer. Done: the orb blooms a sparkle and a thin ring ripples out. Press squashes to 0.94. Reads --color-surface / --color-text / --color-muted / --color-primary / --color-line; reduced motion freezes in reasoning."}</script>
8
+ <style data-stage>
9
+ :root{color-scheme:light;--color-bg:#efede7;--color-surface:#fff;--color-text:#141413;--color-muted:#76756f;--color-line:rgba(20,20,19,.1);--color-primary:#6d5dfc;--color-danger:#ff375f;--color-warning:#ffb340;--color-success:#2eb85c;--font-sans:-apple-system,BlinkMacSystemFont,"SF Pro Text","PingFang SC","Microsoft YaHei",system-ui,sans-serif}
10
+ :root[data-theme=dark]{color-scheme:dark;--color-bg:#17171a;--color-surface:#2c2c30;--color-text:#f5f5f4;--color-muted:#8e8d88;--color-line:rgba(255,255,255,.12);--color-primary:#8b7dff}
11
+ html,body{height:100%;margin:0}
12
+ body{display:grid;place-items:center;background:var(--color-bg);font-family:var(--font-sans);-webkit-font-smoothing:antialiased;overflow:hidden;user-select:none;-webkit-user-select:none}
13
+ .paused *{animation-play-state:paused!important}
14
+ .stage-fit{position:absolute;left:50%;top:50%;width:max-content;display:grid;place-items:center;transform:translate(-50%,-50%) scale(var(--fit,1))}
15
+ </style>
16
+ <style data-comp>
17
+ /* 灵光胶囊 · AI 三态伸缩 + 虹彩边框 + 声波星芒。颜色读:--color-surface / --color-text / --color-muted / --color-primary / --color-line */
18
+ .c-ai-capsule{--ac-a:var(--color-primary,#6d5dfc);--ac-w:116px;--ac-sp:linear(0,.07,.24,.48,.74,.96,1.08,1.12,1.08,1.02,.98,.97,.99,1.01,1);position:relative;display:inline-grid;place-items:center;height:68px;font-family:var(--font-sans,system-ui)}
19
+ .c-ai-capsule[data-s="pulse"]{--ac-w:152px}
20
+ .c-ai-capsule[data-s="done"]{--ac-w:126px}
21
+ .c-ai-capsule .ac-g{position:absolute;width:calc(var(--ac-w) + 16px);height:54px;border-radius:99px;background:radial-gradient(ellipse at 35% 50%,color-mix(in srgb,var(--ac-a) 36%,transparent),transparent 72%);filter:blur(16px);opacity:.45;transition:width .6s var(--ac-sp),opacity .35s;pointer-events:none}
22
+ .c-ai-capsule[data-s="pulse"] .ac-g{opacity:.95}
23
+ .c-ai-capsule[data-s="done"] .ac-g{opacity:.78}
24
+ .c-ai-capsule .ac-h{position:absolute;width:var(--ac-w);height:48px;border-radius:99px;border:1.5px solid var(--ac-a);opacity:0;pointer-events:none}
25
+ .c-ai-capsule[data-s="done"] .ac-h{animation:ac-rip .64s cubic-bezier(.18,.84,.28,1) forwards}
26
+ .c-ai-capsule .ac-b{position:relative;z-index:2;width:var(--ac-w);height:48px;padding:0;border:0;border-radius:99px;background:0;cursor:pointer;outline:0;transition:width .6s var(--ac-sp),transform .54s var(--ac-sp);-webkit-tap-highlight-color:transparent}
27
+ .c-ai-capsule .ac-b:hover{transform:translateY(-1px)}
28
+ .c-ai-capsule .ac-b:active,.c-ai-capsule.is-p .ac-b{transform:scale(.94);transition:transform .1s cubic-bezier(.3,0,.5,1),width .6s var(--ac-sp)}
29
+ .c-ai-capsule .ac-b:focus-visible .ac-s{outline:2px solid var(--ac-a);outline-offset:4px}
30
+ .c-ai-capsule .ac-s{position:relative;display:flex;align-items:center;gap:10px;width:100%;height:100%;padding:0 16px 0 9px;box-sizing:border-box;border-radius:99px;overflow:hidden;background:var(--color-surface,#fff);box-shadow:inset 0 1px 0 rgba(255,255,255,.45),0 0 0 .5px var(--color-line,rgba(0,0,0,.1)),0 2px 5px rgba(0,0,0,.06),0 16px 34px -12px rgba(0,0,0,.3);transition:box-shadow .35s}
31
+ .c-ai-capsule[data-s="pulse"] .ac-s{box-shadow:inset 0 1px 0 rgba(255,255,255,.42),0 2px 6px rgba(0,0,0,.08),0 16px 34px -10px color-mix(in srgb,var(--ac-a) 45%,rgba(0,0,0,.28))}
32
+ .c-ai-capsule[data-s="done"] .ac-s{box-shadow:inset 0 1px 0 rgba(255,255,255,.45),0 0 0 1px color-mix(in srgb,var(--ac-a) 44%,transparent),0 2px 6px rgba(0,0,0,.06),0 16px 34px -10px color-mix(in srgb,var(--ac-a) 36%,rgba(0,0,0,.24))}
33
+ .c-ai-capsule .ac-r{position:absolute;inset:0;border-radius:99px;padding:1.5px;box-sizing:border-box;opacity:0;transition:opacity .32s;pointer-events:none;-webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);mask-composite:exclude}
34
+ .c-ai-capsule .ac-r::before{content:"";position:absolute;left:50%;top:50%;width:180px;height:180px;margin:-90px 0 0 -90px;background:conic-gradient(var(--ac-a),#45c4ff,#ff7b9c,var(--color-warning,#ffb340),var(--ac-a));animation:ac-spin 2.2s linear infinite}
35
+ .c-ai-capsule[data-s="pulse"] .ac-r{opacity:1}
36
+ .c-ai-capsule .ac-o{position:relative;width:30px;height:30px;flex:none;border-radius:50%;display:grid;place-items:center;overflow:hidden;background:conic-gradient(from 20deg,#ff8a65,var(--ac-a),#45c4ff,#ff8a65);box-shadow:inset 0 1px 1px rgba(255,255,255,.55),0 2px 8px color-mix(in srgb,var(--ac-a) 40%,transparent);transition:transform .48s var(--ac-sp),background .35s}
37
+ .c-ai-capsule .ac-o::before{content:"";position:absolute;inset:2px;border-radius:50%;background:radial-gradient(circle at 35% 30%,rgba(255,255,255,.5),transparent 62%);pointer-events:none}
38
+ .c-ai-capsule[data-s="pulse"] .ac-o{background:color-mix(in srgb,var(--ac-a) 16%,var(--color-surface,#fff));box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--ac-a) 32%,transparent)}
39
+ .c-ai-capsule[data-s="done"] .ac-o{background:linear-gradient(155deg,color-mix(in srgb,#fff 18%,var(--ac-a)),var(--ac-a));transform:scale(1.04)}
40
+ .c-ai-capsule .ac-q{display:flex;align-items:center;gap:2.5px;opacity:0;transform:scale(.5);transition:opacity .22s,transform .38s var(--ac-sp)}
41
+ .c-ai-capsule .ac-q i{width:2.5px;height:12px;border-radius:2px;background:var(--ac-a);animation:ac-bar .85s ease-in-out infinite}
42
+ .c-ai-capsule .ac-q i:nth-child(2){height:16px;animation-delay:.16s}
43
+ .c-ai-capsule .ac-q i:nth-child(3){height:10px;animation-delay:.32s}
44
+ .c-ai-capsule[data-s="pulse"] .ac-q{opacity:1;transform:scale(1)}
45
+ .c-ai-capsule .ac-k{position:absolute;width:16px;height:16px;color:#fff;opacity:0;transform:scale(.4) rotate(-35deg);transition:opacity .24s,transform .5s var(--ac-sp)}
46
+ .c-ai-capsule[data-s="done"] .ac-k{opacity:1;transform:scale(1) rotate(0deg)}
47
+ .c-ai-capsule .ac-w{position:relative;flex:1;min-width:0;height:20px;overflow:hidden;text-align:left}
48
+ .c-ai-capsule .ac-t{position:absolute;inset:0;display:flex;align-items:center;font:600 14px/1 var(--font-sans,system-ui);letter-spacing:.01em;white-space:nowrap;color:var(--color-text,#141413);opacity:0;transform:translateY(10px);transition:opacity .24s,transform .42s cubic-bezier(.22,1,.36,1)}
49
+ .c-ai-capsule[data-s="idle"] .ac-t.t0,.c-ai-capsule[data-s="pulse"] .ac-t.t1,.c-ai-capsule[data-s="done"] .ac-t.t2{opacity:1;transform:none}
50
+ .c-ai-capsule[data-s="pulse"] .ac-t.t0,.c-ai-capsule[data-s="done"] .ac-t.t0,.c-ai-capsule[data-s="done"] .ac-t.t1{transform:translateY(-10px)}
51
+ .c-ai-capsule .ac-t.t1{background:linear-gradient(100deg,var(--color-muted,#76756f) 0 32%,var(--color-text,#141413) 50%,var(--color-muted,#76756f) 68% 100%) 0 0/240% 100%;-webkit-background-clip:text;background-clip:text;color:transparent;animation:ac-sh 1.35s linear infinite}
52
+ .c-ai-capsule .ac-t.t2{color:var(--ac-a)}
53
+ .c-ai-capsule .ac-d{position:absolute;right:16px;top:50%;margin-top:-2px;display:inline-flex;gap:3px;opacity:0;transform:scale(.6);transition:opacity .24s,transform .36s var(--ac-sp);pointer-events:none}
54
+ .c-ai-capsule .ac-d i{width:4px;height:4px;border-radius:50%;background:var(--ac-a);animation:ac-hop 1.05s ease-in-out infinite}
55
+ .c-ai-capsule .ac-d i:nth-child(2){animation-delay:.14s}
56
+ .c-ai-capsule .ac-d i:nth-child(3){animation-delay:.28s}
57
+ .c-ai-capsule[data-s="pulse"] .ac-d{opacity:1;transform:scale(1)}
58
+ @keyframes ac-spin{to{transform:rotate(1turn)}}
59
+ @keyframes ac-bar{0%,100%{transform:scaleY(.38)}50%{transform:scaleY(1)}}
60
+ @keyframes ac-hop{0%,70%,100%{transform:translateY(0);opacity:.4}35%{transform:translateY(-3.5px);opacity:1}}
61
+ @keyframes ac-sh{from{background-position:100% 0}to{background-position:-40% 0}}
62
+ @keyframes ac-rip{0%{opacity:.78;transform:scale(.96)}100%{opacity:0;transform:scale(1.18,1.42)}}
63
+ @media (prefers-reduced-motion:reduce){.c-ai-capsule *{animation:none!important;transition-duration:.01ms!important}.c-ai-capsule .ac-t.t1{background:none;color:var(--color-text,#141413)}}
64
+ </style>
65
+ </head>
66
+ <body>
67
+ <div class="stage-fit">
68
+ <div class="c-ai-capsule" data-comp="ai-capsule" data-s="idle">
69
+ <span class="ac-g" aria-hidden="true"></span><span class="ac-h" aria-hidden="true"></span>
70
+ <button class="ac-b" type="button" aria-label="切换灵光状态">
71
+ <span class="ac-s">
72
+ <span class="ac-r" aria-hidden="true"></span>
73
+ <span class="ac-o" aria-hidden="true"><span class="ac-q"><i></i><i></i><i></i></span><svg class="ac-k" viewBox="0 0 20 20" fill="currentColor"><path d="M10 1.8c.5 3.8 2.4 5.7 6.2 6.2-3.8.5-5.7 2.4-6.2 6.2-.5-3.8-2.4-5.7-6.2-6.2 3.8-.5 5.7-2.4 6.2-6.2Z"/></svg></span>
74
+ <span class="ac-w"><span class="ac-t t0">问灵感</span><span class="ac-t t1">推演中</span><span class="ac-t t2">已提炼</span></span>
75
+ <span class="ac-d" aria-hidden="true"><i></i><i></i><i></i></span>
76
+ </span>
77
+ </button>
78
+ </div>
79
+ </div>
80
+ <script data-comp>
81
+ /* 灵光胶囊逻辑:点击在三态间循环。 */
82
+ (() => {
83
+ const ST = ['idle', 'pulse', 'done']
84
+ document.querySelectorAll('.c-ai-capsule').forEach((el) => {
85
+ let idx = Math.max(0, ST.indexOf(el.dataset.s || 'idle'))
86
+ el.acSet = (s) => { idx = typeof s === 'number' ? ((s % 3) + 3) % 3 : Math.max(0, ST.indexOf(s)); el.dataset.s = ST[idx] }
87
+ el.querySelector('.ac-b').addEventListener('click', () => el.acSet(idx + 1))
88
+ })
89
+ })()
90
+ </script>
91
+ <script data-stage>
92
+ /* 演示舞台:每个组件都一样,只改 DEMO 那一段。组件按 340×212 设计,卡片小了整体等比缩小。 */
93
+ (() => {
94
+ const q = new URLSearchParams(location.search); const root = document.documentElement
95
+ root.dataset.theme = (q.get('theme') || (matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')) === 'dark' ? 'dark' : 'light'
96
+ const reduced = matchMedia('(prefers-reduced-motion: reduce)').matches
97
+ const el = document.querySelector('.stage-fit > [data-comp]')
98
+ const fit = () => root.style.setProperty('--fit', Math.min(1, innerWidth / 340, innerHeight / 212).toFixed(3))
99
+ fit(); addEventListener('resize', fit)
100
+ let playing = !q.has('still'); let hovering = false; let timers = []
101
+ const later = (fn, ms) => timers.push(setTimeout(() => { if (playing && !hovering) fn() }, ms)) // 演示用的定时器:用户一来就全部作废
102
+ const stop = () => { timers.forEach(clearTimeout); timers = []; DEMO.stop() }
103
+ const go = (ms) => { stop(); if (playing && !hovering && !reduced) later(() => DEMO.loop(later), ms) }
104
+ // ===== 只改这一段 =====
105
+ const step = (later, st, w, next) => { el.classList.add('is-p'); later(() => { el.classList.remove('is-p'); el.acSet(st); later(next, w) }, 120) }
106
+ const DEMO = {
107
+ settle () { el.acSet('pulse') },
108
+ loop (later) { step(later, 'pulse', 1750, () => step(later, 'done', 1450, () => step(later, 'idle', 950, () => DEMO.loop(later)))) },
109
+ stop () { el.classList.remove('is-p') },
110
+ }
111
+ // =====================
112
+ document.body.addEventListener('pointerenter', () => { hovering = true; stop() })
113
+ document.body.addEventListener('pointerleave', () => { hovering = false; go(1400) })
114
+ addEventListener('message', (e) => {
115
+ const d = e.data; if (!d || typeof d !== 'object') return
116
+ if (d.theme === 'light' || d.theme === 'dark') root.dataset.theme = d.theme
117
+ if (typeof d.ddpPlay === 'boolean') { playing = d.ddpPlay; root.classList.toggle('paused', !playing); if (playing) go(400); else stop() }
118
+ })
119
+ try { parent.postMessage({ ddpMotionReady: 1 }, '*') } catch (e) { /* 单独打开时没有外层 */ }
120
+ if (reduced || q.has('still')) DEMO.settle(); else go(600)
121
+ })()
122
+ </script>
123
+ </body>
124
+ </html>