mirror of
https://github.com/jeertmans/manim-slides.git
synced 2025-06-07 03:49:00 +08:00

* feat(lib): add `loop` option to `next_slide` and remove `start/end_loop` * fix(docs): PR number
41 lines
834 B
Python
41 lines
834 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(loop=True)
|
|
|
|
self.play(Rotate(square, +PI / 2))
|
|
self.play(Rotate(square, -PI / 2))
|
|
|
|
self.next_slide()
|
|
|
|
other_text = Text("Other text")
|
|
self.wipe([square, circle], [other_text])
|
|
|
|
self.next_slide()
|
|
self.zoom(other_text, [])
|