dsh-design-studio 2.0.1 → 2.1.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 (129) hide show
  1. package/README.en.md +2 -1
  2. package/README.md +2 -1
  3. package/THIRD_PARTY_NOTICES.md +319 -0
  4. package/assets/motion/ai-capsule.html +4 -2
  5. package/assets/motion/ai-glow-input.html +4 -2
  6. package/assets/motion/app-fab.html +130 -0
  7. package/assets/motion/app-gallery.html +125 -0
  8. package/assets/motion/app-index.html +138 -0
  9. package/assets/motion/app-largetitle.html +138 -0
  10. package/assets/motion/app-onboard.html +141 -0
  11. package/assets/motion/app-player.html +152 -0
  12. package/assets/motion/app-popover.html +133 -0
  13. package/assets/motion/app-rings.html +143 -0
  14. package/assets/motion/app-searchhist.html +131 -0
  15. package/assets/motion/app-tabbar.html +148 -0
  16. package/assets/motion/app-tabs.html +150 -0
  17. package/assets/motion/app-video.html +136 -0
  18. package/assets/motion/balance-odometer.html +4 -2
  19. package/assets/motion/bottom-sheet.html +4 -2
  20. package/assets/motion/brightness-pill.html +4 -2
  21. package/assets/motion/chart-area.html +111 -0
  22. package/assets/motion/chart-bar.html +100 -0
  23. package/assets/motion/chart-donut.html +145 -0
  24. package/assets/motion/chart-funnel.html +120 -0
  25. package/assets/motion/chart-gantt.html +140 -0
  26. package/assets/motion/chart-gauge.html +126 -0
  27. package/assets/motion/chart-heat.html +121 -0
  28. package/assets/motion/chart-kpi.html +110 -0
  29. package/assets/motion/chart-line.html +154 -0
  30. package/assets/motion/chart-radar.html +153 -0
  31. package/assets/motion/chart-rank.html +112 -0
  32. package/assets/motion/chart-stack.html +107 -0
  33. package/assets/motion/comet-ring.html +4 -2
  34. package/assets/motion/copy-morph.html +4 -2
  35. package/assets/motion/cube-grid.html +4 -2
  36. package/assets/motion/day-night.html +4 -2
  37. package/assets/motion/dial-knob.html +4 -2
  38. package/assets/motion/dock-magnify.html +4 -2
  39. package/assets/motion/download-ring.html +4 -2
  40. package/assets/motion/expand-card.html +4 -2
  41. package/assets/motion/flip-card.html +4 -2
  42. package/assets/motion/hold-pay.html +4 -2
  43. package/assets/motion/holo-card.html +4 -2
  44. package/assets/motion/keycap.html +4 -2
  45. package/assets/motion/like-jelly.html +4 -2
  46. package/assets/motion/liquid-progress.html +4 -2
  47. package/assets/motion/liquid-segment.html +4 -2
  48. package/assets/motion/live-capsule.html +4 -2
  49. package/assets/motion/m-actionsheet.html +84 -0
  50. package/assets/motion/m-address.html +113 -0
  51. package/assets/motion/m-buybar.html +122 -0
  52. package/assets/motion/m-calendar.html +135 -0
  53. package/assets/motion/m-capsule-nav.html +97 -0
  54. package/assets/motion/m-cart.html +162 -0
  55. package/assets/motion/m-category.html +154 -0
  56. package/assets/motion/m-chat.html +125 -0
  57. package/assets/motion/m-coupon.html +84 -0
  58. package/assets/motion/m-dialog.html +102 -0
  59. package/assets/motion/m-empty.html +121 -0
  60. package/assets/motion/m-filter.html +171 -0
  61. package/assets/motion/m-goods.html +151 -0
  62. package/assets/motion/m-grid.html +98 -0
  63. package/assets/motion/m-login.html +127 -0
  64. package/assets/motion/m-msglist.html +88 -0
  65. package/assets/motion/m-order.html +111 -0
  66. package/assets/motion/m-profile.html +110 -0
  67. package/assets/motion/m-pull.html +199 -0
  68. package/assets/motion/m-settings.html +81 -0
  69. package/assets/motion/m-sku.html +114 -0
  70. package/assets/motion/m-swiper.html +163 -0
  71. package/assets/motion/m-timeline.html +109 -0
  72. package/assets/motion/m-wheel.html +182 -0
  73. package/assets/motion/marker-highlight.html +4 -2
  74. package/assets/motion/marquee-logos.html +4 -2
  75. package/assets/motion/mp-cartbar.html +158 -0
  76. package/assets/motion/mp-checkin.html +121 -0
  77. package/assets/motion/mp-form.html +128 -0
  78. package/assets/motion/mp-group.html +148 -0
  79. package/assets/motion/mp-invite.html +119 -0
  80. package/assets/motion/mp-points.html +143 -0
  81. package/assets/motion/mp-queue.html +136 -0
  82. package/assets/motion/mp-rate.html +166 -0
  83. package/assets/motion/mp-seckill.html +140 -0
  84. package/assets/motion/mp-store.html +137 -0
  85. package/assets/motion/mp-vip.html +126 -0
  86. package/assets/motion/mp-wizard.html +174 -0
  87. package/assets/motion/otp-code.html +7 -4
  88. package/assets/motion/password-eye.html +4 -2
  89. package/assets/motion/ruler-slider.html +4 -2
  90. package/assets/motion/search-expand.html +4 -2
  91. package/assets/motion/send-fly.html +4 -2
  92. package/assets/motion/skeleton-shine.html +4 -2
  93. package/assets/motion/star-rate.html +4 -2
  94. package/assets/motion/success-check.html +4 -2
  95. package/assets/motion/suggest-chips.html +4 -2
  96. package/assets/motion/swipe-row.html +4 -2
  97. package/assets/motion/tabbar-bounce.html +4 -2
  98. package/assets/motion/tactile-controls.html +4 -2
  99. package/assets/motion/text-scramble.html +4 -2
  100. package/assets/motion/toast-stack.html +4 -2
  101. package/assets/motion/token-stream.html +4 -2
  102. package/assets/motion/um-bell.html +106 -0
  103. package/assets/motion/um-chips.html +132 -0
  104. package/assets/motion/um-coin.html +119 -0
  105. package/assets/motion/um-hue.html +128 -0
  106. package/assets/motion/um-ink-switch.html +129 -0
  107. package/assets/motion/um-leaf-tabs.html +138 -0
  108. package/assets/motion/um-plan.html +110 -0
  109. package/assets/motion/um-radial.html +104 -0
  110. package/assets/motion/um-stroke-check.html +86 -0
  111. package/assets/motion/um-swipe-confirm.html +182 -0
  112. package/assets/motion/um-tide.html +180 -0
  113. package/assets/motion/voice-orb.html +4 -2
  114. package/assets/motion/web-404.html +95 -0
  115. package/assets/motion/web-cmdk.html +167 -0
  116. package/assets/motion/web-dropdown.html +94 -0
  117. package/assets/motion/web-faq.html +84 -0
  118. package/assets/motion/web-footer.html +109 -0
  119. package/assets/motion/web-hero.html +98 -0
  120. package/assets/motion/web-navbar.html +149 -0
  121. package/assets/motion/web-newsletter.html +124 -0
  122. package/assets/motion/web-pagination.html +132 -0
  123. package/assets/motion/web-pricing.html +110 -0
  124. package/assets/motion/web-testimonial.html +129 -0
  125. package/assets/motion/web-upload.html +160 -0
  126. package/lib/client.js +72 -14
  127. package/lib/index.js +6 -2
  128. package/lib/motion.js +11 -2
  129. package/package.json +1 -1
