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
@@ -0,0 +1,167 @@
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":"web-cmdk","zh":"命令面板","en":"Command Menu","cat":"web","desc":"顶部输入实时过滤命令,支持上下方向键与回车选中执行","desc_en":"Type to filter commands live; navigate with arrow keys and press Enter to run","needs":"js","play":"press","hint":"打字或方向键","hint_en":"Type or arrows","source":{"name":"cmdk","url":"https://github.com/dip/cmdk/blob/main/cmdk/src/index.tsx","license":"MIT","author":"2022 Paco Coursey"},"prompt":"快捷命令面板:宽 298px 高 168px 圆角 14px 的 --color-surface 浮窗,照 dip/cmdk 的搜索框、分组标题、data-selected 高亮行和键盘循环选择交互重写。顶部 36px 搜索框带放大镜图标和 ESC 键帽;中间显示匹配命令(支持中文与拼音首字母过滤、悬停同步选中、上下方向键与 Ctrl+N/P 循环切换、回车或点击执行);底部 24px 提示栏展示快捷键与执行反馈。读 --color-surface / --color-text / --color-muted / --color-line / --color-primary / --color-success。","prompt_en":"Command palette, 298x168, 14px-radius --color-surface panel adapted from dip/cmdk (search input, group heading, data-selected highlight, and looping keyboard navigation). Top 36px input filters 5 commands live by Chinese text or keywords; ArrowUp/Down and Ctrl+N/P loop active items, pointer move tracks focus, Enter or click runs the command and updates the 24px status footer. Reads --color-surface/text/muted/line/primary/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
+ /* 命令面板 改写自 cmdk(MIT,© 2022 Paco Coursey,https://github.com/dip/cmdk)的 cmdk/src/index.tsx:实时过滤、data-selected 选中态、方向键与 Ctrl+N/P 循环导航及回车执行;重写为无框架单文件并适配设计变量。
18
+ 读 --color-surface / --color-text / --color-muted / --color-line / --color-primary / --color-success */
19
+ .c-web-cmdk{box-sizing:border-box;width:298px;height:168px;border-radius:14px;overflow:hidden;display:flex;flex-direction:column;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-web-cmdk .ck-top{flex:none;height:36px;padding:0 10px 0 11px;display:flex;align-items:center;gap:7px;box-shadow:0 .5px 0 var(--color-line,rgba(0,0,0,.1))}
21
+ .c-web-cmdk .ck-top svg{flex:none;width:14px;height:14px;fill:none;stroke:var(--color-muted,#76756f);stroke-width:2;stroke-linecap:round}
22
+ .c-web-cmdk .ck-in{flex:1;min-width:0;border:0;background:none;padding:0;font:12.5px/1 var(--font-sans,system-ui);color:var(--color-text,#141413);outline:none}
23
+ .c-web-cmdk .ck-in::placeholder{color:var(--color-muted,#76756f)}
24
+ .c-web-cmdk kbd{flex:none;height:17px;padding:0 5px;border-radius:4px;display:inline-grid;place-items:center;font:600 9.5px/1 var(--font-sans,system-ui);color:var(--color-muted,#76756f);background:color-mix(in srgb,var(--color-text,#141413) 7%,transparent);box-shadow:inset 0 0 0 .5px var(--color-line,rgba(0,0,0,.1))}
25
+ .c-web-cmdk [hidden]{display:none!important}
26
+ .c-web-cmdk .ck-list>*{flex:none}
27
+ .c-web-cmdk .ck-list{position:relative;min-height:0;flex:1;padding:5px 6px;overflow:hidden;display:flex;flex-direction:column;gap:2px}
28
+ .c-web-cmdk .ck-grp{padding:2px 6px 1px;font-size:9.5px;font-weight:600;color:var(--color-muted,#76756f)}
29
+ .c-web-cmdk .ck-item{position:relative;height:26px;padding:0 8px 0 10px;border:0;border-radius:7px;background:none;display:flex;align-items:center;gap:7px;font:500 12px/1 var(--font-sans,system-ui);color:var(--color-text,#141413);cursor:pointer;text-align:left;transition:background-color .12s,color .12s}
30
+ .c-web-cmdk .ck-item svg{flex:none;width:13px;height:13px;fill:none;stroke:var(--color-muted,#76756f);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
31
+ .c-web-cmdk .ck-item span{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
32
+ .c-web-cmdk .ck-item[data-selected="true"]{background:color-mix(in srgb,var(--color-primary,#0a84ff) 13%,transparent);color:var(--color-primary,#0a84ff);font-weight:600}
33
+ .c-web-cmdk .ck-item[data-selected="true"] svg{stroke:var(--color-primary,#0a84ff)}
34
+ .c-web-cmdk .ck-item[data-selected="true"]::before{content:"";position:absolute;left:2px;top:6px;bottom:6px;width:2.5px;border-radius:2px;background:var(--color-primary,#0a84ff)}
35
+ .c-web-cmdk .ck-item:focus-visible{outline:2px solid var(--color-primary,#0a84ff);outline-offset:-2px}
36
+ .c-web-cmdk .ck-list>.ck-empty{flex:1;display:grid;place-items:center;font-size:11.5px;color:var(--color-muted,#76756f)}
37
+ .c-web-cmdk .ck-foot{flex:none;height:24px;padding:0 10px;display:flex;align-items:center;justify-content:space-between;font-size:10px;color:var(--color-muted,#76756f);background:color-mix(in srgb,var(--color-text,#141413) 3%,var(--color-surface,#fff));box-shadow:0 -.5px 0 var(--color-line,rgba(0,0,0,.1))}
38
+ .c-web-cmdk .ck-hints{display:flex;align-items:center;gap:6px}
39
+ .c-web-cmdk .ck-st.is-run{color:var(--color-success,#30b35a);font-weight:600}
40
+ @media (prefers-reduced-motion:reduce){.c-web-cmdk *{transition:none!important}}
41
+ </style>
42
+ </head>
43
+ <body>
44
+ <div class="stage-fit">
45
+ <div class="c-web-cmdk" data-comp="web-cmdk">
46
+ <div class="ck-top">
47
+ <svg viewBox="0 0 16 16" aria-hidden="true"><circle cx="7" cy="7" r="4.6"/><path d="M10.5 10.5L14 14"/></svg>
48
+ <input class="ck-in" type="text" placeholder="搜索命令或页面..." aria-label="搜索命令">
49
+ <kbd>ESC</kbd>
50
+ </div>
51
+ <div class="ck-list" role="listbox" aria-label="快捷命令">
52
+ <div class="ck-grp">常用操作</div>
53
+ <button class="ck-item" type="button" role="option" data-kw="xinjian huabu yemian xjhbym new page create" data-selected="true" aria-selected="true"><svg viewBox="0 0 16 16"><path d="M8 3.5v9M3.5 8h9"/></svg><span>新建画布页面</span><kbd>N</kbd></button>
54
+ <button class="ck-item" type="button" role="option" data-kw="qiehuan shense zhuti qhsszt dark theme mode" data-selected="false" aria-selected="false"><svg viewBox="0 0 16 16"><path d="M12.5 9.8A5 5 0 0 1 6.2 3.5a5 5 0 1 0 6.3 6.3z"/></svg><span>切换深色主题</span><kbd>T</kbd></button>
55
+ <button class="ck-item" type="button" role="option" data-kw="daochu shejigao dcsjg export png pdf html" data-selected="false" aria-selected="false"><svg viewBox="0 0 16 16"><path d="M8 3v7M5 7.5L8 10.5l3-3M3 13h10"/></svg><span>导出设计稿</span><kbd>E</kbd></button>
56
+ <button class="ck-item" type="button" role="option" data-kw="dakai zujian sucai dkzjsc library gallery" data-selected="false" aria-selected="false"><svg viewBox="0 0 16 16"><rect x="2.5" y="2.5" width="4.5" height="4.5" rx="1"/><rect x="9" y="2.5" width="4.5" height="4.5" rx="1"/><rect x="2.5" y="9" width="4.5" height="4.5" rx="1"/><rect x="9" y="9" width="4.5" height="4.5" rx="1"/></svg><span>打开组件素材</span><kbd>G</kbd></button>
57
+ <button class="ck-item" type="button" role="option" data-kw="tuandui chengyuan shezhi tdcysz team settings" data-selected="false" aria-selected="false"><svg viewBox="0 0 16 16"><circle cx="8" cy="5.5" r="2.2"/><path d="M3.5 13c.6-2.4 2.3-3.5 4.5-3.5s3.9 1.1 4.5 3.5"/></svg><span>团队成员设置</span><kbd>S</kbd></button>
58
+ <div class="ck-empty" hidden>未找到匹配命令</div>
59
+ </div>
60
+ <div class="ck-foot">
61
+ <span class="ck-hints"><span>↑↓ 选择</span><span>↵ 执行</span></span>
62
+ <span class="ck-st" aria-live="polite">共 5 条命令</span>
63
+ </div>
64
+ </div>
65
+ </div>
66
+ <script data-comp>
67
+ /* 命令面板:实时关键词过滤 + 上下键与 Ctrl+N/P 循环选 + 回车/点击执行 */
68
+ (() => {
69
+ document.querySelectorAll('.c-web-cmdk').forEach((el) => {
70
+ const input = el.querySelector('.ck-in')
71
+ const list = el.querySelector('.ck-list')
72
+ const st = el.querySelector('.ck-st')
73
+ const all = [...list.querySelectorAll('.ck-item')], grp = list.querySelector('.ck-grp'), empty = list.querySelector('.ck-empty')
74
+ const nameOf = (b) => b.querySelector('span').textContent
75
+ let items = all, idx = 0
76
+ const paintSel = () => all.forEach((b) => {
77
+ const on = b === items[idx]
78
+ b.dataset.selected = String(on); b.setAttribute('aria-selected', String(on))
79
+ })
80
+ const reveal = () => { // 一屏只放得下 3 条:键盘走到哪滚到哪(overflow:hidden,滚轮不会被卡住)
81
+ const b = items[idx]; if (!b) return
82
+ if (idx === 0) list.scrollTop = 0
83
+ else if (b.offsetTop < list.scrollTop) list.scrollTop = b.offsetTop - 2
84
+ else if (b.offsetTop + b.offsetHeight > list.scrollTop + list.clientHeight - 4) list.scrollTop = b.offsetTop + b.offsetHeight - list.clientHeight + 4
85
+ }
86
+ const move = (i) => { if (items.length) { idx = ((i % items.length) + items.length) % items.length; paintSel(); reveal() } }
87
+ const render = (q) => {
88
+ const s = (q || '').trim().toLowerCase()
89
+ all.forEach((b) => { b.hidden = !!s && !nameOf(b).toLowerCase().includes(s) && !(b.dataset.kw || '').includes(s) })
90
+ items = all.filter((b) => !b.hidden); idx = 0
91
+ grp.textContent = s ? '匹配结果' : '常用操作'; grp.hidden = !items.length; empty.hidden = !!items.length
92
+ paintSel(); list.scrollTop = 0
93
+ st.classList.remove('is-run'); st.textContent = !items.length ? '0 条匹配' : s ? `找到 ${items.length} 条` : `共 ${all.length} 条命令`
94
+ }
95
+ const run = (i) => {
96
+ if (!items[i]) return
97
+ idx = i; paintSel()
98
+ st.classList.add('is-run'); st.textContent = '已执行:' + nameOf(items[i])
99
+ }
100
+ input.addEventListener('input', () => render(input.value))
101
+ el.addEventListener('keydown', (e) => {
102
+ if (e.isComposing) return // 拼音还没上屏
103
+ if (e.key === 'ArrowDown' || (e.ctrlKey && e.key === 'n')) {
104
+ if (!items.length) return; e.preventDefault(); move(idx + 1)
105
+ } else if (e.key === 'ArrowUp' || (e.ctrlKey && e.key === 'p')) {
106
+ if (!items.length) return; e.preventDefault(); move(idx - 1)
107
+ } else if (e.key === 'Enter') {
108
+ if (!items.length) return; e.preventDefault(); run(idx)
109
+ } else if (e.key === 'Escape') {
110
+ e.preventDefault(); input.value = ''; render('')
111
+ }
112
+ })
113
+ list.addEventListener('pointermove', (e) => {
114
+ const b = e.target.closest('.ck-item'); if (!b) return
115
+ const i = items.indexOf(b); if (i >= 0 && i !== idx) { idx = i; paintSel() }
116
+ })
117
+ list.addEventListener('click', (e) => {
118
+ const b = e.target.closest('.ck-item'); if (b) run(items.indexOf(b))
119
+ })
120
+ el.ckQuery = (q) => { input.value = q; render(q) }
121
+ el.ckMove = move
122
+ el.ckRun = () => run(idx)
123
+ })
124
+ })()
125
+ </script>
126
+ <script data-stage>
127
+ /* 演示舞台:每个组件都一样,只改 DEMO 那一段。组件按 340×212 设计,卡片小了整体等比缩小。 */
128
+ (() => {
129
+ const q = new URLSearchParams(location.search); const root = document.documentElement
130
+ root.dataset.theme = (q.get('theme') || (matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')) === 'dark' ? 'dark' : 'light'
131
+ const reduced = matchMedia('(prefers-reduced-motion: reduce)').matches
132
+ const el = document.querySelector('.stage-fit > [data-comp]')
133
+ // 桌面版里框常常先报 0 宽高、之后变大却不触发 resize:读到 0 不能记下来(会一直缩没),框变化和外层发消息时再算
134
+ const fit = () => { if (innerWidth > 0 && innerHeight > 0) root.style.setProperty('--fit', Math.min(1, innerWidth / 340, innerHeight / 212).toFixed(3)) }
135
+ fit(); addEventListener('resize', fit); addEventListener('load', fit); addEventListener('message', fit)
136
+ if (typeof ResizeObserver === 'function') new ResizeObserver(fit).observe(root)
137
+ let playing = !q.has('still'); let hovering = false; let timers = []
138
+ const later = (fn, ms) => timers.push(setTimeout(() => { if (playing && !hovering) fn() }, ms)) // 演示用的定时器:用户一来就全部作废
139
+ const stop = () => { timers.forEach(clearTimeout); timers = []; DEMO.stop() }
140
+ const go = (ms) => { stop(); if (playing && !hovering && !reduced) later(() => DEMO.loop(later), ms) }
141
+ // ===== 只改这一段 =====
142
+ const DEMO = {
143
+ settle () { el.ckQuery('') },
144
+ loop (later) {
145
+ later(() => el.ckMove(1), 500)
146
+ later(() => el.ckQuery('导'), 1300)
147
+ later(() => el.ckQuery('导出'), 1750)
148
+ later(() => el.ckRun(), 2400)
149
+ later(() => el.ckQuery(''), 3900)
150
+ later(() => DEMO.loop(later), 4700)
151
+ },
152
+ stop () {},
153
+ }
154
+ // =====================
155
+ document.body.addEventListener('pointerenter', () => { hovering = true; stop() })
156
+ document.body.addEventListener('pointerleave', () => { hovering = false; go(1400) })
157
+ addEventListener('message', (e) => {
158
+ const d = e.data; if (!d || typeof d !== 'object') return
159
+ if (d.theme === 'light' || d.theme === 'dark') root.dataset.theme = d.theme
160
+ if (typeof d.ddpPlay === 'boolean') { playing = d.ddpPlay; root.classList.toggle('paused', !playing); if (playing) go(400); else stop() }
161
+ })
162
+ try { parent.postMessage({ ddpMotionReady: 1 }, '*') } catch (e) { /* 单独打开时没有外层 */ }
163
+ if (reduced || q.has('still')) DEMO.settle(); else go(600)
164
+ })()
165
+ </script>
166
+ </body>
167
+ </html>
@@ -0,0 +1,94 @@
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":"web-dropdown","zh":"下拉菜单","en":"Dropdown Menu","cat":"web","desc":"点触发按钮菜单从右上角弹开,危险项单独用红字分隔","desc_en":"Trigger button springs open a floating menu with icons and a separated danger item","needs":"css","play":"press","hint":"点按钮展开","hint_en":"Tap to toggle","source":{"name":"HyperUI","url":"https://github.com/markmead/hyperui/blob/main/public/examples/application/dropdown/1.html","license":"MIT","author":"Mark Mead"},"prompt":"网站下拉操作菜单:宽 196px 高 166px 定位容器,照 HyperUI dropdown/1.html 的分割触发按钮加浮层菜单、常规操作与底部红字删除项结构。触发按钮高 32px 圆角 9px,右侧箭头展开时旋转 180 度;下方浮层圆角 12px 含「复制链接」「重命名」「导出图片」及分隔线下的 --color-danger「删除项目」,展开时从右上角以弹簧缩放弹出(0.34s)。纯 CSS(checkbox),读 --color-surface / --color-text / --color-muted / --color-line / --color-primary / --color-danger。","prompt_en":"Web dropdown menu inside a 196x166 container, adapted from HyperUI application/dropdown/1.html with a split trigger button and floating menu panel. The 32px 9px-radius trigger rotates its chevron 180deg when open; the 12px-radius popover springs in from top-right (0.34s) with Copy Link, Rename, Export Image, a hairline divider, and a --color-danger Delete action. Pure CSS checkbox reading --color-surface/text/muted/line/primary/danger."}</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
+ /* 下拉菜单 改写自 HyperUI(MIT,© Mark Mead,https://github.com/markmead/hyperui)的 application/dropdown/1.html:分割按钮触发器、浮层菜单项与底部红字删除项结构;去 Tailwind,加弹簧弹出过渡。
18
+ 读 --color-surface / --color-text / --color-muted / --color-line / --color-primary / --color-danger */
19
+ .c-web-dropdown{--dd-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;display:block;width:196px;height:166px;cursor:pointer;font-family:var(--font-sans,system-ui);-webkit-tap-highlight-color:transparent;color:var(--color-text,#141413)}
20
+ .c-web-dropdown input{position:absolute;opacity:0;pointer-events:none}
21
+ .c-web-dropdown .dd-trig{position:absolute;right:0;top:0;height:32px;border-radius:9px;display:inline-flex;align-items:stretch;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);transition:transform .16s}
22
+ .c-web-dropdown .dd-trig:active{transform:scale(.95)}
23
+ .c-web-dropdown .dd-lbl{padding:0 11px;display:grid;place-items:center;font-size:12px;font-weight:600}
24
+ .c-web-dropdown .dd-ic{width:30px;display:grid;place-items:center;border-left:.5px solid var(--color-line,rgba(0,0,0,.1));color:var(--color-muted,#76756f)}
25
+ .c-web-dropdown .dd-ic svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;transition:transform .32s var(--dd-sp),stroke .2s}
26
+ .c-web-dropdown input:checked~.dd-trig .dd-ic svg{transform:rotate(180deg);stroke:var(--color-primary,#0a84ff)}
27
+ .c-web-dropdown input:focus-visible~.dd-trig{outline:2px solid var(--color-primary,#0a84ff);outline-offset:2px}
28
+ .c-web-dropdown .dd-menu{position:absolute;right:0;top:38px;width:196px;padding:4px;box-sizing:border-box;border-radius:12px;display:grid;gap:1px;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);transform-origin:88% 0;opacity:0;visibility:hidden;transform:translateY(-6px) scale(.92);transition:opacity .2s,transform .34s var(--dd-sp),visibility .2s}
29
+ .c-web-dropdown input:checked~.dd-menu{opacity:1;visibility:visible;transform:none}
30
+ .c-web-dropdown .dd-item{height:28px;padding:0 9px;border-radius:8px;display:flex;align-items:center;gap:8px;font-size:12px;font-weight:500;transition:background-color .14s}
31
+ .c-web-dropdown .dd-item svg{flex:none;width:14px;height:14px;fill:none;stroke:var(--color-muted,#76756f);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
32
+ .c-web-dropdown .dd-item:hover{background:color-mix(in srgb,var(--color-text,#141413) 6%,transparent)}
33
+ .c-web-dropdown .dd-item:active{background:color-mix(in srgb,var(--color-text,#141413) 10%,transparent)}
34
+ .c-web-dropdown .dd-sep{display:block;height:.5px;margin:2px 6px;background:var(--color-line,rgba(0,0,0,.1))}
35
+ .c-web-dropdown .dd-del{color:var(--color-danger,#ff375f)}
36
+ .c-web-dropdown .dd-del svg{stroke:currentColor}
37
+ .c-web-dropdown .dd-del:hover{background:color-mix(in srgb,var(--color-danger,#ff375f) 11%,transparent)}
38
+ @media (prefers-reduced-motion:reduce){.c-web-dropdown *{transition:none!important}}
39
+ </style>
40
+ </head>
41
+ <body>
42
+ <div class="stage-fit">
43
+ <label class="c-web-dropdown" data-comp="web-dropdown">
44
+ <input type="checkbox" checked aria-label="展开操作菜单">
45
+ <span class="dd-trig"><span class="dd-lbl">页面操作</span><span class="dd-ic"><svg viewBox="0 0 16 16"><path d="M4.5 6.5L8 10l3.5-3.5"/></svg></span></span>
46
+ <span class="dd-menu" role="menu">
47
+ <span class="dd-item" role="menuitem"><svg viewBox="0 0 16 16"><rect x="5.5" y="5.5" width="7.5" height="7.5" rx="1.5"/><path d="M10.5 5.5V4A1.5 1.5 0 0 0 9 2.5H4A1.5 1.5 0 0 0 2.5 4v5A1.5 1.5 0 0 0 4 10.5h1.5"/></svg>复制分享链接</span>
48
+ <span class="dd-item" role="menuitem"><svg viewBox="0 0 16 16"><path d="M11.2 2.8l2 2L6 12H4v-2l7.2-7.2z"/></svg>重命名页面</span>
49
+ <span class="dd-item" role="menuitem"><svg viewBox="0 0 16 16"><path d="M8 3v6.5M5.2 7L8 9.8 10.8 7M3 12.5h10"/></svg>导出为图片</span>
50
+ <i class="dd-sep"></i>
51
+ <span class="dd-item dd-del" role="menuitem"><svg viewBox="0 0 16 16"><path d="M3 4.5h10M6.2 4.5V3h3.6v1.5M4.8 4.5l.6 8.5h5.2l.6-8.5"/></svg>删除项目</span>
52
+ </span>
53
+ </label>
54
+ </div>
55
+ <script data-stage>
56
+ /* 演示舞台:每个组件都一样,只改 DEMO 那一段。组件按 340×212 设计,卡片小了整体等比缩小。 */
57
+ (() => {
58
+ const q = new URLSearchParams(location.search); const root = document.documentElement
59
+ root.dataset.theme = (q.get('theme') || (matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')) === 'dark' ? 'dark' : 'light'
60
+ const reduced = matchMedia('(prefers-reduced-motion: reduce)').matches
61
+ const el = document.querySelector('.stage-fit > [data-comp]')
62
+ // 桌面版里框常常先报 0 宽高、之后变大却不触发 resize:读到 0 不能记下来(会一直缩没),框变化和外层发消息时再算
63
+ const fit = () => { if (innerWidth > 0 && innerHeight > 0) root.style.setProperty('--fit', Math.min(1, innerWidth / 340, innerHeight / 212).toFixed(3)) }
64
+ fit(); addEventListener('resize', fit); addEventListener('load', fit); addEventListener('message', fit)
65
+ if (typeof ResizeObserver === 'function') new ResizeObserver(fit).observe(root)
66
+ let playing = !q.has('still'); let hovering = false; let timers = []
67
+ const later = (fn, ms) => timers.push(setTimeout(() => { if (playing && !hovering) fn() }, ms)) // 演示用的定时器:用户一来就全部作废
68
+ const stop = () => { timers.forEach(clearTimeout); timers = []; DEMO.stop() }
69
+ const go = (ms) => { stop(); if (playing && !hovering && !reduced) later(() => DEMO.loop(later), ms) }
70
+ // ===== 只改这一段 =====
71
+ const box = el.querySelector('input')
72
+ const DEMO = {
73
+ settle () { box.checked = true },
74
+ loop (later) {
75
+ later(() => { box.checked = false }, 750)
76
+ later(() => { box.checked = true }, 2200)
77
+ later(() => DEMO.loop(later), 4200)
78
+ },
79
+ stop () {},
80
+ }
81
+ // =====================
82
+ document.body.addEventListener('pointerenter', () => { hovering = true; stop() })
83
+ document.body.addEventListener('pointerleave', () => { hovering = false; go(1400) })
84
+ addEventListener('message', (e) => {
85
+ const d = e.data; if (!d || typeof d !== 'object') return
86
+ if (d.theme === 'light' || d.theme === 'dark') root.dataset.theme = d.theme
87
+ if (typeof d.ddpPlay === 'boolean') { playing = d.ddpPlay; root.classList.toggle('paused', !playing); if (playing) go(400); else stop() }
88
+ })
89
+ try { parent.postMessage({ ddpMotionReady: 1 }, '*') } catch (e) { /* 单独打开时没有外层 */ }
90
+ if (reduced || q.has('still')) DEMO.settle(); else go(600)
91
+ })()
92
+ </script>
93
+ </body>
94
+ </html>
@@ -0,0 +1,84 @@
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":"web-faq","zh":"问答折叠","en":"FAQ Accordion","cat":"web","desc":"点问题平滑展开回答,右侧箭头旋转 180 度,支持多条同时打开","desc_en":"Tap any question to smoothly unfold the answer while the chevron flips 180 degrees","needs":"css","play":"press","hint":"点问题展开","hint_en":"Tap to expand","source":{"name":"HyperUI","url":"https://github.com/markmead/hyperui/blob/main/public/examples/marketing/faqs/1.html","license":"MIT","author":"Mark Mead"},"prompt":"常见问题折叠列表:宽 296px 圆角 16px 的 --color-surface 卡片,内含 3 条问答,照 HyperUI faqs/1.html 的标题加右侧旋转箭头结构。每条用隐藏 checkbox 配 CSS grid-template-rows 从 0fr 到 1fr 平滑展开(0.3s cubic-bezier(.25,.9,.35,1)),展开时箭头旋转 180 度且标题切 --color-primary 高亮;3 条全展开总高仍不超过 170px。纯 CSS,读 --color-surface / --color-text / --color-muted / --color-line / --color-primary。","prompt_en":"FAQ accordion list in a 296px 16px-radius --color-surface card with 3 items adapted from HyperUI faqs/1.html (question header plus rotating chevron). Each item uses a hidden checkbox and CSS grid-template-rows (0fr to 1fr, 0.3s cubic-bezier(.25,.9,.35,1)) while rotating the chevron 180deg and tinting the title with --color-primary. Even all 3 open stay under 170px tall. Pure CSS reading --color-surface/text/muted/line/primary."}</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
+ /* 问答折叠 改写自 HyperUI(MIT,© Mark Mead,https://github.com/markmead/hyperui)的 marketing/faqs/1.html:问答标题与展开旋转 180 度箭头结构;去 Tailwind,改用纯 CSS grid-template-rows 实现顺滑展开动画。
18
+ 读 --color-surface / --color-text / --color-muted / --color-line / --color-primary */
19
+ .c-web-faq{box-sizing:border-box;width:296px;padding:3px 0;border-radius:16px;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-web-faq .fq-it{position:relative;display:block;cursor:pointer}
21
+ .c-web-faq .fq-it+.fq-it::before{content:"";position:absolute;left:12px;right:12px;top:0;border-top:.5px solid var(--color-line,rgba(0,0,0,.1))}
22
+ .c-web-faq input{position:absolute;opacity:0;pointer-events:none}
23
+ .c-web-faq .fq-q{height:31px;padding:0 12px;display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;font-weight:600;transition:color .2s,background-color .18s}
24
+ .c-web-faq .fq-q:hover{background:color-mix(in srgb,var(--color-text,#141413) 3%,transparent)}
25
+ .c-web-faq .fq-arr{flex:none;width:15px;height:15px;fill:none;stroke:var(--color-muted,#76756f);stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;transition:transform .32s cubic-bezier(.3,1.4,.5,1),stroke .2s}
26
+ .c-web-faq .fq-a{display:grid;grid-template-rows:0fr;transition:grid-template-rows .3s cubic-bezier(.25,.9,.35,1)}
27
+ .c-web-faq .fq-a>span{overflow:hidden;display:block;padding:0 12px;font-size:11px;line-height:15px;color:var(--color-muted,#76756f);opacity:0;transition:opacity .22s,padding-bottom .3s}
28
+ .c-web-faq input:checked~.fq-q{color:var(--color-primary,#0a84ff)}
29
+ .c-web-faq input:checked~.fq-q .fq-arr{transform:rotate(180deg);stroke:var(--color-primary,#0a84ff)}
30
+ .c-web-faq input:checked~.fq-a{grid-template-rows:1fr}
31
+ .c-web-faq input:checked~.fq-a>span{opacity:1;padding-bottom:7px}
32
+ .c-web-faq input:focus-visible~.fq-q{outline:2px solid var(--color-primary,#0a84ff);outline-offset:-2px}
33
+ @media (prefers-reduced-motion:reduce){.c-web-faq *{transition:none!important}}
34
+ </style>
35
+ </head>
36
+ <body>
37
+ <div class="stage-fit">
38
+ <div class="c-web-faq" data-comp="web-faq">
39
+ <label class="fq-it"><input type="checkbox" checked><span class="fq-q"><span>支持随时取消订阅吗?</span><svg class="fq-arr" viewBox="0 0 16 16" aria-hidden="true"><path d="M4 6l4 4 4-4"/></svg></span><span class="fq-a"><span>支持,取消后当前周期内仍可正常使用全部功能。</span></span></label>
40
+ <label class="fq-it"><input type="checkbox"><span class="fq-q"><span>导出的代码可以直接商用吗?</span><svg class="fq-arr" viewBox="0 0 16 16" aria-hidden="true"><path d="M4 6l4 4 4-4"/></svg></span><span class="fq-a"><span>所有组件均支持个人与商业站点直接集成使用。</span></span></label>
41
+ <label class="fq-it"><input type="checkbox"><span class="fq-q"><span>深色模式需要单独写样式吗?</span><svg class="fq-arr" viewBox="0 0 16 16" aria-hidden="true"><path d="M4 6l4 4 4-4"/></svg></span><span class="fq-a"><span>不需要,所有颜色统一读取设计变量自动切换。</span></span></label>
42
+ </div>
43
+ </div>
44
+ <script data-stage>
45
+ /* 演示舞台:每个组件都一样,只改 DEMO 那一段。组件按 340×212 设计,卡片小了整体等比缩小。 */
46
+ (() => {
47
+ const q = new URLSearchParams(location.search); const root = document.documentElement
48
+ root.dataset.theme = (q.get('theme') || (matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')) === 'dark' ? 'dark' : 'light'
49
+ const reduced = matchMedia('(prefers-reduced-motion: reduce)').matches
50
+ const el = document.querySelector('.stage-fit > [data-comp]')
51
+ // 桌面版里框常常先报 0 宽高、之后变大却不触发 resize:读到 0 不能记下来(会一直缩没),框变化和外层发消息时再算
52
+ const fit = () => { if (innerWidth > 0 && innerHeight > 0) root.style.setProperty('--fit', Math.min(1, innerWidth / 340, innerHeight / 212).toFixed(3)) }
53
+ fit(); addEventListener('resize', fit); addEventListener('load', fit); addEventListener('message', fit)
54
+ if (typeof ResizeObserver === 'function') new ResizeObserver(fit).observe(root)
55
+ let playing = !q.has('still'); let hovering = false; let timers = []
56
+ const later = (fn, ms) => timers.push(setTimeout(() => { if (playing && !hovering) fn() }, ms)) // 演示用的定时器:用户一来就全部作废
57
+ const stop = () => { timers.forEach(clearTimeout); timers = []; DEMO.stop() }
58
+ const go = (ms) => { stop(); if (playing && !hovering && !reduced) later(() => DEMO.loop(later), ms) }
59
+ // ===== 只改这一段 =====
60
+ const boxes = el.querySelectorAll('input')
61
+ const DEMO = {
62
+ settle () { boxes[0].checked = true; boxes[1].checked = false; boxes[2].checked = false },
63
+ loop (later) {
64
+ later(() => { boxes[0].checked = false; boxes[1].checked = true }, 800)
65
+ later(() => { boxes[1].checked = false; boxes[2].checked = true }, 2300)
66
+ later(() => DEMO.settle(), 3800)
67
+ later(() => DEMO.loop(later), 4600)
68
+ },
69
+ stop () {},
70
+ }
71
+ // =====================
72
+ document.body.addEventListener('pointerenter', () => { hovering = true; stop() })
73
+ document.body.addEventListener('pointerleave', () => { hovering = false; go(1400) })
74
+ addEventListener('message', (e) => {
75
+ const d = e.data; if (!d || typeof d !== 'object') return
76
+ if (d.theme === 'light' || d.theme === 'dark') root.dataset.theme = d.theme
77
+ if (typeof d.ddpPlay === 'boolean') { playing = d.ddpPlay; root.classList.toggle('paused', !playing); if (playing) go(400); else stop() }
78
+ })
79
+ try { parent.postMessage({ ddpMotionReady: 1 }, '*') } catch (e) { /* 单独打开时没有外层 */ }
80
+ if (reduced || q.has('still')) DEMO.settle(); else go(600)
81
+ })()
82
+ </script>
83
+ </body>
84
+ </html>
@@ -0,0 +1,109 @@
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":"web-footer","zh":"网页页脚","en":"Website Footer","cat":"web","desc":"多栏品牌与导航链接配底部状态和语言切换胶囊","desc_en":"Multi-column brand and link footer with status dot and language switch pill","needs":"css","play":"press","hint":"切换语言胶囊","hint_en":"Toggle language","source":{"name":"daisyUI","url":"https://github.com/saadeghi/daisyui/blob/master/packages/daisyui/src/components/footer.css","license":"MIT","author":"2020 Pouya Saadeghi"},"prompt":"网站紧凑多栏页脚:宽 298px 圆角 16px 的 --color-surface 卡片,照 daisyUI footer.css 的多列网格与弱化分栏标题(footer-title)排布。左侧为「云杉工坊」标志、一句话简介与三枚内联抽象社区图标;右侧「产品」「支持」两列链接,悬停切 --color-primary 高亮;底栏由 0.5px --color-line 分隔,左版权与绿色在线状态点,右纯 CSS checkbox 胶囊在「中文 / EN」间弹簧滑动切换。读 --color-surface / --color-text / --color-muted / --color-line / --color-primary / --color-success。","prompt_en":"Compact web footer, 298px, 16px-radius --color-surface card adapted from daisyUI footer.css multi-column grid and muted section headings. Left holds a fictional brand mark, tagline and three SVG icons; right holds Product and Support columns with --color-primary hover. Bottom .5px --color-line bar pairs copyright, a --color-success dot and a pure-CSS spring language switch pill. Reads --color-surface/text/muted/line/primary/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
+ /* 网页页脚 改写自 daisyUI(MIT,© 2020 Pouya Saadeghi,https://github.com/saadeghi/daisyui)的 packages/daisyui/src/components/footer.css:多栏网格与弱化分栏标题层次;去 Tailwind,缩成紧凑卡片并加语言切换胶囊。
18
+ 读 --color-surface / --color-text / --color-muted / --color-line / --color-primary / --color-success */
19
+ .c-web-footer{--ft-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);box-sizing:border-box;width:298px;padding:13px 14px 10px;border-radius:16px;display:grid;gap:10px;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-web-footer .ft-cols{display:grid;grid-template-columns:1.35fr 1fr 1fr;gap:10px;align-items:start}
21
+ .c-web-footer .ft-brand{display:grid;gap:6px}
22
+ .c-web-footer .ft-logo{display:flex;align-items:center;gap:5px;font-size:12.5px;font-weight:700}
23
+ .c-web-footer .ft-mark{width:18px;height:18px;border-radius:5px;display:grid;place-items:center;background:var(--color-primary,#0a84ff);color:#fff}
24
+ .c-web-footer .ft-mark svg{width:11px;height:11px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
25
+ .c-web-footer .ft-bio{margin:0;font-size:10px;line-height:1.45;color:var(--color-muted,#76756f)}
26
+ .c-web-footer .ft-soc{display:flex;gap:5px;margin-top:2px}
27
+ .c-web-footer .ft-soc span{width:21px;height:21px;border-radius:6px;display:grid;place-items:center;color:var(--color-muted,#76756f);background:color-mix(in srgb,var(--color-text,#141413) 6%,transparent);cursor:pointer;transition:color .18s,background-color .18s,transform .16s}
28
+ .c-web-footer .ft-soc span:hover{color:var(--color-primary,#0a84ff);background:color-mix(in srgb,var(--color-primary,#0a84ff) 12%,transparent)}
29
+ .c-web-footer .ft-soc span:active{transform:scale(.9)}
30
+ .c-web-footer .ft-soc svg{width:11px;height:11px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
31
+ .c-web-footer .ft-col{display:grid;gap:4px}
32
+ .c-web-footer .ft-title{font-size:10px;font-weight:700;letter-spacing:.04em;color:var(--color-muted,#76756f);margin-bottom:2px}
33
+ .c-web-footer .ft-link{font-size:11px;line-height:16px;color:var(--color-text,#141413);cursor:pointer;transition:color .16s,transform .16s}
34
+ .c-web-footer .ft-link:hover{color:var(--color-primary,#0a84ff);transform:translateX(2px)}
35
+ .c-web-footer .ft-bot{padding-top:8px;border-top:.5px solid var(--color-line,rgba(0,0,0,.1));display:flex;align-items:center;justify-content:space-between;gap:6px}
36
+ .c-web-footer .ft-copy{display:flex;align-items:center;gap:5px;font-size:10px;color:var(--color-muted,#76756f)}
37
+ .c-web-footer .ft-dot{width:6px;height:6px;border-radius:50%;background:var(--color-success,#30b35a)}
38
+ .c-web-footer .ft-lang{position:relative;box-sizing:border-box;display:inline-grid;grid-template-columns:34px 30px;align-items:center;height:22px;padding:2px;border-radius:11px;background:color-mix(in srgb,var(--color-text,#141413) 7%,transparent);box-shadow:inset 0 0 0 .5px var(--color-line,rgba(0,0,0,.1));cursor:pointer;font-size:10px;font-weight:600}
39
+ .c-web-footer input{position:absolute;opacity:0;pointer-events:none}
40
+ .c-web-footer .ft-thumb{position:absolute;left:2px;top:2px;width:34px;height:18px;border-radius:9px;background:var(--color-surface,#fff);box-shadow:0 1px 2px rgba(0,0,0,.14);transition:transform .42s var(--ft-sp),width .28s}
41
+ .c-web-footer .ft-lang span{position:relative;z-index:1;text-align:center;color:var(--color-muted,#76756f);transition:color .2s}
42
+ .c-web-footer input:not(:checked)~.ft-zh,.c-web-footer input:checked~.ft-en{color:var(--color-text,#141413)}
43
+ .c-web-footer input:checked~.ft-thumb{width:30px;transform:translateX(34px)}
44
+ .c-web-footer input:focus-visible~.ft-thumb{outline:2px solid var(--color-primary,#0a84ff);outline-offset:1px}
45
+ @media (prefers-reduced-motion:reduce){.c-web-footer *{transition:none!important}}
46
+ </style>
47
+ </head>
48
+ <body>
49
+ <div class="stage-fit">
50
+ <footer class="c-web-footer" data-comp="web-footer">
51
+ <div class="ft-cols">
52
+ <div class="ft-brand">
53
+ <div class="ft-logo"><i class="ft-mark"><svg viewBox="0 0 16 16"><path d="M8 2.5L3 13h10L8 2.5z"/></svg></i>云杉工坊</div>
54
+ <p class="ft-bio">轻巧顺手的网页模块与配色工具</p>
55
+ <div class="ft-soc" aria-hidden="true">
56
+ <span><svg viewBox="0 0 16 16"><circle cx="8" cy="8" r="5.5"/><path d="M2.5 8h11M8 2.5c1.8 1.6 1.8 9.4 0 11M8 2.5c-1.8 1.6-1.8 9.4 0 11"/></svg></span>
57
+ <span><svg viewBox="0 0 16 16"><path d="M3 4.5h10v7H6.5L3 13.5v-9z"/></svg></span>
58
+ <span><svg viewBox="0 0 16 16"><rect x="2.5" y="4" width="11" height="8" rx="1.5"/><path d="M3 4.5L8 8.5l5-4"/></svg></span>
59
+ </div>
60
+ </div>
61
+ <div class="ft-col"><div class="ft-title">产品</div><span class="ft-link">设计模板</span><span class="ft-link">组件合集</span><span class="ft-link">更新日志</span></div>
62
+ <div class="ft-col"><div class="ft-title">支持</div><span class="ft-link">帮助中心</span><span class="ft-link">服务条款</span><span class="ft-link">联系我们</span></div>
63
+ </div>
64
+ <div class="ft-bot">
65
+ <span class="ft-copy"><i class="ft-dot"></i>© 2026 云杉工坊</span>
66
+ <label class="ft-lang"><input type="checkbox" aria-label="切换语言"><i class="ft-thumb"></i><span class="ft-zh">中文</span><span class="ft-en">EN</span></label>
67
+ </div>
68
+ </footer>
69
+ </div>
70
+ <script data-stage>
71
+ /* 演示舞台:每个组件都一样,只改 DEMO 那一段。组件按 340×212 设计,卡片小了整体等比缩小。 */
72
+ (() => {
73
+ const q = new URLSearchParams(location.search); const root = document.documentElement
74
+ root.dataset.theme = (q.get('theme') || (matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')) === 'dark' ? 'dark' : 'light'
75
+ const reduced = matchMedia('(prefers-reduced-motion: reduce)').matches
76
+ const el = document.querySelector('.stage-fit > [data-comp]')
77
+ // 桌面版里框常常先报 0 宽高、之后变大却不触发 resize:读到 0 不能记下来(会一直缩没),框变化和外层发消息时再算
78
+ const fit = () => { if (innerWidth > 0 && innerHeight > 0) root.style.setProperty('--fit', Math.min(1, innerWidth / 340, innerHeight / 212).toFixed(3)) }
79
+ fit(); addEventListener('resize', fit); addEventListener('load', fit); addEventListener('message', fit)
80
+ if (typeof ResizeObserver === 'function') new ResizeObserver(fit).observe(root)
81
+ let playing = !q.has('still'); let hovering = false; let timers = []
82
+ const later = (fn, ms) => timers.push(setTimeout(() => { if (playing && !hovering) fn() }, ms)) // 演示用的定时器:用户一来就全部作废
83
+ const stop = () => { timers.forEach(clearTimeout); timers = []; DEMO.stop() }
84
+ const go = (ms) => { stop(); if (playing && !hovering && !reduced) later(() => DEMO.loop(later), ms) }
85
+ // ===== 只改这一段 =====
86
+ const box = el.querySelector('input')
87
+ const DEMO = {
88
+ settle () { box.checked = false },
89
+ loop (later) {
90
+ later(() => { box.checked = true }, 900)
91
+ later(() => { box.checked = false }, 2600)
92
+ later(() => DEMO.loop(later), 4200)
93
+ },
94
+ stop () {},
95
+ }
96
+ // =====================
97
+ document.body.addEventListener('pointerenter', () => { hovering = true; stop() })
98
+ document.body.addEventListener('pointerleave', () => { hovering = false; go(1400) })
99
+ addEventListener('message', (e) => {
100
+ const d = e.data; if (!d || typeof d !== 'object') return
101
+ if (d.theme === 'light' || d.theme === 'dark') root.dataset.theme = d.theme
102
+ if (typeof d.ddpPlay === 'boolean') { playing = d.ddpPlay; root.classList.toggle('paused', !playing); if (playing) go(400); else stop() }
103
+ })
104
+ try { parent.postMessage({ ddpMotionReady: 1 }, '*') } catch (e) { /* 单独打开时没有外层 */ }
105
+ if (reduced || q.has('still')) DEMO.settle(); else go(600)
106
+ })()
107
+ </script>
108
+ </body>
109
+ </html>
@@ -0,0 +1,98 @@
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":"web-hero","zh":"首屏横幅","en":"Hero Banner","cat":"web","desc":"居中大标题配主色强调词与双按钮,点主按钮弹回并切换已开启态","desc_en":"Centered hero headline with a highlighted keyword and two buttons; the main button morphs on tap","needs":"css","play":"press","hint":"点主按钮","hint_en":"Tap primary CTA","source":{"name":"HyperUI","url":"https://github.com/markmead/hyperui/blob/main/public/examples/marketing/banners/1.html","license":"MIT","author":"Mark Mead"},"prompt":"网站首屏居中横幅:宽 298px 高 166px 圆角 16px 的 --color-surface 卡片,顶部铺一层柔和的 --color-primary 径向微光。结构照 HyperUI banners/1.html 居中排布:小号版本胶囊、两行大标题(关键词用 --color-primary 高亮)、一行简短副标题、底部「立即体验」实心主按钮与「查看演示」描边次按钮。点主按钮时压扁回弹并切为 --color-success「已开启体验」,同时顶部微光切柔和绿光。纯 CSS(checkbox)。","prompt_en":"Centered web hero banner, 298x166, 16px-radius --color-surface card with a soft radial --color-primary top glow. Adapts HyperUI banners/1.html: compact release pill, bold two-line headline with a --color-primary accent word, concise subtitle, filled primary CTA and outlined secondary button. Tapping the primary CTA squishes and springs into a --color-success confirmed state while shifting the ambient glow. Pure CSS checkbox."}</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
+ /* 首屏横幅 改写自 HyperUI(MIT,© Mark Mead,https://github.com/markmead/hyperui)的 marketing/banners/1.html:居中大标题、强调词与双行动按钮层次;去 Tailwind,加微光背景与点击反馈态。
18
+ 读 --color-surface / --color-text / --color-muted / --color-line / --color-primary / --color-success */
19
+ .c-web-hero{--hr-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;box-sizing:border-box;width:298px;height:166px;padding:15px 18px 14px;border-radius:16px;overflow:hidden;display:grid;justify-items:center;align-content:center;gap:7px;text-align:center;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-web-hero::before{content:"";position:absolute;inset:-24px -16px auto;height:110px;background:radial-gradient(ellipse at 50% 0,color-mix(in srgb,var(--color-primary,#0a84ff) 24%,transparent),transparent 72%);pointer-events:none;transition:opacity .35s}
21
+ .c-web-hero::after{content:"";position:absolute;inset:-24px -16px auto;height:110px;background:radial-gradient(ellipse at 50% 0,color-mix(in srgb,var(--color-success,#30b35a) 26%,transparent),transparent 72%);opacity:0;pointer-events:none;transition:opacity .35s}
22
+ .c-web-hero:has(input:checked)::before{opacity:0}
23
+ .c-web-hero:has(input:checked)::after{opacity:1}
24
+ .c-web-hero .hr-cta{position:relative}
25
+ .c-web-hero input{position:absolute;opacity:0;pointer-events:none}
26
+ .c-web-hero .hr-badge{position:relative;display:inline-flex;align-items:center;gap:5px;height:20px;padding:0 9px;border-radius:10px;font-size:10px;font-weight:600;color:var(--color-primary,#0a84ff);background:color-mix(in srgb,var(--color-primary,#0a84ff) 12%,transparent);box-shadow:inset 0 0 0 .5px color-mix(in srgb,var(--color-primary,#0a84ff) 24%,transparent);transition:color .28s,background-color .28s}
27
+ .c-web-hero .hr-dot{width:5px;height:5px;border-radius:50%;background:currentColor}
28
+ .c-web-hero h2{position:relative;margin:0;font-size:18px;line-height:1.25;font-weight:800;letter-spacing:-.02em}
29
+ .c-web-hero h2 strong{color:var(--color-primary,#0a84ff);font-weight:800}
30
+ .c-web-hero p{position:relative;margin:0;font-size:11px;line-height:1.45;color:var(--color-muted,#76756f);max-width:240px}
31
+ .c-web-hero .hr-acts{position:relative;display:flex;align-items:center;gap:8px;margin-top:3px}
32
+ .c-web-hero .hr-cta,.c-web-hero .hr-sec{height:29px;padding:0 13px;border-radius:9px;display:inline-flex;align-items:center;justify-content:center;gap:4px;font-size:11.5px;font-weight:600;cursor:pointer;transition:transform .42s var(--hr-sp),background-color .26s,box-shadow .26s}
33
+ .c-web-hero .hr-cta{min-width:96px;color:#fff;background:var(--color-primary,#0a84ff);box-shadow:0 6px 14px -6px color-mix(in srgb,var(--color-primary,#0a84ff) 70%,transparent)}
34
+ .c-web-hero .hr-cta:active,.c-web-hero.is-press .hr-cta{transform:scale(.92);transition:transform .1s}
35
+ .c-web-hero .hr-cta .hr-s2{display:none}
36
+ .c-web-hero:has(input:checked) .hr-acts .hr-cta{background:var(--color-success,#30b35a);box-shadow:0 6px 14px -6px color-mix(in srgb,var(--color-success,#30b35a) 70%,transparent)}
37
+ .c-web-hero:has(input:checked) .hr-acts .hr-cta .hr-s1{display:none}
38
+ .c-web-hero:has(input:checked) .hr-acts .hr-cta .hr-s2{display:inline-flex;align-items:center;gap:4px}
39
+ .c-web-hero:has(input:checked) .hr-badge{color:var(--color-success,#30b35a);background:color-mix(in srgb,var(--color-success,#30b35a) 13%,transparent);box-shadow:inset 0 0 0 .5px color-mix(in srgb,var(--color-success,#30b35a) 28%,transparent)}
40
+ .c-web-hero:has(input:focus-visible) .hr-acts .hr-cta{outline:2px solid var(--color-primary,#0a84ff);outline-offset:2px}
41
+ .c-web-hero .hr-sec{color:var(--color-text,#141413);background:color-mix(in srgb,var(--color-text,#141413) 5%,transparent);box-shadow:inset 0 0 0 .5px var(--color-line,rgba(0,0,0,.14))}
42
+ .c-web-hero .hr-sec:active{transform:scale(.95)}
43
+ @media (prefers-reduced-motion:reduce){.c-web-hero::before,.c-web-hero::after,.c-web-hero *{transition:none!important}}
44
+ </style>
45
+ </head>
46
+ <body>
47
+ <div class="stage-fit">
48
+ <div class="c-web-hero" data-comp="web-hero">
49
+ <span class="hr-badge"><i class="hr-dot"></i>新版 2.4 已发布</span>
50
+ <h2>让每一次页面搭建<br><strong>更快</strong>落地上线</h2>
51
+ <p>零配置网页区块库,深浅配色开箱即用</p>
52
+ <span class="hr-acts">
53
+ <label class="hr-cta"><input type="checkbox" aria-label="立即体验"><span class="hr-s1">立即体验 →</span><span class="hr-s2">✓ 已开启体验</span></label>
54
+ <span class="hr-sec">查看演示</span>
55
+ </span>
56
+ </div>
57
+ </div>
58
+ <script data-stage>
59
+ /* 演示舞台:每个组件都一样,只改 DEMO 那一段。组件按 340×212 设计,卡片小了整体等比缩小。 */
60
+ (() => {
61
+ const q = new URLSearchParams(location.search); const root = document.documentElement
62
+ root.dataset.theme = (q.get('theme') || (matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')) === 'dark' ? 'dark' : 'light'
63
+ const reduced = matchMedia('(prefers-reduced-motion: reduce)').matches
64
+ const el = document.querySelector('.stage-fit > [data-comp]')
65
+ // 桌面版里框常常先报 0 宽高、之后变大却不触发 resize:读到 0 不能记下来(会一直缩没),框变化和外层发消息时再算
66
+ const fit = () => { if (innerWidth > 0 && innerHeight > 0) root.style.setProperty('--fit', Math.min(1, innerWidth / 340, innerHeight / 212).toFixed(3)) }
67
+ fit(); addEventListener('resize', fit); addEventListener('load', fit); addEventListener('message', fit)
68
+ if (typeof ResizeObserver === 'function') new ResizeObserver(fit).observe(root)
69
+ let playing = !q.has('still'); let hovering = false; let timers = []
70
+ const later = (fn, ms) => timers.push(setTimeout(() => { if (playing && !hovering) fn() }, ms)) // 演示用的定时器:用户一来就全部作废
71
+ const stop = () => { timers.forEach(clearTimeout); timers = []; DEMO.stop() }
72
+ const go = (ms) => { stop(); if (playing && !hovering && !reduced) later(() => DEMO.loop(later), ms) }
73
+ // ===== 只改这一段 =====
74
+ const box = el.querySelector('input')
75
+ const tap = (later) => { el.classList.add('is-press'); later(() => { el.classList.remove('is-press'); box.checked = !box.checked }, 140) }
76
+ const DEMO = {
77
+ settle () { box.checked = false; el.classList.remove('is-press') },
78
+ loop (later) {
79
+ later(() => tap(later), 900)
80
+ later(() => tap(later), 2900)
81
+ later(() => DEMO.loop(later), 4400)
82
+ },
83
+ stop () { el.classList.remove('is-press') },
84
+ }
85
+ // =====================
86
+ document.body.addEventListener('pointerenter', () => { hovering = true; stop() })
87
+ document.body.addEventListener('pointerleave', () => { hovering = false; go(1400) })
88
+ addEventListener('message', (e) => {
89
+ const d = e.data; if (!d || typeof d !== 'object') return
90
+ if (d.theme === 'light' || d.theme === 'dark') root.dataset.theme = d.theme
91
+ if (typeof d.ddpPlay === 'boolean') { playing = d.ddpPlay; root.classList.toggle('paused', !playing); if (playing) go(400); else stop() }
92
+ })
93
+ try { parent.postMessage({ ddpMotionReady: 1 }, '*') } catch (e) { /* 单独打开时没有外层 */ }
94
+ if (reduced || q.has('still')) DEMO.settle(); else go(600)
95
+ })()
96
+ </script>
97
+ </body>
98
+ </html>