chore(catalog): run oxfmt over the nine new cursor compositions

This commit is contained in:
Miguel Ángel
2026-09-23 01:41:29 -04:00
parent c1150e0826
commit 15caf65c2e
12 changed files with 521 additions and 131 deletions
+45 -12
View File
@@ -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";
+6 -1
View File
@@ -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);
+77 -18
View File
@@ -85,7 +85,16 @@
<path d="M0 0 L15 -5.5 L15 5.5 Z" fill="#1d1d22" />
<path id="ca-pen-tip" d="M3 -1.4 L15 -5.5 L15 5.5 L3 1.4 Z" />
<rect x="15" y="-7.5" width="14" height="15" rx="2" fill="#2a2a31" />
<rect x="29" y="-9" width="62" height="18" rx="4" fill="#f6f6f8" stroke="#1d1d22" stroke-width="1.5" />
<rect
x="29"
y="-9"
width="62"
height="18"
rx="4"
fill="#f6f6f8"
stroke="#1d1d22"
stroke-width="1.5"
/>
<rect x="36" y="-9" width="8" height="18" id="ca-pen-band" />
<rect x="91" y="-9.5" width="16" height="19" rx="6" fill="#1d1d22" />
</g>
@@ -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 };
@@ -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 @@
<div id="root" data-composition-id="cursor-context-menu" data-duration="5.2">
<div class="cm-stage">
<div class="cm-window">
<div class="cm-bar"><i class="cm-dot"></i><i class="cm-dot"></i><i class="cm-dot"></i><span>Launch assets</span></div>
<div class="cm-bar">
<i class="cm-dot"></i><i class="cm-dot"></i><i class="cm-dot"></i
><span>Launch assets</span>
</div>
<div class="cm-grid" id="cm-grid"></div>
</div>
</div>
@@ -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 &middot; PDF", "linear-gradient(135deg,#ff8a7a,#e8465b)"],
["Launch film v4", "mp4", "2.4 GB &middot; Video", "linear-gradient(135deg,#8f7bff,#4b3bd6)"],
["Pricing notes", "md", "18 KB &middot; Text", "linear-gradient(135deg,#6fc3ff,#2f7de1)"],
["Team offsite", "jpg", "4.8 MB &middot; Image", "linear-gradient(135deg,#7fe0a6,#1f9d6b)"],
["Launch film v4 copy", "mp4", "2.4 GB &middot; Video", "linear-gradient(135deg,#8f7bff,#4b3bd6)"],
[
"Launch film v4",
"mp4",
"2.4 GB &middot; Video",
"linear-gradient(135deg,#8f7bff,#4b3bd6)",
],
[
"Pricing notes",
"md",
"18 KB &middot; Text",
"linear-gradient(135deg,#6fc3ff,#2f7de1)",
],
[
"Team offsite",
"jpg",
"4.8 MB &middot; Image",
"linear-gradient(135deg,#7fe0a6,#1f9d6b)",
],
[
"Launch film v4 copy",
"mp4",
"2.4 GB &middot; 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 =
'<div class="cm-thumb" style="background:' + f[3] + '"></div>' +
'<div class="cm-name">' + f[0] + "." + f[1] + '</div><div class="cm-meta">' + f[2] + "</div>";
'<div class="cm-thumb" style="background:' +
f[3] +
'"></div>' +
'<div class="cm-name">' +
f[0] +
"." +
f[1] +
'</div><div class="cm-meta">' +
f[2] +
"</div>";
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) + ")";
+48 -16
View File
@@ -188,7 +188,9 @@
<div class="dd-col-head">To do <span class="dd-count" id="dd-count-a">4</span></div>
</div>
<div class="dd-col" style="left: 1020px">
<div class="dd-col-head">In progress <span class="dd-count" id="dd-count-b">0</span></div>
<div class="dd-col-head">
In progress <span class="dd-count" id="dd-count-b">0</span>
</div>
</div>
<div class="dd-slot" id="dd-slot" style="left: 1040px; top: 300px">
<div class="dd-slot-hot" id="dd-slot-hot"></div>
@@ -238,7 +240,13 @@
</g>
</defs>
<!-- Outline pass under a fill pass, so the overlapping parts read as one hand. -->
<use href="#dd-hand-shape" fill="#141414" stroke="#141414" stroke-width="2.6" stroke-linejoin="round" />
<use
href="#dd-hand-shape"
fill="#141414"
stroke="#141414"
stroke-width="2.6"
stroke-linejoin="round"
/>
<use href="#dd-hand-shape" fill="#ffffff" />
</svg>
</div>
@@ -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";
}
@@ -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 =
'<div class="ms-ring"></div><div class="ms-photo" style="--a:' + p[0] + ";--b:" + p[1] +
";--c:" + p[2] + '"></div><div class="ms-check">' + CHECK + '</div><div class="ms-name">' +
p[3] + "</div>";
'<div class="ms-ring"></div><div class="ms-photo" style="--a:' +
p[0] +
";--b:" +
p[1] +
";--c:" +
p[2] +
'"></div><div class="ms-check">' +
CHECK +
'</div><div class="ms-name">' +
p[3] +
"</div>";
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 };
@@ -164,14 +164,18 @@
</div>
<div class="ts-toolbar" id="ts-toolbar">
<div class="ts-btn" id="ts-bold">
<svg viewBox="0 0 24 24"><path d="M7 4h6.5a4 4 0 0 1 0 8H7zM7 12h7.5a4 4 0 0 1 0 8H7z" /></svg>
<svg viewBox="0 0 24 24">
<path d="M7 4h6.5a4 4 0 0 1 0 8H7zM7 12h7.5a4 4 0 0 1 0 8H7z" />
</svg>
</div>
<div class="ts-btn">
<svg viewBox="0 0 24 24"><path d="M14 4h-4M14 20h-4M13.5 4 10.5 20" /></svg>
</div>
<div class="ts-btn">
<svg viewBox="0 0 24 24">
<path d="M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1" />
<path
d="M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1"
/>
</svg>
</div>
<div class="ts-btn">
@@ -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";
@@ -181,36 +181,92 @@
</div>
<div class="zf-h" style="left: 18%; top: 4%">Revenue</div>
<div class="zf-sub" style="left: 18%; top: 9.2%">Updated 2 minutes ago</div>
<div class="zf-pill zf-card" id="zf-range" style="left: 62%; top: 4.8%; width: 13%">Last 30 days</div>
<div class="zf-pill" id="zf-export" style="left: 85%; top: 4.8%; width: 11%; background: #171a26; color: #fff">Export</div>
<div class="zf-card zf-kpi" style="left: 18%; top: 16%; width: 24.5%; height: 13%; padding: 1.4cqw">
<div class="zf-pill zf-card" id="zf-range" style="left: 62%; top: 4.8%; width: 13%">
Last 30 days
</div>
<div
class="zf-pill"
id="zf-export"
style="left: 85%; top: 4.8%; width: 11%; background: #171a26; color: #fff"
>
Export
</div>
<div
class="zf-card zf-kpi"
style="left: 18%; top: 16%; width: 24.5%; height: 13%; padding: 1.4cqw"
>
<span>Net revenue</span><b>$84,210</b>
</div>
<div class="zf-card zf-kpi" style="left: 44.75%; top: 16%; width: 24.5%; height: 13%; padding: 1.4cqw">
<div
class="zf-card zf-kpi"
style="left: 44.75%; top: 16%; width: 24.5%; height: 13%; padding: 1.4cqw"
>
<span>Active customers</span><b>1,284</b>
</div>
<div class="zf-card zf-kpi" style="left: 71.5%; top: 16%; width: 24.5%; height: 13%; padding: 1.4cqw">
<div
class="zf-card zf-kpi"
style="left: 71.5%; top: 16%; width: 24.5%; height: 13%; padding: 1.4cqw"
>
<span>Churn</span><b>2.1%</b>
</div>
<div class="zf-card" style="left: 18%; top: 32%; width: 51.25%; height: 35%">
<svg viewBox="0 0 100 50" preserveAspectRatio="none" style="position: absolute; inset: 12% 4% 8%; width: 92%; height: 80%">
<path d="M0 40 L10 36 L20 38 L30 30 L40 31 L50 22 L60 25 L70 17 L80 19 L90 10 L100 12" fill="none" stroke="#4f5bff" stroke-width="1.2" vector-effect="non-scaling-stroke" />
<svg
viewBox="0 0 100 50"
preserveAspectRatio="none"
style="position: absolute; inset: 12% 4% 8%; width: 92%; height: 80%"
>
<path
d="M0 40 L10 36 L20 38 L30 30 L40 31 L50 22 L60 25 L70 17 L80 19 L90 10 L100 12"
fill="none"
stroke="#4f5bff"
stroke-width="1.2"
vector-effect="non-scaling-stroke"
/>
</svg>
<div class="zf-card" id="zf-tip" style="left: 60%; top: 8%; padding: 0.6cqw 0.9cqw; font-size: 0.95cqw; opacity: 0; box-shadow: 0 0.6cqw 1.6cqw rgba(20, 24, 40, 0.16)">
<div
class="zf-card"
id="zf-tip"
style="
left: 60%;
top: 8%;
padding: 0.6cqw 0.9cqw;
font-size: 0.95cqw;
opacity: 0;
box-shadow: 0 0.6cqw 1.6cqw rgba(20, 24, 40, 0.16);
"
>
Sep 14 <b>$3,920</b>
</div>
</div>
<div class="zf-card" style="left: 71.5%; top: 32%; width: 24.5%; height: 35%; padding: 1.4cqw; font-size: 1cqw">
<div
class="zf-card"
style="
left: 71.5%;
top: 32%;
width: 24.5%;
height: 35%;
padding: 1.4cqw;
font-size: 1cqw;
"
>
<b>Top plans</b>
<div class="zf-bar" style="top: 26%">Team<i style="width: 46%"></i></div>
<div class="zf-bar" style="top: 50%">Business<i style="width: 32%"></i></div>
<div class="zf-bar" style="top: 74%">Starter<i style="width: 22%"></i></div>
</div>
<div class="zf-card" style="left: 18%; top: 70%; width: 78%; height: 26%">
<div class="zf-row" style="top: 0; border: 0; color: #7a7f93">Customer<span>Plan</span><span>Amount</span></div>
<div class="zf-row" style="top: 20%">Harbor Freight Co.<span>Team</span><span>$1,240</span></div>
<div class="zf-row" style="top: 40%">Lumen Dental<span>Starter</span><span>$320</span></div>
<div class="zf-row" style="top: 60%">Parkside Studio<span>Business</span><span>$2,880</span></div>
<div class="zf-row" style="top: 0; border: 0; color: #7a7f93">
Customer<span>Plan</span><span>Amount</span>
</div>
<div class="zf-row" style="top: 20%">
Harbor Freight Co.<span>Team</span><span>$1,240</span>
</div>
<div class="zf-row" style="top: 40%">
Lumen Dental<span>Starter</span><span>$320</span>
</div>
<div class="zf-row" style="top: 60%">
Parkside Studio<span>Business</span><span>$2,880</span>
</div>
</div>
</div>
<div class="zf-ripple" id="zf-ripple"></div>
@@ -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) {
+7 -2
View File
@@ -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);
+1 -7
View File
@@ -193,13 +193,7 @@
data-height="1080"
data-duration="4.4"
>
<div
class="dialog clip"
id="dialog"
data-start="0"
data-duration="4.4"
data-track-index="0"
>
<div class="dialog clip" id="dialog" data-start="0" data-duration="4.4" data-track-index="0">
<div class="title">Export</div>
<div class="thumb"><div class="thumb-time">0:42</div></div>
<div class="file">product-tour.mp4</div>
+8 -2
View File
@@ -84,7 +84,9 @@
<h1>Launch notes, week 38</h1>
<p>
The new onboarding flow ships to everyone on Thursday. Read the
<span class="sel" id="sel">rollout checklist<span class="sel-line" id="sel-line"></span></span>
<span class="sel" id="sel"
>rollout checklist<span class="sel-line" id="sel-line"></span
></span>
before your first support shift, and flag anything that still reads unclear.
</p>
<p>Open questions go in the team thread, not in comments on this page.</p>
@@ -108,7 +110,11 @@
<script>
window.__timelines = window.__timelines || {};
var tl = gsap.timeline({ paused: true });
tl.to("#sel", { color: "#2563eb", backgroundColor: "rgba(59,130,246,0.1)", duration: 0.2 }, 2.4);
tl.to(
"#sel",
{ color: "#2563eb", backgroundColor: "rgba(59,130,246,0.1)", duration: 0.2 },
2.4,
);
tl.to("#sel-line", { scaleX: 1, duration: 0.3, ease: "power3.out" }, 2.42);
window.__timelines["magnetic-cursor-demo"] = tl;
</script>
+65 -15
View File
@@ -111,13 +111,38 @@
<rect id="mc-plate" x="0" y="0" width="0" height="0" rx="0" />
</svg>
<div class="mc-bar" id="mc-bar">
<div class="mc-btn"><svg class="mc-icon" viewBox="0 0 24 24"><path d="M7 5h6a3.5 3.5 0 0 1 0 7H7zM7 12h7a3.5 3.5 0 0 1 0 7H7z" /></svg></div>
<div class="mc-btn"><svg class="mc-icon" viewBox="0 0 24 24"><path d="M10 5h8M6 19h8M14 5l-4 14" /></svg></div>
<div class="mc-btn"><svg class="mc-icon" viewBox="0 0 24 24"><path d="M7 4v7a5 5 0 0 0 10 0V4M5 20h14" /></svg></div>
<div class="mc-btn">
<svg class="mc-icon" viewBox="0 0 24 24">
<path d="M7 5h6a3.5 3.5 0 0 1 0 7H7zM7 12h7a3.5 3.5 0 0 1 0 7H7z" />
</svg>
</div>
<div class="mc-btn">
<svg class="mc-icon" viewBox="0 0 24 24"><path d="M10 5h8M6 19h8M14 5l-4 14" /></svg>
</div>
<div class="mc-btn">
<svg class="mc-icon" viewBox="0 0 24 24">
<path d="M7 4v7a5 5 0 0 0 10 0V4M5 20h14" />
</svg>
</div>
<div class="mc-sep"></div>
<div class="mc-btn"><svg class="mc-icon" viewBox="0 0 24 24"><path d="M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1" /></svg></div>
<div class="mc-btn"><svg class="mc-icon" viewBox="0 0 24 24"><path d="M9 6h11M9 12h11M9 18h11M4.5 6h.01M4.5 12h.01M4.5 18h.01" /></svg></div>
<div class="mc-btn"><svg class="mc-icon" viewBox="0 0 24 24"><rect x="3.5" y="4.5" width="17" height="15" rx="2.5" /><path d="M3.5 16l5-5 4 4 3-3 5 5M15 9h.01" /></svg></div>
<div class="mc-btn">
<svg class="mc-icon" viewBox="0 0 24 24">
<path
d="M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1"
/>
</svg>
</div>
<div class="mc-btn">
<svg class="mc-icon" viewBox="0 0 24 24">
<path d="M9 6h11M9 12h11M9 18h11M4.5 6h.01M4.5 12h.01M4.5 18h.01" />
</svg>
</div>
<div class="mc-btn">
<svg class="mc-icon" viewBox="0 0 24 24">
<rect x="3.5" y="4.5" width="17" height="15" rx="2.5" />
<path d="M3.5 16l5-5 4 4 3-3 5 5M15 9h.01" />
</svg>
</div>
</div>
</div>
@@ -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;
});