import { Node, Txt, Layout, makeScene2D } from "@motion-canvas/2d";
import { beginSlide, waitFor, createRef } from "@motion-canvas/core";
import { palette } from "../palette";

export default makeScene2D(function* (view) {
  const node = createRef<Node>();

  view.add(
    <Node ref={node}>
      <Layout layout direction="column" textAlign="center" gap={80}>
        <Txt fontFamily={"Fira Code"} fill={palette.text.hex}>
          Compiling The Lambda Calculus {"=> λ"}
        </Txt>
        <Txt fontFamily={"Fira Code"} fill={palette.text.hex}>
          Elizabeth Hunt (@simponic)
        </Txt>
      </Layout>
    </Node>
  );
  yield* beginSlide("Title");
  yield* node().opacity(0, 1);
  yield* waitFor(1);
});
