-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
21d2e87
commit 33a8dc0
Showing
12 changed files
with
89 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
import { SimpleTrailFunction } from '../types' | ||
|
||
export const parallel = (frames: SimpleTrailFunction[]): SimpleTrailFunction => startAt => | ||
frames.flatMap(frameFn => frameFn(startAt)) | ||
export const parallel = | ||
(frames: SimpleTrailFunction[]): SimpleTrailFunction => | ||
(startAt) => | ||
frames.flatMap((frameFn) => frameFn(startAt)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import { SimpleTrailFunction } from '../types' | ||
import { totalDuration } from '../timeline/totalDuration' | ||
|
||
export const sequence = ( | ||
frames: SimpleTrailFunction[], | ||
): SimpleTrailFunction => startAt => { | ||
let offset = startAt | ||
return frames.flatMap(frameFn => { | ||
const frame = frameFn(offset) | ||
offset = totalDuration(frame) | ||
return frame | ||
}) | ||
} | ||
export const sequence = | ||
(frames: SimpleTrailFunction[]): SimpleTrailFunction => | ||
(startAt) => { | ||
let offset = startAt | ||
return frames.flatMap((frameFn) => { | ||
const frame = frameFn(offset) | ||
offset = totalDuration(frame) | ||
return frame | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { TrailFrame } from '../types' | ||
|
||
export const totalDuration = (frames: TrailFrame[]): number => | ||
Math.max(...frames.map(frame => frame.startAt + frame.duration)) | ||
Math.max(...frames.map((frame) => frame.startAt + frame.duration)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
export const text = (txt: string) => (n: number): string | number => { | ||
return txt.substr(0, txt.length * n) | ||
} | ||
export const text = | ||
(txt: string) => | ||
(n: number): string | number => { | ||
return txt.substr(0, txt.length * n) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters