mirror of
https://github.com/jeertmans/manim-slides.git
synced 2025-08-06 14:19:52 +08:00

* refactor(lib): change how manim API is imported * chore(lib): delete old files * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * wip: moving all commands * adding animations * fix tests * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix mypy * fixes * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * trying to fix docs * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * wip: docs * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * make it work * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * wip test * tests are working * improving docs * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix index * docs: nicer shift * docs: nicer quickstart example * fix tests * change tests * move coverage to test workflow * fix(tests): remove resolve * strict resolve * change local path test * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * documented changes * cleanup docs * cleanup files * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix(ci): set type --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
41 lines
848 B
Python
41 lines
848 B
Python
# flake8: noqa: F403, F405
|
|
# type: ignore
|
|
|
|
from manim_slides import Slide
|
|
from manim_slides.slide import MANIM, MANIMGL
|
|
|
|
if MANIM:
|
|
from manim import *
|
|
elif MANIMGL:
|
|
from manimlib import *
|
|
|
|
|
|
class BasicSlide(Slide):
|
|
def construct(self):
|
|
text = Text("This is some text")
|
|
|
|
self.play(Write(text))
|
|
|
|
circle = Circle(radius=3, color=BLUE)
|
|
|
|
self.play(Transform(text, circle))
|
|
|
|
circle = text # this is to avoid name confusion
|
|
|
|
square = Square()
|
|
|
|
self.play(FadeIn(square))
|
|
|
|
self.next_slide()
|
|
|
|
self.start_loop()
|
|
self.play(Rotate(square, +PI / 2))
|
|
self.play(Rotate(square, -PI / 2))
|
|
self.end_loop()
|
|
|
|
other_text = Text("Other text")
|
|
self.wipe([square, circle], [other_text])
|
|
|
|
self.next_slide()
|
|
self.zoom(other_text, [])
|