package/README.en.md CHANGED
@@ -37,7 +37,8 @@ If DSH can't reach the npm registry, it falls back to a mirror in China. To upda
37
37
 
38
38
  ## What it does
39
39
 
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.
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, 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
+ - **Components (122 as of 2.1):** besides motion and small interactions there are now app screens, mini program and shop pieces, web sections and charts. Try them right in the card, then **Add to chat** and the model builds it into your design. Many are adapted from MIT-licensed open-source projects; credits are in `THIRD_PARTY_NOTICES.md`.
41
42
  - **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.
42
43
  - **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.
43
44
  - **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.
package/README.md CHANGED
@@ -37,7 +37,8 @@
37
37
 
38
38
  ## 能做什么
39
39
 
40
- - **2.0 新界面**:设计台分三页。「首页」放最近的设计,点「新建」选类型就开始;「素材库」里有模板、风格、动效组件和设计系统,风格能「试穿」当场换上看效果,挑中的点「加入对话」放进输入框,补一句再发;「我的」放做过的设计、收藏和品牌。画布底下的工具条和输入条一样高、左右对齐,侧栏再窄也只排一行,版本和缩放这时挪进右上角「⋯」。改字、改样式、页面设置都能撤销和重做(⌘Z / ⇧⌘Z),改过的地方标一个圆点,点一下「恢复为」原来的值。第一次打开有两步引导,换页、弹层都加了柔和的动效。
40
+ - **2.0 新界面**:设计台分三页。「首页」放最近的设计,点「新建」选类型就开始;「素材库」里有模板、风格、组件和设计系统,风格能「试穿」当场换上看效果,挑中的点「加入对话」放进输入框,补一句再发;「我的」放做过的设计、收藏和品牌。画布底下的工具条和输入条一样高、左右对齐,侧栏再窄也只排一行,版本和缩放这时挪进右上角「⋯」。改字、改样式、页面设置都能撤销和重做(⌘Z / ⇧⌘Z),改过的地方标一个圆点,点一下「恢复为」原来的值。第一次打开有两步引导,换页、弹层都加了柔和的动效。
41
+ - **组件(2.1 加到 122 个)**:除了动效和小交互,多了 App 界面、小程序和电商、网页区块、数据图表,在卡片里就能点着试;挑中点「加入对话」,让模型照着做进你的设计。不少改自 MIT 开源项目,出处写在 `THIRD_PARTY_NOTICES.md`。
41
42
  - **嵌入式屏幕**:新建里选「嵌入式屏幕」,给单片机、嵌入式 Linux 的小屏做界面,常用屏幕尺寸直接选;做好转成 LVGL(C)或 Qt Quick / QML 代码,插件自己编译出图,和设计稿逐屏比对,图标也能导出成代码要的格式。
