Skip to content

Commit

Permalink
Add word prop
Browse files Browse the repository at this point in the history
  • Loading branch information
pskd73 committed Dec 6, 2023
1 parent 4920ded commit da5b568
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
12 changes: 11 additions & 1 deletion packages/example/src/Example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { AbsoluteFill } from "remotion";
import { z } from "zod";

export const inputSchema = z.object({
word: z.boolean().default(false),
duration: z.number().min(1),
opacity: z.array(z.number().step(0.1).min(0).max(1)).optional(),
x: z.array(z.number().step(0.1)).optional(),
Expand All @@ -13,6 +14,7 @@ export const inputSchema = z.object({
});

export default function Example({
word,
duration,
opacity,
x,
Expand All @@ -33,7 +35,15 @@ export default function Example({
<h1 style={{ fontSize: 200, fontFamily: "sans-serif", color: "black" }}>
<AnimatedSpan
duration={duration}
animation={{ opacity, x, y, scale, rotate, windowSize }}
animation={{
delimiter: word ? " " : "",
opacity,
x,
y,
scale,
rotate,
windowSize,
}}
>
Hello world!
</AnimatedSpan>
Expand Down
3 changes: 2 additions & 1 deletion packages/example/src/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const Root = () => {
y: [0, 0],
scale: [1, 1],
rotate: [0, 0],
windowSize: 20
windowSize: 20,
word: false,
}}
schema={inputSchema}
/>
Expand Down

0 comments on commit da5b568

Please sign in to comment.