from manim import *
class ClockManyDemo(Scene):
    def construct(self):
        title = Text("多个圆形同时顺时针变换为正方形", font="STLiti", font_size=28).to_edge(UP)
        self.play(FadeIn(title), run_time=0.6)
        left = [UP * 1.7 + LEFT * 2, LEFT * 2, DOWN * 1.7 + LEFT * 2]
        right = [UP * 1.7 + RIGHT * 2, RIGHT * 2, DOWN * 1.7 + RIGHT * 2]
        circles = VGroup(*[Circle(radius=0.55, color=BLUE, stroke_width=7).move_to(p) for p in left])
        squares = VGroup(*[Square(side_length=1.0, color=YELLOW, stroke_width=7).move_to(p) for p in right])
        self.play(*[FadeIn(c) for c in circles], run_time=0.8)
        self.play(*[ClockwiseTransform(c, s) for c, s in zip(circles, squares)], run_time=2.4)
        note = Text("逐对指定源与目标，三个变换同时播放", font="STLiti", font_size=21, color=YELLOW).to_edge(DOWN)
        self.play(FadeIn(note), run_time=0.4)
        self.wait(1.8)
