diff options
author | Lizzy Hunt <elizabeth.hunt@simponic.xyz> | 2024-02-01 22:11:05 -0700 |
---|---|---|
committer | Lizzy Hunt <elizabeth.hunt@simponic.xyz> | 2024-02-01 22:11:05 -0700 |
commit | d19084665195cb20e62ba77ab9cf46d800b3975b (patch) | |
tree | 7ec34f86ceb54f5fabf77afd114b4d8eb6bd8b7d | |
parent | 2b2ed28e2d5e5f1bec6543d18907e7cca46faac0 (diff) | |
download | compiling-the-lambda-calculus-d19084665195cb20e62ba77ab9cf46d800b3975b.tar.gz compiling-the-lambda-calculus-d19084665195cb20e62ba77ab9cf46d800b3975b.zip |
add xkcd and basic transitions
-rw-r--r-- | public/fonts/JetBrainsMono-Regular.ttf | bin | 0 -> 273900 bytes | |||
-rw-r--r-- | public/img/me.jpg | bin | 0 -> 152611 bytes | |||
-rw-r--r-- | public/img/me.png | bin | 770449 -> 0 bytes | |||
-rw-r--r-- | public/img/xkcd.png | bin | 0 -> 45552 bytes | |||
-rw-r--r-- | src/global.css | 7 | ||||
-rw-r--r-- | src/project.ts | 9 | ||||
-rw-r--r-- | src/scenes/example.tsx | 23 | ||||
-rw-r--r-- | src/scenes/index.ts | 4 | ||||
-rw-r--r-- | src/scenes/me.tsx | 83 | ||||
-rw-r--r-- | src/scenes/title.meta (renamed from src/scenes/example.meta) | 0 | ||||
-rw-r--r-- | src/scenes/title.tsx | 36 | ||||
-rw-r--r-- | src/theme.ts (renamed from src/palette.ts) | 3 |
12 files changed, 120 insertions, 45 deletions
diff --git a/public/fonts/JetBrainsMono-Regular.ttf b/public/fonts/JetBrainsMono-Regular.ttf Binary files differnew file mode 100644 index 0000000..dff66cc --- /dev/null +++ b/public/fonts/JetBrainsMono-Regular.ttf diff --git a/public/img/me.jpg b/public/img/me.jpg Binary files differnew file mode 100644 index 0000000..697009b --- /dev/null +++ b/public/img/me.jpg diff --git a/public/img/me.png b/public/img/me.png Binary files differdeleted file mode 100644 index 7090360..0000000 --- a/public/img/me.png +++ /dev/null diff --git a/public/img/xkcd.png b/public/img/xkcd.png Binary files differnew file mode 100644 index 0000000..9533da5 --- /dev/null +++ b/public/img/xkcd.png diff --git a/src/global.css b/src/global.css index b271252..cd3afe3 100644 --- a/src/global.css +++ b/src/global.css @@ -1 +1,6 @@ -@import url("https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;700&display=swap"); +@font-face { + font-family: "JetBrains"; + src: + local("JetBrains"), + url(public/fonts/JetBrainsMono-Regular.ttf) format("truetype"); +} diff --git a/src/project.ts b/src/project.ts index 82af284..b403dc5 100644 --- a/src/project.ts +++ b/src/project.ts @@ -1,10 +1,7 @@ import { makeProject } from "@motion-canvas/core"; - -import "./global.css"; // <- import the css - -import example from "./scenes/example?scene"; -import me from "./scenes/me?scene"; +import { scenes } from "./scenes"; +import "./global.css"; export default makeProject({ - scenes: [example, me], + scenes, }); diff --git a/src/scenes/example.tsx b/src/scenes/example.tsx deleted file mode 100644 index 8e38187..0000000 --- a/src/scenes/example.tsx +++ /dev/null @@ -1,23 +0,0 @@ -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); -}); diff --git a/src/scenes/index.ts b/src/scenes/index.ts new file mode 100644 index 0000000..9d08ec5 --- /dev/null +++ b/src/scenes/index.ts @@ -0,0 +1,4 @@ +import title from "./title?scene"; +import me from "./me?scene"; + +export const scenes = [title, me]; diff --git a/src/scenes/me.tsx b/src/scenes/me.tsx index 9d5740f..2e36605 100644 --- a/src/scenes/me.tsx +++ b/src/scenes/me.tsx @@ -1,19 +1,74 @@ -import { Img, Txt, Layout, makeScene2D } from "@motion-canvas/2d"; -import { beginSlide, waitFor } from "@motion-canvas/core"; +import { Node, Img, Txt, Layout, makeScene2D } from "@motion-canvas/2d"; +import { beginSlide, createRef, waitFor, all } from "@motion-canvas/core"; -import me from "../../public/img/me.png"; +import me from "../../public/img/me.jpg"; +import { theme } from "../theme"; export default makeScene2D(function* (view) { - yield* beginSlide("Title"); - view.add( - <Layout - layout - direction="row" - justifyContent="space-around" - alignItems="center" - gap={0} - > - <Img scale={0.5} src={me}></Img> - </Layout> + const img = createRef<Img>(); + const node = createRef<Node>(); + const layout = createRef<Layout>(); + const src = createRef<Txt>(); + + yield view.add( + <> + <Layout + layout + ref={layout} + direction="column" + justifyContent="center" + gap={12} + alignItems="start" + y={-10} + > + <Node ref={node} opacity={0}> + <Txt fontFamily={theme.font} fill={theme.text.hex}> + Hello! + </Txt> + <Txt fontFamily={theme.font} fill={theme.text.hex}> + My name is Elizabeth{" "} + <Txt fontFamily={theme.font} fill={theme.teal.hex}> + (@simponic) + </Txt> + . + </Txt> + <Txt fontFamily={theme.font} fill={theme.text.hex}> + I love 😍 + </Txt> + <Txt fontFamily={theme.font} fill={theme.text.hex}> + {"=>"} Common LISP + </Txt> + <Txt fontFamily={theme.font} fill={theme.text.hex}> + {"=>"}{" "} + <Txt fontFamily={theme.font} fill={theme.mauve.hex}> + Elixir + </Txt> + </Txt> + <Txt fontFamily={theme.font} fill={theme.text.hex}> + {"=>"} Functional Programming + </Txt> + </Node> + </Layout> + <Img y={-10} ref={img} src={me} width={10} alpha={0} radius={20} />{" "} + <Txt opacity={0} ref={src} fontFamily={theme.font} fill={theme.green.hex}> + git.simponic.xyz/simponic/compiling-the-lambda-calculus + </Txt> + </> ); + + yield img().fill(img().getColorAtPoint(0)); + + const diff = 370; + yield* all( + img().size([450, 450], 1), + img().radius(50, 1), + img().alpha(1, 1), + img().position.x(-diff, 1), + node().opacity(1, 1), + layout().position.x(diff, 1), + src().opacity(1, 1), + src().position.y(275, 1) + ); + + yield* beginSlide("About Me"); }); diff --git a/src/scenes/example.meta b/src/scenes/title.meta index 011b988..011b988 100644 --- a/src/scenes/example.meta +++ b/src/scenes/title.meta diff --git a/src/scenes/title.tsx b/src/scenes/title.tsx new file mode 100644 index 0000000..775e9ec --- /dev/null +++ b/src/scenes/title.tsx @@ -0,0 +1,36 @@ +import { Img, Txt, Layout, makeScene2D } from "@motion-canvas/2d"; +import { beginSlide } from "@motion-canvas/core"; +import { theme } from "../theme"; + +import xkcd from "../../public/img/xkcd.png"; + +export default makeScene2D(function* (view) { + yield view.add( + <> + <Layout + layout + direction="column" + textAlign="center" + alignItems="center" + gap={100} + > + <Txt fontFamily={theme.font} fill={theme.text.hex}> + Compiling The Lambda Calculus{" "} + <Txt fontFamily={theme.font} fill={theme.blue.hex}> + {"=> λ"} + </Txt> + </Txt> + <Img scale={1.4} src={xkcd}></Img> + <Txt + fontFamily={theme.font} + fill={theme.flamingo.hex} + fontStyle="italic" + fontSize={40} + > + #2453 + </Txt> + </Layout> + </> + ); + yield* beginSlide("Title"); +}); diff --git a/src/palette.ts b/src/theme.ts index af1017b..77aa48e 100644 --- a/src/palette.ts +++ b/src/theme.ts @@ -1,5 +1,6 @@ /* https://raw.githubusercontent.com/catppuccin/palette/main/palette.json */ -export const palette = { +export const theme = { + font: "JetBrains", rosewater: { hex: "#f5e0dc", rgb: { |