diff --git a/registry/components/agent-cursor/agent-cursor.html b/registry/components/agent-cursor/agent-cursor.html index 72375d1719..b718b35bf1 100644 --- a/registry/components/agent-cursor/agent-cursor.html +++ b/registry/components/agent-cursor/agent-cursor.html @@ -130,7 +130,12 @@ } .ag-status { color: rgba(255, 255, 255, 0.9); - background: linear-gradient(90deg, rgba(255, 255, 255, 0.45) 35%, #fff 50%, rgba(255, 255, 255, 0.45) 65%); + background: linear-gradient( + 90deg, + rgba(255, 255, 255, 0.45) 35%, + #fff 50%, + rgba(255, 255, 255, 0.45) 65% + ); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; @@ -216,7 +221,9 @@ var compositionId = "agent-cursor"; var duration = Math.max( 0.001, - parseFloat(root.dataset.duration || html.getAttribute("data-composition-duration") || "6"), + parseFloat( + root.dataset.duration || html.getAttribute("data-composition-duration") || "6", + ), ); var W = root.clientWidth || 1920; var H = root.clientHeight || 1080; @@ -284,7 +291,8 @@ function positionAt(t) { if (t <= T_ENTER) return lerp(START, READ_A, enter(clamp01(t / T_ENTER))); - if (t <= T_READ_END) return lerp(READ_A, READ_B, reading(clamp01((t - T_ENTER) / (T_READ_END - T_ENTER)))); + if (t <= T_READ_END) + return lerp(READ_A, READ_B, reading(clamp01((t - T_ENTER) / (T_READ_END - T_ENTER)))); var from = READ_B; for (var i = 0; i < beats.length; i++) { var b = beats[i]; @@ -327,7 +335,10 @@ var text = stepText(index); var typeDur = Math.min(0.4, text.length * 0.026) * k; var shown = Math.floor(clamp01(since / typeDur) * text.length); - return { text: text.slice(0, Math.max(index === 0 ? 0 : 1, shown)), thinking: thinking }; + return { + text: text.slice(0, Math.max(index === 0 ? 0 : 1, shown)), + thinking: thinking, + }; } var bursts = beats.map(function (b) { @@ -340,11 +351,18 @@ s.setAttribute("viewBox", "-10 -10 20 20"); s.setAttribute("class", "ag-spark"); var star = document.createElementNS(SVG_NS, "path"); - star.setAttribute("d", "M0 -10 L2.4 -2.4 L10 0 L2.4 2.4 L0 10 L-2.4 2.4 L-10 0 L-2.4 -2.4 Z"); + star.setAttribute( + "d", + "M0 -10 L2.4 -2.4 L10 0 L2.4 2.4 L0 10 L-2.4 2.4 L-10 0 L-2.4 -2.4 Z", + ); star.setAttribute("fill", j % 2 ? "#ffffff" : accent); s.appendChild(star); wrap.appendChild(s); - sparks.push({ el: s, angle: (j * 45 + (j % 2 ? 14 : -6)) * (Math.PI / 180), reach: [1, 0.72, 0.88][j % 3] }); + sparks.push({ + el: s, + angle: (j * 45 + (j % 2 ? 14 : -6)) * (Math.PI / 180), + reach: [1, 0.72, 0.88][j % 3], + }); } root.appendChild(wrap); return { at: b.click, sparks: sparks }; @@ -367,10 +385,17 @@ actor.style.transform = "translate(" + p.x.toFixed(2) + "px," + p.y.toFixed(2) + "px)"; arrow.style.transform = "scale(" + press(t).toFixed(3) + ")"; arrow.style.transformOrigin = "0 0"; - glow.style.transform = "rotate(" + (t * 140).toFixed(1) + "deg) scale(" + (1 + 0.08 * Math.sin(t * 4.2)).toFixed(3) + ")"; + glow.style.transform = + "rotate(" + + (t * 140).toFixed(1) + + "deg) scale(" + + (1 + 0.08 * Math.sin(t * 4.2)).toFixed(3) + + ")"; glow.style.opacity = (0.5 + 0.12 * Math.sin(t * 3.1)).toFixed(3); - tagAnchor.style.transform = "translate(" + tp.x.toFixed(2) + "px," + tp.y.toFixed(2) + "px)"; - tag.style.transform = "scale(" + (0.9 + 0.1 * enter(clamp01((t - 0.15 * k) / (0.35 * k)))).toFixed(3) + ")"; + tagAnchor.style.transform = + "translate(" + tp.x.toFixed(2) + "px," + tp.y.toFixed(2) + "px)"; + tag.style.transform = + "scale(" + (0.9 + 0.1 * enter(clamp01((t - 0.15 * k) / (0.35 * k)))).toFixed(3) + ")"; var leaving = clamp01((t - T_EXIT) / (0.25 * k)); tag.style.opacity = (clamp01((t - 0.15 * k) / (0.2 * k)) * (1 - leaving)).toFixed(3); @@ -383,7 +408,8 @@ check.style.opacity = done.toFixed(3); check.style.transform = "scale(" + (0.5 + 0.5 * pop(done)).toFixed(3) + ")"; dot.style.opacity = (1 - done).toFixed(3); - dot.style.transform = "scale(" + (status.thinking ? 0.8 + 0.2 * Math.sin(t * 12) : 1).toFixed(3) + ")"; + dot.style.transform = + "scale(" + (status.thinking ? 0.8 + 0.2 * Math.sin(t * 12) : 1).toFixed(3) + ")"; bursts.forEach(function (burst) { var u = (t - burst.at) / (0.5 * k); @@ -395,8 +421,15 @@ var r = (0.2 + 2.4 * enter(u)) * s.reach; s.el.style.opacity = (1 - u * u).toFixed(3); s.el.style.transform = - "translate(" + (Math.cos(s.angle) * r).toFixed(3) + "cqw," + (Math.sin(s.angle) * r).toFixed(3) + - "cqw) scale(" + (1 - 0.7 * u).toFixed(3) + ") rotate(" + (u * 90).toFixed(1) + "deg)"; + "translate(" + + (Math.cos(s.angle) * r).toFixed(3) + + "cqw," + + (Math.sin(s.angle) * r).toFixed(3) + + "cqw) scale(" + + (1 - 0.7 * u).toFixed(3) + + ") rotate(" + + (u * 90).toFixed(1) + + "deg)"; }); }); actor.style.opacity = gone ? "0" : "1"; diff --git a/registry/components/agent-cursor/demo.html b/registry/components/agent-cursor/demo.html index 4acd278585..793cd18fb0 100644 --- a/registry/components/agent-cursor/demo.html +++ b/registry/components/agent-cursor/demo.html @@ -235,7 +235,12 @@ tl.to("#projects", { opacity: 0, x: -12, duration: 0.18, ease: "power2.in" }, 2.83); tl.to("#nav-projects", { color: "#5b6173", duration: 0.2 }, 2.83); tl.to("#nav-settings", { color: "#151827", duration: 0.2 }, 2.83); - tl.fromTo("#settings", { opacity: 0, x: 16 }, { opacity: 1, x: 0, duration: 0.3, ease: "power3.out" }, 2.95); + tl.fromTo( + "#settings", + { opacity: 0, x: 16 }, + { opacity: 1, x: 0, duration: 0.3, ease: "power3.out" }, + 2.95, + ); // Second click (4.39s): backups turn on. tl.to("#backup-toggle", { backgroundColor: "#8b5cf6", duration: 0.2 }, 4.43); diff --git a/registry/components/cursor-annotate/cursor-annotate.html b/registry/components/cursor-annotate/cursor-annotate.html index 1bd34c2e3a..48db3c0086 100644 --- a/registry/components/cursor-annotate/cursor-annotate.html +++ b/registry/components/cursor-annotate/cursor-annotate.html @@ -85,7 +85,16 @@ - + @@ -139,7 +148,8 @@ root.dataset.duration || html.getAttribute("data-composition-duration") || "4.2", ), ); - var shape = ["circle", "underline", "arrow"].indexOf(vars.shape) >= 0 ? vars.shape : "circle"; + var shape = + ["circle", "underline", "arrow"].indexOf(vars.shape) >= 0 ? vars.shape : "circle"; var color = /^#[0-9a-f]{3,8}$/i.test(String(vars.color)) ? vars.color : "#f43f5e"; var W = root.clientWidth || 1920; var H = root.clientHeight || 1080; @@ -180,7 +190,10 @@ var r = (1 + 0.035 * Math.sin(3 * a + 1.1)) * (1 + 0.08 * u); var ex = Math.cos(a) * rx * r; var ey = Math.sin(a) * ry * r; - pts.push([cx + ex * Math.cos(tilt) - ey * Math.sin(tilt), cy + ex * Math.sin(tilt) + ey * Math.cos(tilt)]); + pts.push([ + cx + ex * Math.cos(tilt) - ey * Math.sin(tilt), + cy + ex * Math.sin(tilt) + ey * Math.cos(tilt), + ]); } return [polyline(pts)]; } @@ -192,7 +205,10 @@ var pts = []; for (var i = 0; i <= 48; i++) { var u = i / 48; - pts.push([x0 + span * u, y + 4 * unit * Math.sin(u * Math.PI * 1.3) - 12 * unit * u * u]); + pts.push([ + x0 + span * u, + y + 4 * unit * Math.sin(u * Math.PI * 1.3) - 12 * unit * u * u, + ]); } return [polyline(pts)]; } @@ -200,13 +216,19 @@ // Shaft from below-left, curving onto the region; the head is a second stroke. function arrowStrokes() { var tip = { x: box.x - 10 * unit, y: box.y + box.h + 8 * unit }; - var from = { x: tip.x - Math.max(160 * unit, box.w * 0.7), y: tip.y + Math.max(120 * unit, box.h * 0.9) }; + var from = { + x: tip.x - Math.max(160 * unit, box.w * 0.7), + y: tip.y + Math.max(120 * unit, box.h * 0.9), + }; var ctrl = { x: from.x + (tip.x - from.x) * 0.15, y: tip.y + (from.y - tip.y) * 0.05 }; var pts = []; for (var i = 0; i <= 40; i++) { var u = i / 40; var v = 1 - u; - pts.push([v * v * from.x + 2 * v * u * ctrl.x + u * u * tip.x, v * v * from.y + 2 * v * u * ctrl.y + u * u * tip.y]); + pts.push([ + v * v * from.x + 2 * v * u * ctrl.x + u * u * tip.x, + v * v * from.y + 2 * v * u * ctrl.y + u * u * tip.y, + ]); } var back = Math.atan2(ctrl.y - tip.y, ctrl.x - tip.x); var len = 30 * unit; @@ -216,7 +238,12 @@ return [polyline(pts), polyline([barb(0.5), [tip.x, tip.y], barb(-0.5)])]; } - var strokeDs = shape === "underline" ? underlineStroke() : shape === "arrow" ? arrowStrokes() : loopStroke(); + var strokeDs = + shape === "underline" + ? underlineStroke() + : shape === "arrow" + ? arrowStrokes() + : loopStroke(); var WIDTH = 11 * unit; var strokes = strokeDs.map(function (d) { var thin = document.createElementNS(SVG_NS, "path"); @@ -275,21 +302,35 @@ // Returns the nib position and how far off the paper it is (0 = touching). function penAt(t) { if (t <= T_LAND) return { p: mix(START, first, glide(clamp01(t / T_LAND))), lift: 1 }; - if (t <= T_DRAW) return { p: first, lift: 1 - clamp01((t - T_LAND) / (T_DRAW - T_LAND)) }; + if (t <= T_DRAW) + return { p: first, lift: 1 - clamp01((t - T_LAND) / (T_DRAW - T_LAND)) }; for (var i = 0; i < windows.length; i++) { var w = windows[i]; - if (t <= w.end) return { p: pointOn(strokes[i], stroke((t - w.start) / (w.end - w.start))), lift: 0 }; + if (t <= w.end) + return { + p: pointOn(strokes[i], stroke((t - w.start) / (w.end - w.start))), + lift: 0, + }; var next = windows[i + 1]; if (next && t < next.start) { var u = (t - w.end) / (next.start - w.end); - return { p: mix(pointOn(strokes[i], 1), pointOn(strokes[i + 1], 0), hop(u)), lift: Math.sin(Math.PI * u) }; + return { + p: mix(pointOn(strokes[i], 1), pointOn(strokes[i + 1], 0), hop(u)), + lift: Math.sin(Math.PI * u), + }; } } if (t <= T_EXIT) { var a = clamp01((t - T_LIFT) / (0.45 * squeeze)); - return { p: mix(endPoint, ASIDE, gsap.parseEase("power2.out")(a)), lift: Math.min(1, a * 2.5) }; + return { + p: mix(endPoint, ASIDE, gsap.parseEase("power2.out")(a)), + lift: Math.min(1, a * 2.5), + }; } - return { p: mix(ASIDE, END, leave(clamp01((t - T_EXIT) / (duration - T_EXIT)))), lift: 1 }; + return { + p: mix(ASIDE, END, leave(clamp01((t - T_EXIT) / (duration - T_EXIT)))), + lift: 1, + }; } function drawn(i, t) { @@ -301,23 +342,41 @@ strokes.forEach(function (s, i) { var len = drawn(i, t); s.thin.style.opacity = len > 0.5 ? "1" : "0"; - s.thin.setAttribute("stroke-dasharray", len.toFixed(2) + " " + (s.length * 2).toFixed(2)); + s.thin.setAttribute( + "stroke-dasharray", + len.toFixed(2) + " " + (s.length * 2).toFixed(2), + ); // The thick core trails the tip and never reaches either end: the stroke tapers. var core = Math.min(len, s.length * 0.9) - s.length * 0.08; s.thick.style.opacity = core > 0.5 ? "1" : "0"; - s.thick.setAttribute("stroke-dasharray", Math.max(0, core).toFixed(2) + " " + (s.length * 3).toFixed(2)); + s.thick.setAttribute( + "stroke-dasharray", + Math.max(0, core).toFixed(2) + " " + (s.length * 3).toFixed(2), + ); s.thick.setAttribute("stroke-dashoffset", (-s.length * 0.08).toFixed(2)); }); var state = penAt(t); var lift = state.lift; - pen.style.transform = "translate(" + state.p.x.toFixed(2) + "px," + state.p.y.toFixed(2) + "px)"; + pen.style.transform = + "translate(" + state.p.x.toFixed(2) + "px," + state.p.y.toFixed(2) + "px)"; penBody.setAttribute( "transform", - "scale(" + ((1.45 + 0.14 * lift) * unit).toFixed(4) + ") rotate(" + (-4 * lift).toFixed(2) + ")", + "scale(" + + ((1.45 + 0.14 * lift) * unit).toFixed(4) + + ") rotate(" + + (-4 * lift).toFixed(2) + + ")", ); pen.style.filter = - "drop-shadow(" + (4 + 16 * lift).toFixed(1) + "px " + (6 + 20 * lift).toFixed(1) + - "px " + (3 + 14 * lift).toFixed(1) + "px rgba(0,0,0," + (0.32 - 0.14 * lift).toFixed(3) + "))"; + "drop-shadow(" + + (4 + 16 * lift).toFixed(1) + + "px " + + (6 + 20 * lift).toFixed(1) + + "px " + + (3 + 14 * lift).toFixed(1) + + "px rgba(0,0,0," + + (0.32 - 0.14 * lift).toFixed(3) + + "))"; } var clock = { t: 0 }; diff --git a/registry/components/cursor-context-menu/cursor-context-menu.html b/registry/components/cursor-context-menu/cursor-context-menu.html index fdbed8263f..f4193641bb 100644 --- a/registry/components/cursor-context-menu/cursor-context-menu.html +++ b/registry/components/cursor-context-menu/cursor-context-menu.html @@ -71,7 +71,9 @@ width: 64cqw; border-radius: 1.4cqw; background: var(--cm-win); - box-shadow: 0 2.4cqw 6cqw rgba(8, 12, 28, 0.35), 0 0 0 1px var(--cm-line); + box-shadow: + 0 2.4cqw 6cqw rgba(8, 12, 28, 0.35), + 0 0 0 1px var(--cm-line); } .cm-bar { display: flex; @@ -142,7 +144,9 @@ padding: 0.55cqw; border-radius: 0.9cqw; background: var(--cm-menu); - box-shadow: 0 1.2cqw 3cqw rgba(8, 12, 28, 0.3), 0 0 0 1px var(--cm-line); + box-shadow: + 0 1.2cqw 3cqw rgba(8, 12, 28, 0.3), + 0 0 0 1px var(--cm-line); opacity: 0; will-change: transform, opacity; } @@ -196,7 +200,10 @@
-
Launch assets
+
+ Launch assets +
@@ -242,7 +249,9 @@ var compositionId = "cursor-context-menu"; var duration = Math.max( 0.001, - parseFloat(root.dataset.duration || html.getAttribute("data-composition-duration") || "5.2"), + parseFloat( + root.dataset.duration || html.getAttribute("data-composition-duration") || "5.2", + ), ); root.setAttribute("data-tone", vars.tone === "dark" ? "dark" : "light"); var labels = String(vars.items || DEFAULTS.items || "Open") @@ -256,18 +265,46 @@ var FILES = [ ["Q3 roadmap", "pdf", "1.2 MB · PDF", "linear-gradient(135deg,#ff8a7a,#e8465b)"], - ["Launch film v4", "mp4", "2.4 GB · Video", "linear-gradient(135deg,#8f7bff,#4b3bd6)"], - ["Pricing notes", "md", "18 KB · Text", "linear-gradient(135deg,#6fc3ff,#2f7de1)"], - ["Team offsite", "jpg", "4.8 MB · Image", "linear-gradient(135deg,#7fe0a6,#1f9d6b)"], - ["Launch film v4 copy", "mp4", "2.4 GB · Video", "linear-gradient(135deg,#8f7bff,#4b3bd6)"], + [ + "Launch film v4", + "mp4", + "2.4 GB · Video", + "linear-gradient(135deg,#8f7bff,#4b3bd6)", + ], + [ + "Pricing notes", + "md", + "18 KB · Text", + "linear-gradient(135deg,#6fc3ff,#2f7de1)", + ], + [ + "Team offsite", + "jpg", + "4.8 MB · Image", + "linear-gradient(135deg,#7fe0a6,#1f9d6b)", + ], + [ + "Launch film v4 copy", + "mp4", + "2.4 GB · Video", + "linear-gradient(135deg,#8f7bff,#4b3bd6)", + ], ]; var TARGET = 1; var cards = FILES.map(function (f) { var card = document.createElement("div"); card.className = "cm-file"; card.innerHTML = - '
' + - '
' + f[0] + "." + f[1] + '
' + f[2] + "
"; + '
' + + '
' + + f[0] + + "." + + f[1] + + '
' + + f[2] + + "
"; grid.appendChild(card); return card; }); @@ -316,8 +353,16 @@ var squeeze = Math.min(1, duration / 5.2); var T = { - glide: 0.85, rclick: 0.95, bloom: 1.02, travel0: 1.45, travel1: 2.1, - click: 2.25, collapse: 2.43, act: 2.55, away0: 3.1, away1: 3.7, + glide: 0.85, + rclick: 0.95, + bloom: 1.02, + travel0: 1.45, + travel1: 2.1, + click: 2.25, + collapse: 2.43, + act: 2.55, + away0: 3.1, + away1: 3.7, }; for (var key in T) T[key] *= squeeze; @@ -362,7 +407,9 @@ menu.style.opacity = String(Math.min(1, open * 3) * (1 - shut)); menu.style.transform = "translate(" + mx + "px," + my + "px) scale(" + menuScale + ")"; rows.forEach(function (row, i) { - var k = easeOut(seg(t, T.bloom + i * 0.025 * squeeze, T.bloom + (i * 0.025 + 0.16) * squeeze)); + var k = easeOut( + seg(t, T.bloom + i * 0.025 * squeeze, T.bloom + (i * 0.025 + 0.16) * squeeze), + ); row.style.opacity = String(k); row.style.transform = "translateY(" + (1 - k) * -4 * u + "px)"; }); @@ -372,11 +419,15 @@ y: my + rows[pick].offsetTop + rows[pick].offsetHeight * 0.55, }; var start = { x: -0.06 * W, y: 1.1 * H }; - var aside = { x: itemPoint.x + (left ? -1 : 1) * 160 * u, y: Math.min(H - 60 * u, itemPoint.y + 180 * u) }; + var aside = { + x: itemPoint.x + (left ? -1 : 1) * 160 * u, + y: Math.min(H - 60 * u, itemPoint.y + 180 * u), + }; var p; if (t < T.glide) p = lerp(start, anchor, glide(seg(t, 0, T.glide))); else if (t < T.travel0) p = anchor; - else if (t < T.travel1) p = lerp(anchor, itemPoint, easeInOut(seg(t, T.travel0, T.travel1))); + else if (t < T.travel1) + p = lerp(anchor, itemPoint, easeInOut(seg(t, T.travel0, T.travel1))); else if (t < T.away0) p = itemPoint; else p = lerp(itemPoint, aside, easeInOut(seg(t, T.away0, T.away1))); @@ -391,11 +442,19 @@ var done = t >= T.act; var k = easeOut(seg(t, T.act, T.act + 0.32 * squeeze)); - cards[TARGET].classList.toggle("is-on", t >= T.rclick && !(done && action === "duplicate")); + cards[TARGET].classList.toggle( + "is-on", + t >= T.rclick && !(done && action === "duplicate"), + ); copy.classList.toggle("is-on", done && action === "duplicate"); var showCopy = action === "duplicate" ? k : 0; copy.style.opacity = String(showCopy); - copy.style.transform = "translateY(" + (1 - showCopy) * 18 * u + "px) scale(" + (0.94 + 0.06 * showCopy) + ")"; + copy.style.transform = + "translateY(" + + (1 - showCopy) * 18 * u + + "px) scale(" + + (0.94 + 0.06 * showCopy) + + ")"; var gone = action === "trash" ? k : 0; cards[TARGET].style.opacity = String(1 - gone); cards[TARGET].style.transform = "scale(" + (1 - 0.08 * gone) + ")"; diff --git a/registry/components/cursor-drag-drop/cursor-drag-drop.html b/registry/components/cursor-drag-drop/cursor-drag-drop.html index 122e2486c7..c8d7758453 100644 --- a/registry/components/cursor-drag-drop/cursor-drag-drop.html +++ b/registry/components/cursor-drag-drop/cursor-drag-drop.html @@ -188,7 +188,9 @@
To do 4
-
In progress 0
+
+ In progress 0 +
@@ -238,7 +240,13 @@ - +
@@ -279,7 +287,9 @@ var compositionId = "cursor-drag-drop"; var duration = Math.max( 0.001, - parseFloat(root.dataset.duration || html.getAttribute("data-composition-duration") || "5"), + parseFloat( + root.dataset.duration || html.getAttribute("data-composition-duration") || "5", + ), ); root.setAttribute("data-tone", vars.tone === "dark" ? "dark" : "light"); if (vars.accent) root.style.setProperty("--dd-accent", String(vars.accent)); @@ -289,7 +299,13 @@ var H = root.clientHeight || 1080; var fit = Math.min(W / 1920, H / 1080); $("dd-stage").style.transform = - "translate(" + (W - 1920 * fit) / 2 + "px," + (H - 1080 * fit) / 2 + "px) scale(" + fit + ") translate(960px,545px) scale(1.15) translate(-960px,-545px)"; + "translate(" + + (W - 1920 * fit) / 2 + + "px," + + (H - 1080 * fit) / 2 + + "px) scale(" + + fit + + ") translate(960px,545px) scale(1.15) translate(-960px,-545px)"; var s = Math.min(1, duration / 5); var T_ARRIVE = 0.9 * s; @@ -341,7 +357,8 @@ return { x: GRIP.x + c.x, y: GRIP.y + c.y }; } var dropped = { x: GRIP.x + DROP.x, y: GRIP.y + DROP.y }; - if (t <= T_EXIT) return arc(dropped, ASIDE, 0.1, easeArrive(clamp01((t - T_DRIFT) / (0.5 * s)))); + if (t <= T_EXIT) + return arc(dropped, ASIDE, 0.1, easeArrive(clamp01((t - T_DRIFT) / (0.5 * s)))); return arc(ASIDE, START, -0.1, easeExit(clamp01((t - T_EXIT) / (duration - T_EXIT)))); } @@ -374,8 +391,15 @@ var vx = (ahead.x - lagged.x) / 0.08; var tilt = Math.max(-3, Math.min(3, (vx / 1200) * 3)) * liftAt(t); card.style.transform = - "translate(" + c.x.toFixed(2) + "px," + c.y.toFixed(2) + "px) rotate(" + tilt.toFixed(2) + - "deg) scale(" + cardScaleAt(t).toFixed(4) + ")"; + "translate(" + + c.x.toFixed(2) + + "px," + + c.y.toFixed(2) + + "px) rotate(" + + tilt.toFixed(2) + + "deg) scale(" + + cardScaleAt(t).toFixed(4) + + ")"; lift.style.opacity = liftAt(t).toFixed(3); var close = easeCarry(clamp01((t - T_CARRY - 0.15 * s) / (0.4 * s))); @@ -386,7 +410,8 @@ var gap = Math.hypot(c.x - DROP.x, c.y - DROP.y); var hot = t < T_DROP ? smooth(1 - gap / 300) : 1 - clamp01((t - T_DROP) / (0.3 * s)); slotHot.style.opacity = hot.toFixed(3); - slot.style.opacity = t < T_DROP ? "1" : (1 - clamp01((t - T_DROP) / (0.3 * s))).toFixed(3); + slot.style.opacity = + t < T_DROP ? "1" : (1 - clamp01((t - T_DROP) / (0.3 * s))).toFixed(3); countA.textContent = t >= T_CARRY + 0.15 * s ? "3" : "4"; countB.textContent = t >= T_DROP ? "1" : "0"; @@ -394,16 +419,23 @@ var grabbing = t >= T_PRESS && t < T_DROP; var p = pointerAt(t); var anchor = grabbing ? PALM : ARROW_TIP; - var pressDip = t >= T_PRESS && t < T_PRESS + 0.22 * s - ? 1 - 0.1 * Math.sin(Math.PI * clamp01((t - T_PRESS) / (0.22 * s))) - : 1; - var releasePop = t >= T_DROP && t < T_DROP + 0.2 * s - ? 1 - 0.08 * Math.sin(Math.PI * clamp01((t - T_DROP) / (0.2 * s))) - : 1; + var pressDip = + t >= T_PRESS && t < T_PRESS + 0.22 * s + ? 1 - 0.1 * Math.sin(Math.PI * clamp01((t - T_PRESS) / (0.22 * s))) + : 1; + var releasePop = + t >= T_DROP && t < T_DROP + 0.2 * s + ? 1 - 0.08 * Math.sin(Math.PI * clamp01((t - T_DROP) / (0.2 * s))) + : 1; cursor.style.transformOrigin = anchor.x + "px " + anchor.y + "px"; cursor.style.transform = - "translate(" + (p.x - anchor.x).toFixed(2) + "px," + (p.y - anchor.y).toFixed(2) + - "px) scale(" + (pressDip * releasePop).toFixed(4) + ")"; + "translate(" + + (p.x - anchor.x).toFixed(2) + + "px," + + (p.y - anchor.y).toFixed(2) + + "px) scale(" + + (pressDip * releasePop).toFixed(4) + + ")"; arrow.style.opacity = grabbing ? "0" : "1"; hand.style.opacity = grabbing ? "1" : "0"; } diff --git a/registry/components/cursor-marquee-select/cursor-marquee-select.html b/registry/components/cursor-marquee-select/cursor-marquee-select.html index 1083fefbe4..90e13869a6 100644 --- a/registry/components/cursor-marquee-select/cursor-marquee-select.html +++ b/registry/components/cursor-marquee-select/cursor-marquee-select.html @@ -270,7 +270,9 @@ var compositionId = "cursor-marquee-select"; var duration = Math.max( 0.001, - parseFloat(root.dataset.duration || html.getAttribute("data-composition-duration") || "4.6"), + parseFloat( + root.dataset.duration || html.getAttribute("data-composition-duration") || "4.6", + ), ); if (vars.accent) root.style.setProperty("--ms-accent", String(vars.accent)); var pillLabel = String(vars.pill_label || "selected"); @@ -279,7 +281,13 @@ var H = root.clientHeight || 1080; var fit = Math.min(W / 1920, H / 1080); $("ms-stage").style.transform = - "translate(" + (W - 1920 * fit) / 2 + "px," + (H - 1080 * fit) / 2 + "px) scale(" + fit + ")"; + "translate(" + + (W - 1920 * fit) / 2 + + "px," + + (H - 1080 * fit) / 2 + + "px) scale(" + + fit + + ")"; var PHOTOS = [ ["#ffb86b", "#ff6f91", "#c2416b", "beach-sunset.jpg"], @@ -312,9 +320,17 @@ el.className = "ms-tile"; el.style.cssText = "left:" + box.x + "px;top:" + box.y + "px"; el.innerHTML = - '
' + CHECK + '
' + - p[3] + "
"; + '
' + + CHECK + + '
' + + p[3] + + "
"; grid.appendChild(el); return { box: box, @@ -350,7 +366,10 @@ }; } - var A = { x: (num(vars.start_x, 20.5) / 100) * 1920, y: (num(vars.start_y, 25.5) / 100) * 1080 }; + var A = { + x: (num(vars.start_x, 20.5) / 100) * 1920, + y: (num(vars.start_y, 25.5) / 100) * 1080, + }; var B = { x: (num(vars.end_x, 57) / 100) * 1920, y: (num(vars.end_y, 52) / 100) * 1080 }; var START = { x: 2060, y: 1220 }; var ASIDE = { x: B.x + 120, y: B.y + 110 }; @@ -359,9 +378,11 @@ function pointerAt(t) { if (t <= T_ARRIVE) return arc(START, A, 0.16, easeArrive(clamp01(t / T_ARRIVE))); if (t <= T_DRAG) return A; - if (t <= T_RELEASE) return arc(A, B, 0.06, easeDrag((t - T_DRAG) / (T_RELEASE - T_DRAG))); + if (t <= T_RELEASE) + return arc(A, B, 0.06, easeDrag((t - T_DRAG) / (T_RELEASE - T_DRAG))); if (t <= T_DRIFT) return B; - if (t <= T_EXIT) return arc(B, ASIDE, 0.1, easeArrive(clamp01((t - T_DRIFT) / (0.5 * s)))); + if (t <= T_EXIT) + return arc(B, ASIDE, 0.1, easeArrive(clamp01((t - T_DRIFT) / (0.5 * s)))); return arc(ASIDE, START, -0.1, easeExit(clamp01((t - T_EXIT) / (duration - T_EXIT)))); } function rectAt(t) { @@ -397,7 +418,12 @@ function render(t) { var r = rectAt(t); var dragging = t >= T_DRAG && t < T_RELEASE; - var rectAlpha = t < T_DRAG ? 0 : dragging ? clamp01((t - T_DRAG) / 0.06) : 1 - clamp01((t - T_RELEASE) / (0.18 * s)); + var rectAlpha = + t < T_DRAG + ? 0 + : dragging + ? clamp01((t - T_DRAG) / 0.06) + : 1 - clamp01((t - T_RELEASE) / (0.18 * s)); rect.style.opacity = rectAlpha.toFixed(3); var sx = Math.max(0.001, (r.x1 - r.x0) / 100).toFixed(4); var sy = Math.max(0.001, (r.y1 - r.y0) / 100).toFixed(4); @@ -418,7 +444,8 @@ if (on) count++; if (on) firstAt = Math.min(firstAt, tile.at); tile.ring.style.opacity = clamp01(u * 2).toFixed(3); - tile.photo.style.transform = "scale(" + (1 - 0.06 * clamp01(u * 1.6)).toFixed(4) + ")"; + tile.photo.style.transform = + "scale(" + (1 - 0.06 * clamp01(u * 1.6)).toFixed(4) + ")"; tile.check.style.opacity = clamp01(u * 3).toFixed(3); tile.check.style.transform = "scale(" + (0.5 + 0.5 * easePop(u)).toFixed(4) + ")"; }); @@ -429,10 +456,19 @@ pill.style.transform = "scale(" + (0.94 + 0.06 * easePop(pillU)).toFixed(4) + ")"; var p = pointerAt(t); - var press = t >= T_PRESS && t < T_PRESS + 0.2 * s ? 1 - 0.1 * Math.sin(Math.PI * clamp01((t - T_PRESS) / (0.2 * s))) : 1; + var press = + t >= T_PRESS && t < T_PRESS + 0.2 * s + ? 1 - 0.1 * Math.sin(Math.PI * clamp01((t - T_PRESS) / (0.2 * s))) + : 1; cursor.style.transformOrigin = TIP.x + "px " + TIP.y + "px"; cursor.style.transform = - "translate(" + (p.x - TIP.x).toFixed(2) + "px," + (p.y - TIP.y).toFixed(2) + "px) scale(" + press.toFixed(4) + ")"; + "translate(" + + (p.x - TIP.x).toFixed(2) + + "px," + + (p.y - TIP.y).toFixed(2) + + "px) scale(" + + press.toFixed(4) + + ")"; } var clock = { t: 0 }; diff --git a/registry/components/cursor-text-select/cursor-text-select.html b/registry/components/cursor-text-select/cursor-text-select.html index 593c256647..fec8dd399b 100644 --- a/registry/components/cursor-text-select/cursor-text-select.html +++ b/registry/components/cursor-text-select/cursor-text-select.html @@ -164,14 +164,18 @@
- + + +
- +
@@ -226,7 +230,9 @@ var compositionId = "cursor-text-select"; var duration = Math.max( 0.001, - parseFloat(root.dataset.duration || html.getAttribute("data-composition-duration") || "5.6"), + parseFloat( + root.dataset.duration || html.getAttribute("data-composition-duration") || "5.6", + ), ); var text = String(vars.text || DEFAULTS.text || ""); var phrase = String(vars.phrase || ""); @@ -286,8 +292,19 @@ var squeeze = Math.min(1, duration / 5.6); var T = { - near: 0.6, inEnd: 0.95, press: 1.05, drag0: 1.15, drag1: 2.0, release: 2.05, bar: 2.2, - move0: 2.55, move1: 3.25, click: 3.35, bold: 3.42, away0: 3.9, away1: 4.6, + near: 0.6, + inEnd: 0.95, + press: 1.05, + drag0: 1.15, + drag1: 2.0, + release: 2.05, + bar: 2.2, + move0: 2.55, + move1: 3.25, + click: 3.35, + bold: 3.42, + away0: 3.9, + away1: 4.6, }; for (var key in T) T[key] *= squeeze; var DRAG_REACH = 0.9; @@ -305,7 +322,9 @@ function dip(t, at) { var d = 0.07 * squeeze; if (t < at || t > at + d * 3.3) return 1; - return t < at + d ? 1 - 0.12 * seg(t, at, at + d) : 0.88 + 0.12 * easeOut(seg(t, at + d, at + d * 3.3)); + return t < at + d + ? 1 - 0.12 * seg(t, at, at + d) + : 0.88 + 0.12 * easeOut(seg(t, at + d, at + d * 3.3)); } function render(t) { @@ -326,7 +345,13 @@ var barK = seg(t, T.bar, T.bar + 0.32 * squeeze); toolbar.style.opacity = String(Math.min(1, barK * 2.5)); toolbar.style.transform = - "translate(" + barX + "px," + barY + "px) scale(" + (0.92 + 0.08 * spring(barK)) + ")"; + "translate(" + + barX + + "px," + + barY + + "px) scale(" + + (0.92 + 0.08 * spring(barK)) + + ")"; var pressed = t >= T.click && t < T.click + 0.12 * squeeze; boldBtn.style.transform = pressed ? "scale(0.92)" : ""; boldBtn.classList.toggle("is-on", bold); @@ -340,7 +365,10 @@ }; var aside = { x: cardRight + 80 * u, y: target.y + 140 * u }; var p; - var approach = { x: press.x + 150 * u, y: offsetIn(para).y + para.offsetHeight + 70 * u }; + var approach = { + x: press.x + 150 * u, + y: offsetIn(para).y + para.offsetHeight + 70 * u, + }; if (t < T.near) p = lerp(start, approach, glide(seg(t, 0, T.near))); else if (t < T.inEnd) p = lerp(approach, press, easeInOut(seg(t, T.near, T.inEnd))); else if (t < T.drag0) p = press; @@ -359,8 +387,11 @@ ); var m = seg(inside, -6 * u, 18 * u); var overBar = - barK > 0 && p.x > barX - 10 * u && p.x < barX + toolbar.offsetWidth + 10 * u && - p.y > barY - 10 * u && p.y < barY + toolbar.offsetHeight + 10 * u; + barK > 0 && + p.x > barX - 10 * u && + p.x < barX + toolbar.offsetWidth + 10 * u && + p.y > barY - 10 * u && + p.y < barY + toolbar.offsetHeight + 10 * u; if (overBar) m = 0; var beamH = press.h * 1.15; ibeam.style.height = beamH + "px"; diff --git a/registry/components/cursor-zoom-follow/cursor-zoom-follow.html b/registry/components/cursor-zoom-follow/cursor-zoom-follow.html index f9c1d5669b..1662360ee3 100644 --- a/registry/components/cursor-zoom-follow/cursor-zoom-follow.html +++ b/registry/components/cursor-zoom-follow/cursor-zoom-follow.html @@ -181,36 +181,92 @@
Revenue
Updated 2 minutes ago
-
Last 30 days
-
Export
-
+
+ Last 30 days +
+
+ Export +
+
Net revenue$84,210
-
+
Active customers1,284
-
+
Churn2.1%
- - + + -
+
Sep 14 $3,920
-
+
Top plans
Team
Business
Starter
-
CustomerPlanAmount
-
Harbor Freight Co.Team$1,240
-
Lumen DentalStarter$320
-
Parkside StudioBusiness$2,880
+
+ CustomerPlanAmount +
+
+ Harbor Freight Co.Team$1,240 +
+
+ Lumen DentalStarter$320 +
+
+ Parkside StudioBusiness$2,880 +
@@ -263,7 +319,9 @@ var compositionId = "cursor-zoom-follow"; var duration = Math.max( 0.001, - parseFloat(root.dataset.duration || html.getAttribute("data-composition-duration") || "6"), + parseFloat( + root.dataset.duration || html.getAttribute("data-composition-duration") || "6", + ), ); var W = root.clientWidth || 1920; var H = root.clientHeight || 1080; @@ -314,7 +372,10 @@ var cx = (p0.x + p1.x) / 2 - (p1.y - p0.y) * bend; var cy = (p0.y + p1.y) / 2 + (p1.x - p0.x) * bend; var w = 1 - u; - return { x: w * w * p0.x + 2 * w * u * cx + u * u * p1.x, y: w * w * p0.y + 2 * w * u * cy + u * u * p1.y }; + return { + x: w * w * p0.x + 2 * w * u * cx + u * u * p1.x, + y: w * w * p0.y + 2 * w * u * cy + u * u * p1.y, + }; } function cursorAt(t) { @@ -322,7 +383,8 @@ for (var i = 0; i < MOVES.length; i++) { var m = MOVES[i]; if (t < m.at) return here; - if (t <= m.end) return arc(m.from, m.to, easeInOut(clamp01((t - m.at) / (m.end - m.at))), 0.12); + if (t <= m.end) + return arc(m.from, m.to, easeInOut(clamp01((t - m.at) / (m.end - m.at))), 0.12); here = m.to; } if (t < EXIT_AT) return here; @@ -392,7 +454,13 @@ var cx = Math.max(hw, Math.min(W - hw, c.x)); var cy = Math.max(hh, Math.min(H - hh, c.y)); cam.style.transform = - "translate(" + (W / 2 - cx * z).toFixed(2) + "px," + (H / 2 - cy * z).toFixed(2) + "px) scale(" + z.toFixed(4) + ")"; + "translate(" + + (W / 2 - cx * z).toFixed(2) + + "px," + + (H / 2 - cy * z).toFixed(2) + + "px) scale(" + + z.toFixed(4) + + ")"; var p = cursorAt(t); var hit = lastClickBefore(t); @@ -400,14 +468,26 @@ var dip = since < 0.08 ? since / 0.08 : since < 0.28 ? 1 - (since - 0.08) / 0.2 : 0; cursor.style.transformOrigin = "21% 12.5%"; cursor.style.transform = - "translate(" + p.x.toFixed(2) + "px," + p.y.toFixed(2) + "px) translate(-21%,-12.5%) scale(" + (1 - 0.15 * dip).toFixed(3) + ")"; + "translate(" + + p.x.toFixed(2) + + "px," + + p.y.toFixed(2) + + "px) translate(-21%,-12.5%) scale(" + + (1 - 0.15 * dip).toFixed(3) + + ")"; cursor.style.opacity = t >= duration ? "0" : "1"; var u = clamp01(since / 0.55); ripple.style.opacity = hit && since < 0.55 ? (0.6 * (1 - u)).toFixed(3) : "0"; if (hit) { ripple.style.transform = - "translate(" + hit.p.x.toFixed(2) + "px," + hit.p.y.toFixed(2) + "px) scale(" + (0.3 + 0.9 * gsap.parseEase("power2.out")(u)).toFixed(3) + ")"; + "translate(" + + hit.p.x.toFixed(2) + + "px," + + hit.p.y.toFixed(2) + + "px) scale(" + + (0.3 + 0.9 * gsap.parseEase("power2.out")(u)).toFixed(3) + + ")"; } if (builtIn) { diff --git a/registry/components/dart-cursor/dart-cursor.html b/registry/components/dart-cursor/dart-cursor.html index 1160165bac..535a5e3af1 100644 --- a/registry/components/dart-cursor/dart-cursor.html +++ b/registry/components/dart-cursor/dart-cursor.html @@ -299,7 +299,8 @@ var depth = depthAt(t); var exiting = t > T_EXIT; var perFrame = speed / 60; - var smearUnits = blurAmount * Math.min(exiting ? 36 : 12, (exiting ? 0.28 : 0.16) * perFrame); + var smearUnits = + blurAmount * Math.min(exiting ? 36 : 12, (exiting ? 0.28 : 0.16) * perFrame); var lift = Math.max(0, depth - 0.9); cursor.style.transform = "translate(" + p.x.toFixed(2) + "px," + p.y.toFixed(2) + "px)"; @@ -313,7 +314,11 @@ "))"; spin.setAttribute( "transform", - "rotate(" + rotation.toFixed(2) + ") scale(" + (depth * PX_PER_SVG_UNIT).toFixed(4) + ")", + "rotate(" + + rotation.toFixed(2) + + ") scale(" + + (depth * PX_PER_SVG_UNIT).toFixed(4) + + ")", ); // The blur's x axis is turned onto the travel direction, then the shape turned back. var local = wrap(travelDeg - rotation); diff --git a/registry/components/dart-cursor/demo.html b/registry/components/dart-cursor/demo.html index 35cdbb26b6..bd3bfba428 100644 --- a/registry/components/dart-cursor/demo.html +++ b/registry/components/dart-cursor/demo.html @@ -193,13 +193,7 @@ data-height="1080" data-duration="4.4" > -
+
Export
0:42
product-tour.mp4
diff --git a/registry/components/magnetic-cursor/demo.html b/registry/components/magnetic-cursor/demo.html index ba2ef8cd8c..d989f3a52e 100644 --- a/registry/components/magnetic-cursor/demo.html +++ b/registry/components/magnetic-cursor/demo.html @@ -84,7 +84,9 @@

Launch notes, week 38

The new onboarding flow ships to everyone on Thursday. Read the - rollout checklist + rollout checklist before your first support shift, and flag anything that still reads unclear.

Open questions go in the team thread, not in comments on this page.

@@ -108,7 +110,11 @@ diff --git a/registry/components/magnetic-cursor/magnetic-cursor.html b/registry/components/magnetic-cursor/magnetic-cursor.html index f2b2e3bd7f..967880b63b 100644 --- a/registry/components/magnetic-cursor/magnetic-cursor.html +++ b/registry/components/magnetic-cursor/magnetic-cursor.html @@ -111,13 +111,38 @@
-
-
-
+
+ + + +
+
+ +
+
+ + + +
-
-
-
+
+ + + +
+
+ + + +
+
+ + + + +
@@ -158,7 +183,9 @@ var compositionId = "magnetic-cursor"; var duration = Math.max( 0.001, - parseFloat(root.dataset.duration || html.getAttribute("data-composition-duration") || "5"), + parseFloat( + root.dataset.duration || html.getAttribute("data-composition-duration") || "5", + ), ); var tone = vars.tone === "dark" ? "dark" : "light"; var accent = String(vars.accent || "#3b82f6"); @@ -174,7 +201,8 @@ }) .slice(0, 3); if (visits.length === 0) visits = [0, 3, 5]; - var pressVisit = Math.max(1, Math.min(visits.length, Math.round(Number(vars.press) || 2))) - 1; + var pressVisit = + Math.max(1, Math.min(visits.length, Math.round(Number(vars.press) || 2))) - 1; // Geometry is read once at load: fixed viewport per render, no resize mid-render. var W = root.clientWidth || 1920; @@ -207,7 +235,12 @@ visits.forEach(function (index, k) { if (k > 0) t += GLIDE; var hold = HOLD + (k === pressVisit ? PRESS_HOLD : 0); - plan.push({ index: index, arrive: t, leave: t + hold, press: k === pressVisit ? t + 0.28 : -1 }); + plan.push({ + index: index, + arrive: t, + leave: t + hold, + press: k === pressVisit ? t + 0.28 : -1, + }); t += hold + RELEASE; }); var base = t + EXIT; @@ -251,20 +284,30 @@ var cx = (p0.x + p1.x) / 2 - (p1.y - p0.y) * bend; var cy = (p0.y + p1.y) / 2 + (p1.x - p0.x) * bend; var w = 1 - u; - return { x: w * w * p0.x + 2 * w * u * cx + u * u * p1.x, y: w * w * p0.y + 2 * w * u * cy + u * u * p1.y }; + return { + x: w * w * p0.x + 2 * w * u * cx + u * u * p1.x, + y: w * w * p0.y + 2 * w * u * cy + u * u * p1.y, + }; } function fingerAt(time) { var first = plan[0]; - if (time <= first.arrive) return glide(START, arrivePoint(first), easeOut(clamp01(time / first.arrive)), 0.15); + if (time <= first.arrive) + return glide(START, arrivePoint(first), easeOut(clamp01(time / first.arrive)), 0.15); for (var k = 0; k < plan.length; k++) { var v = plan[k]; var a = arrivePoint(v); var d = driftPoint(v); - if (time <= v.leave) return glide(a, d, easeInOut(clamp01((time - v.arrive) / (v.leave - v.arrive))), 0); + if (time <= v.leave) + return glide(a, d, easeInOut(clamp01((time - v.arrive) / (v.leave - v.arrive))), 0); var next = plan[k + 1]; if (next && time <= next.arrive) { - return glide(d, arrivePoint(next), easeInOut(clamp01((time - v.leave) / (next.arrive - v.leave))), -0.12); + return glide( + d, + arrivePoint(next), + easeInOut(clamp01((time - v.leave) / (next.arrive - v.leave))), + -0.12, + ); } } var last = driftPoint(plan[plan.length - 1]); @@ -307,7 +350,8 @@ if (!active) { // The magnet: within reach of a button the dot is already leaning toward its centre. boxes.forEach(function (b) { - var pull = 0.35 * smooth(1 - Math.hypot(b.x - finger.x, b.y - finger.y) / PULL_RADIUS); + var pull = + 0.35 * smooth(1 - Math.hypot(b.x - finger.x, b.y - finger.y) / PULL_RADIUS); cx = mix(cx, b.x, pull); cy = mix(cy, b.y, pull); }); @@ -337,7 +381,13 @@ var dy = (finger.y - bx.y) * 0.12 * lean; var dip = active && active.index === i ? squash : 0; icon.style.transform = - "translate(" + dx.toFixed(2) + "px," + dy.toFixed(2) + "px) scale(" + (1 - 0.12 * dip).toFixed(3) + ")"; + "translate(" + + dx.toFixed(2) + + "px," + + dy.toFixed(2) + + "px) scale(" + + (1 - 0.12 * dip).toFixed(3) + + ")"; var pressed = plan.some(function (v) { return v.index === i && v.press >= 0 && time >= v.press + 0.05 * k0; });