# 路径描边

绘图仪一笔勾勒出山脊的轮廓。

## 试一试

观察绘图仪如何一笔描出山脊。

## 交互细节

以完整的 SVG 路径长度为准，在 2.2 秒内将描边偏移量降至零。

## 适用场景

展示图案、标志或路线的绘制过程。

## 实现要求

> 沿实际路径长度播放描边，让线条从起点连续延伸至终点。

## 独立 HTML 示例

将以下代码保存为 HTML 文件，用浏览器打开即可离线体验。

```html
<!doctype html>
<html lang="zh-Hans"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>路径描边 · Motion Lab</title><style>*{box-sizing:border-box}body{margin:0;background:#f4f3ec;color:#24251f;font:15px/1.5 system-ui,sans-serif}main{width:min(1080px,100%);margin:auto}header.sample-heading,footer.sample-tools{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;padding:12px 16px}.sample-heading h1{margin:0;font-size:clamp(20px,3vw,32px)}.sample-tools p{margin:0;flex:1 1 240px;font-size:13px}.sample-tools button{min-height:42px;padding:6px 12px;border:1px solid #666957;background:#fcfbf4;color:#202219;border-radius:3px;font:inherit}#playDemo{background:#272a23;color:white}#stage{width:100%;height:clamp(310px,70dvh,700px);position:relative;overflow:auto}.sample-status{min-height:1.4em;margin:0 16px 12px;font-size:13px}button{cursor:pointer}button:focus-visible,a:focus-visible{outline:3px solid #a64c27;outline-offset:2px}[hidden]{display:none!important}@media(prefers-reduced-motion:reduce){*,*::after,*::before{scroll-behavior:auto!important}}
/* Original print-room exhibits. Sizes follow the exhibit area, including standalone players. */
/* Playback geometry must also work when the gallery stylesheet is absent. */
.motion-plate .spring-exhibit .animation-ground,
.motion-plate .tilt-area,
.motion-plate .confetti-area{display:grid;place-items:center}
.motion-plate .motion-label{position:absolute;bottom:5px;left:0;right:0;text-align:center}
.motion-plate .marquee-window{width:100%;overflow:hidden}
.motion-plate .marquee-track{display:flex;width:max-content}
.motion-plate .marquee-group{white-space:nowrap}
.motion-plate .path-area{position:relative}
.motion-plate .path-dot{position:absolute;top:0;left:0}
.motion-plate .custom-pointer{position:absolute;border-radius:50%}
.motion-plate .cursor-area{overflow:hidden;cursor:none}
.motion-plate .story-pin{position:sticky;top:0}
.motion-plate .story-progress{position:absolute}
.motion-plate .horizontal-card{scroll-snap-align:start}
.demo-scene.motion-plate{--stock:#f1e9d7;--type:#262b25;--rule:#b6ae9e;--verm:#b84931;width:100%;height:100%;position:relative;container-type:size;display:grid;place-items:center;isolation:isolate;overflow:hidden;padding:clamp(12px,4%,44px);box-sizing:border-box;background:#e5dfd3;color:var(--type);font:500 14px/1.35 Inter,Pretendard,"Malgun Gothic",system-ui,sans-serif}
.motion-plate *,.motion-plate *:before,.motion-plate *:after{box-sizing:border-box}
.demo-scene.motion-plate{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr)}
.motion-plate .plate-hours{min-width:0}
.motion-plate :is(h3,p,figure){margin:0}.motion-plate :is(button,[tabindex]):focus-visible{outline:3px solid #dd632f;outline-offset:3px}
.motion-plate .plate-head{width:100%;text-align:left;margin:0 0 clamp(13px,4cqh,40px)}
.motion-plate .plate-head small,.motion-plate .plate-page-copy small,.motion-plate .shared-copy small{font:600 11px/1.3 system-ui,sans-serif;letter-spacing:.04em;color:inherit}
.motion-plate .plate-head h3{margin:6px 0 0;font:650 clamp(22px,5.5cqw,54px)/1.1 system-ui,sans-serif;letter-spacing:-.065em;color:inherit}
.motion-plate .plate-caption{display:flex;align-items:baseline;justify-content:space-between;gap:12px;font:600 clamp(10px,2.5cqw,13px)/1.4 system-ui,sans-serif}
.motion-plate .plate-caption em{font:400 italic clamp(12px,3cqw,19px)/1.3 Georgia,"Malgun Gothic",serif;letter-spacing:-.045em;color:inherit}
.motion-plate .plate-control{padding:8px 13px;min-height:35px;color:#fff9e9;background:#2a3029;border:1px solid #2a3029;border-radius:2px;font:600 12px/1.3 system-ui;cursor:pointer}
.motion-plate .plate-contact{width:min(88%,480px,calc(85cqh * 1.35));box-shadow:1px 9px 23px #2329212b;padding:clamp(9px,2cqw,18px);background:#f4f0e3;transform:rotate(-2deg)}
.motion-plate .plate-contact .animation-ground{display:block;height:auto;aspect-ratio:3/2;width:100%;overflow:hidden;background:#292a22}
.motion-plate .plate-contact .contact-photo{width:100%;height:100%;display:block;object-fit:cover}
.motion-plate .plate-contact figcaption{padding:9px 0 1px}.motion-plate.mp-25{background:#333a33}
.motion-plate .plate-sleeve{width:min(92%,530px)}.motion-plate.mp-26{background:#d9d8c6}
.motion-plate .sleeve-slot{height:min(55cqh,260px);width:100%;max-width:430px;position:relative;margin:auto;display:block}
.motion-plate .sleeve-record,.motion-plate .record-disc{border-radius:50%;background:repeating-radial-gradient(circle,#272c29 0 2px,#454944 2.5px 3.4px,#292b27 4px 5px);display:grid;place-items:center;border:1px solid #262a25;box-shadow:2px 5px 12px #1c201d66;aspect-ratio:1}
.motion-plate .sleeve-record{position:absolute;right:6%;top:3%;height:94%}
.motion-plate .sleeve-record i,.motion-plate .record-disc i{width:33%;aspect-ratio:1;border-radius:50%;display:grid;place-items:center;background:radial-gradient(circle,#1b1a17 0 3%,#c65e42 4% 100%);color:#f7ebd1;font:italic 600 clamp(8px,3cqw,15px) Georgia;text-align:center}
.motion-plate .sleeve-pocket{position:relative;display:block;height:100%;width:auto;aspect-ratio:1;margin-left:5%;background:#d26d4f;box-shadow:3px 3px 7px #1a211c46}
.motion-plate .sleeve-pocket .plate-print{width:100%;height:100%}.motion-plate .sleeve-pocket>span:last-child{position:absolute;bottom:9%;left:8%;padding:3px 6px;font:700 12px/1.2 Georgia;background:#f4dfb7}
.motion-plate .plate-proofsheet{width:min(90%,450px);padding:clamp(15px,3.5cqw,30px);background:#f7f0de;color:#44372d;border:1px solid #c1ae95;box-shadow:3px 6px 0 #bbac91}
.motion-plate .plate-proofsheet .animation-ground{position:relative;height:min(43cqh,175px);border-block:1px solid #b2a086;display:grid;place-items:center;margin:12px 0}
.motion-plate .proof-lines{position:absolute;left:0;right:0;top:16%;bottom:16%;background:repeating-linear-gradient(0deg,transparent 0 14px,#cbc2ad 14px 15px)}
.motion-plate .proof-seal{width:auto;height:min(35cqh,130px);aspect-ratio:1;position:relative;display:grid;place-content:center;gap:0;transform:rotate(-7deg);text-align:center;border:5px double #a63b26;color:#a63b26;background:#f5edda;border-radius:50%}
.motion-plate .proof-seal span{font:700 clamp(23px,8cqh,43px)/1.2 Georgia,serif}.motion-plate .proof-seal small{font-size:11px}
.motion-plate .plate-ledger{width:min(95%,570px);padding:clamp(16px,4cqw,38px);background:#f6f0df;box-shadow:0 7px 22px #45513a1c;border-top:3px solid #555c4d}
.motion-plate .track-row,.motion-plate .duration-row{display:grid;grid-template-columns:minmax(68px,24%) 1fr;align-items:center;gap:12px;border-top:1px solid #cbc7b4;padding:12px 0;margin:0;font:600 clamp(10px,2cqw,13px)/1.4 system-ui;color:#54584c}
.motion-plate .track-row>span,.motion-plate .duration-row>span{width:auto;min-width:0;color:inherit}
.motion-plate .motion-track{position:relative;height:30px;background:repeating-linear-gradient(90deg,#dddcc9 0 10px,#bdbfab 10px 11px);border-radius:0}
.motion-plate .motion-ball{width:30px;height:30px;position:absolute;background:#a55539;color:#fff7e2;font:italic 600 16px/30px Georgia;text-align:center}
.motion-plate .track-row:last-child .motion-ball{background:#526f5b}
.motion-plate .duration-line{width:100%;height:13px;background:#d6d5c6}.motion-plate .duration-fill{height:100%;background:#33382e;transform-origin:left}
.motion-plate .duration-row:nth-last-child(2) .duration-fill{background:#b95235}.motion-plate .duration-row:last-child .duration-fill{background:#497269}
.demo-scene.motion-plate.mp-29,.demo-scene.motion-plate.mp-36{background:#2b382e;color:#f0e9d4}
.motion-plate .spring-exhibit{width:min(88%,520px)}.motion-plate .spring-exhibit .animation-ground{height:min(56cqh,270px);position:relative;border-block:1px solid #7a836e}
.motion-plate .spring-target{position:absolute;left:50%;width:1px;top:4%;bottom:20%;background:repeating-linear-gradient(0deg,transparent 0 4px,#a3ac89 4px 7px);z-index:-1}
.motion-plate .spring-exhibit .moving-shape{display:block;width:min(24cqw,112px);height:auto;aspect-ratio:1;border-radius:50%;background:radial-gradient(circle at 32% 25%,#f9ab73,#d27a44 40%,#904529 77%,#623725);box-shadow:5px 13px 12px -8px #151c17b0}
.motion-plate .plate-letterpress{width:min(85%,440px);background:#efe7d4;padding:clamp(13px,3cqw,26px);border:1px solid #bdb196}
.motion-plate .bounce-ground{height:min(47cqh,210px);position:relative;width:100%;margin:0 0 8px;border-bottom:3px solid #4d5145}
.motion-plate .bounce-ball{position:absolute;bottom:0;left:calc(50% - 27px);display:grid;place-content:center;width:54px;height:59px;border-radius:2px;box-shadow:inset -4px -3px #333b32,1px 2px 2px #21282044;color:#f3ecd8;background:#5d675a;font:italic 700 47px/1 Georgia}
.motion-plate .plate-turntable{width:min(90%,430px);background:#c0b492;padding:clamp(13px,3cqw,28px);border:1px solid #ac9e80;box-shadow:3px 6px 0 #8f856f}
.motion-plate .disc-bed{position:relative;width:min(64cqw,42cqh,235px);margin:auto}
.motion-plate .record-disc{width:100%;height:auto;margin:0}
.motion-plate .tonearm{position:absolute;right:-8%;top:2%;height:52%;width:6px;background:#605e51;transform-origin:top;transform:rotate(21deg);box-shadow:2px 3px 3px #252a2444}
.motion-plate .tonearm:after{content:"";position:absolute;bottom:-8px;left:-4px;width:13px;height:18px;background:#3f453b}
.motion-plate .plate-readout{margin-top:10px;font-size:12px;letter-spacing:.04em}
.motion-plate .plate-letter,.motion-plate .plate-poem{width:min(91%,530px);padding:clamp(16px,4cqw,45px);background:#f8f0db;box-shadow:2px 5px 15px #37352724;color:#333b31}
.motion-plate .plate-letter{border-left:6px solid #a25b3f}.motion-plate .type-text{min-height:2.6em;margin:clamp(13px,5cqh,40px) 0;font:550 clamp(23px,5.7cqw,42px)/1.35 Georgia,"Batang",serif!important}
.motion-plate .letter-address{padding-top:10px;border-top:1px solid #bdb59e;font-size:12px}.motion-plate .plate-signal{width:min(92%,580px);padding:clamp(18px,4cqw,42px);background:#303b32;color:#f7f0de;box-shadow:3px 4px 0 #182119}
.motion-plate .scramble-text{margin:clamp(12px,4cqh,30px) 0;padding:.5em .16em;background:#242a24;border-block:1px solid #60705f;color:#f5b97f;font:600 clamp(23px,6.5cqw,55px)/1.3 "Courier New",monospace;letter-spacing:0;white-space:nowrap}
.motion-plate .plate-poem{background:#aa4934;color:#fff2d9}.motion-plate .split-words{margin-top:14px;border-top:1px solid #eab9a3;padding:.2em 0 0;display:block;text-align:left;font:550 clamp(30px,8cqw,67px)/1.13 Georgia,"Batang",serif!important}
.motion-plate .split-words span{display:block}.motion-plate .split-words span:nth-child(2){padding-left:12%}.motion-plate .split-words span:nth-child(3){padding-left:24%}
.motion-plate .plate-count{width:min(85%,610px);border-block:1px solid #87927b;text-align:left;padding:clamp(15px,4cqh,32px) 0}.motion-plate .plate-count .counter-number{font:400 clamp(65px,20cqw,150px)/1 Georgia;letter-spacing:-.08em;color:#f5efd9;font-variant-numeric:tabular-nums}.motion-plate .plate-count>div{white-space:nowrap;margin:6px 0}
.motion-plate .plate-count p,.motion-plate .plate-count .mini-label{color:#cad1b9}
.motion-plate .plate-contour{width:min(92%,560px);padding:clamp(14px,3cqw,32px);color:#473f2f;background-color:#f7efd9;background-image:linear-gradient(#ab9b762b 1px,transparent 1px),linear-gradient(90deg,#ab9b762b 1px,transparent 1px);background-size:18px 18px;border:1px solid #beaf93}
.motion-plate .line-svg{width:100%;height:auto;max-height:36cqh;display:block;margin:15px 0}.motion-plate .line-svg path{fill:none;stroke:#9f4728;stroke-width:3;stroke-linecap:round}
.motion-plate .plate-die{width:min(90%,390px);padding:15px 22px;background:#e6decc;border:1px solid #c7b99e}.motion-plate .morph-shape{display:grid;place-content:center;width:min(30cqw,100px);height:min(32cqh,130px);border-radius:3px;margin:auto;color:#f9e8ca;background:#a94930;box-shadow:3px 5px 0 #87795442;transition:background .65s,border-radius .65s,transform .65s}
.motion-plate .morph-shape i{font:normal 34px Georgia,serif}.motion-plate .morph-shape.morphed{border-radius:50% 50% 4px 4px;transform:rotate(-5deg);background:#4b6b55}.motion-plate .die-state{margin:10px 0}
.motion-plate .plate-hours{width:min(96%,660px);background:#304237;color:#f7efd8;padding:clamp(14px,3cqw,28px)}.motion-plate .marquee-window{border-block:1px solid #a4b199;padding:clamp(12px,3cqh,23px) 0;background:#29372e}.motion-plate .marquee-track{position:relative;gap:24px;color:#f3df8d}.motion-plate .marquee-group{display:flex;gap:24px;align-items:center;font:600 clamp(21px,5cqw,40px)/1.2 Georgia,system-ui}.motion-plate .marquee-group i{font-style:normal;color:#cb8058}.motion-plate .plate-hours p{color:#d7e0c8}
.motion-plate .plate-map{width:min(94%,490px);padding:clamp(12px,3cqw,22px);background:#d5e3d6;color:#324f43}.motion-plate .path-area{width:100%;height:min(42cqh,205px);margin:12px 0;border-block:1px solid #91a99a;background:repeating-linear-gradient(90deg,transparent 0 17px,#99b1a044 17px 18px)}.motion-plate .path-area svg{display:block;width:100%;height:100%}.motion-plate .path-area path{fill:none;stroke:#607e6e;stroke-width:2;stroke-dasharray:3 4}.motion-plate .path-dot{width:14px;height:14px;border:2px solid #faf0dd;border-radius:50%;background:#ac5236}
.motion-plate .plate-print{position:relative;isolation:isolate;display:block;overflow:hidden;width:100%;height:100%;background:#d3bea1}.plate-print i,.plate-print b{display:block;position:absolute}
.motion-plate .print-tide{background:#eccca0}.print-tide i{inset:0;background:repeating-radial-gradient(ellipse at 80% 100%,#636f59 0 6%,#b7bd92 6.5% 9%,#6f7c60 9.5% 12%);clip-path:polygon(0 50%,25% 22%,57% 52%,83% 27%,100% 38%,100% 100%,0 100%)}.print-tide b{width:32%;aspect-ratio:1;right:9%;top:8%;background:#ba5c3d;border-radius:50%;z-index:-1}
.motion-plate .print-arc{background:#dd9d72}.print-arc i{width:93%;height:91%;left:17%;top:13%;border-radius:100% 0 0 0;background:repeating-radial-gradient(ellipse at 100% 95%,#a64632 0 5%,#edbd8d 5.5% 6.5%,#9f432f 7% 10%)}.print-arc b{width:38%;height:74%;left:0;top:0;background:#47594e;clip-path:polygon(0 0,100% 0,0 100%)}
.motion-plate .print-fold{background:#dcd4ac}.print-fold i{inset:7% 6%;background:repeating-linear-gradient(116deg,#596a60 0 13%,#79917a 13% 24%,#d5cf9e 24% 36%);clip-path:polygon(0 82%,34% 9%,52% 57%,80% 18%,100% 90%,98% 100%,0 100%)}.print-fold b{height:12%;background:#a55b40;bottom:4%;left:0;right:0}
.motion-plate .print-rings{background:repeating-radial-gradient(ellipse at 26% 68%,#344b49 0 8%,#e0ceb1 8.6% 9.8%,#3b584e 10.2% 14%)}.print-rings i{height:18%;left:0;right:0;bottom:0;background:#b76646}
.motion-plate .plate-page,.motion-plate .plate-shared{width:min(94%,490px);max-width:none;border:0;border-radius:1px;background:#f5edde;box-shadow:0 9px 20px #272d2429}
.motion-plate .plate-page{padding:clamp(12px,3.5cqw,25px)}.motion-plate .page-demo{min-height:0;padding:0;background:transparent;display:grid;grid-template-columns:1fr 1fr;gap:15px;text-align:left;align-items:center}
.motion-plate .plate-proof{aspect-ratio:3/4;width:100%;max-height:36cqh}.motion-plate .plate-page-copy h3{margin:7px 0;font:650 clamp(23px,5.5cqw,39px)/1.1 system-ui}.motion-plate .plate-page-copy p{color:#59594c;font-size:12px}.motion-plate .plate-page .plate-control{margin-top:10px}
.motion-plate .plate-shared{padding:clamp(14px,3.5cqw,30px)}.motion-plate .shared-list{width:100%;display:flex;align-items:center;gap:14px;border:0;background:none;text-align:left;color:inherit;cursor:pointer;padding:0}
.motion-plate .shared-view{height:auto;padding:0}
.motion-plate .shared-art{transition:none}
.motion-plate .shared-art{display:block;width:39%;height:auto;aspect-ratio:4/3;object-fit:cover;transform-origin:0 0;border-radius:0}.motion-plate .shared-copy{display:grid;padding:0;gap:5px}.motion-plate .shared-copy strong{font:650 clamp(24px,5.2cqw,39px)/1.2 system-ui;letter-spacing:-.06em}.motion-plate .shared-note{font:500 12px/1.4 system-ui;color:#655f50}
.motion-plate .shared-view.expanded .shared-list{display:block}.motion-plate .shared-view.expanded .shared-art{width:100%;height:min(42cqh,235px);transform:none}.motion-plate .shared-view.expanded .shared-copy{margin-top:10px;gap:2px}
.motion-plate .story-scroll{width:min(94%,560px);height:min(77cqh,360px);container-type:size;overflow-y:auto;overscroll-behavior:contain;border-radius:0;background:#dad4c1}
.motion-plate .story-long{height:330%;background:#dad4c1}.motion-plate .story-pin{height:100cqh;display:grid;grid-template-columns:1fr 1fr;align-content:center;gap:15px;padding:clamp(12px,4cqw,29px);text-align:left;background:#eee7d5;color:#2e342d}
.motion-plate .story-pin .plate-print{height:min(68cqh,260px);filter:grayscale(1) contrast(1.15)}
.motion-plate .story-pin[data-phase="1"] .plate-print{filter:sepia(.85) saturate(1.4)}.motion-plate .story-pin[data-phase="2"] .plate-print{filter:none}
.motion-plate .story-text{align-self:center}.motion-plate .story-title{font-size:clamp(26px,7cqw,42px)!important;margin:5px 0}.motion-plate .story-copy{font-size:13px}.motion-plate .story-progress{width:82%;height:3px;left:9%;bottom:6%;background:#a34e34;transform-origin:left}
.motion-plate .horizontal-demo{position:relative;display:flex;align-items:stretch;width:min(96%,690px);gap:13px;overflow-x:auto;padding:6px 0 13px;scroll-snap-type:x mandatory;scrollbar-color:#99a08a transparent}
.motion-plate .horizontal-card{flex:0 0 clamp(167px,44cqw,280px);min-width:0;display:grid;grid-template-rows:1fr auto;height:min(58cqh,285px);padding:10px;background:#f3eddf;border-radius:0;box-shadow:1px 3px 7px #35392c20}
.motion-plate .horizontal-card>div{padding-top:8px}
.motion-plate .plate-ink{width:min(88%,430px);text-align:center}.motion-plate .magnet-area{height:min(43cqh,185px);display:grid;place-items:center;border:1px solid #b6af9a;border-radius:0;background:radial-gradient(ellipse at center,#ded9c6,transparent 70%)}
.motion-plate .magnet-button{background:#f5efdd;color:#333a2f;display:flex;align-items:center;gap:10px;padding:11px 16px;border:1px solid #8d8b76;border-radius:2px;font:650 14px/1.4 system-ui;cursor:pointer}.motion-plate .magnet-button i{width:26px;height:26px;border-radius:50%;background:#bd4b32}
.motion-plate .ink-code{padding-top:8px;font:550 12px/1.4 Consolas,monospace;letter-spacing:.06em}
.motion-plate .plate-screen{width:min(94%,530px);height:min(60cqh,300px);display:grid;place-items:end start;padding:15px;position:relative;background:#e2d9c2;color:#33382c;border-radius:0;touch-action:pan-y}
.motion-plate .cursor-halves{position:absolute;inset:0;display:grid;grid-template-columns:1fr 1fr}.motion-plate .cursor-halves span{padding:10px;font:650 11px/1.2 system-ui}.motion-plate .cursor-halves span+span{background:repeating-radial-gradient(#242a24 0 2px,#424a3d 2.5px 3px);color:#f5eddb}
.motion-plate .plate-screen h3{position:relative;max-width:45%;font-size:clamp(20px,5cqw,38px)}.motion-plate .custom-pointer{display:grid;place-items:center;width:52px;height:52px;color:#27392a;border:2px solid currentColor;backdrop-filter:none;transform:translate(-50%,-50%);font:650 12px/1 Consolas,monospace;pointer-events:none}.motion-plate .custom-pointer.on-ink{color:#f8eed6}
.motion-plate .tilt-area{width:min(90%,430px);height:min(74cqh,360px);perspective:850px}.motion-plate .tilt-card{display:flex;flex-direction:column;align-items:start;justify-content:space-between;text-align:left;padding:clamp(14px,4cqw,29px);height:min(63cqh,275px);width:auto;aspect-ratio:.77;border:1px solid #76856f;border-radius:3px;position:relative;isolation:isolate;overflow:hidden;color:#fff3db;background:repeating-radial-gradient(ellipse at 104% 110%,#324639 0 12px,#81937b 13px 14px,#334d3d 15px 23px);box-shadow:3px 7px 13px #232b2240}
.motion-plate .tilt-card:before{content:"";position:absolute;inset:0;pointer-events:none;z-index:-1;background:linear-gradient(115deg,transparent calc(var(--glint,55%) - 25%),#f7e1b23d var(--glint,55%),transparent calc(var(--glint,55%) + 24%))}
.motion-plate .tilt-card strong{font:italic 550 clamp(30px,7.4cqw,57px)/.93 Georgia;letter-spacing:-.065em}
.motion-plate .confetti-area{width:min(95%,530px);height:min(72cqh,330px);overflow:hidden;position:relative}.motion-plate .admit-ticket{width:84%;position:relative;background:#f4e0af;color:#313728;padding:clamp(14px,4cqw,29px);border:1px solid #c4aa73;box-shadow:4px 6px 0 #ae9c6d70}.motion-plate .admit-ticket h3{font-size:clamp(27px,6.6cqw,48px);margin:15px 0}.motion-plate .ticket-perf{border-top:1px dashed #8d7f53;margin:8px 0 12px}
.motion-plate .ticket-stamp{position:absolute;right:8%;top:41%;border:3px double #a4432d;transform:rotate(-7deg);font:800 clamp(14px,3.8cqw,24px)/1.2 system-ui;color:#a4432d;padding:4px 7px}.motion-plate .ticket-stamp[hidden]{display:none}
.motion-plate .confetti-piece{position:absolute;pointer-events:none;top:46%;left:50%;width:6px;height:12px;border-radius:1px}
.reduced-motion .motion-plate *{transition:none!important;scroll-behavior:auto!important}
@media(prefers-reduced-motion:reduce){.motion-plate *{transition:none!important;scroll-behavior:auto!important}}

.motion-plate .plate-turntable .plate-readout{color:#34382e}
</style></head><body><main><header class="sample-heading"><h1>路径描边</h1><span lang="en">Line Drawing</span></header><div id="stage"></div><footer class="sample-tools"><p>观察绘图仪如何一笔描出山脊。</p><button id="playDemo">绘制山脊</button><button id="reset">重新开始</button></footer><p class="sample-status" id="sampleStatus" role="status"></p></main><script>window.MotionFoundationMedia={};</script><script>'use strict';
(() => {
  const photo = 'media/paper-loop.webp';
  const coverArt = (kind) => '<span class="plate-print print-' + kind + '" aria-hidden="true"><i></i><b></b></span>';
  const button = (action, label) => '<button type="button" class="plate-control" data-act="' + action + '">' + label + '</button>';
  const headline = (small, title) => '<header class="plate-head"><small>' + small + '</small><h3>' + title + '</h3></header>';
  const heading = (label, value) => '<div class="plate-caption"><span>' + label + '</span><em>' + value + '</em></div>';
  const pathD = 'M12 111 C46 105 48 48 78 61 S111 100 139 64 S174 19 205 48 S246 97 273 52 S314 34 348 15';
  const frames = [
    ['制版', '将画稿放在覆有遮光膜的印版上。', 'black'],
    ['曝光', '光线将图案转印到印版上。', 'red'],
    ['显影', '油墨透过之处逐渐显出图像。', 'blue']
  ];
  const titles = ['涟漪','线间','叠印','余晖'];
  const inks = ['珊瑚红','深蓝','松绿'];
  const paperPage = (i) => '<div class="plate-proof">' + coverArt(['tide','arc','fold'][i]) + '</div><div class="plate-page-copy"><small>印样 ' + String(i+1).padStart(2,'0') + '</small><h3>' + ['第一道浪','正午切片','折叠的山脊'][i] + '</h3><p>' + ['重复的线条勾勒出水面。','两种油墨将圆形一分为二。','以墨线描摹纸折山脊的褶皱。'][i] + '</p></div>';
  function contents(id, image) {
    switch (id) {
      case 25: return '<figure class="plate-contact"><div class="animation-ground"><img class="moving-shape contact-photo" src="'+image+'" alt="红色纸环相互交叠的表面"></div><figcaption>' + heading('接触印相','纸上肌理') + '</figcaption></figure>';
      case 26: return '<div class="plate-sleeve">' + headline('唱片架','关于旋转的笔记') + '<div class="animation-ground sleeve-slot"><div class="moving-shape sleeve-record" role="img" aria-label="一张唱片正从封套中滑出"><i></i></div><div class="sleeve-pocket">' + coverArt('arc') + '<span>33⅓ RPM</span></div></div></div>';
      case 27: return '<div class="plate-proofsheet">' + heading('校样单','终审') + '<div class="animation-ground"><div class="proof-lines" aria-hidden="true"></div><div class="moving-shape proof-seal"><span>校了</span><small>已通过</small></div></div>' + heading('印刷检查','油墨 · 密度 · 套准') + '</div>';
      case 28: return '<div class="plate-ledger">' + headline('胶片走片速度','两条等长的轨道') + ['匀速','减速'].map((t,i)=>'<div class="track-row"><span>'+t+'</span><div class="motion-track"><i class="motion-ball">'+(i+1)+'</i></div></div>').join('') + '</div>';
      case 29: return '<div class="scene-center spring-exhibit"><div class="animation-ground"><div class="shape moving-shape" role="img" aria-label="移向目标位置的小球"></div><span class="spring-target" aria-hidden="true"></span><span class="motion-label">静止位置</span></div></div>';
      case 30: return '<div class="plate-letterpress">' + headline('字体样张','落在基线上的一枚铅字') + '<div class="bounce-ground"><span class="bounce-ball">g</span></div>' + heading('罗马体小写字母','基线') + '</div>';
      case 31: return '<div class="plate-ledger">' + headline('印刷节奏','三种油墨，三个到达时刻') + ['黑色　600 毫秒','珊瑚红　1,600 毫秒','青绿　延迟 1 秒'].map(t=>'<div class="duration-row"><span>'+t+'</span><div class="duration-line"><div class="duration-fill"></div></div></div>').join('') + '</div>';
      case 32: return '<div class="scene-center plate-turntable">'+headline('唱机','转盘')+'<div class="disc-bed"><div class="loop-shape record-disc"><i>SIDE A</i></div><div class="tonearm" aria-hidden="true"></div></div><p class="plate-readout">已停止</p></div>';
      case 33: return '<div class="plate-letter">'+heading('工作室来信','寄件人 · 版画工作室')+'<h3 class="type-text"><span class="text-caret">今天的第一张版画印好了。</span></h3><div class="letter-address">收件人　档案室</div></div>';
      case 34: return '<div class="plate-signal">'+headline('排字机状态','铅字检查')+'<div class="scramble-text" aria-label="PLATE READY">PLATE READY</div>'+heading('英文字体样张','11 个字符')+'</div>';
      case 35: return '<div class="plate-poem">'+heading('版式校样','三行诗')+'<h3 class="split-words">'+['光','停留在','纸上'].map(v=>'<span>'+v+'</span>').join('')+'</h3></div>';
      case 36: return '<div class="scene-center plate-count"><span class="mini-label">本月完成的印件</span><div><strong class="counter-number">1,280</strong><span> 件</span></div><p>示例数据</p></div>';
      case 37: return '<div class="scene-center plate-contour">'+heading('笔式绘图仪','山脊习作')+'<svg class="line-svg" viewBox="0 0 360 140" role="img" aria-label="一笔绘出的山脊"><path d="'+pathD+'" fill="none"/></svg>'+heading('单线绘图','纸上水墨')+'</div>';
      case 38: return '<div class="scene-center plate-die">'+headline('裁切样本','书签边角')+'<div class="morph-shape"><i>冊</i></div><p class="die-state">直角</p>'+button('morph','切换裁切形状')+'</div>';
      case 39: return '<div class="scene-center plate-hours">'+headline('展览开放时间','夜间版画工作室')+'<div class="marquee-window"><div class="marquee-track">'+[0,1].map((_,i)=>'<div class="marquee-group" '+(i?'aria-hidden="true"':'')+'><span>周四至周日　14:00–21:00</span><i>✳</i><span>最晚入场　20:30</span><i>✳</i></div>').join('')+'</div><p class="plate-readout">已停止</p></div>';
      case 40: return '<div class="plate-map">'+heading('工作室运送路线','纸张库存 → 包装间')+'<div class="path-area"><svg viewBox="0 0 360 180" preserveAspectRatio="none" aria-label="从库房通往包装间的弯曲路线"><path d="M22 142 C77 142 49 22 131 49 S227 171 280 95 S319 45 340 39"/></svg><i class="path-dot" aria-hidden="true"></i></div>'+heading('运纸小车','已抵达包装间')+'</div>';
      case 41: return '<div class="mini-window plate-page"><div class="page-demo">'+paperPage(0)+'</div>'+button('page','下一幅版画 →')+'</div>';
      case 42: return '<div class="mini-window plate-shared"><div class="shared-view"><button type="button" class="shared-list" aria-expanded="false" data-act="shared"><img src="'+image+'" class="shared-art" alt="扭转的红色纸带"><span class="shared-copy"><small>雕塑档案</small><strong>折叠的表面</strong><span class="shared-note">查看作品 ↗</span></span></button></div></div>';
      case 43: return '<div class="story-scroll" tabindex="0" aria-label="三个版画制作步骤。向下滚动查看。"><div class="story-long"><div class="story-pin">'+coverArt('tide')+'<div class="story-text"><small class="story-step">01 / 03</small><h3 class="story-title">制版</h3><p class="story-copy">'+frames[0][1]+'</p></div><div class="story-progress"></div></div></div></div>';
      case 44: return '<div class="horizontal-demo" tabindex="0" aria-label="四幅版画排成一行。横向移动查看。">'+titles.map((t,i)=>'<article class="horizontal-card">'+coverArt(['tide','arc','fold','rings'][i])+'<div>'+heading('系列 0'+(i+1),t)+'</div></article>').join('')+'</div>';
      case 45: return '<div class="plate-ink">'+headline('油墨色样','下一种墨色')+'<div class="magnet-area"><button type="button" data-act="magnet" class="magnet-button"><i aria-hidden="true"></i><span>珊瑚红</span> ↗</button></div><p class="ink-code">#BD4B32</p></div>';
      case 46: return '<div class="cursor-area plate-screen" tabindex="0" role="group" aria-label="移动指针或按方向键查看分色效果"><div class="cursor-halves"><span>纸张</span><span>黑色印版</span></div><h3>油墨密度</h3><div class="custom-pointer"><b>0%</b></div></div>';
      case 47: return '<div class="tilt-area"><div class="tilt-card" tabindex="0" role="group" aria-label="展览通行证。按方向键可改变倾角。"><small>版画工作室开放日</small><strong>Press<br>Pass.</strong><small>展览通行证</small></div></div>';
      case 48: return '<div class="confetti-area"><article class="admit-ticket">'+heading('版画工作室开放日','ADMIT ONE')+'<h3>入场核验</h3><span class="ticket-stamp" hidden>已入场</span><div class="ticket-perf" aria-hidden="true"></div>'+button('confetti','在通行证上盖章')+'</article></div>';
    }
  }
  function render(id,root,options={}) {
    if (id < 25 || id > 48) return;
    const image=String(options.paperImage || photo).replaceAll('&','&amp;').replaceAll('"','&quot;').replaceAll('<','&lt;');
    root.innerHTML='<div class="demo-scene motion-plate mp-'+id+'" data-demo="'+id+'">'+contents(id,image)+'</div>';
  }
  const guide = {};
  const labels = [
    ['让红色纸环的照片逐渐显现。','在原位引入一张照片或新的版画设计。','显现照片'],
    ['让唱片从封套边缘滑出。','展示藏在卡片后方的内容。','滑出唱片'],
    ['观察小印章放大，成为清晰的审核通过标记。','突出已确认的状态或当前选项。','在校样上盖章'],
    ['比较匀速和减速在相同距离内的表现。','为列表移动或页面区域切换选择缓动方式。','比较运动轨迹'],
    ['观察小球越过目标后回弹，最终停稳。','让按钮和拖动手柄在松开时产生自然的回弹。','松开弹簧'],
    ['让一枚铅字落到基线上，弹跳两次后停稳。','为新出现的项目营造落位感。','落下铅字'],
    ['比较三种油墨的起始和完成时间。','协调多个图层出现的时机。','播放三块印版'],
    ['让唱片转动，再次点击同一按钮即可暂停。','用循环运动表示持续进行的过程。','转动唱片'],
    ['逐字打出信中的一行文字。','逐字呈现艺术家的一句简短留言。','开始打字'],
    ['观察打散的铅字从左到右排成一句话。','让观众把注意力放在渐渐清晰的标题上。','开始排字'],
    ['逐行呈现这首诗。','为短标题或引文安排阅读节奏。','播放诗歌'],
    ['让数字递增至本月完成的印件数量。','在指标摘要中展示新的数值。','播放计数'],
    ['观察绘图仪如何一笔描出山脊。','展示图案、标志或路线的绘制过程。','绘制山脊'],
    ['切换裁切方式，比较直角与拱形书签。','通过形状变化表示当前选项。','切换裁切形状'],
    ['播放或暂停滚动的展览时间公告。','在狭窄的屏幕上循环展示简短公告。','播放公告'],
    ['沿弯曲路线跟随运纸小车穿过工作室。','展示地图上的路线或有序的工作流程。','启动小车'],
    ['选择下一个样本，切换到另一幅版画。','在作品集中同级的页面之间切换。','下一幅版画'],
    ['选择作品，观察缩略图如何过渡到详情视图。','切换至详情视图时，让选中的作品保持视觉连贯。','查看作品'],
    ['向下滚动或进入下一步，观察印版如何变化。','围绕固定的主视觉，分步补充说明。','下一步'],
    ['横向浏览系列作品，或在列表中按方向键切换。','在同一行中浏览系列作品。','下一件作品'],
    ['在油墨色样附近移动指针，或点击按钮切换颜色。','让小按钮对靠近的指针产生吸附反馈。','下一种墨色'],
    ['在纸张和油墨上移动指针，或用方向键查看密度。','指针目标变化时，随之显示当前工具状态。','测量另一处表面'],
    ['移动指针或按方向键，改变观察角度。','查看卡片表面的质感和立体层次。','倾斜通行证'],
    ['在通行证上盖章，查看入场确认和彩纸效果。','为登记成功或申请提交等完成状态提供反馈。','在通行证上盖章']
  ];
  for (let i=0;i<labels.length;i++) {
    const [instruction,use,action]=labels[i];
    guide[i+25]={instruction,use,action};
  }
  guide[36].spec='首次加载和重置时显示 1,280 件。点击播放后从零开始，在 1.6 秒内先快后慢地递增。以整数显示，用逗号分隔千位。数字使用 Georgia 字体，依视口宽度调整为 65–150 像素，并与单位保持在同一行。播放期间可以重新开始。启用减弱动态效果时直接显示最终数值。';
  function player(id,root,{reduced=false,status=()=>{},playButton}={}) {
    if (id<25 || id>48) return;
    const frame=root.querySelector('.motion-plate'), q=s=>frame.querySelector(s), qa=s=>[...frame.querySelectorAll(s)];
    const touchProfile=()=>['ios','android'].includes(frame.ownerDocument.documentElement.dataset.motionPlatform);
    const abort=new AbortController(), animations=new Set(), timers=new Set();
    let turn=0,loop=null,disposed=false,px=.26,py=.49,morph=false;
    const playTrigger=playButton || root.ownerDocument.getElementById('playDemo');
    const on=(el,event,fn,opts={})=>el.addEventListener(event,fn,{...opts,signal:abort.signal});
    const setLabel=text=>{if(playTrigger)playTrigger.textContent=text;};
    const resetTimers=()=>{timers.forEach(clearTimeout);timers.clear();};
    function later(fn,ms){const timer=setTimeout(()=>{timers.delete(timer);if(!disposed)fn();},ms);timers.add(timer);}
    function motion(el,keyframes,options={}) {
      if (reduced) return;
      const a=el.animate(keyframes,{duration:650,easing:'cubic-bezier(.2,.72,.22,1)',...options});
      animations.add(a);
      a.addEventListener('remove',()=>animations.delete(a),{once:true});
      return a;
    }
    const cancelAnimations=()=>{animations.forEach(a=>a.cancel());animations.clear();};
    function revealText(scramble) {
      const el=q(scramble?'.scramble-text':'.text-caret');
      const target=scramble?'PLATE READY':'今天的第一张版画印好了。';
      if(reduced){el.textContent=target;return;}
      const blocks='ABEFGKLMWX';
      const letters=[...target];
      let step=0;
      function tick(){
        const settled=scramble?Math.floor(step/3):step;
        el.textContent=scramble?letters.map((c,i)=>i<settled||c===' '?c:blocks[(i+step)%blocks.length]).join(''):letters.slice(0,settled).join('');
        if(settled<letters.length){step++;later(tick,scramble?35:65);}
      }
      tick();
    }
    function count() {
      const el=q('.counter-number');
      if(reduced){el.textContent='1,280';return}
      const start=performance.now();
      function tick(){const t=Math.min((performance.now()-start)/1600,1);el.textContent=Math.round(1280*(1-(1-t)**3)).toLocaleString('en-US');if(t<1)later(tick,16);}
      tick();
    }
    function repeat(){
      const disc=id===32, el=q(disc?'.loop-shape':'.marquee-track'), readout=q('.plate-readout');
      if(reduced){readout.textContent=disc?'已保留播放位置。':'开放时间已固定显示。';status(readout.textContent);return;}
      if(loop?.playState==='running'){loop.pause();readout.textContent='暂停';setLabel('继续');return;}
      if(loop)loop.play();
      else {
        const distance=disc?0:q('.marquee-group:nth-child(2)').offsetLeft-q('.marquee-group').offsetLeft;
        loop=motion(el,disc?[{transform:'rotate(0deg)'},{transform:'rotate(360deg)'}]:[{transform:'translateX(0)'},{transform:'translateX(-'+distance+'px)'}],{duration:disc?2800:10500,easing:'linear',iterations:Infinity});
      }
      setLabel('停止');readout.textContent='正在播放';
    }
    function cursor(x,y) {
      px=Math.max(.07,Math.min(.93,x));py=Math.max(.10,Math.min(.90,y));
      const p=q('.custom-pointer'), ink=px>.5;
      p.style.left=(px*100)+'%';p.style.top=(py*100)+'%';p.textContent=ink?'92%':'0%';p.classList.toggle('on-ink',ink);
      q('.cursor-area').setAttribute('aria-label','油墨密度 · '+(ink?'黑色印版 92%':'纸张 0%')+' · 按方向键移动');
    }
    function tilt(x,y) {
      px=Math.max(0,Math.min(1,x));py=Math.max(0,Math.min(1,y));
      const card=q('.tilt-card');
      card.style.setProperty('--glint',(20+px*68)+'%');
      card.style.transform=reduced?'none':'rotateX('+((.5-py)*20)+'deg) rotateY('+((px-.5)*24)+'deg)';
    }
    function scrollToStep(){
      const sc=q('.story-scroll'), max=sc.scrollHeight-sc.clientHeight;
      const n=Math.min(2,Math.floor(sc.scrollTop/Math.max(1,max)*3));
      sc.scrollTo({top:(n+1)%3*max/2,behavior:reduced?'instant':'smooth'});
    }
    function publishScroll(){
      const sc=q('.story-scroll'), p=sc.scrollTop/Math.max(1,sc.scrollHeight-sc.clientHeight), n=Math.min(2,Math.floor(p*3));
      q('.story-pin').dataset.phase=n;
      q('.story-step').textContent='0'+(n+1)+' / 03';q('.story-title').textContent=frames[n][0];q('.story-copy').textContent=frames[n][1];
      q('.story-progress').style.transform='scaleX('+p+')';
    }
    function gallery(direction=1){
      const sc=q('.horizontal-demo'), cards=qa('.horizontal-card');
      const index=cards.reduce((best,el,i)=>Math.abs(el.offsetLeft-cards[0].offsetLeft-sc.scrollLeft)<Math.abs(cards[best].offsetLeft-cards[0].offsetLeft-sc.scrollLeft)?i:best,0);
      const atRight=sc.scrollLeft>=sc.scrollWidth-sc.clientWidth-3;
      const next=direction>0&&atRight?0:direction<0&&index===0?cards.length-1:(index+direction+cards.length)%cards.length;
      sc.scrollTo({left:cards[next].offsetLeft-cards[0].offsetLeft,behavior:reduced?'instant':'smooth'});
    }
    function ticket(){
      const box=q('.confetti-area'), stamp=q('.ticket-stamp');
      stamp.hidden=false;q('[data-act="confetti"]').textContent='重新盖章';status('通行证已盖章。');
      qa('.confetti-piece').forEach(el=>el.remove());
      if(reduced)return;
      motion(stamp,[{opacity:0,transform:'rotate(-13deg) scale(1.35)'},{opacity:1,transform:'rotate(-7deg) scale(1)'}],{duration:380});
      for(let i=0;i<28;i++){
        const piece=root.ownerDocument.createElement('i');
        piece.className='confetti-piece';piece.style.background=['#c65039','#507061','#c9943c','#635e7d'][i%4];box.append(piece);
        const theta=i*2.39996, dx=Math.cos(theta)*(40+((i*17)%130)), rise=25+((i*23)%96);
        const a=motion(piece,[{transform:'translate(0,0)',opacity:1},{transform:'translate('+dx+'px,-'+rise+'px) rotate('+i*11+'deg)',opacity:1,offset:.42},{transform:'translate('+dx*1.3+'px,120px) rotate('+i*27+'deg)',opacity:0}],{duration:990+i*8,easing:'ease-out'});
        a.onfinish=()=>piece.remove();
      }
    }
    function play(){
      if(disposed)return;
      if(id===32||id===39){repeat();return;}
      resetTimers();cancelAnimations();
      status(guide[id].action);
      switch(id){
        case 25:motion(q('.moving-shape'),[{opacity:0},{opacity:1}],{duration:1500,easing:'ease-out'});break;
        case 26:motion(q('.moving-shape'),[{transform:'translateX(-68%) rotate(-32deg)'},{transform:'translateX(0) rotate(0deg)'}],{duration:1100});break;
        case 27:motion(q('.moving-shape'),[{transform:'rotate(-7deg) scale(.12)',opacity:.2},{transform:'rotate(-7deg) scale(1)',opacity:1}],{duration:1100});break;
        case 28:qa('.motion-ball').forEach((el,i)=>{const distance=el.parentElement.clientWidth-el.offsetWidth;el.style.transform='translateX('+distance+'px)';motion(el,[{transform:'translateX(0)'},{transform:'translateX('+distance+'px)'}],{duration:1900,easing:i?'cubic-bezier(0,.65,.2,1)':'linear'});});break;
        case 29:motion(q('.moving-shape'),[{transform:'translateX(-125px)'},{transform:'translateX(33px)',offset:.46},{transform:'translateX(-14px)',offset:.66},{transform:'translateX(6px)',offset:.83},{transform:'translateX(0)'}],{duration:1300,easing:'ease-out'});break;
        case 30:motion(q('.bounce-ball'),[{transform:'translateY(-95px)',easing:'ease-in'},{transform:'translateY(0)',offset:.35,easing:'ease-out'},{transform:'translateY(-53px)',offset:.55,easing:'ease-in'},{transform:'translateY(0)',offset:.72,easing:'ease-out'},{transform:'translateY(-14px)',offset:.84,easing:'ease-in'},{transform:'translateY(0)'}],{duration:1350});break;
        case 31:qa('.duration-fill').forEach((el,i)=>motion(el,[{transform:'scaleX(0)'},{transform:'scaleX(1)'}],{duration:i===1?1600:600,delay:i===2?1000:0,fill:'backwards',easing:'linear'}));break;
        case 33:revealText(false);break;
        case 34:revealText(true);break;
        case 35:qa('.split-words span').forEach((el,i)=>motion(el,[{opacity:0,transform:'translateY(.65em) rotate(4deg)'},{opacity:1,transform:'translateY(0)'}],{delay:i*200,duration:750,fill:'backwards'}));break;
        case 36:count();break;
        case 37:{const path=q('.line-svg path'), length=path.getTotalLength();path.style.strokeDasharray=length;motion(path,[{strokeDashoffset:length},{strokeDashoffset:0}],{duration:2200,easing:'ease-in-out'});break;}
        case 38:morph=!morph;q('.morph-shape').classList.toggle('morphed',morph);q('.die-state').textContent=morph?'拱形边角':'直角';break;
        case 40:{const dot=q('.path-dot'),path=q('.path-area path'),length=path.getTotalLength(),size=q('.path-area').getBoundingClientRect();
          const points=Array.from({length:61},(_,i)=>{const p=path.getPointAtLength(i/60*length);return {transform:'translate('+((p.x/360)*size.width-dot.offsetWidth/2)+'px,'+((p.y/180)*size.height-dot.offsetHeight/2)+'px)'};});
          dot.style.transform=points[60].transform;motion(dot,points,{duration:1850,easing:'linear'});break;}
        case 41:turn=(turn+1)%3;q('.page-demo').innerHTML=paperPage(turn);motion(q('.page-demo'),[{opacity:.45,transform:'translateY(18px)'},{opacity:1,transform:'translateY(0)'}],{duration:480});break;
        case 42:{const image=q('.shared-art'),before=image.getBoundingClientRect(),open=q('.shared-view').classList.toggle('expanded');
          q('.shared-list').setAttribute('aria-expanded',String(open));q('.shared-note').textContent=open?'纸环 · 收起 ↙':'查看作品 ↗';
          const after=image.getBoundingClientRect();
          motion(image,[{transform:'translate('+(before.left-after.left)+'px,'+(before.top-after.top)+'px) scale('+(before.width/after.width)+','+(before.height/after.height)+')'},{transform:'none'}],{duration:600});break;}
        case 43:scrollToStep();break;
        case 44:gallery();break;
        case 45:{
          turn=(turn+1)%3;
          const color=['#BD4B32','#384F6B','#527058'][turn],button=q('.magnet-button');
          button.querySelector('span').textContent=inks[turn];button.querySelector('i').style.background=color;q('.ink-code').textContent=color;
          if(touchProfile())motion(button,[{transform:'scale(.96)'},{transform:'scale(1)'}],{duration:160});
          else motion(button,[{transform:'translateX(0)'},{transform:'translateX(19px)',offset:.45},{transform:'translateX(0)'}],{duration:480});
          break;
        }
        case 46:cursor(px<.5?.77:.24,py);break;
        case 47:tilt(++turn%2?.86:.17,.22);break;
        case 48:ticket();break;
      }
    }
    const inside=q('[data-act]');
    if(inside)on(inside,'click',play);
    if(id===43){on(q('.story-scroll'),'scroll',publishScroll,{passive:true});publishScroll();}
    if(id===44)on(q('.horizontal-demo'),'keydown',e=>{if(['ArrowRight','ArrowLeft'].includes(e.key)){e.preventDefault();gallery(e.key==='ArrowRight'?1:-1)}});
    if([45,46,47].includes(id)){
      const area=q(id===45?'.magnet-area':id===46?'.cursor-area':'.tilt-area');
      function handle(x,y){
        if(id===45){if(!reduced)q('.magnet-button').style.transform='translate('+((x-.5)*32)+'px,'+((y-.5)*27)+'px)';}
        else if(id===46)cursor(x,y);else tilt(x,y);
      }
      const point=e=>{
        if(touchProfile()){
          if(id===45 || (e.type==='pointermove'&&!e.buttons))return;
          if(e.type==='pointerdown'&&e.isPrimary)area.setPointerCapture(e.pointerId);
        }
        const r=area.getBoundingClientRect();
        handle((e.clientX-r.left)/r.width,(e.clientY-r.top)/r.height);
      };
      on(area,'pointermove',point);on(area,'pointerdown',point);
      on(area,'pointerleave',()=>{if(id!==46&&!touchProfile())handle(.5,.5)});
      if(id===47)on(area,'lostpointercapture',()=>{if(touchProfile())tilt(.5,.5);});
      if(id===46||id===47){
        if(id===46)cursor(px,py);else tilt(.5,.5);
        on(area,'keydown',e=>{const dir={ArrowLeft:[-.12,0],ArrowRight:[.12,0],ArrowUp:[0,-.12],ArrowDown:[0,.12]}[e.key];if(dir){e.preventDefault();handle(px+dir[0],py+dir[1]);}});
      }
    }
    if(id===40){
      const path=q('.path-area path'),dot=q('.path-dot'),p=path.getPointAtLength(0),area=q('.path-area');
      dot.style.transform='translate('+(p.x*area.clientWidth/360-dot.offsetWidth/2)+'px,'+(p.y*area.clientHeight/180-dot.offsetHeight/2)+'px)';
    }
    setLabel(guide[id].action);
    return {play,dispose(){disposed=true;abort.abort();resetTimers();cancelAnimations();}};
  }
  window.motionPlates={render,player,guide};
})();
</script><script>const id=37, stage=document.querySelector("#stage"), play=document.querySelector("#playDemo"), status=document.querySelector("#sampleStatus"),m=matchMedia("(prefers-reduced-motion: reduce)");let view;function mount(){view?.dispose();status.textContent="";play.textContent="绘制山脊";const options={reduced:m.matches,status:text=>{status.textContent=text},playButton:play};stage.replaceChildren();motionPlates.render(id,stage,{paperImage:window.MotionFoundationMedia["media/paper-loop.webp"]});view=motionPlates.player(id,stage,options);}mount();play.addEventListener("click",()=>view.play());document.querySelector("#reset").addEventListener("click",mount);m.addEventListener("change",mount);</script></body></html>
```
