Skip to content

nexu-io/open-design / plugins/_official/examples/motion-kinetic-motion-designer

motion-kinetic-motion-designer

Verified

FileKindSize
SKILL.mdskill md7.1 KB
assets/Anton-400.ttfbinary166.8 KB
assets/Anton-OFL.txtmarkdown4.4 KB
assets/Caveat-400.ttfbinary394.2 KB
assets/Caveat-OFL.txtmarkdown4.3 KB
assets/cover.jpgbinary121.0 KB
assets/gsap.min.jsscript70.5 KB
assets/soundtrack.mp3binary354.6 KB
example.htmlother16.7 KB
open-design.jsonconfig12.0 KB
references/sound.jsonconfig892 B

example.html

View on GitHub
<!doctype html><html lang="en" data-composition-variables='[{"id": "name", "type": "string", "label": "\u8bbe\u8ba1\u5e08\u59d3\u540d", "default": "CLAUDE", "maxLength": 12}, {"id": "role", "type": "string", "label": "\u804c\u4e1a", "default": "MOTION DESIGNER", "maxLength": 22}, {"id": "headline", "type": "string", "label": "\u4e3b\u6807\u9898", "default": "I MAKE THINGS", "maxLength": 20}, {"id": "verb", "type": "string", "label": "\u52a8\u6548\u5927\u5b57", "default": "MOVE", "maxLength": 8}, {"id": "availability", "type": "string", "label": "\u8054\u7cfb\u77ed\u53e5", "default": "open to new projects", "maxLength": 28}, {"id": "primary", "type": "color", "label": "\u5f3a\u8c03\u8272", "default": "#2f7df6"}]'><head><meta charset="utf-8"><meta name="od-motion-output" content="video"><style>
@font-face{font-family:Anton;src:url(assets/Anton-400.ttf);font-weight:400}
@font-face{font-family:Caveat;src:url(assets/Caveat-400.ttf);font-weight:400 700}
:root{--od-font-heading:"Anton","Noto Sans SC","PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;--od-font-body:"Caveat","Noto Sans SC","PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif}
*{box-sizing:border-box}body{margin:0;background:#191b1e;font-family:var(--od-font-body);display:grid;place-items:center;height:100vh}.od-heading{font-family:var(--od-font-heading)}#main{width:min(100vw,177.777vh);aspect-ratio:16/9;position:relative}canvas{width:100%;height:100%;display:block}#controls{position:fixed;bottom:8px;display:flex;gap:12px;align-items:center;background:#ffffffdd;padding:8px;opacity:0}#controls:hover{opacity:1}#controls input{width:300px}html.od-export #controls{display:none}html.od-export body{display:block}html.od-export #main{width:1920px;height:1080px}
</style><style data-od-font-synthesis>html{font-synthesis:none}</style>
<style data-od-preview-chrome>
#controls{position:fixed;left:50%;bottom:14px;transform:translateX(-50%);z-index:100;display:flex;align-items:center;gap:14px;width:min(900px,92vw);box-sizing:border-box;padding:12px 18px;border-radius:14px;background:#101214dd;color:#fff;font:600 13px ui-monospace,Menlo,monospace;opacity:0;transition:opacity .2s}
#controls:hover,#controls:focus-within{opacity:1}
#controls button{font:inherit;letter-spacing:.06em;background:var(--accent,#3b6cf6);color:#fff;border:0;border-radius:999px;padding:9px 16px;cursor:pointer;min-width:88px;white-space:nowrap}
#controls input[type=range]{flex:1;width:auto;min-width:0;accent-color:var(--accent,#3b6cf6)}
#controls span,#controls output{white-space:nowrap;font-variant-numeric:tabular-nums}
html.od-export #controls{display:none!important}
</style>
</head><body><div id="main" data-composition-id="main" data-od-motion-layout="stage" data-start="0" data-duration="15.061333" data-width="1920" data-height="1080">
<audio id="soundtrack" src="assets/soundtrack.mp3" data-start="0" data-duration="15.061" data-track-index="2" data-volume="1" preload="auto"></audio><canvas id="film" width="1920" height="1080" data-od-id="motion-film"></canvas></div><div id="controls"><button>PLAY</button><input type="range" min="0" step="0.01"><span></span></div><script src="assets/gsap.min.js"></script><script>
const VARS=(window.__hyperframes && window.__hyperframes.getVariables?.())||{};
const CFG = {"duration": 15.061333, "scenes": [{"id": "spacing", "name": "\u5f39\u8df3\u4e0e\u95f4\u8ddd", "dur": 1.9, "minDur": 1.9, "maxDur": 2.8}, {"id": "type", "name": "\u9519\u5cf0\u6587\u5b57", "dur": 1.85, "minDur": 1.85, "maxDur": 2.8}, {"id": "actions", "name": "\u62c9\u4f38\u65cb\u8f6c\u5438\u9644", "dur": 1.8, "minDur": 1.8, "maxDur": 1.8}, {"id": "easing", "name": "\u7f13\u52a8\u66f2\u7ebf", "dur": 2.9, "minDur": 2.9, "maxDur": 4.3}, {"id": "follow", "name": "\u7c92\u5b50\u8ddf\u968f", "dur": 2.55, "minDur": 2.55, "maxDur": 3.8}, {"id": "anticipation", "name": "\u9884\u5907\u52a8\u4f5c", "dur": 2.15, "minDur": 2.15, "maxDur": 3.2}, {"id": "hello", "name": "\u8bbe\u8ba1\u5e08\u540d\u7247", "dur": 1.911333, "minDur": 1.911333, "maxDur": 3}], "cues": [{"id": "ball-land", "scene": "spacing", "at": 0.65}, {"id": "type-enter", "scene": "type", "at": 0.0}, {"id": "bounce", "scene": "actions", "at": 0}, {"id": "spin", "scene": "actions", "at": 0.98}, {"id": "stretch", "scene": "actions", "at": 0.48}, {"id": "snap", "scene": "actions", "at": 1.4}, {"id": "curve", "scene": "easing", "at": 1.1}, {"id": "follow-enter", "scene": "follow", "at": 0}, {"id": "ring-enter", "scene": "anticipation", "at": 0}, {"id": "hello-enter", "scene": "hello", "at": 0}, {"id": "spacing-out", "scene": "spacing", "at": 0, "from": "end"}, {"id": "type-out", "scene": "type", "at": 0, "from": "end"}, {"id": "actions-out", "scene": "actions", "at": 0, "from": "end"}, {"id": "easing-out", "scene": "easing", "at": 0, "from": "end"}, {"id": "follow-out", "scene": "follow", "at": 0, "from": "end"}, {"id": "anticipation-out", "scene": "anticipation", "at": 0, "from": "end"}, {"id": "hello-out", "scene": "hello", "at": 0, "from": "end"}], "name": "CLAUDE", "role": "MOTION DESIGNER", "headline": "I MAKE THINGS", "verb": "MOVE", "availability": "open to new projects", "primary": "#2f7df6"};
Object.assign(CFG,VARS);
const SCENE_START={};CFG.scenes.reduce((t,s)=>(SCENE_START[s.id]=t,t+s.dur),0);
const cueTime=id=>{const c=CFG.cues.find(c=>c.id===id),s=CFG.scenes.find(s=>s.id===c.scene);return SCENE_START[c.scene]+(c.from==='end'?s.dur-c.at:c.at)};
const cv=document.querySelector('canvas'),ctx=cv.getContext('2d'),style=getComputedStyle(document.documentElement),heading=style.getPropertyValue('--od-font-heading'),body=style.getPropertyValue('--od-font-body');
const ink='#191b1e',blue=CFG.primary,red='#ff304e';
const clamp=x=>Math.max(0,Math.min(1,x)),smooth=x=>{x=clamp(x);return x*x*(3-2*x)},out=x=>1-Math.pow(1-clamp(x),3);
function line(x,y,X,Y,c,w=2){ctx.beginPath();ctx.strokeStyle=c;ctx.lineWidth=w;ctx.moveTo(x,y);ctx.lineTo(X,Y);ctx.stroke()}
function dot(x,y,r,c){ctx.beginPath();ctx.fillStyle=c;ctx.arc(x,y,r,0,Math.PI*2);ctx.fill()}
function circle(x,y,r,c,w=2){ctx.beginPath();ctx.strokeStyle=c;ctx.lineWidth=w;ctx.arc(x,y,r,0,Math.PI*2);ctx.stroke()}
function txt(s,x,y,size,c=ink,f=heading,weight=400){ctx.fillStyle=c;ctx.font=weight+' '+size+'px '+f;ctx.fillText(s,x,y)}
function fit(s,x,y,w,h,c=ink){ctx.save();ctx.font='400 100px '+heading;const m=ctx.measureText(s);ctx.translate(x,y);ctx.scale(w/m.width,h/100);ctx.fillStyle=c;ctx.fillText(s,0,0);ctx.restore()}
function diamond(x,y,r,c){ctx.save();ctx.translate(x,y);ctx.rotate(Math.PI/4);ctx.fillStyle=c;ctx.fillRect(-r,-r,r*2,r*2);ctx.restore()}
function arrow(s,x,y,X,Y,c=blue){txt(s,x,y,48,c,body,700);ctx.strokeStyle=c;ctx.lineWidth=4;ctx.beginPath();ctx.moveTo(x+10,y+12);ctx.quadraticCurveTo((x+X)/2,y+40,X,Y);ctx.stroke();line(X,Y,X+17,Y-8,c,4);line(X,Y,X+13,Y+13,c,4)}
function bg(dark,t){ctx.fillStyle=dark?ink:'#eeeef0';ctx.fillRect(0,0,1920,1080);let g=ctx.createRadialGradient(960,530,200,960,530,1200);g.addColorStop(0,dark?'#23252a00':'#ffffff65');g.addColorStop(1,dark?'#00000035':'#00000020');ctx.fillStyle=g;ctx.fillRect(0,0,1920,1080);for(let y=30;y<1080;y+=48)for(let x=24;x<1920;x+=48)dot(x,y,1.5+(Math.sin(t*2+x*.03+y)*.25),dark?'#ffffff0b':'#181b1e0c')}
function hud(t,dark,id){const c=dark?'#aaa9':'#5559';txt('00:00:'+String(Math.floor(t)).padStart(2,'0')+':'+String(Math.floor(t%1*30)).padStart(2,'0'),1700,70,28,c);line(80,1030,1840,1030,c,2);for(let x=80;x<1841;x+=55)line(x,1038,x,1044,c,1);for(let x of [80,300,740,1070,1400,1620]){ctx.save();ctx.translate(x,1030);ctx.rotate(Math.PI/4);ctx.strokeStyle=c;ctx.strokeRect(-6,-6,12,12);ctx.restore()}const x=80+1760*t/CFG.duration;line(x,1014,x,1040,dark?'#eee':'#222',2);diamond(x,1013,4,dark?'#eee':'#222');txt({spacing:'spacing',type:'type',actions:'type',easing:'easing',follow:'follow-through',anticipation:'anticipation',hello:'hello'}[id],Math.min(x+10,1710),1008,30,c,body,700)}
function bounce(u){const x=170+u*670;const y=820-Math.abs(Math.cos(u*Math.PI*2.2))*Math.max(40,650*Math.exp(-u*1.2));return [x,y]}
function spacing(t){const u=t-SCENE_START.spacing;line(140,820,1780,820,'#666',3);for(let j=0;j<24;j++){const z=Math.max(0,u-j*.028);let [x,y]=bounce(z);circle(x,y,44,blue+'32',2)}let [x,y]=bounce(u);ctx.save();ctx.translate(x,y);ctx.rotate(-.3);ctx.scale(1,1.12);dot(0,0,45,blue);ctx.restore();if(t>cueTime('ball-land')){arrow('slow in, slow out',420,230,610,330);arrow('squash!',790,925,760,832,red);arrow('stretch',1510,500,1460,610)} }
function letterLine(s,x,y,w,h,u,delay,c=ink,below=false){ctx.font='400 100px '+heading;const total=ctx.measureText(s).width;let xx=x;for(let k=0;k<s.length;k++){const cw=ctx.measureText(s[k]).width*w/total;const a=out((u-k*delay)/.42);ctx.save();ctx.translate(xx,y+(1-a)*(below?550:-260+70*(k%3)));ctx.rotate((1-a)*(-.4+.16*k));ctx.globalAlpha=a;fit(s[k],0,0,cw,h,c);ctx.restore();xx+=cw}}
function typography(t){let u=t-cueTime('type-enter');
// Late overlap is a second physical landing, not a settled title hold.
const land=Math.exp(-Math.pow((u-1.56)/.17,2)),wob=7*Math.sin(u*9)*Math.exp(-Math.max(0,u-.6)*1.1);
letterLine(CFG.headline,400,360,1110,210,u,.045);letterLine(CFG.verb,400,790+wob+30*land,990,470+22*land,u-.04,.025,ink,true);
ctx.save();ctx.translate(1473,770+14*land+wob);ctx.scale(1+.45*land,1-.40*land);dot(0,0,48,blue);ctx.restore();
if(u>.45){ctx.beginPath();ctx.strokeStyle=blue;ctx.lineWidth=9;ctx.moveTo(390,866);ctx.quadraticCurveTo(920,846+Math.sin(u*8)*7,1430,858);ctx.stroke();arrow('stagger: 45ms',1550,385,1330,390);if(u>1.05)arrow('overlap',1500,944,1475,830)}}
function actions(t){const a=t-cueTime('stretch'),b=t-cueTime('spin'),c=t-cueTime('snap'),bounceT=t-cueTime('bounce');let word=a<0?'BOUNCE':'STRETCH',color=blue;let sx=1,sy=1,rot=0;if(a<0){color='#eeeef0';sx=1.35;sy=1;txt('gravity-ish',1410,810,48,'#a4c5ff',body,700)}if(b>=0){word='SPIN';color='#eeeeef';rot=Math.sin(b*10)*Math.exp(-b*1.7)*1.5;sx=Math.cos(b*11)}else if(a>=0){sx=1.25+.1*Math.sin(a*15);sy=1.2}if(c>=0){word='SNAP';color=red;sx=1;rot=0;line(510,310,1410,310,red+'77');line(510,720,1410,720,red+'77');line(510,0,510,1080,red+'66');line(1410,0,1410,1080,red+'66')}if(a<0){const word='BOUNCE';ctx.font='400 100px '+heading;const total=ctx.measureText(word).width;let x=310;for(let k=0;k<word.length;k++){const w=ctx.measureText(word[k]).width*1300/total,z=bounceT-k*.045,p=clamp(z/.24),drop=-850*Math.pow(1-p,2)+60*Math.sin(p*Math.PI*2)*Math.exp(-p*2);if(z>=0){for(let j=5;j>=0;j--){ctx.save();ctx.globalAlpha=j? .10:1;fit(word[k],x,720+drop-j*22*(1-p),w,470,'#eeeeef');ctx.restore()}}x+=w}return}ctx.save();ctx.translate(960,720);ctx.rotate(rot);ctx.scale(sx,sy);fit(word,-450,0,900,470,color);ctx.restore()}
function easing(t){const u=t-SCENE_START.easing;const easeOn=t>=cueTime('curve');let a=out(u/.5);ctx.save();ctx.globalAlpha=a;line(180,190,180,630,ink,3);line(180,630,860,630,ink,3);for(let x=218;x<=822;x+=151)line(x,228,x,592,'#d7d9dd',1);for(let y=228;y<=592;y+=91)line(218,y,822,y,'#d7d9dd',1);txt('position',195,210,40,'#666',body,700);txt('time',790,674,35,'#666',body,700);ctx.beginPath();ctx.strokeStyle=blue;ctx.lineWidth=5;ctx.moveTo(218,592);if(easeOn)ctx.bezierCurveTo(650,592,390,228,822,228);else ctx.lineTo(822,228);ctx.stroke();diamond(218,592,10,ink);diamond(822,228,10,ink);arrow('linear = robotic',950,330,610,356,red);if(easeOn){const reveal=smooth((t-cueTime('curve')-.12)/.32);line(950,337,1300,315,red,5);ctx.save();ctx.globalAlpha=reveal;txt('ease in-out ✓',950,485,54,blue,body,700);ctx.restore();line(218,592,600,560,'#99999955',5);line(822,228,440,260,'#99999955',5);dot(440,260,9,red);dot(600,560,9,red)}else{dot(420,470,9,red);dot(620,350,9,red)}const q=easeOn?((t-cueTime('curve'))/1.7)%1:clamp((u-.35)/.75);let pos=easeOn?smooth(q):q;line(218+q*604,220,218+q*604,604,blue+'22',10);line(210,872,1705,872,ink,3);for(let j=0;j<12;j++){let z=j/11;let xx=255+z*1340;ctx.strokeStyle=easeOn?blue+'77':red+'44';ctx.lineWidth=2;ctx.beginPath();ctx.roundRect(xx,770,100,100,12);ctx.stroke()}ctx.fillStyle=ink;ctx.beginPath();ctx.roundRect(255+pos*1340,790,85,82,10);ctx.fill();if(u>2)arrow('spacing!',1570,690,1620,772);ctx.restore()}
function path(u){const phase=(u-.5)*Math.PI;return [960-620*Math.sin(phase),520-250*Math.sin(phase*2)]}
function follow(t){const u=t-cueTime('follow-enter'),turn=smooth((u-2.12)/.43),angle=-turn*.48;let [px,py]=path(u);
ctx.save();ctx.translate(960,520);ctx.rotate(angle);ctx.translate(-960,-520);
// A faint figure-eight guide carries the trajectory through the dark field.
ctx.beginPath();ctx.strokeStyle='#a4c5ff20';ctx.lineWidth=2;for(let j=0;j<=180;j++){const [x,y]=path(j/90);j?ctx.lineTo(x,y):ctx.moveTo(x,y)}ctx.stroke();
for(let y=-96;y<1200;y+=60)for(let x=-120;x<2040;x+=60){const dx=x-px,dy=y-py,d=Math.hypot(dx,dy),influence=Math.exp(-d*d/230000);const wave=Math.sin(x*.006+y*.004-u*4);const field=.32+.68*influence,xx=x+Math.sin(u*3+y*.009)*field*46, yy=y+wave*field*56;const hot=d<180;ctx.save();ctx.translate(xx,yy);ctx.rotate(angle+wave*turn*.8);ctx.scale(1+turn*1.8,1);dot(0,0,hot?7:3.2+influence*2,hot?'#ff304eaa':d<600?'#739dff88':'#b4c4e54a');ctx.restore()}
// Separated, fading beads describe velocity and lag rather than a solid stroke.
for(let j=32;j>=0;j--){const [x,y]=path(u-j*.014);const alpha=Math.round(235*Math.pow(1-j/34,1.6));ctx.save();ctx.shadowColor=blue;ctx.shadowBlur=12*(1-j/34);dot(x,y,3+15*(1-j/33),blue+alpha.toString(16).padStart(2,'0'));ctx.restore();if(j<7)dot(x-8,y+3,12-j,blue+'28')}
for(let j=0;j<9;j++){const a=u*2+j*Math.PI*2/9,r=115+18*Math.sin(j+u*5);dot(px+Math.cos(a)*r,py+Math.sin(a)*r,7,red+'99')}
ctx.restore();if(turn<.8)arrow('follow-through',1190,800,1130,685,'#a4c5ff');}
function anticipation(t){let u=t-cueTime('ring-enter'),q=clamp((u-.15)/1.7),r=300*out(u/.6);circle(960,520,r,'#ffffff28',3);ctx.beginPath();ctx.strokeStyle='#eeeef1';ctx.lineWidth=5;ctx.arc(960,520,r,-Math.PI/2,-Math.PI/2+q*Math.PI*2);ctx.stroke();for(let j=0;j<80;j++){let a=j*Math.PI/40;line(960+Math.cos(a)*132,520+Math.sin(a)*132,960+Math.cos(a)*(j%5?146:155),520+Math.sin(a)*(j%5?146:155),'#aaa6',4)}for(let j=0;j<14;j++){let a=j*Math.PI/7-Math.PI/2+u*.13;ctx.save();ctx.translate(960+Math.cos(a)*218,520+Math.sin(a)*218);ctx.rotate(a);ctx.fillStyle=blue;ctx.strokeStyle='#aaa8';ctx.lineWidth=2;if(j/14<q)ctx.fillRect(-9,-9,18,18);else ctx.strokeRect(-9,-9,18,18);ctx.restore()}dot(960+Math.sin(u*4)*6,520,46+Math.sin(u*5)*2,blue);txt(Math.round(q*100)+'%',910,898,46,'#eee');if(q>.7)arrow('anticipation',1190,360,1030,500,'#a4c5ff')}
function hello(t){let u=t-cueTime('hello-enter'),a=out(u/.5);ctx.save();ctx.translate(960,540);ctx.scale(.9+.1*a,.9+.1*a);ctx.translate(-960,-540);letterLine(CFG.role,370,390,1180,180,u,.025);letterLine(CFG.name,370,760+Math.sin(t*2)*4,1080,370,u-.04,.025,ink,true);ctx.save();ctx.translate(1510,732+Math.sin(t*4)*8);ctx.scale(1+.16*Math.sin(t*4),1-.16*Math.sin(t*4));dot(0,0,42,blue);ctx.restore();if(u>.5)arrow(CFG.availability,1030,900,1530,790);ctx.restore()}
function render(t){t=Math.max(0,Math.min(CFG.duration,t));let s=CFG.scenes.find(s=>t>=SCENE_START[s.id]&&t<cueTime(s.id+'-out'))||CFG.scenes.at(-1);const dark=['actions','follow','anticipation'].includes(s.id);bg(dark,t);({spacing, type:typography, actions,easing,follow,anticipation,hello})[s.id](t);hud(t,dark,s.id); // End cues retain the scene switch on stretched tails.
const exits=[cueTime('spacing-out'),cueTime('type-out'),cueTime('actions-out'),cueTime('easing-out'),cueTime('follow-out'),cueTime('anticipation-out'),cueTime('hello-out')];
}
const clock={t:0};const tl=gsap.timeline({paused:true,onUpdate:()=>render(clock.t)}).to(clock,{t:CFG.duration,duration:CFG.duration,ease:'none'});window.__odRenderAt=t=>{tl.pause();tl.time(t,true);clock.t=t;render(t)};const button=document.querySelector('button'),range=document.querySelector('input'),label=document.querySelector('#controls span');range.max=CFG.duration;button.onclick=()=>{if(tl.paused()){tl.play();button.textContent='PAUSE'}else{tl.pause();button.textContent='PLAY'}};range.oninput=()=>window.__odRenderAt(+range.value);function tick(){requestAnimationFrame(tick);range.value=clock.t;label.textContent=clock.t.toFixed(2)+' / '+CFG.duration.toFixed(2)}Promise.all([document.fonts.load('400 100px Anton').catch(()=>[]),document.fonts.load('700 48px Caveat').catch(()=>[]),document.fonts.ready]).then(()=>requestAnimationFrame(()=>requestAnimationFrame(()=>{window.__timelines={main:tl};render(0);tick()})));
</script><script data-od-preview-audio>
(function(){var a=document.getElementById('soundtrack');if(!a||document.documentElement.classList.contains('od-export'))return;
function tick(){if(window.__odMotionSourcePlayer||window.__odMotionRender)return;var tl=window.__timelines&&window.__timelines.main;
if(tl){var t=tl.time(),on=tl.isActive();if(on){if(a.paused)a.play().catch(function(){});if(Math.abs(a.currentTime-t)>0.2)a.currentTime=t;}else{if(!a.paused)a.pause();if(Math.abs(a.currentTime-t)>0.05)a.currentTime=t;}}
requestAnimationFrame(tick);}requestAnimationFrame(tick);})();
</script>
</body></html>
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall