@@ -15,21 +15,21 @@ def __init__(self):
15
15
def construct (self ):
16
16
print ("Building logo..." )
17
17
self .draw_logo ()
18
- self .recenter_frame ()
19
- self .scale_frame ()
18
+ # self.recenter_frame()
19
+ # self.scale_frame()
20
20
self .fadeout ()
21
21
22
22
def draw_logo (self ):
23
- circle1 = m .Circle (stroke_color = m .RED , fill_color = m .RED , fill_opacity = 0.25 )
23
+ circle1 = m .Circle (stroke_color = m .RED , stroke_width = 7.5 , fill_color = m .RED , fill_opacity = 0.25 )
24
24
circle1 .height = 0.25
25
25
circle1 .shift (m .RIGHT * 2 / 3 )
26
26
27
- circle2 = m .Circle (stroke_color = m .RED , fill_color = m .RED , fill_opacity = 0.25 )
27
+ circle2 = m .Circle (stroke_color = m .BLUE , stroke_width = 7.5 , fill_color = m .BLUE , fill_opacity = 0.25 )
28
28
circle2 .height = 0.25
29
29
circle2 .shift (m .UP * (1 / math .sqrt (3 )))
30
30
circle2 .shift (m .LEFT / 3 )
31
31
32
- circle3 = m .Circle (stroke_color = m .RED , fill_color = m .RED , fill_opacity = 0.25 )
32
+ circle3 = m .Circle (stroke_color = m .YELLOW , stroke_width = 7.5 , fill_color = m .YELLOW , fill_opacity = 0.25 )
33
33
circle3 .height = 0.25
34
34
circle3 .shift (m .DOWN * (1 / math .sqrt (3 )))
35
35
circle3 .shift (m .LEFT / 3 )
@@ -38,40 +38,38 @@ def draw_logo(self):
38
38
"git-sim" ,
39
39
font = "Monospace" ,
40
40
font_size = 12 ,
41
- color = m .BLUE ,
41
+ color = m .WHITE ,
42
+ weight = m .BOLD ,
42
43
)
43
44
44
45
arc1 = m .Arc (
45
46
radius = 2 / 3 ,
46
- start_angle = m .PI / 14.5 ,
47
- angle = m .PI / 1.89 ,
48
- color = m .WHITE ,
49
- stroke_width = 1.5 ,
50
- tip_length = 0.1 ,
51
- ).add_tip ()
47
+ start_angle = m .PI / 7.5 ,
48
+ angle = m .PI / 2.5 ,
49
+ color = m .RED ,
50
+ stroke_width = 4 ,
51
+ ).add_tip (m .StealthTip (length = 0.1 , color = m .RED ))
52
52
53
53
arc2 = m .Arc (
54
54
radius = 2 / 3 ,
55
- start_angle = m .PI / 14.5 + 2 * m .PI / 3 ,
56
- angle = m .PI / 1.89 ,
57
- color = m .WHITE ,
58
- stroke_width = 1.5 ,
59
- tip_length = 0.1 ,
60
- ).add_tip ()
55
+ start_angle = m .PI / 7.5 + 2 * m .PI / 3 ,
56
+ angle = m .PI / 2.5 ,
57
+ color = m .BLUE ,
58
+ stroke_width = 4 ,
59
+ ).add_tip (m .StealthTip (length = 0.1 , color = m .BLUE ))
61
60
62
61
arc3 = m .Arc (
63
62
radius = 2 / 3 ,
64
- start_angle = m .PI / 14.5 + 4 * m .PI / 3 ,
65
- angle = m .PI / 1.89 ,
66
- color = m .WHITE ,
67
- stroke_width = 1.5 ,
68
- tip_length = 0.1 ,
69
- ).add_tip ()
70
-
71
- circle4 = m .Circle (stroke_color = m .RED , fill_color = m .RED , fill_opacity = 0.25 )
72
- circle5 = m .Circle (stroke_color = m .RED , fill_color = m .RED , fill_opacity = 0.25 )
73
- circle6 = m .Circle (stroke_color = m .RED , fill_color = m .RED , fill_opacity = 0.25 )
74
- circle7 = m .Circle (stroke_color = m .RED , fill_color = m .RED , fill_opacity = 0.25 )
63
+ start_angle = m .PI / 7.5 + 4 * m .PI / 3 ,
64
+ angle = m .PI / 2.5 ,
65
+ color = m .YELLOW ,
66
+ stroke_width = 4 ,
67
+ ).add_tip (m .StealthTip (length = 0.1 , color = m .YELLOW ))
68
+
69
+ circle4 = m .Circle (stroke_color = m .ORANGE , stroke_width = 7.5 , fill_color = m .ORANGE , fill_opacity = 0.25 )
70
+ circle5 = m .Circle (stroke_color = m .GREEN , stroke_width = 7.5 , fill_color = m .GREEN , fill_opacity = 0.25 )
71
+ circle6 = m .Circle (stroke_color = m .PURPLE , stroke_width = 7.5 , fill_color = m .PURPLE , fill_opacity = 0.25 )
72
+ circle7 = m .Circle (stroke_color = m .MAROON , stroke_width = 7.5 , fill_color = m .MAROON , fill_opacity = 0.25 )
75
73
circle4 .height = 0.25
76
74
circle5 .height = 0.25
77
75
circle6 .height = 0.25
@@ -82,52 +80,21 @@ def draw_logo(self):
82
80
circle6 .next_to (circle5 , m .RIGHT * 1.25 )
83
81
circle7 .next_to (circle6 , m .RIGHT * 1.25 )
84
82
85
- arrow1 = m .Arrow (circle1 .get_center (), m .RIGHT , color = m .WHITE , stroke_width = 1.5 )
86
- arrow1 .set_length (0.275 )
87
- arrow2 = m .Arrow (circle1 .get_center (), m .RIGHT , color = m .WHITE , stroke_width = 1.5 )
88
- arrow2 .set_length (0.275 )
89
- arrow3 = m .Arrow (circle1 .get_center (), m .RIGHT , color = m .WHITE , stroke_width = 1.5 )
90
- arrow3 .set_length (0.275 )
91
- arrow4 = m .Arrow (circle1 .get_center (), m .RIGHT , color = m .WHITE , stroke_width = 1.5 )
92
- arrow4 .set_length (0.275 )
93
-
94
- arrow1 .next_to (circle1 , m .RIGHT * 0.075 )
95
- arrow2 .next_to (circle4 , m .RIGHT * 0.075 )
96
- arrow3 .next_to (circle5 , m .RIGHT * 0.075 )
97
- arrow4 .next_to (circle6 , m .RIGHT * 0.075 )
98
-
99
- message1 = m .Text ("Visually" , font = "Monospace" , font_size = 6 , color = m .WHITE )
100
- message2 = m .Text ("simulate" , font = "Monospace" , font_size = 6 , color = m .WHITE )
101
- message3 = m .Text ("Git" , font = "Monospace" , font_size = 6 , color = m .WHITE )
102
- message4 = m .Text ("commands" , font = "Monospace" , font_size = 6 , color = m .WHITE )
83
+ arrow1 = m .Arrow (circle1 .get_center (), circle4 .get_center (), color = m .WHITE , stroke_width = 3 , max_stroke_width_to_length_ratio = 1000 , max_tip_length_to_length_ratio = 1000 , tip_length = 0.025 , tip_shape = m .StealthTip , buff = 0.21 ).shift (m .LEFT * 0.015 )
84
+ arrow2 = m .Arrow (circle4 .get_center (), circle5 .get_center (), color = m .WHITE , stroke_width = 3 , max_stroke_width_to_length_ratio = 1000 , max_tip_length_to_length_ratio = 1000 , tip_length = 0.025 , tip_shape = m .StealthTip , buff = 0.21 ).shift (m .LEFT * 0.015 )
85
+ arrow3 = m .Arrow (circle5 .get_center (), circle6 .get_center (), color = m .WHITE , stroke_width = 3 , max_stroke_width_to_length_ratio = 1000 , max_tip_length_to_length_ratio = 1000 , tip_length = 0.025 , tip_shape = m .StealthTip , buff = 0.21 ).shift (m .LEFT * 0.015 )
86
+ arrow4 = m .Arrow (circle6 .get_center (), circle7 .get_center (), color = m .WHITE , stroke_width = 3 , max_stroke_width_to_length_ratio = 1000 , max_tip_length_to_length_ratio = 1000 , tip_length = 0.025 , tip_shape = m .StealthTip , buff = 0.21 ).shift (m .LEFT * 0.015 )
87
+
88
+ message1 = m .Text ("Visually" , font = "Monospace" , font_size = 6 , color = m .WHITE , weight = m .BOLD )
89
+ message2 = m .Text ("simulate" , font = "Monospace" , font_size = 6 , color = m .WHITE , weight = m .BOLD )
90
+ message3 = m .Text ("Git" , font = "Monospace" , font_size = 6 , color = m .WHITE , weight = m .BOLD )
91
+ message4 = m .Text ("commands" , font = "Monospace" , font_size = 6 , color = m .WHITE , weight = m .BOLD )
103
92
104
93
message1 .move_to ((circle4 .get_center ()[0 ], circle4 .get_center ()[1 ] + 0.25 , 0 ))
105
94
message2 .move_to ((circle5 .get_center ()[0 ], circle5 .get_center ()[1 ] + 0.25 , 0 ))
106
95
message3 .move_to ((circle6 .get_center ()[0 ], circle6 .get_center ()[1 ] + 0.25 , 0 ))
107
96
message4 .move_to ((circle7 .get_center ()[0 ], circle7 .get_center ()[1 ] + 0.25 , 0 ))
108
97
109
- self .add (
110
- circle1 ,
111
- circle2 ,
112
- circle3 ,
113
- circle4 ,
114
- circle5 ,
115
- circle6 ,
116
- circle7 ,
117
- title ,
118
- arc1 ,
119
- arc2 ,
120
- arc3 ,
121
- arrow1 ,
122
- arrow2 ,
123
- arrow3 ,
124
- arrow4 ,
125
- message1 ,
126
- message2 ,
127
- message3 ,
128
- message4 ,
129
- )
130
-
131
98
self .toFadeOut .add (
132
99
circle1 ,
133
100
circle2 ,
@@ -150,6 +117,43 @@ def draw_logo(self):
150
117
message4 ,
151
118
)
152
119
120
+ if settings .animate :
121
+ self .camera .frame .move_to (self .toFadeOut .get_center ()),
122
+ self .camera .frame .scale_to_fit_width (self .toFadeOut .get_width () * 1.1 )
123
+ if self .toFadeOut .get_height () >= self .camera .frame .get_height ():
124
+ self .camera .frame .scale_to_fit_height (self .toFadeOut .get_height () * 1.25 )
125
+ self .play (m .AddTextLetterByLetter (title ), m .Create (circle1 ), m .Create (arc1 ), m .Create (circle2 ), m .Create (arc2 ), m .Create (circle3 ), m .Create (arc3 ), run_time = 1 / settings .speed )
126
+ self .play (m .Create (arrow1 ), run_time = 1 / (settings .speed * 2.5 ))
127
+ self .play (m .Create (circle4 ), m .AddTextLetterByLetter (message1 ), run_time = 1 / (settings .speed * 2.5 ))
128
+ self .play (m .Create (arrow2 ), run_time = 1 / (settings .speed * 2.5 ))
129
+ self .play (m .Create (circle5 ), m .AddTextLetterByLetter (message2 ), run_time = 1 / (settings .speed * 2.5 ))
130
+ self .play (m .Create (arrow3 ), run_time = 1 / (settings .speed * 2.5 ))
131
+ self .play (m .Create (circle6 ), m .AddTextLetterByLetter (message3 ), run_time = 1 / (settings .speed * 2.5 ))
132
+ self .play (m .Create (arrow4 ), run_time = 1 / (settings .speed * 2.5 ))
133
+ self .play (m .Create (circle7 ), m .AddTextLetterByLetter (message4 ), run_time = 1 / (settings .speed * 2.5 ))
134
+ else :
135
+ self .add (
136
+ circle1 ,
137
+ circle2 ,
138
+ circle3 ,
139
+ circle4 ,
140
+ circle5 ,
141
+ circle6 ,
142
+ circle7 ,
143
+ title ,
144
+ arc1 ,
145
+ arc2 ,
146
+ arc3 ,
147
+ arrow1 ,
148
+ arrow2 ,
149
+ arrow3 ,
150
+ arrow4 ,
151
+ message1 ,
152
+ message2 ,
153
+ message3 ,
154
+ message4 ,
155
+ )
156
+
153
157
154
158
def logo ():
155
159
scene = Logo ()
0 commit comments