MCPcopy Index your code
hub / github.com/initialcommit-com/git-sim / add_details

Method add_details

src/git_sim/config.py:49–248  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

47 self.show_outro()
48
49 def add_details(self):
50 down_shift = m.DOWN * 0.5
51 project_root = m.Rectangle(
52 height=9.0,
53 width=18.0,
54 color=self.fontColor,
55 ).move_to((0, 1000, 0))
56 self.camera.frame.scale_to_fit_width(18 * 1.1)
57 self.camera.frame.move_to(project_root.get_center())
58
59 cmd_text = m.Text(
60 self.trim_cmd(self.cmd, 50),
61 font=self.font,
62 font_size=36,
63 color=self.fontColor,
64 )
65 cmd_text.align_to(project_root, m.UP).shift(m.UP * 0.25 + cmd_text.height)
66
67 project_root_text = m.Text(
68 os.path.basename(os.getcwd()) + "/",
69 font=self.font,
70 font_size=20,
71 color=self.fontColor,
72 )
73 project_root_text.align_to(project_root, m.LEFT).align_to(
74 project_root, m.UP
75 ).shift(m.RIGHT * 0.25).shift(m.DOWN * 0.25)
76
77 dot_git_text = m.Text(
78 ".git/",
79 font=self.font,
80 font_size=20,
81 color=self.fontColor,
82 )
83 dot_git_text.align_to(project_root_text, m.UP).shift(down_shift).align_to(
84 project_root_text, m.LEFT
85 ).shift(m.RIGHT * 0.5)
86
87 config_text = m.Text(
88 "config",
89 font=self.font,
90 font_size=20,
91 color=self.fontColor,
92 )
93 config_text.align_to(dot_git_text, m.UP).shift(down_shift).align_to(
94 dot_git_text, m.LEFT
95 ).shift(m.RIGHT * 0.5)
96
97 if settings.animate:
98 if settings.show_command_as_title:
99 self.play(
100 m.AddTextLetterByLetter(cmd_text, time_per_char=self.time_per_char)
101 )
102 self.play(m.Create(project_root, time_per_char=self.time_per_char))
103 self.play(
104 m.AddTextLetterByLetter(
105 project_root_text, time_per_char=self.time_per_char
106 )

Callers 1

constructMethod · 0.95

Calls 2

resize_rectangleMethod · 0.95
trim_cmdMethod · 0.80

Tested by

no test coverage detected