-
-
Notifications
You must be signed in to change notification settings - Fork 123
Expand file tree
/
Copy pathtag.py
More file actions
61 lines (48 loc) · 1.45 KB
/
Copy pathtag.py
File metadata and controls
61 lines (48 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import manim as m
import typer
from git_sim.animations import handle_animations
from git_sim.git_sim_base_command import GitSimBaseCommand
from git_sim.settings import settings
class Tag(GitSimBaseCommand):
def __init__(self, name: str):
super().__init__()
self.name = name
def construct(self):
if not settings.stdout:
print(f"{settings.INFO_STRING } {type(self).__name__.lower()} {self.name}")
self.show_intro()
self.get_commits()
self.parse_commits(self.commits[0])
self.recenter_frame()
self.scale_frame()
tagText = m.Text(
self.name,
font="Monospace",
font_size=20,
color=self.fontColor,
)
tagRec = m.Rectangle(
color=m.YELLOW,
fill_color=m.YELLOW,
fill_opacity=0.25,
height=0.4,
width=tagText.width + 0.25,
)
tagRec.next_to(self.topref, m.UP)
tagText.move_to(tagRec.get_center())
fulltag = m.VGroup(tagRec, tagText)
if settings.animate:
self.play(m.Create(fulltag), run_time=1 / settings.speed)
else:
self.add(fulltag)
self.toFadeOut.add(tagRec, tagText)
self.fadeout()
self.show_outro()
def tag(
name: str = typer.Argument(
...,
help="The name of the new tag",
)
):
scene = Tag(name=name)
handle_animations(scene=scene)