Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ const newFadeInScrollAnimation: ScrollAnimation = {
description: "Fade in the element as it scrolls into view.",

timing: {
rangeStart: ["start", { type: "unit", value: 0, unit: "%" }],
rangeEnd: ["start", { type: "unit", value: 50, unit: "dvh" }],
rangeStart: ["start", { type: "unit", value: 0, unit: "px" }],
rangeEnd: ["start", { type: "unit", value: 50, unit: "px" }],
fill: "backwards",
easing: "linear",
},
Expand All @@ -45,8 +45,8 @@ const newFadeOutScrollAnimation: ScrollAnimation = {
description: "Fade out the element as it scrolls out of view.",

timing: {
rangeStart: ["end", { type: "unit", value: 50, unit: "dvh" }],
rangeEnd: ["end", { type: "unit", value: 0, unit: "%" }],
rangeStart: ["end", { type: "unit", value: 50, unit: "px" }],
rangeEnd: ["end", { type: "unit", value: 0, unit: "px" }],
fill: "backwards",
easing: "linear",
},
Expand Down
45 changes: 1 addition & 44 deletions packages/sdk/src/schema/animation-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,50 +12,7 @@ const literalUnion = <T extends readonly string[]>(arr: T) =>
);

// Range Units
export const RANGE_UNITS = [
"%",
"px",
"cm",
"mm",
"q",
"in",
"pt",
"pc",
"em",
"rem",
"ex",
"rex",
"cap",
"rcap",
"ch",
"rch",
"lh",
"rlh",
"vw",
"svw",
"lvw",
"dvw",
"vh",
"svh",
"lvh",
"dvh",
"vi",
"svi",
"lvi",
"dvi",
"vb",
"svb",
"lvb",
"dvb",
"vmin",
"svmin",
"lvmin",
"dvmin",
"vmax",
"svmax",
"lvmax",
"dvmax",
] as const;
export const RANGE_UNITS = ["%", "px"] as const;

export const rangeUnitSchema = literalUnion(RANGE_UNITS);

Expand Down