dsh-design-studio 1.5.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +6 -5
- package/README.md +7 -6
- package/THIRD_PARTY_NOTICES.md +108 -0
- package/assets/art/README.md +102 -0
- package/assets/art/brand-mark.webp +0 -0
- package/assets/art/check-clean.webp +0 -0
- package/assets/art/coach-markup.webp +0 -0
- package/assets/art/drop-file.webp +0 -0
- package/assets/art/empty-components.webp +0 -0
- package/assets/art/empty-data.webp +0 -0
- package/assets/art/empty-error.webp +0 -0
- package/assets/art/empty-frames.webp +0 -0
- package/assets/art/empty-history.webp +0 -0
- package/assets/art/empty-market.webp +0 -0
- package/assets/art/empty-notes.webp +0 -0
- package/assets/art/empty-search.webp +0 -0
- package/assets/art/empty-tokens.webp +0 -0
- package/assets/art/empty-works.webp +0 -0
- package/assets/art/guide-icon.webp +0 -0
- package/assets/art/kind-app.webp +0 -0
- package/assets/art/kind-desktop.webp +0 -0
- package/assets/art/kind-diagram.webp +0 -0
- package/assets/art/kind-dshplugin.webp +0 -0
- package/assets/art/kind-email.webp +0 -0
- package/assets/art/kind-embedded.webp +0 -0
- package/assets/art/kind-framed.webp +0 -0
- package/assets/art/kind-miniprogram.webp +0 -0
- package/assets/art/kind-poster.webp +0 -0
- package/assets/art/kind-slides.webp +0 -0
- package/assets/art/kind-tablet.webp +0 -0
- package/assets/art/kind-web.webp +0 -0
- package/assets/art/placeholder-inspire-img.webp +0 -0
- package/assets/art/wait-creating.webp +0 -0
- package/assets/motion/ai-capsule.html +124 -0
- package/assets/motion/ai-glow-input.html +112 -0
- package/assets/motion/balance-odometer.html +112 -0
- package/assets/motion/bottom-sheet.html +149 -0
- package/assets/motion/brightness-pill.html +114 -0
- package/assets/motion/comet-ring.html +95 -0
- package/assets/motion/copy-morph.html +116 -0
- package/assets/motion/cube-grid.html +103 -0
- package/assets/motion/day-night.html +120 -0
- package/assets/motion/dial-knob.html +130 -0
- package/assets/motion/dock-magnify.html +118 -0
- package/assets/motion/download-ring.html +135 -0
- package/assets/motion/expand-card.html +137 -0
- package/assets/motion/flip-card.html +100 -0
- package/assets/motion/hold-pay.html +137 -0
- package/assets/motion/holo-card.html +130 -0
- package/assets/motion/keycap.html +92 -0
- package/assets/motion/like-jelly.html +88 -0
- package/assets/motion/liquid-progress.html +113 -0
- package/assets/motion/liquid-segment.html +127 -0
- package/assets/motion/live-capsule.html +144 -0
- package/assets/motion/marker-highlight.html +94 -0
- package/assets/motion/marquee-logos.html +110 -0
- package/assets/motion/otp-code.html +111 -0
- package/assets/motion/password-eye.html +136 -0
- package/assets/motion/ruler-slider.html +140 -0
- package/assets/motion/search-expand.html +81 -0
- package/assets/motion/send-fly.html +121 -0
- package/assets/motion/skeleton-shine.html +124 -0
- package/assets/motion/star-rate.html +98 -0
- package/assets/motion/success-check.html +114 -0
- package/assets/motion/suggest-chips.html +134 -0
- package/assets/motion/swipe-row.html +126 -0
- package/assets/motion/tabbar-bounce.html +92 -0
- package/assets/motion/tactile-controls.html +89 -0
- package/assets/motion/text-scramble.html +173 -0
- package/assets/motion/toast-stack.html +115 -0
- package/assets/motion/token-stream.html +106 -0
- package/assets/motion/voice-orb.html +144 -0
- package/assets/showcase/alley-noodles-1.webp +0 -0
- package/assets/showcase/alley-noodles-2.webp +0 -0
- package/assets/showcase/alley-noodles-3.webp +0 -0
- package/assets/showcase/autumn-sale-1.webp +0 -0
- package/assets/showcase/bold-folio-1.webp +0 -0
- package/assets/showcase/bold-folio-2.webp +0 -0
- package/assets/showcase/book-club-1.webp +0 -0
- package/assets/showcase/book-club-2.webp +0 -0
- package/assets/showcase/book-club-3.webp +0 -0
- package/assets/showcase/flower-order-1.webp +0 -0
- package/assets/showcase/little-painter-1.webp +0 -0
- package/assets/showcase/little-painter-2.webp +0 -0
- package/assets/showcase/moon-fair-1.webp +0 -0
- package/assets/showcase/nail-booking-1.webp +0 -0
- package/assets/showcase/nail-booking-2.webp +0 -0
- package/assets/showcase/nail-booking-3.webp +0 -0
- package/assets/showcase/night-run-1.webp +0 -0
- package/assets/showcase/paw-diary-1.webp +0 -0
- package/assets/showcase/paw-diary-2.webp +0 -0
- package/assets/showcase/paw-diary-3.webp +0 -0
- package/assets/showcase/pixel-planet-1.webp +0 -0
- package/assets/showcase/pixel-planet-2.webp +0 -0
- package/assets/showcase/pixel-planet-3.webp +0 -0
- package/assets/showcase/pocket-ledger-1.webp +0 -0
- package/assets/showcase/pocket-ledger-2.webp +0 -0
- package/assets/showcase/shiftloom-1.webp +0 -0
- package/assets/showcase/shiftloom-2.webp +0 -0
- package/assets/showcase/slow-breath-1.webp +0 -0
- package/assets/showcase/slow-breath-2.webp +0 -0
- package/assets/showcase/slow-breath-3.webp +0 -0
- package/assets/showcase/slow-trip-1.webp +0 -0
- package/assets/showcase/slow-trip-2.webp +0 -0
- package/assets/showcase/slow-trip-3.webp +0 -0
- package/assets/showcase/slow-weekly-1.webp +0 -0
- package/assets/showcase/stay-confirm-1.webp +0 -0
- package/assets/showcase/stove-recipes-1.webp +0 -0
- package/assets/showcase/stove-recipes-2.webp +0 -0
- package/assets/showcase/strobewatch-1.webp +0 -0
- package/assets/showcase/strobewatch-2.webp +0 -0
- package/assets/showcase/tapeworks-1.webp +0 -0
- package/assets/showcase/tapeworks-2.webp +0 -0
- package/assets/showcase/tea-brand-pitch-1.webp +0 -0
- package/assets/showcase/tea-brand-pitch-2.webp +0 -0
- package/assets/showcase/tea-brand-pitch-3.webp +0 -0
- package/assets/showcase/time-bookshop-1.webp +0 -0
- package/assets/showcase/time-bookshop-2.webp +0 -0
- package/assets/showcase/water-journey-1.webp +0 -0
- package/assets/showcase/water-journey-2.webp +0 -0
- package/assets/showcase/water-journey-3.webp +0 -0
- package/assets/showcase/weekend-go-1.webp +0 -0
- package/assets/showcase/weekend-go-2.webp +0 -0
- package/assets/showcase/weekend-go-3.webp +0 -0
- package/assets/showcase/winter-soup-1.webp +0 -0
- package/assets/showcase/year-review-1.webp +0 -0
- package/assets/showcase/year-review-2.webp +0 -0
- package/assets/showcase/year-review-3.webp +0 -0
- package/lib/browser.js +3 -1
- package/lib/bundle.js +8 -3
- package/lib/canvthumb.js +9 -6
- package/lib/client.js +7427 -2624
- package/lib/components.js +4 -2
- package/lib/core.js +762 -132
- package/lib/design-page-settings.js +48 -0
- package/lib/design-scope.js +36 -0
- package/lib/design-transactions.js +259 -0
- package/lib/drop-folder.js +25 -0
- package/lib/edits.js +125 -8
- package/lib/embedded/lvgl_shot.c +133 -0
- package/lib/embedded/qml_shot.py +66 -0
- package/lib/embedded-shot.js +400 -0
- package/lib/embedded-trust.js +76 -0
- package/lib/fonts.js +30 -21
- package/lib/frames.js +23 -23
- package/lib/gallery/css.js +9 -2
- package/lib/gallery/market-routes.js +23 -7
- package/lib/gallery/pack.js +25 -8
- package/lib/gallery/policy.js +6 -4
- package/lib/gallery/routes.js +255 -83
- package/lib/gallery/submit.js +285 -57
- package/lib/gallery/use.js +13 -4
- package/lib/handoff-embedded.js +1182 -0
- package/lib/handoff.js +212 -71
- package/lib/history.js +393 -43
- package/lib/htmlpack.js +34 -13
- package/lib/impl.js +3 -0
- package/lib/index.js +661 -136
- package/lib/inspire.js +73 -26
- package/lib/kinds.js +11 -2
- package/lib/look.js +45 -25
- package/lib/mock.js +41 -4
- package/lib/motion.js +90 -0
- package/lib/page-settings.js +103 -0
- package/lib/picker.js +348 -70
- package/lib/rules.js +85 -0
- package/lib/serve.js +154 -15
- package/lib/showcase.json +22 -0
- package/lib/styles.js +16 -7
- package/lib/system.js +19 -8
- package/lib/tool.js +2 -1
- package/lib/tweaks.js +146 -9
- package/lib/works.js +151 -19
- package/locale/auto/en.json +1 -1
- package/locale/auto/zh.json +1 -1
- package/locale/en.json +1 -1
- package/locale/offline/en.json +1 -1
- package/locale/offline/zh.json +2 -2
- package/locale/zh.json +1 -1
- package/package.json +3 -2
- package/skills/ui-design/SKILL.md +56 -46
- package/skills/ui-design/frames/dsh/frame.json +1 -1
- package/skills/ui-design/references/app.md +29 -2
- package/skills/ui-design/references/components.md +1 -1
- package/skills/ui-design/references/desktop.md +1 -1
- package/skills/ui-design/references/dshplugin.md +12 -12
- package/skills/ui-design/references/embedded.md +40 -0
- package/skills/ui-design/references/frames.md +20 -20
- package/skills/ui-design/references/miniprogram.md +2 -2
- package/skills/ui-design/references/mock.md +16 -0
- package/skills/ui-design/references/poster.md +2 -1
- package/skills/ui-design/references/tweaks.md +17 -0
- package/skills/ui-design/tokens.css +19 -5
|
@@ -0,0 +1,134 @@
|
|
|
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":"suggest-chips","zh":"建议气泡","en":"Suggestion Chips","cat":"ai","desc":"三个建议气泡依次弹出,点一个顺滑飞进下方输入框变成文字","desc_en":"Three suggestions pop in; tap one and it flies into the input as text","needs":"js","play":"press","hint":"点一个气泡","hint_en":"Tap a chip","source":null,"prompt":"建议气泡:286px 宽组合,三枚胶囊按 0/95/190ms 弹簧弹出,下方配 46px 输入框与发送键。按下气泡微压(scale .92),点击后 FLIP 飞入输入框并融成文字(360ms),输入框微震亮边且发送键弹亮;再点输入框重弹。颜色读 --color-surface / --color-text / --color-muted / --color-line / --color-primary,减少动效直接显示已填入态。","prompt_en":"Suggestion chips: 286px wide; three pills spring in at 0/95/190ms above a 46px input with send button. Press: chip .92; tap: it FLIP-flies into the input as text (360ms), others fade, the input bumps with a lit border, send pops on. Tap the input to replay. Reads --color-surface / --color-text / --color-muted / --color-line / --color-primary; reduced motion: filled state."}</script>
|
|
8
|
+
<style data-stage>
|
|
9
|
+
:root{color-scheme:light;--color-bg:#efede7;--color-surface:#fff;--color-text:#141413;--color-muted:#76756f;--color-line:rgba(20,20,19,.1);--color-primary:#6d5dfc;--color-danger:#ff375f;--color-warning:#ffb340;--color-success:#2eb85c;--font-sans:-apple-system,BlinkMacSystemFont,"SF Pro Text","PingFang SC","Microsoft YaHei",system-ui,sans-serif}
|
|
10
|
+
:root[data-theme=dark]{color-scheme:dark;--color-bg:#17171a;--color-surface:#2c2c30;--color-text:#f5f5f4;--color-muted:#8e8d88;--color-line:rgba(255,255,255,.14);--color-primary:#9d8cff}
|
|
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
|
+
/* 建议气泡 · 三枚气泡依次弹出,点选后飞入下方输入框成字。颜色读设计变量:--color-surface / --color-text / --color-muted / --color-line / --color-primary */
|
|
18
|
+
.c-suggest-chips{--sg-a:var(--color-primary,#6d5dfc);--sg-s:var(--color-surface,#fff);--sg-t:var(--color-text,#141413);--sg-r:color-mix(in srgb,var(--sg-a) 50%,transparent);--sg-g:color-mix(in srgb,var(--sg-a) 38%,transparent);--sg-sh:inset 0 1px 0 #fff5,0 0 0 .5px var(--color-line,#0002),0 2px 4px #0001,0 10px 20px -10px #0004;--sg-sp:linear(0,.05,.18,.36,.56,.75,.91,1.03,1.1,1.12,1.11,1.08,1.04,1.01,.98,.97,.98,1,1.01,1);position:relative;width:286px;display:grid;gap:14px;font-family:var(--font-sans,system-ui)}
|
|
19
|
+
.c-suggest-chips .sg-cs{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;min-height:74px;align-content:center}
|
|
20
|
+
.c-suggest-chips .sg-c,.c-suggest-chips .sg-fly{display:inline-flex;align-items:center;gap:6px;height:33px;padding:0 13px;border:0;border-radius:999px;font:500 13px/1 inherit;color:var(--sg-t);background:var(--sg-s);white-space:nowrap}
|
|
21
|
+
.c-suggest-chips .sg-c::before,.c-suggest-chips .sg-fly::before{content:"";width:11px;height:11px;flex:none;background:var(--sg-a);clip-path:polygon(50% 0,64% 36%,100% 50%,64% 64%,50% 100%,36% 64%,0 50%,36% 36%)}
|
|
22
|
+
.c-suggest-chips .sg-c{position:relative;box-shadow:var(--sg-sh);cursor:pointer;opacity:0;transform:translateY(14px) scale(.84);transition:transform .56s var(--sg-sp),opacity .26s,background-color .24s,box-shadow .26s,color .24s;-webkit-tap-highlight-color:transparent}
|
|
23
|
+
.c-suggest-chips.r .sg-c{opacity:1;transform:none}
|
|
24
|
+
.c-suggest-chips.r .sg-c:nth-child(2){transition-delay:95ms}
|
|
25
|
+
.c-suggest-chips.r .sg-c:nth-child(3){transition-delay:190ms}
|
|
26
|
+
.c-suggest-chips.r .sg-c:hover{transform:translateY(-2px) scale(1.03);transition-delay:0s;box-shadow:0 0 0 1px var(--sg-r),0 8px 18px -8px var(--sg-g)}
|
|
27
|
+
.c-suggest-chips.r .sg-c:active,.c-suggest-chips.r .sg-c.pr{transform:scale(.92);transition:.1s;transition-delay:0s}
|
|
28
|
+
.c-suggest-chips .sg-c:focus-visible{outline:2px solid var(--sg-a);outline-offset:3px}
|
|
29
|
+
.c-suggest-chips .sg-c.pk{opacity:0;transform:scale(.88);transition:.16s;transition-delay:0s;pointer-events:none}
|
|
30
|
+
.c-suggest-chips .sg-c.fd{opacity:.32;transform:translateY(4px) scale(.94);transition:.3s;transition-delay:0s}
|
|
31
|
+
.c-suggest-chips .sg-c.ac{background:color-mix(in srgb,var(--sg-a) 12%,var(--sg-s));color:var(--sg-a);box-shadow:0 0 0 1px var(--sg-r),0 8px 18px -10px var(--sg-g)}
|
|
32
|
+
.c-suggest-chips .sg-b{position:relative;display:flex;align-items:center;gap:8px;height:46px;padding:0 7px 0 16px;border-radius:23px;background:var(--sg-s);box-shadow:var(--sg-sh);cursor:pointer;transition:transform .48s var(--sg-sp),box-shadow .32s}
|
|
33
|
+
.c-suggest-chips .sg-b:active{transform:scale(.98);transition:.1s}
|
|
34
|
+
.c-suggest-chips.f .sg-b{box-shadow:inset 0 1px 0 #fff5,0 0 0 1.2px var(--sg-r),0 14px 28px -10px var(--sg-g)}
|
|
35
|
+
.c-suggest-chips.ld .sg-b{animation:sg-bm .44s var(--sg-sp)}
|
|
36
|
+
.c-suggest-chips .sg-f{position:relative;flex:1;min-width:0;height:20px;display:flex;align-items:center;font:500 14px/20px inherit}
|
|
37
|
+
.c-suggest-chips .sg-ph{position:absolute;left:0;color:var(--color-muted,#76756f);opacity:.78;transition:.14s;pointer-events:none}
|
|
38
|
+
.c-suggest-chips.fl .sg-ph,.c-suggest-chips.f .sg-ph{opacity:0;transform:translateX(-6px)}
|
|
39
|
+
.c-suggest-chips .sg-v{color:var(--sg-t);white-space:nowrap;opacity:0;transition:opacity .15s}
|
|
40
|
+
.c-suggest-chips.f .sg-v{opacity:1}
|
|
41
|
+
.c-suggest-chips .sg-k{display:inline-block;width:2px;height:15px;margin-left:2px;border-radius:1px;background:var(--sg-a);opacity:0}
|
|
42
|
+
.c-suggest-chips.f .sg-k{opacity:1;animation:sg-bl 1s ease-in-out infinite}
|
|
43
|
+
.c-suggest-chips .sg-s{width:32px;height:32px;flex:none;border-radius:50%;display:grid;place-items:center;color:var(--color-muted,#76756f);background:color-mix(in srgb,var(--sg-t) 7%,transparent);transition:.28s,transform .52s var(--sg-sp)}
|
|
44
|
+
.c-suggest-chips .sg-s svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
|
|
45
|
+
.c-suggest-chips.f .sg-s{color:#fff;background:var(--sg-a);box-shadow:inset 0 1px 0 #fff5,0 6px 16px -4px var(--sg-g);animation:sg-pp .52s var(--sg-sp)}
|
|
46
|
+
.c-suggest-chips .sg-fly{position:absolute;left:0;top:0;z-index:8;box-shadow:0 0 0 1px var(--sg-r),0 10px 22px -6px var(--sg-g);pointer-events:none}
|
|
47
|
+
.c-suggest-chips .sg-fly.go{background:0;box-shadow:none;font-size:14px;padding:0;transition:transform .36s cubic-bezier(.22,.82,.24,1),background-color .24s,box-shadow .22s,padding .3s,font-size .3s}
|
|
48
|
+
.c-suggest-chips .sg-fly.go::before{opacity:0;width:0;margin-right:-6px;transition:.2s}
|
|
49
|
+
@keyframes sg-bm{0%{transform:scale(.982)}50%{transform:scale(1.018)}100%{transform:scale(1)}}
|
|
50
|
+
@keyframes sg-pp{0%{transform:scale(.78)}100%{transform:scale(1)}}
|
|
51
|
+
@keyframes sg-bl{50%{opacity:.15}}
|
|
52
|
+
@media (prefers-reduced-motion:reduce){.c-suggest-chips *{animation:none!important;transition-duration:.01ms!important;transition-delay:0s!important}}
|
|
53
|
+
</style>
|
|
54
|
+
</head>
|
|
55
|
+
<body>
|
|
56
|
+
<div class="stage-fit">
|
|
57
|
+
<div class="c-suggest-chips" data-comp="suggest-chips">
|
|
58
|
+
<div class="sg-cs" role="group" aria-label="建议问题">
|
|
59
|
+
<button class="sg-c" type="button" data-q="换套暖秋配色">换套暖秋配色</button>
|
|
60
|
+
<button class="sg-c" type="button" data-q="精简成三句话">精简成三句话</button>
|
|
61
|
+
<button class="sg-c" type="button" data-q="写一段开场白">写一段开场白</button>
|
|
62
|
+
</div>
|
|
63
|
+
<div class="sg-b" role="button" tabindex="0" aria-label="输入框,点一下重置建议">
|
|
64
|
+
<span class="sg-f"><span class="sg-ph">选个话题…</span><span class="sg-v"></span><i class="sg-k" aria-hidden="true"></i></span>
|
|
65
|
+
<span class="sg-s" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M12 19V5M6.5 10.5 12 5l5.5 5.5"/></svg></span>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
<script data-comp>
|
|
70
|
+
/* 建议气泡:依次弹出,点选 FLIP 飞入输入框。 */
|
|
71
|
+
(() => {
|
|
72
|
+
const rm = matchMedia('(prefers-reduced-motion: reduce)').matches
|
|
73
|
+
document.querySelectorAll('.c-suggest-chips').forEach((el) => {
|
|
74
|
+
const cs = [...el.querySelectorAll('.sg-c')], bar = el.querySelector('.sg-b'), fd = el.querySelector('.sg-f'), val = el.querySelector('.sg-v'), cl = el.classList
|
|
75
|
+
let busy = 0, ts = [], fly = 0
|
|
76
|
+
const clean = () => { ts.forEach(clearTimeout); ts = []; if (fly) { fly.remove(); fly = 0 } }
|
|
77
|
+
el.sgReset = (pop = 1) => { clean(); busy = 0; cl.remove('r', 'fl', 'f', 'ld'); cs.forEach((c) => c.classList.remove('pk', 'fd', 'pr', 'ac')); val.textContent = ''; if (pop) { void el.offsetWidth; cl.add('r') } }
|
|
78
|
+
el.sgSettle = () => { clean(); busy = 0; cl.remove('fl', 'ld'); cl.add('r', 'f'); cs.forEach((c, i) => { c.classList.remove('pk', 'fd', 'pr'); c.classList.toggle('ac', i === 2) }); val.textContent = cs[2].dataset.q }
|
|
79
|
+
el.sgPick = (i, done) => {
|
|
80
|
+
const ch = cs[i]; if (!ch || busy) return
|
|
81
|
+
busy = 1; clean(); const q = ch.dataset.q
|
|
82
|
+
cl.remove('f', 'ld'); cs.forEach((c) => c.classList.remove('pk', 'fd', 'ac'))
|
|
83
|
+
if (rm) { val.textContent = q; cl.add('f'); ch.classList.add('ac'); busy = 0; done && done(); return }
|
|
84
|
+
const r0 = el.getBoundingClientRect(), sc = r0.width / el.offsetWidth || 1, r1 = ch.getBoundingClientRect(), r2 = fd.getBoundingClientRect()
|
|
85
|
+
const at = (r, dy = 0) => `translate(${((r.left - r0.left) / sc).toFixed(1)}px,${((r.top - r0.top) / sc + dy).toFixed(1)}px)`
|
|
86
|
+
fly = document.createElement('span'); fly.className = 'sg-fly'; fly.textContent = q; fly.style.transform = at(r1); el.append(fly)
|
|
87
|
+
cl.add('fl'); ch.classList.add('pk'); cs.forEach((c) => c !== ch && c.classList.add('fd'))
|
|
88
|
+
void fly.offsetWidth; fly.classList.add('go'); fly.style.transform = at(r2, -6)
|
|
89
|
+
ts.push(setTimeout(() => { if (fly) { fly.remove(); fly = 0 } val.textContent = q; cl.remove('fl'); cl.add('f', 'ld'); busy = 0; done && done() }, 360))
|
|
90
|
+
}
|
|
91
|
+
cs.forEach((c, i) => c.addEventListener('click', () => el.sgPick(i)))
|
|
92
|
+
bar.addEventListener('click', () => el.sgReset(1))
|
|
93
|
+
bar.addEventListener('keydown', (e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); el.sgReset(1) } })
|
|
94
|
+
cl.add('r')
|
|
95
|
+
})
|
|
96
|
+
})()
|
|
97
|
+
</script>
|
|
98
|
+
<script data-stage>
|
|
99
|
+
/* 演示舞台:每个组件都一样,只改 DEMO 那一段。组件按 340×212 设计,卡片小了整体等比缩小。 */
|
|
100
|
+
(() => {
|
|
101
|
+
const q = new URLSearchParams(location.search); const root = document.documentElement
|
|
102
|
+
root.dataset.theme = (q.get('theme') || (matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')) === 'dark' ? 'dark' : 'light'
|
|
103
|
+
const reduced = matchMedia('(prefers-reduced-motion: reduce)').matches
|
|
104
|
+
const el = document.querySelector('.stage-fit > [data-comp]')
|
|
105
|
+
const fit = () => root.style.setProperty('--fit', Math.min(1, innerWidth / 340, innerHeight / 212).toFixed(3))
|
|
106
|
+
fit(); addEventListener('resize', fit)
|
|
107
|
+
let playing = !q.has('still'); let hovering = false; let timers = []
|
|
108
|
+
const later = (fn, ms) => timers.push(setTimeout(() => { if (playing && !hovering) fn() }, ms)) // 演示用的定时器:用户一来就全部作废
|
|
109
|
+
const stop = () => { timers.forEach(clearTimeout); timers = []; DEMO.stop() }
|
|
110
|
+
const go = (ms) => { stop(); if (playing && !hovering && !reduced) later(() => DEMO.loop(later), ms) }
|
|
111
|
+
// ===== 只改这一段 =====
|
|
112
|
+
const cs = [...el.querySelectorAll('.sg-c')]; let turn = 0
|
|
113
|
+
const DEMO = {
|
|
114
|
+
settle () { el.sgSettle() },
|
|
115
|
+
loop (later) {
|
|
116
|
+
el.sgReset(true); const i = turn++ % cs.length
|
|
117
|
+
later(() => { cs[i].classList.add('pr'); later(() => { cs[i].classList.remove('pr'); el.sgPick(i, () => later(() => DEMO.loop(later), 1450)) }, 120) }, 640)
|
|
118
|
+
},
|
|
119
|
+
stop () { cs.forEach((c) => c.classList.remove('pr')); if (!el.classList.contains('r') || el.classList.contains('f')) el.sgReset(true) },
|
|
120
|
+
}
|
|
121
|
+
// =====================
|
|
122
|
+
document.body.addEventListener('pointerenter', () => { hovering = true; stop() })
|
|
123
|
+
document.body.addEventListener('pointerleave', () => { hovering = false; go(1400) })
|
|
124
|
+
addEventListener('message', (e) => {
|
|
125
|
+
const d = e.data; if (!d || typeof d !== 'object') return
|
|
126
|
+
if (d.theme === 'light' || d.theme === 'dark') root.dataset.theme = d.theme
|
|
127
|
+
if (typeof d.ddpPlay === 'boolean') { playing = d.ddpPlay; root.classList.toggle('paused', !playing); if (playing) go(400); else stop() }
|
|
128
|
+
})
|
|
129
|
+
try { parent.postMessage({ ddpMotionReady: 1 }, '*') } catch (e) { /* 单独打开时没有外层 */ }
|
|
130
|
+
if (reduced || q.has('still')) DEMO.settle(); else go(600)
|
|
131
|
+
})()
|
|
132
|
+
</script>
|
|
133
|
+
</body>
|
|
134
|
+
</html>
|
|
@@ -0,0 +1,126 @@
|
|
|
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":"swipe-row","zh":"滑动操作行","en":"Swipe Action Row","cat":"gesture","desc":"左右拖拽卡片露出彩色操作块,越界带橡皮筋阻尼与松手回弹","desc_en":"Swipe to reveal colored actions, with rubber-band resistance and a spring back","needs":"js","play":"drag","hint":"左右拖一拖","hint_en":"Swipe","source":null,"prompt":"双向滑动操作行:276×68 凹槽托盘内嵌极简圆角行卡,支持横向拖拽与越界橡皮筋阻尼,松手弹簧吸附:左滑 -102px 露出蓝色置顶与红色删除两枚缩放弹出的操作块,卡内文字自动右补不裁切;右滑 +62px 露出琥珀星标块,均可点击触发反馈。颜色读 --color-surface / --color-text / --color-primary / --color-danger / --color-warning / --color-line,减少动效定格左滑态。","prompt_en":"Swipe row: 276×68 recessed tray with a rounded row card. Sideways drag, rubber-band past limits, spring snap on release. Left to -102px: blue pin and red delete scale in, row text shifts right so nothing clips; right to +62px: amber star. Actions are tappable. Reads --color-surface / --color-text / --color-muted / --color-primary / --color-danger / --color-warning / --color-line; reduced motion: swiped left."}</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:#ff9f0a;--color-success:#2eb85c;--font-sans:-apple-system,BlinkMacSystemFont,"SF Pro Text","PingFang SC","Microsoft YaHei",system-ui,sans-serif}
|
|
10
|
+
:root[data-theme=dark]{color-scheme:dark;--color-bg:#17171a;--color-surface:#2c2c30;--color-text:#f5f5f4;--color-muted:#8e8d88;--color-line:rgba(255,255,255,.12);--color-primary:#3898ff}
|
|
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;touch-action: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
|
+
/* 滑动操作行 · 双向橡皮筋拖拽。颜色读:--color-surface / --color-text / --color-muted / --color-primary / --color-danger / --color-warning / --color-line */
|
|
18
|
+
.c-swipe-row{--sr-sp:linear(0,.07,.24,.48,.74,.96,1.08,1.12,1.08,1.02,.98,.97,.99,1.01,1);position:relative;width:276px;height:68px;padding:4px;box-sizing:border-box;border-radius:22px;overflow:hidden;background:color-mix(in srgb,var(--color-text,#141413) 6%,var(--color-surface,#fff));box-shadow:inset 0 1.5px 4px rgba(0,0,0,.12),0 0 0 .5px var(--color-line,rgba(0,0,0,.1)),0 14px 32px -14px rgba(0,0,0,.26);font-family:var(--font-sans,system-ui);touch-action:none}
|
|
19
|
+
.c-swipe-row .sr-left,.c-swipe-row .sr-right{position:absolute;top:5px;bottom:5px;display:flex;gap:5px}
|
|
20
|
+
.c-swipe-row .sr-left{left:5px}
|
|
21
|
+
.c-swipe-row .sr-right{right:5px}
|
|
22
|
+
.c-swipe-row .sr-act{width:46px;border:0;border-radius:15px;color:#fff;display:grid;place-items:center;cursor:pointer;outline:0;padding:0;box-shadow:inset 0 1px 0 rgba(255,255,255,.32),0 4px 12px -2px rgba(0,0,0,.22);opacity:0;transform:scale(.76);transition:transform .42s var(--sr-sp),opacity .22s;-webkit-tap-highlight-color:transparent}
|
|
23
|
+
.c-swipe-row .sr-act svg{width:18px;height:18px;pointer-events:none}
|
|
24
|
+
.c-swipe-row .sr-act:active{transform:scale(.88)!important}
|
|
25
|
+
.c-swipe-row .sr-act.star{width:54px;background:linear-gradient(160deg,color-mix(in srgb,#fff 14%,var(--color-warning,#ff9f0a)),var(--color-warning,#ff9f0a))}
|
|
26
|
+
.c-swipe-row .sr-act.pin{background:linear-gradient(160deg,color-mix(in srgb,#fff 14%,var(--color-primary,#0a84ff)),var(--color-primary,#0a84ff))}
|
|
27
|
+
.c-swipe-row .sr-act.del{background:linear-gradient(160deg,color-mix(in srgb,#fff 14%,var(--color-danger,#ff375f)),var(--color-danger,#ff375f))}
|
|
28
|
+
.c-swipe-row .sr-card{position:relative;z-index:2;width:100%;height:100%;padding:0 14px 0 11px;box-sizing:border-box;border-radius:18px;overflow:hidden;display:flex;align-items:center;background:var(--color-surface,#fff);box-shadow:inset 0 1px 0 rgba(255,255,255,.5),0 0 0 .5px var(--color-line,rgba(0,0,0,.09)),0 2px 6px rgba(0,0,0,.08),0 10px 22px -10px rgba(0,0,0,.26);cursor:grab;will-change:transform;transition:transform .48s var(--sr-sp)}
|
|
29
|
+
.c-swipe-row .sr-inner{width:100%;display:flex;align-items:center;gap:11px;will-change:transform;transition:transform .48s var(--sr-sp)}
|
|
30
|
+
.c-swipe-row.is-drag .sr-card,.c-swipe-row.is-drag .sr-inner,.c-swipe-row.is-drag .sr-act{transition:none}
|
|
31
|
+
.c-swipe-row.is-drag .sr-card{cursor:grabbing}
|
|
32
|
+
.c-swipe-row .sr-ico{width:36px;height:36px;flex:none;border-radius:11px;display:grid;place-items:center;color:var(--color-primary,#0a84ff);background:color-mix(in srgb,var(--color-primary,#0a84ff) 14%,transparent);box-shadow:inset 0 0 0 .5px color-mix(in srgb,var(--color-primary,#0a84ff) 24%,transparent);transition:opacity .25s}
|
|
33
|
+
.c-swipe-row .sr-ico svg{width:18px;height:18px}
|
|
34
|
+
.c-swipe-row .sr-title{flex:1;min-width:0;font:650 14px/1.2 var(--font-sans,system-ui);letter-spacing:-.01em;color:var(--color-text,#141413);display:flex;align-items:center;gap:6px;white-space:nowrap}
|
|
35
|
+
.c-swipe-row .sr-badge{width:7px;height:7px;border-radius:50%;background:var(--color-warning,#ff9f0a);opacity:0;transform:scale(.2);transition:opacity .22s,transform .42s var(--sr-sp)}
|
|
36
|
+
.c-swipe-row[data-mark="star"] .sr-badge{opacity:1;transform:scale(1);background:var(--color-warning,#ff9f0a)}
|
|
37
|
+
.c-swipe-row[data-mark="pin"] .sr-badge{opacity:1;transform:scale(1);background:var(--color-primary,#0a84ff)}
|
|
38
|
+
.c-swipe-row .sr-grip{display:flex;align-items:center;gap:3px;color:var(--color-muted,#76756f);opacity:.48;flex:none;transition:opacity .25s}
|
|
39
|
+
.c-swipe-row .sr-grip i{width:3.5px;height:3.5px;border-radius:50%;background:currentColor}
|
|
40
|
+
.c-swipe-row.is-shake .sr-card{animation:sr-nudge .38s ease}
|
|
41
|
+
@keyframes sr-nudge{0%,100%{transform:translateX(0)}30%{transform:translateX(-14px)}65%{transform:translateX(5px)}}
|
|
42
|
+
@media (prefers-reduced-motion:reduce){.c-swipe-row *{animation:none!important;transition-duration:.01ms!important}}
|
|
43
|
+
</style>
|
|
44
|
+
</head>
|
|
45
|
+
<body>
|
|
46
|
+
<div class="stage-fit">
|
|
47
|
+
<div class="c-swipe-row" data-comp="swipe-row" data-pos="0">
|
|
48
|
+
<div class="sr-left"><button class="sr-act star" type="button" aria-label="星标"><svg viewBox="0 0 20 20" fill="currentColor"><path d="M10 2.4 12.3 7l5 .7-3.6 3.5.9 5L10 13.8 5.4 16.2l.9-5L2.7 7.7l5-.7z"/></svg></button></div>
|
|
49
|
+
<div class="sr-right">
|
|
50
|
+
<button class="sr-act pin" type="button" aria-label="置顶"><svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M6.8 3.5h6.4l-.9 4.8 2.6 2.4v1.3H5.1v-1.3l2.6-2.4zM10 12v4.6"/></svg></button>
|
|
51
|
+
<button class="sr-act del" type="button" aria-label="删除"><svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M4.2 5.8h11.6M7.8 5.8V4.3c0-.5.4-.9.9-.9h2.6c.5 0 .9.4.9.9v1.5M5.8 5.8l.8 9.8c.1.6.5 1 1.1 1h4.6c.6 0 1-.4 1.1-1l.8-9.8"/></svg></button>
|
|
52
|
+
</div>
|
|
53
|
+
<div class="sr-card" role="group" aria-label="滑动卡片">
|
|
54
|
+
<div class="sr-inner">
|
|
55
|
+
<span class="sr-ico" aria-hidden="true"><svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"><rect x="4" y="3.2" width="12" height="13.6" rx="2.6"/><path d="M7.2 7.5h5.6M7.2 11h3.6"/></svg></span>
|
|
56
|
+
<span class="sr-title">设计手记<i class="sr-badge" aria-hidden="true"></i></span>
|
|
57
|
+
<span class="sr-grip" aria-hidden="true"><i></i><i></i><i></i></span>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
<script data-comp>
|
|
63
|
+
/* 滑动操作行逻辑:双向橡皮筋拖拽与弹性吸附,左滑文字右补。 */
|
|
64
|
+
(() => {
|
|
65
|
+
const L = -102, R = 62
|
|
66
|
+
document.querySelectorAll('.c-swipe-row').forEach((el) => {
|
|
67
|
+
const card = el.querySelector('.sr-card'), inner = el.querySelector('.sr-inner'), ico = el.querySelector('.sr-ico'), grip = el.querySelector('.sr-grip')
|
|
68
|
+
const star = el.querySelector('.star'), pin = el.querySelector('.pin'), del = el.querySelector('.del')
|
|
69
|
+
let x = 0, drag = null
|
|
70
|
+
const paint = (nx) => {
|
|
71
|
+
x = nx; el.dataset.pos = String(Math.round(nx)); card.style.transform = `translateX(${nx.toFixed(1)}px)`
|
|
72
|
+
const rl = Math.max(0, Math.min(1, -nx / -L)), rr = Math.max(0, Math.min(1, nx / R))
|
|
73
|
+
inner.style.transform = `translateX(${(rl * 58).toFixed(1)}px)`
|
|
74
|
+
ico.style.opacity = Math.max(0, 1 - rl * 1.45).toFixed(2); grip.style.opacity = Math.max(0, 0.48 - rl * 0.48).toFixed(2)
|
|
75
|
+
pin.style.opacity = Math.min(1, rl * 1.25).toFixed(2); pin.style.transform = `scale(${(0.74 + 0.26 * rl).toFixed(3)}) translateX(${((1 - rl) * 14).toFixed(1)}px)`
|
|
76
|
+
del.style.opacity = Math.min(1, rl * 1.15).toFixed(2); del.style.transform = `scale(${(0.7 + 0.3 * rl).toFixed(3)}) translateX(${((1 - rl) * 9).toFixed(1)}px)`
|
|
77
|
+
star.style.opacity = Math.min(1, rr * 1.25).toFixed(2); star.style.transform = `scale(${(0.74 + 0.26 * rr).toFixed(3)}) translateX(${((rr - 1) * 12).toFixed(1)}px)`
|
|
78
|
+
}
|
|
79
|
+
el.srMove = (nx, imm = false) => { el.classList.toggle('is-drag', imm); paint(nx); if (imm) requestAnimationFrame(() => el.classList.remove('is-drag')) }
|
|
80
|
+
card.addEventListener('pointerdown', (e) => { card.setPointerCapture(e.pointerId); el.classList.add('is-drag'); drag = { x0: e.clientX, base: x, moved: false } })
|
|
81
|
+
card.addEventListener('pointermove', (e) => {
|
|
82
|
+
if (!drag) return; const dx = e.clientX - drag.x0; if (Math.abs(dx) > 4) drag.moved = true
|
|
83
|
+
let raw = drag.base + dx; if (raw < L) raw = L + (raw - L) * 0.24; else if (raw > R) raw = R + (raw - R) * 0.24; paint(raw)
|
|
84
|
+
})
|
|
85
|
+
const end = () => { if (!drag) return; const m = drag.moved; drag = null; el.classList.remove('is-drag'); paint(!m ? (x < -30 || x > 24 ? 0 : L) : x < L * 0.4 ? L : x > R * 0.42 ? R : 0) }
|
|
86
|
+
card.addEventListener('pointerup', end); card.addEventListener('pointercancel', end)
|
|
87
|
+
star.addEventListener('click', () => { el.dataset.mark = el.dataset.mark === 'star' ? '' : 'star'; paint(0) })
|
|
88
|
+
pin.addEventListener('click', () => { el.dataset.mark = el.dataset.mark === 'pin' ? '' : 'pin'; paint(0) })
|
|
89
|
+
del.addEventListener('click', () => { paint(0); el.classList.remove('is-shake'); void el.offsetWidth; el.classList.add('is-shake'); setTimeout(() => el.classList.remove('is-shake'), 400) })
|
|
90
|
+
paint(0)
|
|
91
|
+
})
|
|
92
|
+
})()
|
|
93
|
+
</script>
|
|
94
|
+
<script data-stage>
|
|
95
|
+
/* 演示舞台:每个组件都一样,只改 DEMO 那一段。组件按 340×212 设计,卡片小了整体等比缩小。 */
|
|
96
|
+
(() => {
|
|
97
|
+
const q = new URLSearchParams(location.search); const root = document.documentElement
|
|
98
|
+
root.dataset.theme = (q.get('theme') || (matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')) === 'dark' ? 'dark' : 'light'
|
|
99
|
+
const reduced = matchMedia('(prefers-reduced-motion: reduce)').matches
|
|
100
|
+
const el = document.querySelector('.stage-fit > [data-comp]')
|
|
101
|
+
const fit = () => root.style.setProperty('--fit', Math.min(1, innerWidth / 340, innerHeight / 212).toFixed(3))
|
|
102
|
+
fit(); addEventListener('resize', fit)
|
|
103
|
+
let playing = !q.has('still'); let hovering = false; let timers = []
|
|
104
|
+
const later = (fn, ms) => timers.push(setTimeout(() => { if (playing && !hovering) fn() }, ms)) // 演示用的定时器:用户一来就全部作废
|
|
105
|
+
const stop = () => { timers.forEach(clearTimeout); timers = []; DEMO.stop() }
|
|
106
|
+
const go = (ms) => { stop(); if (playing && !hovering && !reduced) later(() => DEMO.loop(later), ms) }
|
|
107
|
+
// ===== 只改这一段 =====
|
|
108
|
+
const DEMO = {
|
|
109
|
+
settle () { el.srMove(-102, true) },
|
|
110
|
+
loop (later) { el.srMove(-102); later(() => { el.srMove(0); later(() => { el.srMove(62); later(() => { el.srMove(0); later(() => DEMO.loop(later), 900) }, 1450) }, 700) }, 1500) },
|
|
111
|
+
stop () {},
|
|
112
|
+
}
|
|
113
|
+
// =====================
|
|
114
|
+
document.body.addEventListener('pointerenter', () => { hovering = true; stop() })
|
|
115
|
+
document.body.addEventListener('pointerleave', () => { hovering = false; go(1400) })
|
|
116
|
+
addEventListener('message', (e) => {
|
|
117
|
+
const d = e.data; if (!d || typeof d !== 'object') return
|
|
118
|
+
if (d.theme === 'light' || d.theme === 'dark') root.dataset.theme = d.theme
|
|
119
|
+
if (typeof d.ddpPlay === 'boolean') { playing = d.ddpPlay; root.classList.toggle('paused', !playing); if (playing) go(400); else stop() }
|
|
120
|
+
})
|
|
121
|
+
try { parent.postMessage({ ddpMotionReady: 1 }, '*') } catch (e) { /* 单独打开时没有外层 */ }
|
|
122
|
+
if (reduced || q.has('still')) DEMO.settle(); else go(600)
|
|
123
|
+
})()
|
|
124
|
+
</script>
|
|
125
|
+
</body>
|
|
126
|
+
</html>
|
|
@@ -0,0 +1,92 @@
|
|
|
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": "tabbar-bounce", "zh": "弹跳标签栏", "en": "Bouncy Tab Bar", "cat": "nav", "desc": "点哪个图标它就弹跳一下并填色,背后的胶囊拉长滑过去","desc_en":"The tapped icon bounces and fills while the pill stretches over to it", "needs": "css", "play": "press", "hint": "点图标","hint_en":"Tap an icon", "source": null, "prompt": "底部标签栏:274×64 全圆角条,底色 --color-surface 加发丝边、内高光和两层阴影;5 个 52px 图标格(radio + label,纯 CSS)。选中的格子背后有一块淡主色胶囊(--color-primary 14% 混进 surface),用 :has 换位置、弹簧 linear() 滑过去(.62s,过冲约 6%,被条内圆角裁住);每格一个同样的拉伸关键帧(横向拉到 1.42 再收拢),换格时动画名变了就重播,于是滑动时像被拉长、到位再收拢。被选中的图标先压扁、跳起 7px、再落地抖一下(.6s),描边变主色并填上淡主色;按住时图标缩到 .86。减少动效时直接换位、不跳。一页放多个时单选的 name 要改成不同的。", "prompt_en": "Tab bar: 274×64 --color-surface bar, five 52px cells (radio + label, pure CSS). A pale pill (--color-primary 14% into surface) slides via :has on a linear() spring (.62s, ~6% overshoot), clipped by the bar; a stretch keyframe (scaleX 1.42) replays as its animation-name changes per tab. The chosen icon squashes, hops 7px, lands with a wobble, fills pale; press .86. Reduced motion: instant. Unique radio names."}</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
|
+
/* 弹跳标签栏 · 纯 CSS(radio + :has)。颜色读 --color-surface / --color-text / --color-muted / --color-line / --color-primary */
|
|
18
|
+
.c-tabbar-bounce{--tb-w:52px;--tb-i:0;--tb-c:var(--color-primary,#0a84ff);--tb-spring:linear(0,.08,.27,.5,.71,.87,.97,1.03,1.055,1.06,1.05,1.035,1.02,1.008,1,.996,.995,.996,.998,1);position:relative;display:flex;padding:7px;border-radius:32px;background:var(--color-surface,#fff);box-shadow:inset 0 1px 0 rgba(255,255,255,.55),0 0 0 .5px var(--color-line,rgba(0,0,0,.1)),0 2px 4px rgba(0,0,0,.06),0 16px 34px -12px rgba(0,0,0,.3);font-family:var(--font-sans,system-ui);-webkit-tap-highlight-color:transparent}
|
|
19
|
+
.c-tabbar-bounce .tb-blob{position:absolute;left:7px;right:7px;top:7px;height:50px;border-radius:25px;overflow:hidden;pointer-events:none}
|
|
20
|
+
.c-tabbar-bounce .tb-blob i{position:absolute;left:0;top:0;width:var(--tb-w);height:50px;transform:translateX(calc(var(--tb-i)*var(--tb-w)));transition:transform .62s var(--tb-spring)}
|
|
21
|
+
.c-tabbar-bounce .tb-blob b{position:absolute;inset:0;border-radius:25px;background:color-mix(in srgb,var(--tb-c) 14%,var(--color-surface,#fff));animation:tb-st0 .6s cubic-bezier(.3,.6,.4,1)}
|
|
22
|
+
.c-tabbar-bounce .tb-t{position:relative;display:grid;place-items:center;width:var(--tb-w);height:50px;border-radius:25px;color:var(--color-muted,#76756f);cursor:pointer;transition:color .3s}
|
|
23
|
+
.c-tabbar-bounce .tb-t input{position:absolute;inset:0;margin:0;opacity:0;cursor:pointer}
|
|
24
|
+
.c-tabbar-bounce .tb-t svg{width:25px;height:25px;overflow:visible;fill:transparent;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;transition:transform .6s var(--tb-spring),fill .3s}
|
|
25
|
+
.c-tabbar-bounce .tb-t:hover{color:var(--color-text,#141413)}
|
|
26
|
+
.c-tabbar-bounce .tb-t:active svg,.c-tabbar-bounce .tb-t.is-press svg{transform:scale(.86);transition:transform .12s cubic-bezier(.3,0,.5,1),fill .3s}
|
|
27
|
+
.c-tabbar-bounce .tb-t:has(input:checked){color:var(--tb-c)}
|
|
28
|
+
.c-tabbar-bounce .tb-t:has(input:checked) svg{fill:color-mix(in srgb,var(--tb-c) 24%,transparent);animation:tb-hop .62s cubic-bezier(.3,.7,.4,1)}
|
|
29
|
+
.c-tabbar-bounce .tb-t:has(input:focus-visible){outline:2px solid var(--tb-c);outline-offset:-2px}
|
|
30
|
+
.c-tabbar-bounce:has(.tb-t:nth-of-type(2) input:checked){--tb-i:1}
|
|
31
|
+
.c-tabbar-bounce:has(.tb-t:nth-of-type(2) input:checked) .tb-blob b{animation-name:tb-st1}
|
|
32
|
+
.c-tabbar-bounce:has(.tb-t:nth-of-type(3) input:checked){--tb-i:2}
|
|
33
|
+
.c-tabbar-bounce:has(.tb-t:nth-of-type(3) input:checked) .tb-blob b{animation-name:tb-st2}
|
|
34
|
+
.c-tabbar-bounce:has(.tb-t:nth-of-type(4) input:checked){--tb-i:3}
|
|
35
|
+
.c-tabbar-bounce:has(.tb-t:nth-of-type(4) input:checked) .tb-blob b{animation-name:tb-st3}
|
|
36
|
+
.c-tabbar-bounce:has(.tb-t:nth-of-type(5) input:checked){--tb-i:4}
|
|
37
|
+
.c-tabbar-bounce:has(.tb-t:nth-of-type(5) input:checked) .tb-blob b{animation-name:tb-st4}
|
|
38
|
+
@keyframes tb-st0{0%{transform:none}35%{transform:scale(1.42,.9)}62%{transform:scale(.93,1.03)}82%{transform:scale(1.03,.99)}100%{transform:none}}
|
|
39
|
+
@keyframes tb-st1{0%{transform:none}35%{transform:scale(1.42,.9)}62%{transform:scale(.93,1.03)}82%{transform:scale(1.03,.99)}100%{transform:none}}
|
|
40
|
+
@keyframes tb-st2{0%{transform:none}35%{transform:scale(1.42,.9)}62%{transform:scale(.93,1.03)}82%{transform:scale(1.03,.99)}100%{transform:none}}
|
|
41
|
+
@keyframes tb-st3{0%{transform:none}35%{transform:scale(1.42,.9)}62%{transform:scale(.93,1.03)}82%{transform:scale(1.03,.99)}100%{transform:none}}
|
|
42
|
+
@keyframes tb-st4{0%{transform:none}35%{transform:scale(1.42,.9)}62%{transform:scale(.93,1.03)}82%{transform:scale(1.03,.99)}100%{transform:none}}
|
|
43
|
+
@keyframes tb-hop{0%{transform:scale(.86)}18%{transform:translateY(2px) scale(1.16,.84)}42%{transform:translateY(-7px) scale(.92,1.1)}64%{transform:translateY(0) scale(1.08,.93)}80%{transform:translateY(-1.5px) scale(.98,1.02)}100%{transform:none}}
|
|
44
|
+
@media (prefers-reduced-motion:reduce){.c-tabbar-bounce *{animation:none!important;transition-duration:.01ms!important;transition-delay:0s!important}}
|
|
45
|
+
</style>
|
|
46
|
+
</head>
|
|
47
|
+
<body>
|
|
48
|
+
<div class="stage-fit">
|
|
49
|
+
<nav class="c-tabbar-bounce" data-comp="tabbar-bounce">
|
|
50
|
+
<span class="tb-blob" aria-hidden="true"><i><b></b></i></span>
|
|
51
|
+
<label class="tb-t"><input type="radio" name="tb-tab" aria-label="首页" checked><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 10.4 12 4l8 6.4V19a1.2 1.2 0 0 1-1.2 1.2H15v-5.4H9v5.4H5.2A1.2 1.2 0 0 1 4 19z"/></svg></label>
|
|
52
|
+
<label class="tb-t"><input type="radio" name="tb-tab" aria-label="发现"><svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="8.6"/><path d="m15.6 8.4-2.1 5.1-5.1 2.1 2.1-5.1z"/></svg></label>
|
|
53
|
+
<label class="tb-t"><input type="radio" name="tb-tab" aria-label="购物袋"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5.6 8.2h12.8l-.9 11a1.4 1.4 0 0 1-1.4 1.3H7.9a1.4 1.4 0 0 1-1.4-1.3z"/><path d="M9 10.5V7.6a3 3 0 0 1 6 0v2.9"/></svg></label>
|
|
54
|
+
<label class="tb-t"><input type="radio" name="tb-tab" aria-label="喜欢"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 20c-.3 0-7.6-4.3-8.6-9.4C2.7 6.9 6.6 4.4 9.6 6c1 .5 1.8 1.3 2.4 2.2.6-.9 1.4-1.7 2.4-2.2 3-1.6 6.9.9 6.2 4.6C19.6 15.7 12.3 20 12 20z"/></svg></label>
|
|
55
|
+
<label class="tb-t"><input type="radio" name="tb-tab" aria-label="我的"><svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="8.4" r="3.8"/><path d="M4.8 20c.7-3.7 3.6-5.8 7.2-5.8s6.5 2.1 7.2 5.8z"/></svg></label>
|
|
56
|
+
</nav>
|
|
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
|
+
const fit = () => root.style.setProperty('--fit', Math.min(1, innerWidth / 340, innerHeight / 212).toFixed(3))
|
|
66
|
+
fit(); addEventListener('resize', fit)
|
|
67
|
+
let playing = !q.has('still'); let hovering = false; let timers = []
|
|
68
|
+
const later = (fn, ms) => timers.push(setTimeout(() => { if (playing && !hovering) fn() }, ms)) // 演示用的定时器:用户一来就全部作废
|
|
69
|
+
const stop = () => { timers.forEach(clearTimeout); timers = []; DEMO.stop() }
|
|
70
|
+
const go = (ms) => { stop(); if (playing && !hovering && !reduced) later(() => DEMO.loop(later), ms) }
|
|
71
|
+
// ===== 只改这一段 =====
|
|
72
|
+
const tabs = [...el.querySelectorAll('.tb-t')]; const path = [1, 4, 2, 3, 0]; let k = 0
|
|
73
|
+
const tap = (i, later) => { tabs[i].classList.add('is-press'); later(() => { tabs[i].classList.remove('is-press'); tabs[i].querySelector('input').checked = true }, 130) }
|
|
74
|
+
const DEMO = {
|
|
75
|
+
settle () { tabs[3].querySelector('input').checked = true }, // 落定:「喜欢」那格选中
|
|
76
|
+
loop (later) { later(() => { tap(path[k], later); k = (k + 1) % path.length; later(() => DEMO.loop(later), 1300) }, 450) },
|
|
77
|
+
stop () { tabs.forEach((t) => t.classList.remove('is-press')) },
|
|
78
|
+
}
|
|
79
|
+
// =====================
|
|
80
|
+
document.body.addEventListener('pointerenter', () => { hovering = true; stop() })
|
|
81
|
+
document.body.addEventListener('pointerleave', () => { hovering = false; go(1400) })
|
|
82
|
+
addEventListener('message', (e) => {
|
|
83
|
+
const d = e.data; if (!d || typeof d !== 'object') return
|
|
84
|
+
if (d.theme === 'light' || d.theme === 'dark') root.dataset.theme = d.theme
|
|
85
|
+
if (typeof d.ddpPlay === 'boolean') { playing = d.ddpPlay; root.classList.toggle('paused', !playing); if (playing) go(400); else stop() }
|
|
86
|
+
})
|
|
87
|
+
try { parent.postMessage({ ddpMotionReady: 1 }, '*') } catch (e) { /* 单独打开时没有外层 */ }
|
|
88
|
+
if (reduced || q.has('still')) DEMO.settle(); else go(600)
|
|
89
|
+
})()
|
|
90
|
+
</script>
|
|
91
|
+
</body>
|
|
92
|
+
</html>
|
|
@@ -0,0 +1,89 @@
|
|
|
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":"tactile-controls","zh":"果冻开关","en":"Squish Toggle","cat":"input","desc":"按住滑钮沿滑动方向弹性拉长,松手带过冲滑落并点亮柔光","desc_en":"The knob stretches as it slides, overshoots a little, and lights up","needs":"css","play":"press","hint":"点一下拨动","hint_en":"Tap to toggle","source":null,"prompt":"果冻弹性开关:122×66 凹槽开关轨内嵌 54×54 立体珠光滑钮,纯 CSS(checkbox + :checked),零文字。按下时滑钮以当前侧为锚点横向拉伸压扁(scaleX 1.24, scaleY .91,110ms),松手后以弹簧曲线(620ms)带着果冻过冲滑到另一端;开启态轨道渐变为成功色并透出柔光,滑钮中心凹点同步亮起微光指示灯。颜色读 --color-surface / --color-text / --color-success / --color-line,减少动效定格在开启态。","prompt_en":"Squish toggle: 122×66 recessed track, 54×54 pearly knob, pure CSS (checkbox + :checked), no text. Press stretches the knob from its side (scale 1.24, .91, 110ms); release springs it across with jelly overshoot (620ms). On: the track turns --color-success with a glow; the knob's center LED lights. Reads --color-surface / --color-text / --color-success / --color-line; reduced motion freezes on."}</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;--color-success:#30c45c;--font-sans:-apple-system,BlinkMacSystemFont,"SF Pro Text","PingFang SC","Microsoft YaHei",system-ui,sans-serif}
|
|
10
|
+
:root[data-theme=dark]{color-scheme:dark;--color-bg:#17171a;--color-surface:#2c2c30;--color-text:#f5f5f4;--color-muted:#8e8d88;--color-line:rgba(255,255,255,.12);--color-success:#30d158}
|
|
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
|
+
/* 果冻开关 · 纯 CSS 按压拉伸形变 + 弹簧过冲滑钮。颜色读设计变量:--color-surface / --color-text / --color-success / --color-line */
|
|
18
|
+
.c-tactile-controls{--tc-w:122px;--tc-h:66px;--tc-k:54px;--tc-p:6px;--tc-ok:var(--color-success,#30c45c);--tc-spring:linear(0,.05,.18,.36,.56,.75,.91,1.03,1.1,1.12,1.1,1.07,1.03,.99,.97,.96,.97,.98,1,1.01,1.01,1,1,1);position:relative;display:inline-grid;place-items:center;width:var(--tc-w);height:var(--tc-h);cursor:pointer;-webkit-tap-highlight-color:transparent}
|
|
19
|
+
.c-tactile-controls input{position:absolute;inset:0;margin:0;opacity:0;cursor:pointer;z-index:4}
|
|
20
|
+
.c-tactile-controls .tc-track{position:relative;display:block;width:var(--tc-w);height:var(--tc-h);border-radius:999px;background:color-mix(in srgb,var(--color-text,#141413) 11%,var(--color-surface,#fff));box-shadow:inset 0 2px 6px rgba(0,0,0,.16),inset 0 -1px 0 rgba(255,255,255,.35),0 0 0 .5px var(--color-line,rgba(0,0,0,.1)),0 2px 5px rgba(0,0,0,.05),0 16px 32px -14px rgba(0,0,0,.24);transition:background-color .36s ease,box-shadow .36s ease,transform .5s var(--tc-spring)}
|
|
21
|
+
.c-tactile-controls input:active+.tc-track,.c-tactile-controls.is-press .tc-track{transform:scale(.97);transition:transform .1s cubic-bezier(.3,0,.5,1),background-color .36s ease}
|
|
22
|
+
.c-tactile-controls input:focus-visible+.tc-track{outline:2px solid var(--tc-ok);outline-offset:4px}
|
|
23
|
+
.c-tactile-controls input:checked+.tc-track{background:var(--tc-ok);box-shadow:inset 0 2px 6px rgba(0,0,0,.14),inset 0 -1px 0 rgba(255,255,255,.28),0 0 0 .5px color-mix(in srgb,var(--tc-ok) 55%,transparent),0 2px 5px rgba(0,0,0,.06),0 18px 36px -10px color-mix(in srgb,var(--tc-ok) 65%,transparent)}
|
|
24
|
+
.c-tactile-controls .tc-i,.c-tactile-controls .tc-o{position:absolute;top:50%;pointer-events:none;transition:opacity .32s ease,transform .42s var(--tc-spring)}
|
|
25
|
+
.c-tactile-controls .tc-i{left:25px;width:3px;height:14px;margin-top:-7px;border-radius:2px;background:#fff;opacity:0;transform:scaleY(.4)}
|
|
26
|
+
.c-tactile-controls .tc-o{right:20px;width:13px;height:13px;margin-top:-6.5px;border-radius:50%;border:2.2px solid color-mix(in srgb,var(--color-text,#141413) 26%,transparent);box-sizing:border-box;opacity:.9;transform:scale(1)}
|
|
27
|
+
.c-tactile-controls input:checked+.tc-track .tc-i{opacity:.85;transform:scaleY(1)}
|
|
28
|
+
.c-tactile-controls input:checked+.tc-track .tc-o{opacity:0;transform:scale(.5)}
|
|
29
|
+
.c-tactile-controls .tc-mover{position:absolute;left:var(--tc-p);top:var(--tc-p);width:var(--tc-k);height:var(--tc-k);transition:transform .62s var(--tc-spring);pointer-events:none}
|
|
30
|
+
.c-tactile-controls input:checked+.tc-track .tc-mover{transform:translateX(calc(var(--tc-w) - var(--tc-k) - var(--tc-p) * 2))}
|
|
31
|
+
.c-tactile-controls .tc-knob{position:relative;display:grid;place-items:center;width:100%;height:100%;border-radius:999px;transform-origin:22% 50%;background:radial-gradient(circle at 38% 26%,#fff 0%,#f4f4f6 68%,#e6e6ea 100%);box-shadow:inset 0 1.5px 1px #fff,inset 0 -2px 3px rgba(0,0,0,.09),0 2px 4px rgba(0,0,0,.16),0 8px 18px -4px rgba(0,0,0,.28);transition:transform .48s var(--tc-spring),box-shadow .3s ease}
|
|
32
|
+
.c-tactile-controls input:checked+.tc-track .tc-knob{transform-origin:78% 50%}
|
|
33
|
+
.c-tactile-controls input:active+.tc-track .tc-knob,.c-tactile-controls.is-press .tc-knob{transform:scale(1.24,.91);transition:transform .11s cubic-bezier(.3,0,.5,1)}
|
|
34
|
+
.c-tactile-controls .tc-dimple{width:22px;height:22px;border-radius:50%;display:grid;place-items:center;background:radial-gradient(circle at 50% 65%,#fff,#e4e4e8);box-shadow:inset 0 1.5px 3px rgba(0,0,0,.11),0 1px 0 rgba(255,255,255,.9)}
|
|
35
|
+
.c-tactile-controls .tc-led{width:6px;height:6px;border-radius:50%;background:rgba(20,20,19,.16);transition:background-color .28s ease,box-shadow .32s ease,transform .42s var(--tc-spring)}
|
|
36
|
+
.c-tactile-controls input:checked+.tc-track .tc-led{background:var(--tc-ok);box-shadow:0 0 8px color-mix(in srgb,var(--tc-ok) 80%,transparent);transform:scale(1.15)}
|
|
37
|
+
@media (prefers-reduced-motion:reduce){.c-tactile-controls *{animation:none!important;transition-duration:.01ms!important}}
|
|
38
|
+
</style>
|
|
39
|
+
</head>
|
|
40
|
+
<body>
|
|
41
|
+
<div class="stage-fit">
|
|
42
|
+
<label class="c-tactile-controls" data-comp="tactile-controls">
|
|
43
|
+
<input type="checkbox" checked aria-label="切换果冻开关">
|
|
44
|
+
<span class="tc-track" aria-hidden="true">
|
|
45
|
+
<span class="tc-i"></span>
|
|
46
|
+
<span class="tc-o"></span>
|
|
47
|
+
<span class="tc-mover">
|
|
48
|
+
<span class="tc-knob"><span class="tc-dimple"><span class="tc-led"></span></span></span>
|
|
49
|
+
</span>
|
|
50
|
+
</span>
|
|
51
|
+
</label>
|
|
52
|
+
</div>
|
|
53
|
+
<script data-stage>
|
|
54
|
+
/* 演示舞台:每个组件都一样,只改 DEMO 那一段。组件按 340×212 设计,卡片小了整体等比缩小。 */
|
|
55
|
+
(() => {
|
|
56
|
+
const q = new URLSearchParams(location.search); const root = document.documentElement
|
|
57
|
+
root.dataset.theme = (q.get('theme') || (matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')) === 'dark' ? 'dark' : 'light'
|
|
58
|
+
const reduced = matchMedia('(prefers-reduced-motion: reduce)').matches
|
|
59
|
+
const el = document.querySelector('.stage-fit > [data-comp]')
|
|
60
|
+
const fit = () => root.style.setProperty('--fit', Math.min(1, innerWidth / 340, innerHeight / 212).toFixed(3))
|
|
61
|
+
fit(); addEventListener('resize', fit)
|
|
62
|
+
let playing = !q.has('still'); let hovering = false; let timers = []
|
|
63
|
+
const later = (fn, ms) => timers.push(setTimeout(() => { if (playing && !hovering) fn() }, ms)) // 演示用的定时器:用户一来就全部作废
|
|
64
|
+
const stop = () => { timers.forEach(clearTimeout); timers = []; DEMO.stop() }
|
|
65
|
+
const go = (ms) => { stop(); if (playing && !hovering && !reduced) later(() => DEMO.loop(later), ms) }
|
|
66
|
+
// ===== 只改这一段 =====
|
|
67
|
+
const box = el.querySelector('input')
|
|
68
|
+
const flip = (later, then) => { el.classList.add('is-press'); later(() => { el.classList.remove('is-press'); box.checked = !box.checked; then() }, 160) }
|
|
69
|
+
const DEMO = {
|
|
70
|
+
settle () { box.checked = true }, // 落定状态:开启绿光态
|
|
71
|
+
loop (later) {
|
|
72
|
+
later(() => flip(later, () => later(() => flip(later, () => DEMO.loop(later)), 1550)), 1100)
|
|
73
|
+
},
|
|
74
|
+
stop () { el.classList.remove('is-press') },
|
|
75
|
+
}
|
|
76
|
+
// =====================
|
|
77
|
+
document.body.addEventListener('pointerenter', () => { hovering = true; stop() })
|
|
78
|
+
document.body.addEventListener('pointerleave', () => { hovering = false; go(1400) })
|
|
79
|
+
addEventListener('message', (e) => {
|
|
80
|
+
const d = e.data; if (!d || typeof d !== 'object') return
|
|
81
|
+
if (d.theme === 'light' || d.theme === 'dark') root.dataset.theme = d.theme
|
|
82
|
+
if (typeof d.ddpPlay === 'boolean') { playing = d.ddpPlay; root.classList.toggle('paused', !playing); if (playing) go(400); else stop() }
|
|
83
|
+
})
|
|
84
|
+
try { parent.postMessage({ ddpMotionReady: 1 }, '*') } catch (e) { /* 单独打开时没有外层 */ }
|
|
85
|
+
if (reduced || q.has('still')) DEMO.settle(); else go(600)
|
|
86
|
+
})()
|
|
87
|
+
</script>
|
|
88
|
+
</body>
|
|
89
|
+
</html>
|