Skip to content

Create professional demos and 3D mockups in seconds, directly in your browser

feat: add new 3D motion presets and animations

CristianOlivera19e1ea498e2c7
diff --git a/app/components/ui/editor/MockupMotionTrackItem.tsx b/app/components/ui/editor/MockupMotionTrackItem.tsx
index 3de6038..941d6a4 100644
--- a/app/components/ui/editor/MockupMotionTrackItem.tsx
+++ b/app/components/ui/editor/MockupMotionTrackItem.tsx
@@ -2,7 +2,7 @@
import { useState, useCallback, useEffect, useMemo } from "react";
import { motion, useMotionValue } from "framer-motion";
-import type { MockupMotionFragment } from "@/lib/mockup-motion";
+import { MOTION_PRESET_3D_IDS, type MockupMotionFragment } from "@/lib/mockup-motion";
import { useTranslations } from "next-intl";
const MIN_FRAGMENT_DURATION = 0.3;
@@ -37,7 +37,7 @@ export function MockupMotionTrackItem({
const label = t(`presets.${fragment.presetId}`);
- const is3D = fragment.presetId === "orbit-entrance" || fragment.presetId === "turntable-drift" || fragment.presetId === "flick-exit";
+ const is3D = MOTION_PRESET_3D_IDS.has(fragment.presetId);
const timeToPixels = useCallback(
(time: number) => (time / videoDuration) * contentWidth,
diff --git a/components/ui/MotionPresetIcon.tsx b/components/ui/MotionPresetIcon.tsx
index 8ac0b67..dfd3241 100644
--- a/components/ui/MotionPresetIcon.tsx
+++ b/components/ui/MotionPresetIcon.tsx
@@ -102,10 +102,6 @@ export function MotionPresetIconStyles() {
.force-animate .mp-card--z-spin-reveal {
animation: mp-z-spin-reveal 1.3s cubic-bezier(0.65, 0, 0.35, 1) infinite alternate;
}
- .group:hover .mp-card--isometric-lift,
- .force-animate .mp-card--isometric-lift {
- animation: mp-isometric-lift 1.3s cubic-bezier(0.65, 0, 0.35, 1) infinite alternate;
- }
.group:hover .mp-card--cinematic-showcase,
.force-animate .mp-card--cinematic-showcase {
animation: mp-cinematic-showcase 2.6s ease-in-out infinite alternate;
@@ -142,14 +138,30 @@ export function MotionPresetIconStyles() {
.force-animate .mp-card--orbit-entrance {
animation: mp-orbit-entrance 1.6s cubic-bezier(0.65, 0, 0.35, 1) infinite alternate;
}
- .group:hover .mp-card--turntable-drift,
- .force-animate .mp-card--turntable-drift {
- animation: mp-turntable-drift 3s ease-in-out infinite alternate;
- }
.group:hover .mp-card--flick-exit,
.force-animate .mp-card--flick-exit {
animation: mp-flick-exit 1s cubic-bezier(0.65, 0, 0.35, 1) infinite alternate;
}
+ .group:hover .mp-card--hero-reveal,
+ .force-animate .mp-card--hero-reveal {
+ animation: mp-hero-reveal 1.8s cubic-bezier(0.65, 0, 0.35, 1) infinite alternate;
+ }
+ .group:hover .mp-card--macro-pan,
+ .force-animate .mp-card--macro-pan {
+ animation: mp-macro-pan 2.6s ease-in-out infinite alternate;
+ }
+ .group:hover .mp-card--screen-glide,
+ .force-animate .mp-card--screen-glide {
+ animation: mp-screen-glide 2.8s ease-in-out infinite alternate;
+ }
+ .group:hover .mp-card--float-hold,
+ .force-animate .mp-card--float-hold {
+ animation: mp-float-hold 3.2s ease-in-out infinite;
+ }
+ .group:hover .mp-card--spiral-drop,
+ .force-animate .mp-card--spiral-drop {
+ animation: mp-spiral-drop 1.2s cubic-bezier(0.65, 0, 0.35, 1) infinite alternate;
+ }
}
@keyframes mp-focus-in {
0% { transform: scale(1.22); filter: blur(3.5px); opacity: 0.45; }
@@ -163,10 +175,6 @@ export function MotionPresetIconStyles() {
0% { transform: scale(0.62) rotateZ(-78deg) rotateX(38deg); opacity: 0.5; }
100% { transform: scale(1) rotateZ(0) rotateX(0); opacity: 1; }
}
- @keyframes mp-isometric-lift {
- 0% { transform: scale(1.28) rotateX(42deg) rotateZ(-18deg); }
- 100% { transform: scale(1) rotateX(8deg) rotateZ(0deg); }
- }
@keyframes mp-cinematic-showcase {
0% { transform: scale(1.4) translate(8%, 6%) rotateX(5deg) rotateY(8deg); filter: blur(1.5px); }
100% { transform: scale(1) translate(0, 0) rotateX(0) rotateY(0); filter: blur(0); }
@@ -216,18 +224,35 @@ export function MotionPresetIconStyles() {
60% { transform: scale(0.9) rotateY(40deg) rotateX(10deg) translateY(5%); opacity: 0.8; }
100% { transform: scale(1) rotateY(0) rotateX(0) translateY(0); opacity: 1; }
}
- @keyframes mp-turntable-drift {
- 0% { transform: rotateY(0deg) translateY(0) scale(1); opacity: 0.6; }
- 25% { transform: rotateY(90deg) translateY(-3%) scale(1.01); opacity: 1; }
- 50% { transform: rotateY(180deg) translateY(0) scale(0.99); opacity: 1; }
- 75% { transform: rotateY(270deg) translateY(3%) scale(1.01); opacity: 1; }
- 100% { transform: rotateY(360deg) translateY(0) scale(1); opacity: 0.6; }
- }
@keyframes mp-flick-exit {
0% { transform: rotateY(0) translateX(0) scale(1); opacity: 1; }
50% { transform: rotateY(40deg) translateX(10%) scale(0.95); opacity: 0.7; }
100% { transform: rotateY(100deg) translateX(35%) scale(0.8); opacity: 0; }
}
+ @keyframes mp-hero-reveal {
+ 0% { transform: rotateY(190deg) rotateX(-22deg) scale(1.35); opacity: 0.4; }
+ 70% { transform: rotateY(12deg) rotateX(0deg) scale(1.02); opacity: 1; }
+ 100% { transform: rotateY(0) rotateX(0) scale(1); opacity: 1; }
+ }
+ @keyframes mp-macro-pan {
+ 0% { transform: scale(1.55) translate(-9%, 7%) rotateY(14deg) rotateX(4deg); }
+ 100% { transform: scale(1.55) translate(9%, -7%) rotateY(-14deg) rotateX(-4deg); }
+ }
+ @keyframes mp-screen-glide {
+ 0% { transform: scale(1.28) translate(2%, -11%) rotateY(6deg) rotateX(-2deg); }
+ 100% { transform: scale(1.28) translate(-2%, 11%) rotateY(-6deg) rotateX(2deg); }
+ }
+ @keyframes mp-float-hold {
+ 0% { transform: translate(0, 0) rotateY(0deg) rotateX(0deg) scale(1); }
+ 25% { transform: translate(2.5%, -2%) rotateY(6deg) rotateX(-2.5deg) scale(1.03); }
+ 50% { transform: translate(0, -3.5%) rotateY(0deg) rotateX(-4deg) scale(1.06); }
+ 75% { transform: translate(-2.5%, -2%) rotateY(-6deg) rotateX(-2.5deg) scale(1.11); }
+ 100% { transform: translate(0, 0) rotateY(0deg) rotateX(0deg) scale(1.15); }
+ }
+ @keyframes mp-spiral-drop {
+ 0% { transform: translateY(0) rotateZ(0) rotateY(0) scale(1); opacity: 1; }
+ 100% { transform: translateY(38%) rotateZ(85deg) rotateY(38deg) scale(0.55); opacity: 0; }
+ }
`}</style>
);
}
\ No newline at end of file
diff --git a/lib/mockup-motion-3d.ts b/lib/mockup-motion-3d.ts
index 9b3239e..597401a 100644
--- a/lib/mockup-motion-3d.ts
+++ b/lib/mockup-motion-3d.ts
@@ -1,32 +1,26 @@
-/**
- * Motion presets for 3D mockups (Three.js / React Three Fiber).
- *
- * Unlike 2D motion (which produces CSS transforms applied to a DOM element),
- * 3D motion produces values intended to be applied directly to a THREE.Group
- * inside the scene graph: Euler rotation (radians), position offset (scene
- * units), uniform scale, and opacity. The consumers (Mockup3DStage) apply
- * these on top of the model's base transform every frame via useFrame.
- *
- * The preset vocabulary is intentionally separate from 2D motion because the
- * visual language differs: 3D models benefit from real orbital camera moves,
- * physical depth parallax, and tumbling reveals that CSS perspective cannot
- * reproduce faithfully.
- */
-
export type Mockup3DMotionPresetId =
| "none"
| "orbit-entrance"
- | "turntable-drift"
- | "flick-exit";
-
+ | "flick-exit"
+ | "hero-reveal"
+ | "macro-pan"
+ | "screen-glide"
+ | "float-hold"
+ | "spiral-drop";
export const MOCKUP_3D_MOTION_PRESETS: {
id: Mockup3DMotionPresetId;
category: "Entrance" | "Continue" | "Exit";
}[] = [
- { id: "orbit-entrance", category: "Entrance" },
- { id: "turntable-drift", category: "Continue" },
- { id: "flick-exit", category: "Exit" },
-];
+ { id: "orbit-entrance", category: "Entrance" },
+ { id: "hero-reveal", category: "Entrance" },
+
+ { id: "macro-pan", category: "Continue" },
+ { id: "screen-glide", category: "Continue" },
+ { id: "float-hold", category: "Continue" },
+
+ { id: "flick-exit", category: "Exit" },
+ { id: "spiral-drop", category: "Exit" },
+ ];
export interface Mockup3DMotionConfig {
presetId: Mockup3DMotionPresetId;
@@ -143,45 +137,6 @@ export function sampleMockup3DMotion(
};
}
- /**
- * TURNTABLE DRIFT — a continuous, slow orbital drift with subtle vertical
- * bob and a gentle scale breathing. Designed to run for the whole clip
- * duration so the model always feels alive without distracting from the
- * screen content.
- */
- case "turntable-drift": {
- const p = clamp01(currentTime / clipDurationSec);
- const speedT = clamp01(speed / 100);
-
- // Full revolution cadence: faster speed completes more turns.
- const turns = lerp(0.4, 1.1, speedT);
- const rotY = p * Math.PI * 2 * turns;
-
- // Vertical bob: 1.5 oscillations across the clip.
- const bobAmp = lerp(0.015, 0.045, i);
- const posY = Math.sin(p * Math.PI * 2 * 1.5) * bobAmp;
-
- // Subtle X-axis tilt sway synced to the bob for a floating feel.
- const tiltAmp = lerp(3, 8, i) * DEG;
- const rotX = Math.sin(p * Math.PI * 2 * 1.5 + Math.PI / 2) * tiltAmp;
-
- // Gentle breathing scale.
- const breathAmp = lerp(0.008, 0.02, i);
- const scale = 1 + Math.sin(p * Math.PI * 2 * 1.5) * breathAmp;
-
- // Soft entry fade-in over the first ~12% so it never pops.
- const entryFade = easeOutCubic(clamp01(p / 0.12));
-
- return {
- ...REST_MOCKUP_3D_MOTION,
- rotX,
- rotY,
- scale,
- posY,
- opacity: entryFade,
- };
- }
-
/**
* FLICK EXIT — the model quickly tilts, rotates, and accelerates away
* while fading out. Mirrors the physical "swipe away" gesture.
@@ -211,6 +166,136 @@ export function sampleMockup3DMotion(
};
}
+ case "hero-reveal": {
+ const dur = Math.min(speedToDurationSec(speed) * 1.5, clipDurationSec);
+ const t = clamp01(currentTime / dur);
+ const eased = easeOutCubic(t);
+ const settleRot = easeOutBack(clamp01(t));
+
+
+ const startRotY = lerp(160, 220, i) * DEG;
+ const startRotX = lerp(-15, -45, i) * DEG;
+ const startScale = lerp(1.2, 1.6, i);
+ const startZ = lerp(-0.1, -0.4, i);
+
+ return {
+ ...REST_MOCKUP_3D_MOTION,
+ rotY: lerp(startRotY, 0, settleRot),
+ rotX: lerp(startRotX, 0, eased),
+ scale: lerp(startScale, 1, eased),
+ posZ: lerp(startZ, 0, eased),
+ opacity: easeOutCubic(clamp01(t * 3)),
+ };
+ }
+
+ case "macro-pan": {
+ const p = clamp01(currentTime / clipDurationSec);
+ const eased = easeInOutCubic(p);
+
+ const zoom = lerp(1.25, 1.6, i);
+
+ const panDistY = lerp(0.15, 0.35, i);
+ const panDistX = lerp(0.08, 0.20, i);
+
+ const startY = -panDistY;
+ const endY = panDistY;
+
+ const startX = -panDistX;
+ const endX = panDistX;
+
+ const baseRotY = lerp(-55, -75, i) * DEG;
+ const tiltY = lerp(baseRotY - (8 * DEG), baseRotY + (8 * DEG), eased);
+
+ const tiltX = lerp(12 * DEG, 0 * DEG, eased);
+
+ return {
+ ...REST_MOCKUP_3D_MOTION,
+ scale: zoom,
+
+ posY: lerp(startY, endY, eased),
+
+ posX: lerp(startX, endX, eased),
+
+ rotY: tiltY,
+ rotX: tiltX,
+
+ rotZ: Math.sin(eased * Math.PI) * (lerp(0.5, 2.5, i) * DEG),
+
+ opacity: 1,
+ };
+ }
+
+ case "screen-glide": {
+ const p = clamp01(currentTime / clipDurationSec);
+ const eased = easeInOutCubic(p);
+
+ const zoom = lerp(1.15, 1.5, i);
+ const panDistY = lerp(0.08, 0.22, i);
+ const panFromY = panDistY * 0.85;
+ const panToY = -panDistY;
+ const driftX = lerp(0.015, 0.05, i);
+ const tiltY = lerp(3, 9, i) * DEG;
+ const tiltX = lerp(1, 3.5, i) * DEG;
+
+ return {
+ ...REST_MOCKUP_3D_MOTION,
+ scale: zoom,
+ posY: lerp(panFromY, panToY, eased),
+ posX: Math.sin(eased * Math.PI) * driftX,
+ rotY: lerp(tiltY, -tiltY, eased),
+ rotX: lerp(-tiltX, tiltX, eased),
+ opacity: 1,
+ };
+ }
+
+ case "float-hold": {
+ const p = clamp01(currentTime / clipDurationSec);
+ const env = Math.min(1, Math.min(p / 0.15, (1 - p) / 0.15) * 4);
+ const envelope = clamp01(env);
+ const zoomEnd = lerp(1.06, 1.2, i);
+ const zoom = lerp(1, zoomEnd, easeInOutCubic(p));
+
+ const w = Math.PI * lerp(0.35, 0.6, i);
+ const ampX = lerp(0.015, 0.05, i) * envelope;
+ const ampY = lerp(0.012, 0.04, i) * envelope;
+ const ampRotY = lerp(2.5, 8, i) * DEG * envelope;
+ const ampRotX = lerp(1.5, 5, i) * DEG * envelope;
+
+ return {
+ ...REST_MOCKUP_3D_MOTION,
+ scale: zoom,
+ posX: Math.sin(currentTime * w) * ampX,
+ posY: Math.cos(currentTime * w * 0.75) * ampY,
+ rotY: Math.sin(currentTime * w * 0.8) * ampRotY,
+ rotX: Math.cos(currentTime * w * 0.6) * ampRotX,
+ rotZ: Math.sin(currentTime * w * 0.5) * ampRotX * 0.3,
+ opacity: 1,
+ };
+ }
+
+ case "spiral-drop": {
+ const dur = Math.min(speedToDurationSec(speed) * 1.1, clipDurationSec);
+ const startAt = Math.max(0, clipDurationSec - dur);
+ const t = clamp01((currentTime - startAt) / dur);
+ const eased = easeOutQuint(t);
+
+ const dropY = lerp(-0.15, -0.5, i);
+ const spinZ = lerp(45, 120, i) * DEG;
+ const spinY = lerp(20, 60, i) * DEG;
+ const spinX = lerp(10, 40, i) * DEG;
+ const scaleDown = lerp(0.85, 0.5, i);
+
+ return {
+ ...REST_MOCKUP_3D_MOTION,
+ posY: lerp(0, dropY, eased),
+ rotZ: lerp(0, spinZ, eased),
+ rotY: lerp(0, spinY, eased),
+ rotX: lerp(0, spinX, eased),
+ scale: lerp(1, scaleDown, eased),
+ opacity: lerp(1, 0, eased),
+ };
+ }
+
default:
return REST_MOCKUP_3D_MOTION;
}
@@ -221,7 +306,11 @@ const DEFAULT_CONTINUOUS_DURATION = 3;
const SMALL_DURATION_PRESETS_3D = new Set<Mockup3DMotionPresetId>(["orbit-entrance"]);
-const LONG_DURATION_PRESETS_3D = new Set<Mockup3DMotionPresetId>(["turntable-drift"]);
+const LONG_DURATION_PRESETS_3D = new Set<Mockup3DMotionPresetId>([
+ "macro-pan",
+ "screen-glide",
+ "float-hold",
+]);
export function getDefault3DFragmentDuration(
presetId: Mockup3DMotionPresetId,
diff --git a/lib/mockup-motion.ts b/lib/mockup-motion.ts
index c5d04f7..699527c 100644
--- a/lib/mockup-motion.ts
+++ b/lib/mockup-motion.ts
@@ -15,8 +15,12 @@ export type MockupMotionPresetId =
| "crane-sweep"
| "z-spin-reveal"
| "orbit-entrance"
- | "turntable-drift"
- | "flick-exit";
+ | "flick-exit"
+ | "hero-reveal"
+ | "macro-pan"
+ | "screen-glide"
+ | "float-hold"
+ | "spiral-drop";
export type MockupMotionMode = "2d" | "3d";
@@ -27,22 +31,26 @@ export interface MockupMotionPresetDef {
}
export const MOCKUP_MOTION_PRESETS: MockupMotionPresetDef[] = [
- { id: "focus-in", category: "Entrance", mode: "2d" },
- { id: "depth-emerge", category: "Entrance", mode: "2d" },
- { id: "z-spin-reveal", category: "Entrance", mode: "2d" },
- { id: "isometric-lift", category: "Entrance", mode: "2d" },
- { id: "cinematic-showcase", category: "Continue", mode: "2d" },
- { id: "macro-track", category: "Continue", mode: "2d" },
- { id: "whip-showcase", category: "Continue", mode: "2d" },
- { id: "spatial-roam", category: "Continue", mode: "2d" },
- { id: "crane-sweep", category: "Continue", mode: "2d" },
- { id: "rise-crash", category: "Continue", mode: "2d" },
- { id: "exit-fade-down", category: "Exit", mode: "2d" },
- { id: "exit-scale-blur", category: "Exit", mode: "2d" },
- { id: "orbit-entrance", category: "Entrance", mode: "3d" },
- { id: "turntable-drift", category: "Continue", mode: "3d" },
- { id: "flick-exit", category: "Exit", mode: "3d" },
- ];
+ { id: "focus-in", category: "Entrance", mode: "2d" },
+ { id: "depth-emerge", category: "Entrance", mode: "2d" },
+ { id: "z-spin-reveal", category: "Entrance", mode: "2d" },
+ { id: "isometric-lift", category: "Entrance", mode: "2d" },
+ { id: "cinematic-showcase", category: "Continue", mode: "2d" },
+ { id: "macro-track", category: "Continue", mode: "2d" },
+ { id: "whip-showcase", category: "Continue", mode: "2d" },
+ { id: "spatial-roam", category: "Continue", mode: "2d" },
+ { id: "crane-sweep", category: "Continue", mode: "2d" },
+ { id: "rise-crash", category: "Continue", mode: "2d" },
+ { id: "exit-fade-down", category: "Exit", mode: "2d" },
+ { id: "exit-scale-blur", category: "Exit", mode: "2d" },
+ { id: "orbit-entrance", category: "Entrance", mode: "3d" },
+ { id: "flick-exit", category: "Exit", mode: "3d" },
+ { id: "hero-reveal", category: "Entrance", mode: "3d" },
+ { id: "macro-pan", category: "Continue", mode: "3d" },
+ { id: "screen-glide", category: "Continue", mode: "3d" },
+ { id: "float-hold", category: "Continue", mode: "3d" },
+ { id: "spiral-drop", category: "Exit", mode: "3d" },
+];
/** IDs that belong to 3D mode (used for routing to the 3D sampler). */
export const MOTION_PRESET_3D_IDS: ReadonlySet<MockupMotionPresetId> = new Set(
@@ -391,7 +399,7 @@ export function sampleMockupMotion(
const speedT = clamp01(speed / 100);
const i = clamp01(intensity / 100);
const p = clamp01(currentTime / clipDurationSec);
-
+
const act1 = lerp(0.12, 0.10, speedT);
const act2 = lerp(0.32, 0.28, speedT);
const act3 = lerp(0.42, 0.36, speedT);
@@ -400,10 +408,10 @@ export function sampleMockupMotion(
const act6 = lerp(0.85, 0.78, speedT);
const heroScale = lerp(1.02, 1.05, i);
const orbitScale = lerp(1.1, 1.2, i);
- const macroScale = lerp(1.6, 1.85, i);
+ const macroScale = lerp(1.6, 1.85, i);
const tiltXMax = lerp(20, 35, i);
const tiltYMax = lerp(20, 35, i);
-
+
const ptBottomRight = { x: -lerp(0.15, 0.22, i), y: -lerp(0.15, 0.22, i) };
const ptTopRight = { x: -lerp(0.15, 0.22, i), y: lerp(0.15, 0.22, i) };
const ptTopLeft = { x: lerp(0.15, 0.22, i), y: lerp(0.15, 0.22, i) };
@@ -438,8 +446,8 @@ export function sampleMockupMotion(
const t = clamp01((p - act1) / (act2 - act1));
scale = macroScale * lensBreath;
- anchorX = ptBottomRight.x;
- anchorY = lerp(ptBottomRight.y, ptTopRight.y, t);
+ anchorX = ptBottomRight.x;
+ anchorY = lerp(ptBottomRight.y, ptTopRight.y, t);
tiltX = tiltXMax;
tiltY = lerp(-tiltYMax, -tiltYMax * 0.6, t);
@@ -449,12 +457,12 @@ export function sampleMockupMotion(
const lp = easeInOutCubic(t);
const arc = Math.sin(t * Math.PI);
- scale = lerp(macroScale, macroScale * 0.85, lp) - (arc * 0.15);
+ scale = lerp(macroScale, macroScale * 0.85, lp) - (arc * 0.15);
anchorX = lerp(ptTopRight.x, ptTopLeft.x, lp);
- anchorY = lerp(ptTopRight.y, ptTopLeft.y, lp);
+ anchorY = lerp(ptTopRight.y, ptTopLeft.y, lp);
tiltX = lerp(tiltXMax, tiltXMax * 0.5, lp) + (arc * 15);
- tiltY = lerp(-tiltYMax * 0.6, tiltYMax, lp);
+ tiltY = lerp(-tiltYMax * 0.6, tiltYMax, lp);
tiltZ = arc * lerp(6, 12, i);
blur = arc * lerp(12, 24, i);
@@ -527,23 +535,23 @@ export function sampleMockupMotion(
const speedT = clamp01(speed / 100);
const i = clamp01(intensity / 100);
const p = clamp01(currentTime / clipDurationSec);
- const a1 = lerp(0.12, 0.09, speedT);
- const a2 = lerp(0.30, 0.25, speedT);
- const a3 = lerp(0.44, 0.38, speedT);
- const a4 = lerp(0.54, 0.47, speedT);
- const a5 = lerp(0.68, 0.62, speedT);
- const a6 = lerp(0.84, 0.78, speedT);
-
- const cenitalScale = lerp(0.88, 0.98, i);
+ const a1 = lerp(0.12, 0.09, speedT);
+ const a2 = lerp(0.30, 0.25, speedT);
+ const a3 = lerp(0.44, 0.38, speedT);
+ const a4 = lerp(0.54, 0.47, speedT);
+ const a5 = lerp(0.68, 0.62, speedT);
+ const a6 = lerp(0.84, 0.78, speedT);
+
+ const cenitalScale = lerp(0.88, 0.98, i);
const heroScale = lerp(1.02, 1.08, i);
const macroScale = lerp(1.50, 1.80, i);
-
- const cenitalTiltX = -lerp(55, 82, i);
- const hoverTiltX = -lerp(18, 32, i);
- const levelTiltX = lerp(2, 5, i);
- const tiltYMax = lerp(16, 28, i);
-
+ const cenitalTiltX = -lerp(55, 82, i);
+ const hoverTiltX = -lerp(18, 32, i);
+ const levelTiltX = lerp(2, 5, i);
+
+ const tiltYMax = lerp(16, 28, i);
+
const ptCenter = { x: 0, y: 0 };
const ptRightFeature = { x: -lerp(0.18, 0.28, i), y: lerp(0.02, 0.06, i) };
const ptLeftFeature = { x: lerp(0.18, 0.28, i), y: lerp(-0.02, -0.06, i) };
@@ -587,13 +595,13 @@ export function sampleMockupMotion(
tx: levelTiltX * 0.6, ty: tiltYMax * 0.20, tz: 0, blur: 0
};
-
+
const h6 = {
s: heroScale, x: 0, y: 0,
tx: lerp(5, 12, i), ty: -lerp(10, 18, i), tz: 0, blur: 0
};
-
+
const h7_end = {
s: heroScale * lerp(1.1, 1.18, i),
x: 0,
@@ -604,9 +612,9 @@ export function sampleMockupMotion(
blur: 0
};
-
-
-
+
+
+
let scale: number;
let anchorX: number;
let anchorY: number;
@@ -616,7 +624,7 @@ export function sampleMockupMotion(
let blur: number;
if (p <= a1) {
-
+
const t = clamp01(p / a1);
const lp = easeOutCubic(t);
scale = lerp(h0.s, h1.s, lp) * breath;
@@ -628,7 +636,7 @@ export function sampleMockupMotion(
blur = 0;
} else if (p <= a2) {
-
+
const t = clamp01((p - a1) / (a2 - a1));
const lp = smootherStep(t);
scale = lerp(h1.s, h2.s, lp) * breath;
@@ -640,7 +648,7 @@ export function sampleMockupMotion(
blur = 0;
} else if (p <= a3) {
-
+
const t = clamp01((p - a2) / (a3 - a2));
const lp = smoothStep(t);
scale = lerp(h2.s, h3.s, lp) * breath;
@@ -652,20 +660,20 @@ export function sampleMockupMotion(
blur = 0;
} else if (p <= a4) {
-
+
const t = clamp01((p - a3) / (a4 - a3));
const lp = easeInOutCubic(t);
const arc = Math.sin(Math.PI * lp);
const arcAsym = Math.sin(Math.PI * Math.pow(lp, 0.8));
scale = lerp(h3.s, h4.s, lp) * lerp(1, 0.88, arc);
-
+
const midX = (h3.x + h4.x) * 0.5;
const midY = Math.max(h3.y, h4.y) + lerp(0.04, 0.10, i);
const u = 1 - lp;
anchorX = u * u * h3.x + 2 * u * lp * midX + lp * lp * h4.x;
anchorY = u * u * h3.y + 2 * u * lp * midY + lp * lp * h4.y;
-
+
const flare = arcAsym * lerp(0.55, 1.0, i);
tiltX = lerp(h3.tx, h4.tx, lp) + flare * hoverTiltX * 0.5;
tiltY = lerp(h3.ty, h4.ty, lp) + flare * tiltYMax * 0.6;
@@ -673,7 +681,7 @@ export function sampleMockupMotion(
blur = arcAsym * motionBlurMax;
} else if (p <= a5) {
-
+
const t = clamp01((p - a4) / (a5 - a4));
const lp = smoothStep(t);
scale = lerp(h4.s, h5.s, lp) * breath;
@@ -687,10 +695,10 @@ export function sampleMockupMotion(
tiltX = lerp(h4.tx, h5.tx, lp) + driftX * lerp(10, 24, i);
tiltY = lerp(h4.ty, h5.ty, lp) + driftY * lerp(8, 16, i);
tiltZ = handRot * 0.4;
- blur = lerp(lerp(2, 5, i), 0, lp);
+ blur = lerp(lerp(2, 5, i), 0, lp);
} else if (p <= a6) {
-
+
const t = clamp01((p - a5) / (a6 - a5));
const lp = smootherStep(t);
scale = lerp(h5.s, h6.s, lp) * breath;
@@ -702,16 +710,16 @@ export function sampleMockupMotion(
blur = 0;
} else {
-
+
const t = clamp01((p - a6) / (1 - a6));
- const lp = easeOutExpo(t);
+ const lp = easeOutExpo(t);
scale = lerp(h6.s, h7_end.s, lp) * breath;
anchorX = lerp(h6.x, h7_end.x, lp);
anchorY = lerp(h6.y, h7_end.y, lp);
tiltX = lerp(h6.tx, h7_end.tx, lp);
tiltY = lerp(h6.ty, h7_end.ty, lp);
-
+
const finalSettle = 1 - lp;
tiltZ = handRot * 0.2 * finalSettle;
blur = 0;
@@ -727,7 +735,7 @@ export function sampleMockupMotion(
const translateXPct = scale * anchorX * 100;
const translateYPct = scale * anchorY * 100;
-
+
const tiltMag = Math.abs(tiltX) + Math.abs(tiltY);
const tiltNorm = clamp01(tiltMag / (Math.abs(cenitalTiltX) + tiltYMax || 1));
const perspective = lerp(3500, 900, tiltNorm);
@@ -750,7 +758,7 @@ export function sampleMockupMotion(
const speedT = clamp01(speed / 100);
const i = clamp01(intensity / 100);
const p = clamp01(currentTime / clipDurationSec);
-
+
const act1 = lerp(0.12, 0.10, speedT);
const act2 = lerp(0.30, 0.26, speedT);
const act3 = lerp(0.44, 0.38, speedT);
@@ -760,15 +768,15 @@ export function sampleMockupMotion(
const heroScale = lerp(1.02, 1.08, i);
const macroScale = lerp(1.55, 1.85, i);
- const crashScale = lerp(1.35, 1.65, i);
-
- const tiltXMax = lerp(22, 38, i);
+ const crashScale = lerp(1.35, 1.65, i);
+
+ const tiltXMax = lerp(22, 38, i);
const tiltYMax = lerp(14, 26, i);
-
+
const ptTop = { x: lerp(0.06, 0.12, i), y: lerp(0.18, 0.32, i) };
const ptBottom = { x: lerp(-0.08, -0.16, i), y: -lerp(0.18, 0.32, i) };
const ptCenter = { x: 0, y: 0 };
-
+
const easeInOutCubic = (t: number): number =>
t < 0.5 ? 4 * t ** 3 : 1 - (-2 * t + 2) ** 3 / 2;
const smootherStep = (t: number): number => t * t * t * (t * (t * 6 - 15) + 10);
@@ -787,7 +795,7 @@ export function sampleMockupMotion(
scale = lerp(heroScale, macroScale, lp);
anchorX = lerp(0, ptTop.x, lp);
anchorY = lerp(0, ptTop.y, lp);
- tiltX = lerp(tiltXMax, tiltXMax * 0.25, lp);
+ tiltX = lerp(tiltXMax, tiltXMax * 0.25, lp);
tiltY = lerp(0, tiltYMax * 0.3, lp);
blur = 0;
@@ -803,12 +811,12 @@ export function sampleMockupMotion(
const t = clamp01((p - act2) / (act3 - act2));
const lp = easeInOutCubic(t);
const arc = Math.sin(t * Math.PI);
- scale = lerp(macroScale, crashScale, lp) * lerp(1, 0.88, arc);
+ scale = lerp(macroScale, crashScale, lp) * lerp(1, 0.88, arc);
anchorX = lerp(ptTop.x, ptBottom.x, lp);
anchorY = lerp(ptTop.y, ptBottom.y, lp);
tiltX = lerp(tiltXMax * 0.25, -tiltXMax * 0.6, lp) + arc * lerp(8, 18, i);
tiltY = lerp(tiltYMax * 0.15, -tiltYMax * 0.4, lp);
- tiltZ = arc * lerp(-5, -12, i);
+ tiltZ = arc * lerp(-5, -12, i);
blur = arc * lerp(14, 28, i);
} else if (p <= act4) {
@@ -819,7 +827,7 @@ export function sampleMockupMotion(
anchorY = ptBottom.y;
tiltX = lerp(-tiltXMax * 0.6, -tiltXMax * 0.35, lp);
tiltY = lerp(-tiltYMax * 0.4, -tiltYMax * 0.2, lp);
- blur = lerp(lerp(3, 6, i), 0, lp);
+ blur = lerp(lerp(3, 6, i), 0, lp);
} else if (p <= act5) {
const t = clamp01((p - act4) / (act5 - act4));
@@ -839,7 +847,7 @@ export function sampleMockupMotion(
scale = lerp(macroScale * 1.05, heroScale, lp);
anchorX = lerp(ptCenter.x, 0, lp);
anchorY = lerp(ptCenter.y, 0, lp);
- tiltX = lerp(0, tiltXMax, lp);
+ tiltX = lerp(0, tiltXMax, lp);
tiltY = 0;
tiltZ = 0;
blur = 0;
@@ -850,7 +858,7 @@ export function sampleMockupMotion(
scale = heroScale;
anchorX = 0;
anchorY = 0;
- tiltX = tiltXMax;
+ tiltX = tiltXMax;
tiltY = 0;
tiltZ = 0;
blur = 0;
@@ -877,13 +885,13 @@ export function sampleMockupMotion(
case "whip-showcase": {
const speedT = clamp01(speed / 100);
const i = clamp01(intensity / 100);
- const a1 = lerp(0.12, 0.08, speedT);
- const a2 = lerp(0.28, 0.22, speedT);
- const a3 = lerp(0.44, 0.36, speedT);
- const a4 = lerp(0.52, 0.44, speedT);
- const a5 = lerp(0.68, 0.60, speedT);
- const a6 = lerp(0.80, 0.72, speedT);
- const a7 = lerp(0.90, 0.84, speedT);
+ const a1 = lerp(0.12, 0.08, speedT);
+ const a2 = lerp(0.28, 0.22, speedT);
+ const a3 = lerp(0.44, 0.36, speedT);
+ const a4 = lerp(0.52, 0.44, speedT);
+ const a5 = lerp(0.68, 0.60, speedT);
+ const a6 = lerp(0.80, 0.72, speedT);
+ const a7 = lerp(0.90, 0.84, speedT);
const p = clamp01(currentTime / clipDurationSec);
const anchorHero = { x: 0, y: 0 };
@@ -923,10 +931,10 @@ export function sampleMockupMotion(
tiltX: featBTiltX * 0.4,
tiltY: featBTiltY * 0.4,
};
-
+
const handoff6End = {
scale: zoomHero * lerp(1.06, 1.12, i),
- anchorX: lerp(0.04, 0.10, i),
+ anchorX: lerp(0.04, 0.10, i),
anchorY: lerp(0.01, 0.03, i),
tiltX: heroTiltX * lerp(0.85, 0.95, i),
tiltY: heroTiltY * lerp(0.85, 0.95, i),
@@ -934,19 +942,19 @@ export function sampleMockupMotion(
const handoff7End = {
scale: zoomHero * lerp(1.02, 1.06, i),
- anchorX: -lerp(0.04, 0.10, i),
+ anchorX: -lerp(0.04, 0.10, i),
anchorY: lerp(0.005, 0.015, i),
tiltX: heroTiltX * lerp(0.9, 1.0, i),
tiltY: heroTiltY * lerp(0.9, 1.0, i),
};
-
+
const smoothStep = (t: number): number => t * t * (3 - 2 * t);
const smootherStep = (t: number): number => t * t * t * (t * (t * 6 - 15) + 10);
const easeInOutQuart = (t: number): number =>
t < 0.5 ? 8 * t * t * t * t : 1 - Math.pow(-2 * t + 2, 4) / 2;
const easeOutBack = (t: number, o: number = 1.70158): number =>
1 + (o + 1) * Math.pow(t - 1, 3) + o * Math.pow(t - 1, 2);
-
+
const hSeed = currentTime * lerp(0.8, 1.8, i);
const hAmp = lerp(0.08, 0.20, i);
const handX = Math.sin(hSeed * 3.1) * Math.cos(hSeed * 1.7) * hAmp;
@@ -1081,14 +1089,14 @@ export function sampleMockupMotion(
blur = 0;
}
-
+
const inWhip = (p > a3 && p < a4);
if (!inWhip) {
anchorX += handX * 0.001;
anchorY += handY * 0.001;
}
-
+
const translateXPct = scale * anchorX * 100;
const translateYPct = scale * anchorY * 100;
diff --git a/messages/en.json b/messages/en.json
index 4d9b521..264e893 100644
--- a/messages/en.json
+++ b/messages/en.json
@@ -1379,8 +1379,12 @@
"rise-crash": "Rise and Crash",
"crane-sweep": "Crane Sweep",
"orbit-entrance": "Orbit Entrance",
- "turntable-drift": "Turntable Drift",
- "flick-exit": "Flick Exit"
+ "flick-exit": "Flick Exit",
+ "hero-reveal": "Hero Reveal",
+ "macro-pan": "Macro Pan",
+ "screen-glide": "Screen Glide",
+ "float-hold": "Floating Hold",
+ "spiral-drop": "Spiral Drop"
},
"controls": {
"intensity": "Intensity",
diff --git a/messages/es.json b/messages/es.json
index ddf6c57..2f3c4fa 100644
--- a/messages/es.json
+++ b/messages/es.json
@@ -1357,8 +1357,12 @@
"rise-crash": "Elevación y Caída Rápida",
"crane-sweep": "Barrido de Grúa",
"orbit-entrance": "Entrada en órbita",
- "turntable-drift": "Giro de plataforma",
- "flick-exit": "Salida rápida"
+ "flick-exit": "Salida rápida",
+ "hero-reveal": "Revelación Hero",
+ "macro-pan": "Paneo Macro",
+ "screen-glide": "Recorrido de Pantalla",
+ "float-hold": "Flotación Suave",
+ "spiral-drop": "Caída en Espiral"
},
"controls": {
"intensity": "Intensidad",
diff --git a/messages/ko.json b/messages/ko.json
index adb2273..0d59e71 100644
--- a/messages/ko.json
+++ b/messages/ko.json
@@ -1379,8 +1379,12 @@
"rise-crash": "상승 및 추락",
"crane-sweep": "크레인 스윕",
"orbit-entrance": "오빗 입장",
- "turntable-drift": "턴테이블 드리프트",
- "flick-exit": "플릭 퇴장"
+ "flick-exit": "플릭 퇴장",
+ "hero-reveal": "히어로 리빌",
+ "macro-pan": "매크로 팬",
+ "screen-glide": "화면 슬라이드",
+ "float-hold": "플로팅 홀드",
+ "spiral-drop": "스파이럴 드롭"
},
"controls": {
"intensity": "강도",
diff --git a/messages/ru.json b/messages/ru.json
index 37c1815..9bced28 100644
--- a/messages/ru.json
+++ b/messages/ru.json
@@ -1379,8 +1379,12 @@
"rise-crash": "Взлет и Падение",
"crane-sweep": "Панорама Кран-Стрелы",
"orbit-entrance": "Орбитальный вход",
- "turntable-drift": "Вращение подиума",
- "flick-exit": "Быстрый выход"
+ "flick-exit": "Быстрый выход",
+ "hero-reveal": "Эффектный показ",
+ "macro-pan": "Макро-панорама",
+ "screen-glide": "Плавный обзор экрана",
+ "float-hold": "Мягкое парение",
+ "spiral-drop": "Спиральное падение"
},
"controls": {
"intensity": "Интенсивность",