diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..beaaaef --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +__pycache__ +media +slides +Slides_assets +slides.pdf \ No newline at end of file diff --git a/images/announcement.png b/images/announcement.png new file mode 100644 index 0000000..09690ac Binary files /dev/null and b/images/announcement.png differ diff --git a/images/background.png b/images/background.png new file mode 100644 index 0000000..3033adc Binary files /dev/null and b/images/background.png differ diff --git a/images/channel.png b/images/channel.png new file mode 100644 index 0000000..9d5d190 Binary files /dev/null and b/images/channel.png differ diff --git a/images/summer_videos.jpg b/images/summer_videos.jpg new file mode 100644 index 0000000..c2ca316 Binary files /dev/null and b/images/summer_videos.jpg differ diff --git a/images/title.png b/images/title.png new file mode 100644 index 0000000..fd7a6b6 Binary files /dev/null and b/images/title.png differ diff --git a/scenes/animation_a.py b/scenes/animation_a.py new file mode 100644 index 0000000..de91551 --- /dev/null +++ b/scenes/animation_a.py @@ -0,0 +1,58 @@ +from manim import * +from manim_slides import Slide + +from util import text, coordinates + +class AnimationA(Slide): + def __init__(self): + super().__init__() + self.title = "Example (1)" + self.triangle_color = BLUE + + def construct(self, render): + du = 0.2 * DOWN + d1 = Dot(LEFT*4+du) + d2 = Dot(RIGHT*2+du) + d3 = Dot(RIGHT*1+UP*3+du) + + triangle = Polygon( + d1.get_center(),d2.get_center(),d3.get_center(), + color = self.triangle_color, + stroke_width = 8 + ) + render.add(triangle) + + alpha_arc = Angle.from_three_points(d2,d1,d3, color=self.triangle_color) + beta_arc = Angle.from_three_points(d3,d2,d1, color=self.triangle_color) + gamma_arc = Angle.from_three_points(d1,d3,d2, color=self.triangle_color) + + render.add(alpha_arc) + render.add(beta_arc) + render.add(gamma_arc) + + alpha = text.math(r"\alpha").next_to(d1).shift(0.3*RIGHT+0.2*UP) + beta = text.math(r"\beta").next_to(d2, UP).shift(0.4*LEFT) + gamma = text.math(r"\gamma").next_to(d3, DOWN).shift(0.2*DOWN+0.2*LEFT) + angles = VGroup(alpha, beta, gamma) + + render.add(alpha) + render.add(beta) + render.add(gamma) + + render.wait() + render.next_slide() + + equation_1 = text.math(r"\alpha").move_to(2 * DOWN) + equation_2 = text.math(r"\alpha", " + ", r"\beta").move_to(2 * DOWN) + equation_3 = text.math(r"\alpha", " + ", r"\beta", " + ", r"\gamma").move_to(2 * DOWN) + equation_4 = text.math(r"\alpha", " + ", r"\beta", " + ", r"\gamma", r" = 180^\circ").move_to(2 * DOWN) + + render.play(TransformMatchingTex(alpha.copy(), equation_1)) + render.wait() + render.play(TransformMatchingTex(Group(equation_1, beta.copy()), equation_2)) + render.wait() + render.play(TransformMatchingTex(Group(equation_2, gamma.copy()), equation_3)) + render.wait() + render.play(TransformMatchingTex(equation_3, equation_4)) + + render.wait() diff --git a/scenes/animation_b.py b/scenes/animation_b.py new file mode 100644 index 0000000..2bea98d --- /dev/null +++ b/scenes/animation_b.py @@ -0,0 +1,19 @@ +from manim import * +from manim_slides import Slide + +from util import text, coordinates + +class Example(Slide): + def __init__(self): + super().__init__() + self.title = "Example" + + + def construct(self, render): + my_text = text.tex("Test").next_to(coordinates.UPPER_LEFT) + render.add(my_text) + + circle = Circle(radius=2, color=BLUE) + render.add(circle) + + render.wait() \ No newline at end of file diff --git a/scenes/community.py b/scenes/community.py new file mode 100644 index 0000000..13f3c75 --- /dev/null +++ b/scenes/community.py @@ -0,0 +1,28 @@ +from manim import * +from manim_slides import Slide + +from util import text, coordinates + +class Community(Slide): + def __init__(self): + super().__init__() + self.title = "The Manim Community" + + + def construct(self, render): + exposition = ImageMobject( + "images/announcement.png" + ).scale_to_fit_width( + 0.4 * render.camera.frame_width + ).next_to(ORIGIN, LEFT) + + participants = ImageMobject( + "images/summer_videos.jpg" + ).scale_to_fit_width( + 0.4 * render.camera.frame_width + ).next_to(ORIGIN, RIGHT) + + render.add(exposition) + render.add(participants) + + render.wait() \ No newline at end of file diff --git a/scenes/example.py b/scenes/example.py new file mode 100644 index 0000000..2bea98d --- /dev/null +++ b/scenes/example.py @@ -0,0 +1,19 @@ +from manim import * +from manim_slides import Slide + +from util import text, coordinates + +class Example(Slide): + def __init__(self): + super().__init__() + self.title = "Example" + + + def construct(self, render): + my_text = text.tex("Test").next_to(coordinates.UPPER_LEFT) + render.add(my_text) + + circle = Circle(radius=2, color=BLUE) + render.add(circle) + + render.wait() \ No newline at end of file diff --git a/scenes/title.py b/scenes/title.py new file mode 100644 index 0000000..aff6431 --- /dev/null +++ b/scenes/title.py @@ -0,0 +1,37 @@ +from dataclasses import dataclass + +from manim import * +from manim_slides import Slide + +from util import text + +@dataclass +class Title(Slide): + title: str + authors: str + affiliation: str + date: str + + def construct(self, render): + background = ImageMobject("images/title.png") + background.scale_to_fit_height(render.camera.frame_height) + background.scale_to_fit_width(render.camera.frame_width) + render.add(background) + + coordinate_start = 6 * LEFT + 1 * UP + + text_authors = text.tex(self.authors, color = WHITE, font_size=24).next_to(coordinate_start, RIGHT) + text_affiliation = text.tex(self.affiliation, color = WHITE, font_size=24).next_to(text_authors, DOWN, buff=0.35).align_to(text_authors, LEFT) + text_title = text.tex(f'\\textbf{{{self.title}}}', color = WHITE, font_size = 42).next_to(text_affiliation, DOWN, buff=0.35).align_to(text_authors, LEFT) + text_date = text.tex(self.date, color = WHITE, font_size=24).shift(3 * DOWN).align_to(text_authors, LEFT) + + render.add(text_authors) + render.add(text_affiliation) + render.add(text_title) + render.add(text_date) + + render.wait() + + + + diff --git a/scenes/what.py b/scenes/what.py new file mode 100644 index 0000000..8169825 --- /dev/null +++ b/scenes/what.py @@ -0,0 +1,16 @@ +from manim import * +from manim_slides import Slide + +from util import text, coordinates + +class What(Slide): + def __init__(self): + super().__init__() + self.title = "What is Manim?" + + + def construct(self, render): + channel = ImageMobject("images/channel.png").scale_to_fit_width(0.8 * render.camera.frame_width) + render.add(channel) + + render.wait() \ No newline at end of file diff --git a/slides.html b/slides.html new file mode 100644 index 0000000..b2fa954 --- /dev/null +++ b/slides.html @@ -0,0 +1,301 @@ + + +
+ + + +