import { Layout, Txt, makeScene2D } from "@motion-canvas/2d";
import {
  Direction,
  beginSlide,
  createRef,
  slideTransition,
} from "@motion-canvas/core";
import { theme } from "../theme";

const goingFurtherLInes = [
  "pattern matching",
  "the typed lambda calculus",
  "church turing thesis",
  "lazy vs eager loading, why we use left innermost reduction",
  "compiling to machine code & continuation passing style as IR",
  "monads",
];

export default makeScene2D(function* (view) {
  const lines = createRef<Txt>();

  view.add(
    <Layout layout direction="column" alignItems="center">
      <Txt fontSize={40} fontFamily={theme.font} fill={theme.text.hex}>
        Going Further
      </Txt>
      <Txt
        ref={lines}
        fontSize={30}
        fontFamily={theme.font}
        fill={theme.text.hex}
      ></Txt>
    </Layout>
  );

  yield* slideTransition(Direction.Right);
  yield* beginSlide("Going Further");

  for (const line of goingFurtherLInes) {
    yield* lines().text(lines().text() + "\n\n" + line, 1);
    yield* beginSlide("line - " + line);
  }
});
