# Line Drawing

A pen plotter traces the outline of a ridge in a single stroke.

## Try it

Start the plotter and follow the line across the page.

## Interaction details

Use the full SVG path length and animate its stroke offset to zero over 2.2 seconds.

## Where to use it

Showing how a contour, route, or logo is drawn.

## Implementation prompt

> Reveal the outline progressively along the path.

## Standalone HTML

Save the code below as an HTML file and open it in your browser. The example works offline.

```html
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Line Drawing · 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>Line Drawing</h1></header><div id="stage"></div><footer class="sample-tools"><p>Watch the plotter trace a ridge in one stroke.</p><button id="playDemo">Draw ridge</button><button id="reset">Restart</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 = [
    ['Mask', 'Place the drawing on the masked plate.', 'black'],
    ['Expose', 'Light transfers the pattern to the plate.', 'red'],
    ['Develop', 'The image appears where ink flows through.', 'blue']
  ];
  const titles = ['Ripples','Between Lines','Overprint','Afterglow'];
  const inks = ['Coral','Deep blue','Pine green'];
  const paperPage = (i) => '<div class="plate-proof">' + coverArt(['tide','arc','fold'][i]) + '</div><div class="plate-page-copy"><small>Print sample ' + String(i+1).padStart(2,'0') + '</small><h3>' + ['First Wave','Slice of Noon','Folded Ridge'][i] + '</h3><p>' + ['A repeated line traces the water’s surface.','Two inks divide a circular shape.','The folds of a paper ridge traced in ink.'][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="Overlapping surfaces of a red paper loop"></div><figcaption>' + heading('Contact print','The Paper Surface') + '</figcaption></figure>';
      case 26: return '<div class="plate-sleeve">' + headline('Record shelf','Notes on Rotation') + '<div class="animation-ground sleeve-slot"><div class="moving-shape sleeve-record" role="img" aria-label="A record sliding out of its sleeve"><i></i></div><div class="sleeve-pocket">' + coverArt('arc') + '<span>33⅓ RPM</span></div></div></div>';
      case 27: return '<div class="plate-proofsheet">' + heading('Proof sheet','Final review') + '<div class="animation-ground"><div class="proof-lines" aria-hidden="true"></div><div class="moving-shape proof-seal"><span>校了</span><small>Approved</small></div></div>' + heading('Press check','Ink · density · registration') + '</div>';
      case 28: return '<div class="plate-ledger">' + headline('Film transport speed','Two tracks of equal length') + ['Constant speed','Ease out'].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="A ball moving toward its target"></div><span class="spring-target" aria-hidden="true"></span><span class="motion-label">Rest position</span></div></div>';
      case 30: return '<div class="plate-letterpress">' + headline('Type specimen','A piece of type landing on the baseline') + '<div class="bounce-ground"><span class="bounce-ball">g</span></div>' + heading('Roman lowercase','Baseline') + '</div>';
      case 31: return '<div class="plate-ledger">' + headline('Print timing','Three inks, three arrival times') + ['Black　600 ms','Coral　1,600 ms','Teal　1 s delay'].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('Record player','Turntable')+'<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">Stopped</p></div>';
      case 33: return '<div class="plate-letter">'+heading('Studio letter','From · The print studio')+'<h3 class="type-text"><span class="text-caret">The first print of the day is ready.</span></h3><div class="letter-address">To　The archive</div></div>';
      case 34: return '<div class="plate-signal">'+headline('Typesetter status','Type check')+'<div class="scramble-text" aria-label="PLATE READY">PLATE READY</div>'+heading('English type specimen','11 characters')+'</div>';
      case 35: return '<div class="plate-poem">'+heading('Layout proof','Poem in three lines')+'<h3 class="split-words">'+['Light','lingers','on paper'].map(v=>'<span>'+v+'</span>').join('')+'</h3></div>';
      case 36: return '<div class="scene-center plate-count"><span class="mini-label">Jobs completed this month</span><div><strong class="counter-number">1,280</strong><span> jobs</span></div><p>Sample data</p></div>';
      case 37: return '<div class="scene-center plate-contour">'+heading('Pen plotter','Ridge Study')+'<svg class="line-svg" viewBox="0 0 360 140" role="img" aria-label="A ridge drawn by a pen"><path d="'+pathD+'" fill="none"/></svg>'+heading('Single-line drawing','Ink on paper')+'</div>';
      case 38: return '<div class="scene-center plate-die">'+headline('Trim sample','Bookmark corners')+'<div class="morph-shape"><i>冊</i></div><p class="die-state">Square corners</p>'+button('morph','Change trim')+'</div>';
      case 39: return '<div class="scene-center plate-hours">'+headline('Exhibition hours','The Night Print Studio')+'<div class="marquee-window"><div class="marquee-track">'+[0,1].map((_,i)=>'<div class="marquee-group" '+(i?'aria-hidden="true"':'')+'><span>Thu–Sun　14:00–21:00</span><i>✳</i><span>Last entry　20:30</span><i>✳</i></div>').join('')+'</div><p class="plate-readout">Stopped</p></div>';
      case 40: return '<div class="plate-map">'+heading('Studio transport route','Paper stock → Packing')+'<div class="path-area"><svg viewBox="0 0 360 180" preserveAspectRatio="none" aria-label="A curved route from storage to the packing room"><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('Paper trolley','Arrived at packing')+'</div>';
      case 41: return '<div class="mini-window plate-page"><div class="page-demo">'+paperPage(0)+'</div>'+button('page','Next print →')+'</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="A twisted strip of red paper"><span class="shared-copy"><small>Sculpture record</small><strong>Folded Surfaces</strong><span class="shared-note">View works ↗</span></span></button></div></div>';
      case 43: return '<div class="story-scroll" tabindex="0" aria-label="Three printmaking stages. Scroll down."><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">Mask</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="Four prints in a line. Move horizontally.">'+titles.map((t,i)=>'<article class="horizontal-card">'+coverArt(['tide','arc','fold','rings'][i])+'<div>'+heading('Series 0'+(i+1),t)+'</div></article>').join('')+'</div>';
      case 45: return '<div class="plate-ink">'+headline('Ink swatches','Next ink color')+'<div class="magnet-area"><button type="button" data-act="magnet" class="magnet-button"><i aria-hidden="true"></i><span>Coral</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="Explore the color separation using the arrow keys or pointer"><div class="cursor-halves"><span>Paper</span><span>Black plate</span></div><h3>Ink density</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="Exhibition pass. Tilt with the arrow keys."><small>Print studio open day</small><strong>Press<br>Pass.</strong><small>Exhibition pass</small></div></div>';
      case 48: return '<div class="confetti-area"><article class="admit-ticket">'+heading('Print Studio Open House','ADMIT ONE')+'<h3>Admission check</h3><span class="ticket-stamp" hidden>Admitted</span><div class="ticket-perf" aria-hidden="true"></div>'+button('confetti','Stamp pass')+'</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 = [
    ['Gradually reveal the photograph of a red paper loop.','Introduce a photo or a new print design in place.','Reveal photograph'],
    ['Slide a record out from the edge of its sleeve.','Reveal an item tucked behind a card.','Slide out record'],
    ['Watch the small proof stamp grow into an approval mark.','Emphasize a confirmed state or selection.','Stamp proof'],
    ['Compare constant speed and deceleration over the same distance.','Choose the easing for a list movement or section transition.','Compare tracks'],
    ['Watch the ball pass its target, spring back, and settle.','Give buttons and handles a physical response when released.','Release spring'],
    ['Drop a piece of type onto the baseline and let it bounce twice before settling.','Give new items a sense of landing in place.','Drop type'],
    ['Compare start and finish times across three inks.','Coordinate the arrival of several layers.','Play three plates'],
    ['Start the record spinning and use the same button to pause.','Use a looping motion to show a continuing process.','Spin record'],
    ['Type a single line of a letter, one character at a time.','Present a short message from the artist in sequence.','Type letter'],
    ['Watch the scattered type resolve into a phrase from left to right.','Draw attention to the final title as it resolves.','Set type'],
    ['Reveal the poem one line at a time.','Set a reading rhythm for a short title or quotation.','Play poem'],
    ['Count up to the monthly number of completed jobs.','Show a new value in a summary metric.','Play count'],
    ['Watch the plotter trace a ridge in one stroke.','Show how a drawing, logo, or route takes shape.','Draw ridge'],
    ['Change the trim to compare square and arched bookmarks.','Show a selected option through a change in shape.','Change trim'],
    ['Start and stop the scrolling exhibition hours.','Repeat a short announcement on a narrow display.','Play announcement'],
    ['Follow the trolley along a curved route through the print studio.','Illustrate a route on a map or an ordered workflow.','Start trolley'],
    ['Select the next sample to switch to another print.','Move between equivalent pages in a portfolio.','Next print'],
    ['Select the work to follow its photo from the thumbnail into the detail view.','Keep the selected work visually connected to its detail view.','View works'],
    ['Scroll down or move to the next step to see how the plate changes.','Add successive explanations to a fixed visual.','Next step'],
    ['Browse the series horizontally or use the arrow keys inside the list.','Explore a series of works in one row.','Next work'],
    ['Move the pointer around the ink swatch or press the button to see its next color.','Guide an approaching pointer toward a small button.','Next ink color'],
    ['Move across the paper and ink, or use the arrow keys to check their density.','Show the current tool state through the pointer as its target changes.','Measure other surface'],
    ['Move the pointer or use the arrow keys to change the viewing angle.','Inspect the surface and depth of a card.','Tilt pass'],
    ['Stamp the pass to confirm admission and scatter confetti.','Mark completion, such as registration or an application submission.','Stamp pass']
  ];
  for (let i=0;i<labels.length;i++) {
    const [instruction,use,action]=labels[i];
    guide[i+25]={instruction,use,action};
  }
  guide[36].spec='Show 1,280 jobs on initial load and reset. Play starts at zero and runs for 1.6 seconds, moving quickly at first and easing out. Round to whole numbers with comma separators. Set the number in Georgia at 65–150 px according to viewport width, keeping the unit on the same line. Allow restarting mid-play and show the final value immediately with reduced motion.';
  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':'The first print of the day is 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?'Playback position held.':'Exhibition hours pinned.';status(readout.textContent);return;}
      if(loop?.playState==='running'){loop.pause();readout.textContent='Pause';setLabel('Resume');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('Stop');readout.textContent='Playing';
    }
    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 density · '+(ink?'Black plate 92%':'Paper 0%')+' · Move with arrow keys');
    }
    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='Stamp again';status('Pass stamped.');
      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?'Arched corners':'Square corners';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?'Paper Loop · Collapse ↙':'View works ↗';
          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="Draw ridge";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>
```
