This commit is contained in:
parent
1d9c38e94a
commit
a8943fc924
32
app/src/services/render.service.ts
Normal file
32
app/src/services/render.service.ts
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
import { Timeline } from "primitives/Timeline";
|
||||||
|
// TODO: publish package maybe provide wrapper etc.
|
||||||
|
import * as creatorWasm from "../../../lib/creator_rs/pkg";
|
||||||
|
import { z } from "zod";
|
||||||
|
import { useTimelineStore } from "stores/timeline.store";
|
||||||
|
import { useEntitiesStore } from "stores/entities.store";
|
||||||
|
import { useRenderStateStore } from "stores/render-state.store";
|
||||||
|
|
||||||
|
export class RenderService {
|
||||||
|
render() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
calculate() {
|
||||||
|
const timelineStore = useTimelineStore.getState();
|
||||||
|
const entitiesStore = useEntitiesStore.getState();
|
||||||
|
const renderStateStore = useRenderStateStore.getState();
|
||||||
|
|
||||||
|
|
||||||
|
let timeline: z.input<typeof Timeline> = {
|
||||||
|
...timelineStore,
|
||||||
|
entities: entitiesStore.entities,
|
||||||
|
render_state: renderStateStore.renderState
|
||||||
|
}
|
||||||
|
|
||||||
|
timeline = Timeline.parse(timeline);
|
||||||
|
|
||||||
|
const renderedEntities = creatorWasm.calculate_timeline_from_json_at_curr_frame(JSON.stringify(timeline));
|
||||||
|
|
||||||
|
console.log(renderedEntities);
|
||||||
|
}
|
||||||
|
}
|
@ -15,7 +15,8 @@ export const button = cva(
|
|||||||
variants: {
|
variants: {
|
||||||
variant: {
|
variant: {
|
||||||
default: "bg-main text-neutral hocus:bg-main/80",
|
default: "bg-main text-neutral hocus:bg-main/80",
|
||||||
primary: "bg-primary/50 text-main hocus:bg-primary/80",
|
primary:
|
||||||
|
"bg-primary dark:bg-primary/50 text-neutral dark:text-main hocus:bg-primary/80 dark:hocus:bg-primary/80",
|
||||||
destructive:
|
destructive:
|
||||||
"bg-error text-destructive-foreground hocus:bg-destructive/90",
|
"bg-error text-destructive-foreground hocus:bg-destructive/90",
|
||||||
outline:
|
outline:
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
:root {
|
:root {
|
||||||
--color-main: 0 0% 0%;
|
--color-main: 0 0% 0%;
|
||||||
--color-main: 0 0% 10%;
|
--color-main: 0 0% 10%;
|
||||||
--color-primary: 0 0% 0%;
|
--color-primary: 280 80% 50%;
|
||||||
--color-neutral: 0 0% 100%;
|
--color-neutral: 0 0% 100%;
|
||||||
--color-neutral-accent: 0 0% 93%;
|
--color-neutral-accent: 0 0% 93%;
|
||||||
--color-highlight: 264 100% 50%;
|
--color-highlight: 264 100% 50%;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user