update logo
improve font resolution logic generate icons improve timeline
This commit is contained in:
@@ -6,7 +6,7 @@ import {
|
||||
RectEntity,
|
||||
TextEntity,
|
||||
} from "./Entities";
|
||||
import { AnimatedVec2 } from "./Values";
|
||||
import { AnimatedVec2, AnimatedVec3 } from "./Values";
|
||||
import { TextPaint } from "./Paint";
|
||||
|
||||
export const AnimationData = z.object({
|
||||
@@ -21,7 +21,7 @@ export const AnimatedTransform = z.object({
|
||||
/** Skews by the given animated vec2 */
|
||||
skew: AnimatedVec2,
|
||||
/** Rotates by the given animated vec2 */
|
||||
rotate: AnimatedVec2,
|
||||
rotate: AnimatedVec3,
|
||||
/** Scales on the x and y axis by the given animated vec2 */
|
||||
scale: AnimatedVec2,
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { z } from "zod";
|
||||
import { Vec2 } from "./Values";
|
||||
import { Vec2, Vec3 } from "./Values";
|
||||
import { Paint, TextPaint } from "./Paint";
|
||||
|
||||
const EntityTypeOptions = ["Text", "Ellipse", "Rect", "StaggeredText"] as const;
|
||||
@@ -8,7 +8,7 @@ export const EntityType = z.enum(EntityTypeOptions);
|
||||
|
||||
export const Transform = z.object({
|
||||
skew: Vec2,
|
||||
rotate: Vec2,
|
||||
rotate: Vec3,
|
||||
translate: Vec2,
|
||||
scale: Vec2,
|
||||
});
|
||||
|
||||
@@ -35,7 +35,7 @@ export const Paint = z.object({
|
||||
export const TextPaint = z.object({
|
||||
style: PaintStyle,
|
||||
align: TextAlign,
|
||||
fontName: z.string(),
|
||||
font_name: z.string(),
|
||||
size: z.number().min(0),
|
||||
});
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import { Keyframes } from "./Keyframe";
|
||||
import { Interpolation } from "./Interpolation";
|
||||
|
||||
export const Vec2 = z.array(z.number()).length(2);
|
||||
export const Vec3 = z.array(z.number()).length(3);
|
||||
|
||||
export const AnimatedNumber = z.object({
|
||||
keyframes: Keyframes,
|
||||
@@ -12,6 +13,10 @@ export const AnimatedVec2 = z.object({
|
||||
keyframes: z.array(AnimatedNumber).length(2),
|
||||
});
|
||||
|
||||
export const AnimatedVec3 = z.object({
|
||||
keyframes: z.array(AnimatedNumber).length(3),
|
||||
});
|
||||
|
||||
export function staticAnimatedNumber(
|
||||
number: number
|
||||
): z.infer<typeof AnimatedNumber> {
|
||||
@@ -33,35 +38,22 @@ export function staticAnimatedNumber(
|
||||
export function staticAnimatedVec2(
|
||||
x: number,
|
||||
y: number
|
||||
): z.infer<typeof AnimatedVec2> {
|
||||
return {
|
||||
keyframes: [staticAnimatedNumber(x), staticAnimatedNumber(y)],
|
||||
};
|
||||
}
|
||||
|
||||
export function staticAnimatedVec3(
|
||||
x: number,
|
||||
y: number,
|
||||
z: number
|
||||
): z.infer<typeof AnimatedVec2> {
|
||||
return {
|
||||
keyframes: [
|
||||
{
|
||||
keyframes: {
|
||||
values: [
|
||||
{
|
||||
interpolation: {
|
||||
type: "Linear",
|
||||
},
|
||||
value: x,
|
||||
offset: 0,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
keyframes: {
|
||||
values: [
|
||||
{
|
||||
interpolation: {
|
||||
type: "Linear",
|
||||
},
|
||||
value: y,
|
||||
offset: 0,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
staticAnimatedNumber(x),
|
||||
staticAnimatedNumber(y),
|
||||
staticAnimatedNumber(z),
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user