42
43
  - **三个方向挑着做**:先出三个风格不同的首屏并排比,挑中再做全套;单独一屏也能「再出两版」。
43
44
  - **点一下就改**:点元素或框一块区域,输入框里出现一个小标签(悬停看详情),你只要补一句怎么改;标注、样式、风格、检查清单这些放进输入框的也都是小标签,不再是一大段字;发出去模型拿到完整的位置和样式。改过的地方在预览里闪一下。也能直接在页面上画圈、画箭头、写字,拼成一张图交给模型,或者复制下来贴到别处。「样式」里可以「各屏一起改」;你在右侧栏亲手改过的地方,模型下一步会先知道,不会改回去。
@@ -106,3 +106,322 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
106
106
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
107
107
  SOFTWARE.
108
108
  ```
109
+
110
+ ## WeUI
111
+
112
+ - Source: https://github.com/Tencent/weui
113
+ - Used in: m-actionsheet.html (Action Sheet), m-dialog.html (Confirm Dialog), m-grid.html (Grid Menu), m-settings.html (Settings List), m-wheel.html (Wheel Picker)
114
+
115
+ ```
116
+ MIT License
117
+
118
+ Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
119
+
120
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
121
+ this software and associated documentation files (the "Software"), to deal in
122
+ the Software without restriction, including without limitation the rights to
123
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
124
+ of the Software, and to permit persons to whom the Software is furnished to do
125
+ so, subject to the following conditions:
126
+
127
+ The above copyright notice and this permission notice shall be included in all
128
+ copies or substantial portions of the Software.
129
+
130
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
131
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
132
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
133
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
134
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
135
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
136
+ SOFTWARE.
137
+ ```
138
+
139
+ ## TDesign Miniprogram
140
+
141
+ - Source: https://github.com/Tencent/tdesign-miniprogram
142
+ - Used in: m-calendar.html (Booking Calendar), m-capsule-nav.html (Capsule Nav Bar), m-category.html (Category Sidebar), m-swiper.html (Banner Swiper), m-timeline.html (Tracking Timeline), mp-form.html (Signup Form), mp-group.html (Group Buy), mp-points.html (Points Progress), mp-seckill.html (Flash Seckill)
143
+
144
+ ```
145
+ MIT License
146
+
147
+ Copyright (c) 2021-present TDesign
148
+
149
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
150
+ this software and associated documentation files (the "Software"), to deal in
151
+ the Software without restriction, including without limitation the rights to
152
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
153
+ of the Software, and to permit persons to whom the Software is furnished to do
154
+ so, subject to the following conditions:
155
+
156
+ The above copyright notice and this permission notice shall be included in all
157
+ copies or substantial portions of the Software.
158
+
159
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
160
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
161
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
162
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
163
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
164
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
165
+ SOFTWARE.
166
+ ```
167
+
168
+ ## TDesign Miniprogram Retail Starter
169
+
170
+ - Source: https://github.com/Tencent/tdesign-miniprogram-starter-retail
171
+ - Used in: m-address.html (Address Card), m-buybar.html (Product Buy Bar), m-cart.html (Cart Items), m-coupon.html (Coupon Ticket), m-goods.html (Goods Card), m-order.html (Order Card), m-profile.html (Profile Header), m-sku.html (SKU Picker), mp-cartbar.html (Order Cart Bar), mp-rate.html (Order Review)
172
+
173
+ ```
174
+ MIT License
175
+
176
+ Copyright (c) 2021-present TDesign
177
+
178
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
179
+ this software and associated documentation files (the "Software"), to deal in
180
+ the Software without restriction, including without limitation the rights to
181
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
182
+ of the Software, and to permit persons to whom the Software is furnished to do
183
+ so, subject to the following conditions:
184
+
185
+ The above copyright notice and this permission notice shall be included in all
186
+ copies or substantial portions of the Software.
187
+
188
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
189
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
190
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
191
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
192
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
193
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
194
+ SOFTWARE.
195
+ ```
196
+
197
+ ## Vant
198
+
199
+ - Source: https://github.com/youzan/vant
200
+ - Used in: app-tabs.html (Sticky Tabs), m-filter.html (Filter Dropdown), m-msglist.html (Message List), m-pull.html (Pull to Refresh), mp-store.html (Store Picker), mp-wizard.html (Step Form)
201
+
202
+ ```
203
+ MIT License
204
+
205
+ Copyright (c) Youzan
206
+ Copyright (c) Chen Jiahan and other contributors
207
+
208
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
209
+ this software and associated documentation files (the "Software"), to deal in
210
+ the Software without restriction, including without limitation the rights to
211
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
212
+ of the Software, and to permit persons to whom the Software is furnished to do
213
+ so, subject to the following conditions:
214
+
215
+ The above copyright notice and this permission notice shall be included in all
216
+ copies or substantial portions of the Software.
217
+
218
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
219
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
220
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
221
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
222
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
223
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
224
+ SOFTWARE.
225
+ ```
226
+
227
+ ## Framework7
228
+
229
+ - Source: https://github.com/framework7io/framework7
230
+ - Used in: app-fab.html (Speed Dial FAB), app-index.html (Index Bar), app-largetitle.html (Large Title Nav), app-popover.html (Popover Menu)
231
+
232
+ ```
233
+ The MIT License (MIT)
234
+
235
+ Copyright (c) 2014 Vladimir Kharlampidi
236
+
237
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
238
+ this software and associated documentation files (the "Software"), to deal in
239
+ the Software without restriction, including without limitation the rights to
240
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
241
+ the Software, and to permit persons to whom the Software is furnished to do so,
242
+ subject to the following conditions:
243
+
244
+ The above copyright notice and this permission notice shall be included in all
245
+ copies or substantial portions of the Software.
246
+
247
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
248
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
249
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
250
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
251
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
252
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
253
+ ```
254
+
255
+ ## Konsta UI
256
+
257
+ - Source: https://github.com/konstaui/konsta
258
+ - Used in: app-tabbar.html (Center Tab Bar)
259
+
260
+ ```
261
+ MIT License
262
+
263
+ Copyright (c) 2021 Vladimir Kharlampidi
264
+
265
+ Permission is hereby granted, free of charge, to any person obtaining a copy
266
+ of this software and associated documentation files (the "Software"), to deal
267
+ in the Software without restriction, including without limitation the rights
268
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
269
+ copies of the Software, and to permit persons to whom the Software is
270
+ furnished to do so, subject to the following conditions:
271
+
272
+ The above copyright notice and this permission notice shall be included in all
273
+ copies or substantial portions of the Software.
274
+
275
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
276
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
277
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
278
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
279
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
280
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
281
+ SOFTWARE.
282
+ ```
283
+
284
+ ## Charts.css
285
+
286
+ - Source: https://github.com/ChartsCSS/charts.css
287
+ - Used in: chart-area.html (Area Chart), chart-bar.html (Column Chart), chart-rank.html (Rank Bars), chart-stack.html (Stacked Bars)
288
+
289
+ ```
290
+ MIT License
291
+
292
+ Copyright (c) 2020 Rami Yushuvaev
293
+
294
+ Permission is hereby granted, free of charge, to any person obtaining a copy
295
+ of this software and associated documentation files (the "Software"), to deal
296
+ in the Software without restriction, including without limitation the rights
297
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
298
+ copies of the Software, and to permit persons to whom the Software is
299
+ furnished to do so, subject to the following conditions:
300
+
301
+ The above copyright notice and this permission notice shall be included in all
302
+ copies or substantial portions of the Software.
303
+
304
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
305
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
306
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
307
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
308
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
309
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
310
+ SOFTWARE.
311
+ ```
312
+
313
+ ## daisyUI
314
+
315
+ - Source: https://github.com/saadeghi/daisyui
316
+ - Used in: chart-kpi.html (KPI Card), web-footer.html (Website Footer)
317
+
318
+ ```
319
+ MIT License
320
+
321
+ Copyright (c) 2020 Pouya Saadeghi
322
+
323
+ Permission is hereby granted, free of charge, to any person obtaining a copy
324
+ of this software and associated documentation files (the "Software"), to deal
325
+ in the Software without restriction, including without limitation the rights
326
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
327
+ copies of the Software, and to permit persons to whom the Software is
328
+ furnished to do so, subject to the following conditions:
329
+
330
+ The above copyright notice and this permission notice shall be included in all
331
+ copies or substantial portions of the Software.
332
+
333
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
334
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
335
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
336
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
337
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
338
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
339
+ SOFTWARE.
340
+ ```
341
+
342
+ ## UI Moments
343
+
344
+ - Source: https://github.com/guanmo-ai/ui-moments
345
+ - Used in: um-bell.html (Bell Toggle), um-chips.html (Chip Input), um-coin.html (Flip Coin), um-hue.html (Hue Orbit), um-ink-switch.html (Ink Switch), um-leaf-tabs.html (Leaf Tabs), um-plan.html (Plan Picker), um-radial.html (Radial Menu), um-stroke-check.html (Stroke Checklist), um-swipe-confirm.html (Swipe Confirm), um-tide.html (Tide Progress)
346
+
347
+ ```
348
+ MIT License
349
+
350
+ Copyright (c) 2026 guanmo-ai
351
+
352
+ Permission is hereby granted, free of charge, to any person obtaining a copy
353
+ of this software and associated documentation files (the "Software"), to deal
354
+ in the Software without restriction, including without limitation the rights
355
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
356
+ copies of the Software, and to permit persons to whom the Software is
357
+ furnished to do so, subject to the following conditions:
358
+
359
+ The above copyright notice and this permission notice shall be included in all
360
+ copies or substantial portions of the Software.
361
+
362
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
363
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
364
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
365
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
366
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
367
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
368
+ SOFTWARE.
369
+ ```
370
+
371
+ ## cmdk
372
+
373
+ - Source: https://github.com/dip/cmdk
374
+ - Used in: web-cmdk.html (Command Menu)
375
+
376
+ ```
377
+ MIT License
378
+
379
+ Copyright (c) 2022 Paco Coursey
380
+
381
+ Permission is hereby granted, free of charge, to any person obtaining a copy
382
+ of this software and associated documentation files (the "Software"), to deal
383
+ in the Software without restriction, including without limitation the rights
384
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
385
+ copies of the Software, and to permit persons to whom the Software is
386
+ furnished to do so, subject to the following conditions:
387
+
388
+ The above copyright notice and this permission notice shall be included in all
389
+ copies or substantial portions of the Software.
390
+
391
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
392
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
393
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
394
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
395
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
396
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
397
+ SOFTWARE.
398
+ ```
399
+
400
+ ## HyperUI
401
+
402
+ - Source: https://github.com/markmead/hyperui
403
+ - Used in: web-dropdown.html (Dropdown Menu), web-faq.html (FAQ Accordion), web-hero.html (Hero Banner), web-navbar.html (Website Navbar), web-newsletter.html (Newsletter Box), web-pagination.html (Breadcrumb & Pager), web-pricing.html (Pricing Cards), web-testimonial.html (Testimonial Wall), web-upload.html (Dropzone Upload)
404
+
405
+ ```
406
+ MIT License
407
+
408
+ Copyright (c) Mark Mead
409
+
410
+ Permission is hereby granted, free of charge, to any person obtaining a copy
411
+ of this software and associated documentation files (the "Software"), to deal
412
+ in the Software without restriction, including without limitation the rights
413
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
414
+ copies of the Software, and to permit persons to whom the Software is
415
+ furnished to do so, subject to the following conditions:
416
+
417
+ The above copyright notice and this permission notice shall be included in all
418
+ copies or substantial portions of the Software.
419
+
420
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
421
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
422
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
423
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
424
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
425
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
426
+ SOFTWARE.
427
+ ```
@@ -95,8 +95,10 @@ body{display:grid;place-items:center;background:var(--color-bg);font-family:var(
95
95
  root.dataset.theme = (q.get('theme') || (matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')) === 'dark' ? 'dark' : 'light'
96
96
  const reduced = matchMedia('(prefers-reduced-motion: reduce)').matches
97
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)
98
+ // 桌面版里框常常先报 0 宽高、之后变大却不触发 resize:读到 0 不能记下来(会一直缩没),框变化和外层发消息时再算
99
+ const fit = () => { if (innerWidth > 0 && innerHeight > 0) root.style.setProperty('--fit', Math.min(1, innerWidth / 340, innerHeight / 212).toFixed(3)) }
100
+ fit(); addEventListener('resize', fit); addEventListener('load', fit); addEventListener('message', fit)
101
+ if (typeof ResizeObserver === 'function') new ResizeObserver(fit).observe(root)
100
102
  let playing = !q.has('still'); let hovering = false; let timers = []
101
103
  const later = (fn, ms) => timers.push(setTimeout(() => { if (playing && !hovering) fn() }, ms)) // 演示用的定时器:用户一来就全部作废
102
104
  const stop = () => { timers.forEach(clearTimeout); timers = []; DEMO.stop() }
@@ -82,8 +82,10 @@ body{display:grid;place-items:center;background:var(--color-bg);font-family:var(
82
82
  root.dataset.theme = (q.get('theme') || (matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')) === 'dark' ? 'dark' : 'light'
83
83
  const reduced = matchMedia('(prefers-reduced-motion: reduce)').matches
84
84
  const el = document.querySelector('.stage-fit > [data-comp]')
85
- const fit = () => root.style.setProperty('--fit', Math.min(1, innerWidth / 340, innerHeight / 212).toFixed(3))
86
- fit(); addEventListener('resize', fit)
85
+ // 桌面版里框常常先报 0 宽高、之后变大却不触发 resize:读到 0 不能记下来(会一直缩没),框变化和外层发消息时再算
86
+ const fit = () => { if (innerWidth > 0 && innerHeight > 0) root.style.setProperty('--fit', Math.min(1, innerWidth / 340, innerHeight / 212).toFixed(3)) }
87
+ fit(); addEventListener('resize', fit); addEventListener('load', fit); addEventListener('message', fit)
88
+ if (typeof ResizeObserver === 'function') new ResizeObserver(fit).observe(root)
87
89
  let playing = !q.has('still'); let hovering = false; let timers = []
88
90
  const later = (fn, ms) => timers.push(setTimeout(() => { if (playing && !hovering) fn() }, ms)) // 演示用的定时器:用户一来就全部作废
89
91
  const stop = () => { timers.forEach(clearTimeout); timers = []; DEMO.stop() }
@@ -0,0 +1,130 @@
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":"app-fab","zh":"悬浮按钮","en":"Speed Dial FAB","cat":"mobile","desc":"右下角悬浮主按钮,点击旋转展开三个带标签的快捷操作,再点收起","desc_en":"Floating action button that rotates and fans out three staggered labeled speed-dial actions","needs":"js","play":"press","hint":"点加号展开","hint_en":"Tap to expand","source":{"name":"Framework7","url":"https://github.com/framework7io/framework7/blob/master/src/core/components/fab/fab.less","license":"MIT","author":"2014 Vladimir Kharlampidi"},"prompt":"移动端右下角悬浮按钮(Speed Dial):宽 256px 高 172px 圆角 18px 的 --color-surface 预览屏,参照 Framework7 fab.less 的 .fab-opened 展开结构、双图标旋转切换与子项错峰 45ms 延迟弹出。主按钮直径 40px 锚定右下角,点击后加号旋转 45° 切换关闭态,背景轻压暗,上方错峰扇出三个带说明胶囊的彩色圆形动作按钮(新建笔记、拍一张、扫一扫)。点击任一动作会轻提示并收起菜单。读 --color-surface / --color-text / --color-muted / --color-line / --color-primary / --color-warning / --color-success。","prompt_en":"Mobile speed-dial FAB: 256x172 --color-surface card (18px radius) adapted from Framework7 fab.less (.fab-opened icon morph and 45ms staggered actions). A 40px bottom-right --color-primary FAB rotates 45deg, dims the backdrop, and fans out three labeled circular actions upward. Tapping an action updates the top badge and collapses. Reads --color-surface / --color-text / --color-line / --color-primary / --color-warning / --color-success."}</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:#0a84ff;--color-danger:#ff375f;--color-warning:#ffb340;--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,.1)}
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
+ /* 悬浮按钮 改写自 Framework7(MIT,© 2014 Vladimir Kharlampidi,https://github.com/framework7io/framework7)的 fab.less:.fab-opened 主按钮图标旋转切换与 .fab-buttons 错峰延迟弹出;补写左侧文字胶囊与微预览背景。
18
+ 读 --color-surface / --color-text / --color-muted / --color-line / --color-primary / --color-warning / --color-success */
19
+ .c-app-fab{--fb-sp:linear(0,.07,.245,.475,.716,.931,1.1,1.212,1.267,1.272,1.239,1.184,1.118,1.054,.999,.958,.934,.925,.928,.94,.956,.975,.992,1.005,1.015,1.02,1.021,1.019,1.015,1.01,1.005,1.001,.997,.995,.994,.994,.995,.996,.998,.999,1);position:relative;width:256px;height:172px;border-radius:18px;overflow:hidden;background:var(--color-surface,#fff);box-shadow:0 0 0 .5px var(--color-line,rgba(0,0,0,.1)),0 2px 4px rgba(0,0,0,.05),0 14px 30px -14px rgba(0,0,0,.3);font-family:var(--font-sans,system-ui);-webkit-tap-highlight-color:transparent;color:var(--color-text,#141413)}
20
+ .c-app-fab .fb-bg{padding:12px 14px;display:grid;gap:10px}
21
+ .c-app-fab .fb-hdr{display:flex;align-items:center;justify-content:space-between}
22
+ .c-app-fab .fb-hdr b{font-size:13px;font-weight:700}
23
+ .c-app-fab .fb-pill{padding:2px 8px;border-radius:9px;font-size:10px;font-weight:600;color:var(--color-primary,#0a84ff);background:color-mix(in srgb,var(--color-primary,#0a84ff) 12%,transparent)}
24
+ .c-app-fab .fb-skel{display:grid;gap:8px}
25
+ .c-app-fab .fb-card{height:36px;border-radius:10px;padding:8px 10px;box-sizing:border-box;display:flex;align-items:center;gap:8px;background:color-mix(in srgb,var(--color-text,#141413) 4%,var(--color-surface,#fff));box-shadow:inset 0 0 0 .5px var(--color-line,rgba(0,0,0,.07))}
26
+ .c-app-fab .fb-card i{width:18px;height:18px;border-radius:6px;background:color-mix(in srgb,var(--color-text,#141413) 10%,transparent)}
27
+ .c-app-fab .fb-card span{height:7px;width:var(--w);border-radius:4px;background:color-mix(in srgb,var(--color-text,#141413) 12%,transparent)}
28
+ .c-app-fab .fb-mask{position:absolute;inset:0;background:color-mix(in srgb,var(--color-surface,#fff) 62%,rgba(0,0,0,.35));backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px);opacity:0;pointer-events:none;transition:opacity .22s;z-index:2}
29
+ .c-app-fab.is-open .fb-mask{opacity:1;pointer-events:auto}
30
+ .c-app-fab .fb-dial{position:absolute;right:14px;bottom:60px;z-index:3;display:flex;flex-direction:column;align-items:flex-end;gap:7px;pointer-events:none}
31
+ .c-app-fab.is-open .fb-dial{pointer-events:auto}
32
+ .c-app-fab .fb-item{display:inline-flex;align-items:center;gap:7px;border:0;padding:0;background:none;cursor:pointer;opacity:0;transform:translate3d(0,12px,0) scale(.6);transform-origin:right center;transition:transform .38s var(--fb-sp),opacity .18s}
33
+ .c-app-fab.is-open .fb-item{opacity:1;transform:none}
34
+ .c-app-fab.is-open .fb-item:nth-child(3){transition-delay:0ms}
35
+ .c-app-fab.is-open .fb-item:nth-child(2){transition-delay:45ms}
36
+ .c-app-fab.is-open .fb-item:nth-child(1){transition-delay:90ms}
37
+ .c-app-fab .fb-item:active .fb-ci{transform:scale(.86)}
38
+ .c-app-fab .fb-item:focus-visible,.c-app-fab .fb-main:focus-visible{outline:2px solid var(--color-primary,#0a84ff);outline-offset:2px}
39
+ .c-app-fab .fb-lb{padding:4px 9px;border-radius:9px;font-size:11px;font-weight:600;color:var(--color-text,#141413);background:var(--color-surface,#fff);box-shadow:0 0 0 .5px var(--color-line,rgba(0,0,0,.1)),0 4px 12px -4px rgba(0,0,0,.22)}
40
+ .c-app-fab .fb-ci{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;color:#fff;background:var(--k);box-shadow:0 4px 10px -2px color-mix(in srgb,var(--k) 55%,transparent);transition:transform .18s}
41
+ .c-app-fab .fb-ci svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
42
+ .c-app-fab .fb-main{position:absolute;right:12px;bottom:12px;z-index:4;width:40px;height:40px;border:0;border-radius:50%;display:grid;place-items:center;color:#fff;background:var(--color-primary,#0a84ff);box-shadow:0 6px 16px -4px color-mix(in srgb,var(--color-primary,#0a84ff) 60%,transparent);cursor:pointer;transition:transform .34s var(--fb-sp),background-color .22s}
43
+ .c-app-fab .fb-main:active{transform:scale(.88)}
44
+ .c-app-fab .fb-main svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:2.3;stroke-linecap:round;transition:transform .38s var(--fb-sp)}
45
+ .c-app-fab.is-open .fb-main svg{transform:rotate(45deg)}
46
+ @media (prefers-reduced-motion:reduce){.c-app-fab *{transition:none!important}}
47
+ </style>
48
+ </head>
49
+ <body>
50
+ <div class="stage-fit">
51
+ <div class="c-app-fab is-open" data-comp="app-fab">
52
+ <div class="fb-bg">
53
+ <div class="fb-hdr"><b>灵感收集箱</b><span class="fb-pill">快捷入口</span></div>
54
+ <div class="fb-skel">
55
+ <div class="fb-card"><i></i><span style="--w:64%"></span></div>
56
+ <div class="fb-card"><i></i><span style="--w:48%"></span></div>
57
+ <div class="fb-card"><i></i><span style="--w:56%"></span></div>
58
+ </div>
59
+ </div>
60
+ <div class="fb-mask"></div>
61
+ <div class="fb-dial">
62
+ <button class="fb-item" type="button" data-a="扫一扫"><span class="fb-lb">扫一扫</span><span class="fb-ci" style="--k:var(--color-success,#30b35a)"><svg viewBox="0 0 20 20"><path d="M4 7V5a1 1 0 0 1 1-1h2m6 0h2a1 1 0 0 1 1 1v2m0 6v2a1 1 0 0 1-1 1h-2m-6 0H5a1 1 0 0 1-1-1v-2M4 10h12"/></svg></span></button>
63
+ <button class="fb-item" type="button" data-a="拍一张"><span class="fb-lb">拍一张</span><span class="fb-ci" style="--k:var(--color-warning,#ffb340)"><svg viewBox="0 0 20 20"><path d="M3.5 7.5A1.5 1.5 0 0 1 5 6h1.8l1.2-1.8h4L13.2 6H15a1.5 1.5 0 0 1 1.5 1.5v7A1.5 1.5 0 0 1 15 16H5a1.5 1.5 0 0 1-1.5-1.5z"/><circle cx="10" cy="11" r="2.6"/></svg></span></button>
64
+ <button class="fb-item" type="button" data-a="写笔记"><span class="fb-lb">写笔记</span><span class="fb-ci" style="--k:var(--color-primary,#0a84ff)"><svg viewBox="0 0 20 20"><path d="M13.5 4.2l2.3 2.3-8.6 8.6H4.9v-2.3z"/></svg></span></button>
65
+ </div>
66
+ <button class="fb-main" type="button" aria-label="展开快捷动作" aria-expanded="true"><svg viewBox="0 0 20 20"><path d="M10 4v12M4 10h12"/></svg></button>
67
+ </div>
68
+ </div>
69
+ <script data-comp>
70
+ /* 悬浮按钮:点主按钮展开/收起错峰动作,点动作后更新状态胶囊并收起 */
71
+ (() => {
72
+ document.querySelectorAll('.c-app-fab').forEach((el) => {
73
+ const main = el.querySelector('.fb-main'), pill = el.querySelector('.fb-pill')
74
+ let open = el.classList.contains('is-open')
75
+ const setOpen = (v) => {
76
+ open = !!v
77
+ el.classList.toggle('is-open', open)
78
+ main.setAttribute('aria-expanded', open)
79
+ }
80
+ main.addEventListener('click', () => setOpen(!open))
81
+ el.querySelector('.fb-mask').addEventListener('click', () => setOpen(false))
82
+ el.querySelectorAll('.fb-item').forEach((b) => b.addEventListener('click', () => {
83
+ pill.textContent = '已选 ' + b.dataset.a
84
+ setOpen(false)
85
+ }))
86
+ el.fbSet = (v, txt) => { setOpen(v); if (txt) pill.textContent = txt }
87
+ })
88
+ })()
89
+ </script>
90
+ <script data-stage>
91
+ /* 演示舞台:每个组件都一样,只改 DEMO 那一段。组件按 340×212 设计,卡片小了整体等比缩小。 */
92
+ (() => {
93
+ const q = new URLSearchParams(location.search); const root = document.documentElement
94
+ root.dataset.theme = (q.get('theme') || (matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')) === 'dark' ? 'dark' : 'light'
95
+ const reduced = matchMedia('(prefers-reduced-motion: reduce)').matches
96
+ const el = document.querySelector('.stage-fit > [data-comp]')
97
+ // 桌面版里框常常先报 0 宽高、之后变大却不触发 resize:读到 0 不能记下来(会一直缩没),框变化和外层发消息时再算
98
+ const fit = () => { if (innerWidth > 0 && innerHeight > 0) root.style.setProperty('--fit', Math.min(1, innerWidth / 340, innerHeight / 212).toFixed(3)) }
99
+ fit(); addEventListener('resize', fit); addEventListener('load', fit); addEventListener('message', fit)
100
+ if (typeof ResizeObserver === 'function') new ResizeObserver(fit).observe(root)
101
+ let playing = !q.has('still'); let hovering = false; let timers = []
102
+ const later = (fn, ms) => timers.push(setTimeout(() => { if (playing && !hovering) fn() }, ms)) // 演示用的定时器:用户一来就全部作废
103
+ const stop = () => { timers.forEach(clearTimeout); timers = []; DEMO.stop() }
104
+ const go = (ms) => { stop(); if (playing && !hovering && !reduced) later(() => DEMO.loop(later), ms) }
105
+ // ===== 只改这一段 =====
106
+ const DEMO = {
107
+ settle () { el.fbSet(true, '快捷入口') },
108
+ loop (later) {
109
+ el.fbSet(false, '快捷入口')
110
+ later(() => el.fbSet(true), 650)
111
+ later(() => el.fbSet(false, '已选 写笔记'), 2400)
112
+ later(() => el.fbSet(true), 3400)
113
+ later(() => DEMO.loop(later), 4900)
114
+ },
115
+ stop () {},
116
+ }
117
+ // =====================
118
+ document.body.addEventListener('pointerenter', () => { hovering = true; stop() })
119
+ document.body.addEventListener('pointerleave', () => { hovering = false; go(1400) })
120
+ addEventListener('message', (e) => {
121
+ const d = e.data; if (!d || typeof d !== 'object') return
122
+ if (d.theme === 'light' || d.theme === 'dark') root.dataset.theme = d.theme
123
+ if (typeof d.ddpPlay === 'boolean') { playing = d.ddpPlay; root.classList.toggle('paused', !playing); if (playing) go(400); else stop() }
124
+ })
125
+ try { parent.postMessage({ ddpMotionReady: 1 }, '*') } catch (e) { /* 单独打开时没有外层 */ }
126
+ if (reduced || q.has('still')) DEMO.settle(); else go(600)
127
+ })()
128
+ </script>
129
+ </body>
130
+ </html>