Stagger a rectangular panel's new dashboard by rail order
Changing dashboard kept the grid mounted, so every new tile rose at once. The grid is drawn afresh per dashboard and its tiles come in row by row: from below, top row first, for one further down the rail, and from above, bottom row first, for one further up, as a round panel's dashboards slide. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WgBfkm4rCmtd1T4vHWjEPx
This commit is contained in:
@@ -21,7 +21,8 @@ import type { Look } from "../../settings"
|
||||
|
||||
type LookMotion = {
|
||||
spring: Transition
|
||||
/** How a widget arrives on the canvas. */
|
||||
/** How a widget arrives on the canvas. `custom` is the side it comes from,
|
||||
* as `gridStagger` takes it. */
|
||||
enter: Variants
|
||||
/** Seconds for one round of the ambient ground; 0 draws none. */
|
||||
drift: number
|
||||
@@ -34,7 +35,7 @@ export const LOOK: Record<Look, LookMotion> = {
|
||||
// the way the rest of the product does.
|
||||
spring: { type: "spring", stiffness: 420, damping: 34, mass: 1 },
|
||||
enter: {
|
||||
hidden: { opacity: 0, y: 8 },
|
||||
hidden: (from = 1) => ({ opacity: 0, y: 8 * from }),
|
||||
visible: { opacity: 1, y: 0 },
|
||||
},
|
||||
drift: 0,
|
||||
@@ -42,7 +43,7 @@ export const LOOK: Record<Look, LookMotion> = {
|
||||
material: {
|
||||
spring: { type: "spring", stiffness: 550, damping: 38, mass: 1 },
|
||||
enter: {
|
||||
hidden: { opacity: 0, y: 8 },
|
||||
hidden: (from = 1) => ({ opacity: 0, y: 8 * from }),
|
||||
visible: { opacity: 1, y: 0 },
|
||||
},
|
||||
drift: 0,
|
||||
@@ -50,15 +51,23 @@ export const LOOK: Record<Look, LookMotion> = {
|
||||
glass: {
|
||||
spring: { type: "spring", stiffness: 320, damping: 22, mass: 0.8 },
|
||||
enter: {
|
||||
hidden: { opacity: 0, y: 12, scale: 0.96 },
|
||||
hidden: (from = 1) => ({ opacity: 0, y: 12 * from, scale: 0.96 }),
|
||||
visible: { opacity: 1, y: 0, scale: 1 },
|
||||
},
|
||||
drift: 46,
|
||||
},
|
||||
}
|
||||
|
||||
/** Widgets arrive as a page rather than all at once. */
|
||||
/**
|
||||
* Widgets arrive as a page rather than all at once, row by row.
|
||||
*
|
||||
* `custom` is the side they come from: below (1), as a round panel's next
|
||||
* dashboard rises, or above (-1) for one further up a panel's rail, which
|
||||
* brings the last row in first.
|
||||
*/
|
||||
export const gridStagger: Variants = {
|
||||
hidden: {},
|
||||
visible: { transition: { staggerChildren: 0.03 } },
|
||||
visible: (from = 1) => ({
|
||||
transition: { staggerChildren: 0.03, staggerDirection: from < 0 ? -1 : 1 },
|
||||
}),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user