Skip to content

Commit b37236e

Browse files
committed
fix(registry): match Tahoe notification motion
1 parent 4819d84 commit b37236e

1 file changed

Lines changed: 21 additions & 22 deletions

File tree

registry/blocks/macos-tahoe-liquid-glass/macos-tahoe-liquid-glass.html

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,18 +1175,18 @@
11751175
}
11761176
}
11771177

1178-
function drawNotification(ctx) {
1179-
drawGlassPanel(ctx, 1002, 62, 390, 96, 28);
1180-
drawRoundedImage(ctx, macToastIcon, 1022, 84, 44, 44, 12);
1178+
function drawNotification(ctx, x, y) {
1179+
drawGlassPanel(ctx, x, y, 390, 96, 28);
1180+
drawRoundedImage(ctx, macToastIcon, x + 20, y + 22, 44, 44, 12);
11811181
ctx.fillStyle = "rgba(10,34,62,0.96)";
11821182
ctx.font = "900 18px Inter, system-ui, sans-serif";
1183-
ctx.fillText("Messages", 1082, 88);
1183+
ctx.fillText("Messages", x + 80, y + 26);
11841184
ctx.font = "800 12px Inter, system-ui, sans-serif";
11851185
ctx.fillStyle = "rgba(10,34,62,0.58)";
1186-
ctx.fillText("now", 1178, 90);
1186+
ctx.fillText("now", x + 176, y + 28);
11871187
ctx.font = "800 13px Inter, system-ui, sans-serif";
11881188
ctx.fillStyle = "rgba(10,34,62,0.78)";
1189-
ctx.fillText("Liquid Glass preview is ready for review.", 1082, 116);
1189+
ctx.fillText("Liquid Glass preview is ready for review.", x + 80, y + 54);
11901190
}
11911191

11921192
function drawDock(ctx) {
@@ -1211,13 +1211,10 @@
12111211
drawDesktopWidgets(ctx);
12121212
drawFinderWindow(ctx);
12131213
ctx.textBaseline = "top";
1214-
var toastProgress = Math.max(0, Math.min(1, S.macToast * 1.15));
1215-
if (toastProgress > 0.01) {
1214+
if (S.macToastOpacity > 0.01) {
12161215
ctx.save();
1217-
ctx.globalAlpha = toastProgress;
1218-
ctx.translate(0, (1 - toastProgress) * -34);
1219-
ctx.filter = "blur(" + (1 - toastProgress) * 4 + "px)";
1220-
drawNotification(ctx);
1216+
ctx.globalAlpha = S.macToastOpacity;
1217+
drawNotification(ctx, S.macToastX, S.macToastY);
12211218
ctx.restore();
12221219
}
12231220
drawDock(ctx);
@@ -1372,7 +1369,9 @@
13721369
cardReveal: 0,
13731370
titleFade: 0,
13741371
counter: 0,
1375-
macToast: 0,
1372+
macToastOpacity: 0,
1373+
macToastX: 1464,
1374+
macToastY: 62,
13761375
macPanel: 0,
13771376
p: 0,
13781377
};
@@ -1399,14 +1398,9 @@
13991398
var macControl = document.getElementById("mac-control");
14001399
var macMedia = document.getElementById("mac-media");
14011400
if (macToast) {
1402-
macToast.style.opacity = Math.min(1, S.macToast * 1.15);
1403-
macToast.style.transform =
1404-
"translateY(" +
1405-
(1 - S.macToast) * -34 +
1406-
"px) scale(" +
1407-
(0.965 + S.macToast * 0.035) +
1408-
")";
1409-
macToast.style.filter = "blur(" + (1 - S.macToast) * 4 + "px)";
1401+
macToast.style.opacity = S.macToastOpacity;
1402+
macToast.style.transform = "translateX(" + (S.macToastX - 1002) + "px)";
1403+
macToast.style.filter = "none";
14101404
}
14111405
if (macControl) {
14121406
macControl.style.opacity = 0.5 + S.macPanel * 0.5;
@@ -1467,7 +1461,12 @@
14671461
tl.to(S, { counter: 43, duration: 2, ease: driftEase }, 0.5);
14681462
// Cards stagger in (0→1 reveals all cards sequentially)
14691463
tl.to(S, { cardReveal: 1, duration: 3, ease: breatheEase }, 0.8);
1470-
tl.to(S, { macToast: 1, macPanel: 1, duration: 1.1, ease: breatheEase }, 0.45);
1464+
tl.set(S, { macToastX: 1464, macToastY: 62, macToastOpacity: 0 }, 0);
1465+
tl.to(S, { macToastX: 988, macToastOpacity: 1, duration: 0.38, ease: "power3.out" }, 0.45);
1466+
tl.to(S, { macToastX: 1002, duration: 0.16, ease: "power2.out" }, 0.83);
1467+
tl.to(S, { macToastY: 72, duration: 0.18, ease: "power2.out" }, 4.25);
1468+
tl.to(S, { macToastY: 62, duration: 0.22, ease: "power2.out" }, 4.43);
1469+
tl.to(S, { macPanel: 1, duration: 1.1, ease: breatheEase }, 0.45);
14711470
</script>
14721471
</body>
14731472
</html>

0 commit comments

Comments
 (0)