-
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
Showing
13 changed files
with
283 additions
and
12 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from manim import * | ||
from manim_slides import Slide | ||
|
||
from util import text, coordinates | ||
|
||
class HelloWorld(Slide): | ||
def __init__(self): | ||
super().__init__() | ||
self.title = None | ||
|
||
|
||
def construct(self, render): | ||
black = Rectangle(color=BLACK, fill_color=BLACK, fill_opacity=1.0, height=render.camera.frame_height, width=render.camera.frame_width) | ||
render.add(black) | ||
|
||
circle = Circle() | ||
circle.set_fill(PINK, opacity=0.5) | ||
render.play(Create(circle)) | ||
|
||
render.wait() |
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
from manim import * | ||
from manim_slides import Slide | ||
|
||
from util import text, coordinates | ||
|
||
class Installation(Slide): | ||
def __init__(self): | ||
super().__init__() | ||
self.title = "Installation" | ||
|
||
|
||
def construct(self, render): | ||
text_linux = text.tex("Install dependencies on Linux:").next_to(coordinates.UPPER_LEFT, RIGHT).shift(0.25*DOWN) | ||
render.add(text_linux) | ||
|
||
dependency_linux = Code(code=r""" | ||
sudo apt install build-essential python3-dev libcairo2-dev libpango1.0-dev ffmpeg | ||
""", language="sh", font_size=160).next_to(text_linux, DOWN).set_x(0) | ||
render.add(dependency_linux) | ||
|
||
text_macos = text.tex("Install dependencies on MacOS:").next_to(dependency_linux, DOWN, buff=0.5).align_to(text_linux, LEFT) | ||
render.add(text_macos) | ||
|
||
dependency_macos = Code(code=r""" | ||
brew install py3cairo ffmpeg | ||
brew install pango pkg-config scipy | ||
""", language="sh", font_size=160).next_to(text_macos, DOWN).set_x(0) | ||
render.add(dependency_macos) | ||
|
||
text_manim_slides = text.tex("Install manim-slides:").next_to(dependency_macos, DOWN, buff=0.5).align_to(text_linux, LEFT) | ||
render.add(text_manim_slides) | ||
|
||
install_slides = Code(code=r""" | ||
pip install manim-slides[manim] | ||
""", language="sh", font_size=160).next_to(text_manim_slides, DOWN).set_x(0) | ||
render.add(install_slides) | ||
|
||
render.wait() |
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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
from manim import * | ||
from manim_slides import Slide | ||
|
||
from util import text, coordinates | ||
|
||
class Outline(Slide): | ||
def __init__(self): | ||
super().__init__() | ||
self.title = "Outline" | ||
|
||
def static(self, render, position): | ||
my_text = text.tex(r"Some text with math: ${a \over b} = c$").next_to(coordinates.UPPER_LEFT) | ||
|
||
flowers = ImageMobject( | ||
"images/flowers.png" | ||
).scale_to_fit_height(3).next_to( | ||
my_text, DOWN, aligned_edge=LEFT, buff=1.0 | ||
).shift(RIGHT) | ||
|
||
buildings= ImageMobject( | ||
"images/buildings.jpg" | ||
).scale_to_fit_height(3).next_to(flowers, RIGHT).set_x(-flowers.get_x()) | ||
|
||
group = Group(my_text, flowers, buildings).scale_to_fit_width(4.25).next_to(position, DOWN, buff=2.0) | ||
render.add(group) | ||
|
||
box = Rectangle(width=5, height=3, color=BLACK).move_to(group) | ||
render.add(box) | ||
|
||
|
||
|
||
def animated(self, render, position): | ||
circle = Circle(fill_color=RED, fill_opacity=1.0).move_to(4*LEFT) | ||
triangle = Triangle(color=GREEN) | ||
rectangle = Rectangle(width=2.0, height=2.0, color=BLUE).move_to(4*RIGHT) | ||
|
||
group = VGroup(circle, triangle, rectangle).scale_to_fit_width(4.25).next_to(position, DOWN, buff=3.0) | ||
render.add(group) | ||
|
||
box = Rectangle(width=5, height=3, color=BLACK).move_to(group).shift(0.5*UP) | ||
render.add(box) | ||
|
||
render.wait() | ||
render.next_slide(loop=True) | ||
|
||
render.play(circle.animate.set_fill(BLUE)) | ||
render.play(triangle.animate.shift(1*UP), run_time=2.0) | ||
render.play(rectangle.animate.scale(1.5)) | ||
|
||
def construct(self, render): | ||
part_a = text.tex("Part 1", font_size=46).next_to(2.5*UP, LEFT, buff=3.0) | ||
part_b = text.tex("Part 2", font_size=46).next_to(2.5*UP, RIGHT, buff=3.0) | ||
render.add(part_a) | ||
render.add(part_b) | ||
|
||
self.static(render, part_a) | ||
self.animated(render, part_b) | ||
|
||
render.wait() |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from manim import * | ||
from manim_slides import Slide | ||
|
||
from util import text, coordinates | ||
|
||
class Project(Slide): | ||
def __init__(self): | ||
super().__init__() | ||
self.title = "Prepared Template" | ||
|
||
|
||
def construct(self, render): | ||
url = text.tex(r"Starting Point: https://github.com/aannleax/manim-template").next_to(coordinates.UPPER_LEFT).shift(0.25*DOWN) | ||
render.add(url) | ||
|
||
github = ImageMobject("images/github.png").scale_to_fit_height(5).shift(0.25*DOWN) | ||
render.add(github) | ||
|
||
render.wait() |
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