aboutsummaryrefslogtreecommitdiffstats
path: root/scenes/v9_regla72.py
diff options
context:
space:
mode:
authorElvis Claros Castro <elvis@claros.ar>2026-09-26 20:50:41 -0300
committerElvis Claros Castro <elvis@claros.ar>2026-09-26 20:50:41 -0300
commitfafaebb051907a848a9406f9da19669c81a83a3b (patch)
treec30ea26e6b549e5523af2bae5c39569e9a946b12 /scenes/v9_regla72.py
parent59355909f2de9236af8168a26c70bcf6caa3b285 (diff)
download100cia-videos-main.tar.gz
100cia-videos-main.zip
Translate code, comments and logs to English; English README; configurable paths and env varsHEADmain
Identifiers, docstrings, comments and console messages are now in English. Narration, subtitles and on-screen text stay in Spanish (they are the video content). The Blender <-> Godot physics protocol uses English keys and body prefixes chosen to keep the original creation order, so cached simulations and renders stay bit-identical. The old Spanish environment variable names are still accepted.
Diffstat (limited to 'scenes/v9_regla72.py')
-rw-r--r--scenes/v9_regla72.py68
1 files changed, 34 insertions, 34 deletions
diff --git a/scenes/v9_regla72.py b/scenes/v9_regla72.py
index 9811ff4..75d3f3b 100644
--- a/scenes/v9_regla72.py
+++ b/scenes/v9_regla72.py
@@ -4,34 +4,34 @@ sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from manim import *
from tiktok import *
-BAR_X0, BAR_MAX = -2.35, 3.3 # barra proporcional a los años
+BAR_X0, BAR_MAX = -2.35, 3.3 # bar proportional to the years
-class Regla72(TikTok):
+class RuleOf72(TikTok):
NAME = "regla72"
- def fila(self, tasa, anios, y, color, maxa=12.0):
- t = Text(f"{tasa}%", font=FONT, font_size=46, weight=BOLD, color=color)
+ def row(self, rate, years, y, color, maxa=12.0):
+ t = Text(f"{rate}%", font=FONT, font_size=46, weight=BOLD, color=color)
t.move_to([-3.95, y, 0], LEFT)
- w = max(anios / maxa * BAR_MAX, 0.05)
+ w = max(years / maxa * BAR_MAX, 0.05)
bar = RoundedRectangle(corner_radius=0.1, width=w, height=0.46, stroke_width=0,
fill_color=color, fill_opacity=1)
bar.move_to([BAR_X0, y, 0], LEFT)
- lab = Text(f"{anios:g} años".replace(".", ","), font=FONT, font_size=40,
+ lab = Text(f"{years:g} años".replace(".", ","), font=FONT, font_size=40,
weight=BOLD, color=WHITE)
lab.next_to(bar, RIGHT, buff=0.25)
return VGroup(t, bar, lab)
def construct(self):
self.prepare()
- chip = self.chip("Finanzas en 40 segundos", VERDE)
+ chip = self.chip("Finanzas en 40 segundos", C_GREEN)
with self.beat(0) as b:
q = VGroup(
self.fit(Text("¿cuánto tarda tu plata", font=FONT, font_size=52,
weight=BOLD, color=WHITE), 8.2),
self.fit(Text("en duplicarse?", font=FONT, font_size=52,
- weight=BOLD, color=AMBAR), 8.2),
+ weight=BOLD, color=AMBER), 8.2),
).arrange(DOWN, buff=0.3).move_to(UP * 3.4)
b.play(FadeIn(chip, shift=DOWN * 0.3), run_time=0.45)
b.play(FadeIn(q[0], shift=UP * 0.15), run_time=0.6)
@@ -39,74 +39,74 @@ class Regla72(TikTok):
with self.beat(1) as b:
name = self.fit(Text("LA REGLA DEL 72", font=FONT, font_size=66,
- weight=BOLD, color=VERDE), 8.2).move_to(UP * 1.4)
+ weight=BOLD, color=C_GREEN), 8.2).move_to(UP * 1.4)
b.play(FadeIn(name, scale=0.7), run_time=0.8)
- b.play(Flash(name, color=VERDE, line_length=0.6, num_lines=20,
+ b.play(Flash(name, color=C_GREEN, line_length=0.6, num_lines=20,
flash_radius=2.6), run_time=0.7)
with self.beat(2) as b:
f = MathTex(r"\frac{72}{\text{tasa anual}} = \text{años}",
color=WHITE).scale(1.5).move_to(DOWN * 0.6)
- f[0][0:2].set_color(VERDE)
+ f[0][0:2].set_color(C_GREEN)
b.play(FadeOut(q), name.animate.scale(0.62).move_to(UP * 5.35), run_time=0.6)
b.play(Write(f), run_time=1.1)
rows = []
- for i, (tasa, anios, col, yy) in enumerate(
- [(6, 12, AMBAR, -2.6), (9, 8, CELESTE, -3.7), (12, 6, VERDE, -4.8)]):
- rows.append(self.fila(tasa, anios, yy, col))
+ for i, (rate, years, col, yy) in enumerate(
+ [(6, 12, AMBER, -2.6), (9, 8, C_SKY, -3.7), (12, 6, C_GREEN, -4.8)]):
+ rows.append(self.row(rate, years, yy, col))
with self.beat(3) as b:
b.play(f.animate.scale(0.72).move_to(UP * 3.6), run_time=0.5)
for r in rows:
r.shift(UP * 4.3)
- cuenta = MathTex(r"72 \div 6 = 12", color=AMBAR).scale(1.35).move_to(UP * 1.75)
- b.play(Write(cuenta), run_time=0.8)
+ count = MathTex(r"72 \div 6 = 12", color=AMBER).scale(1.35).move_to(UP * 1.75)
+ b.play(Write(count), run_time=0.8)
b.play(FadeIn(rows[0][0]), GrowFromEdge(rows[0][1], LEFT),
FadeIn(rows[0][2]), run_time=0.8)
with self.beat(4) as b:
- c2 = MathTex(r"72 \div 9 = 8", color=CELESTE).scale(1.35).move_to(UP * 1.75)
- b.play(Transform(cuenta, c2), run_time=0.6)
+ c2 = MathTex(r"72 \div 9 = 8", color=C_SKY).scale(1.35).move_to(UP * 1.75)
+ b.play(Transform(count, c2), run_time=0.6)
b.play(FadeIn(rows[1][0]), GrowFromEdge(rows[1][1], LEFT),
FadeIn(rows[1][2]), run_time=0.8)
with self.beat(5) as b:
- c3 = MathTex(r"72 \div 12 = 6", color=VERDE).scale(1.35).move_to(UP * 1.75)
- b.play(Transform(cuenta, c3), run_time=0.6)
+ c3 = MathTex(r"72 \div 12 = 6", color=C_GREEN).scale(1.35).move_to(UP * 1.75)
+ b.play(Transform(count, c3), run_time=0.6)
b.play(FadeIn(rows[2][0]), GrowFromEdge(rows[2][1], LEFT),
FadeIn(rows[2][2]), run_time=0.8)
tabla = VGroup(*rows)
with self.beat(6) as b:
- inv = self.fit(Text("y también al revés", font=FONT, font_size=50,
- weight=BOLD, color=ROSA), 8.0).move_to(DOWN * 1.1)
- b.play(FadeOut(cuenta), run_time=0.3)
- b.play(FadeIn(inv, shift=UP * 0.15), run_time=0.7)
+ inv_m = self.fit(Text("y también al revés", font=FONT, font_size=50,
+ weight=BOLD, color=C_PINK), 8.0).move_to(DOWN * 1.1)
+ b.play(FadeOut(count), run_time=0.3)
+ b.play(FadeIn(inv_m, shift=UP * 0.15), run_time=0.7)
with self.beat(7) as b:
- b.play(FadeOut(VGroup(tabla, inv)), run_time=0.45)
+ b.play(FadeOut(VGroup(tabla, inv_m)), run_time=0.45)
infl = VGroup(
self.fit(Text("30% de inflación anual", font=FONT, font_size=48,
- weight=BOLD, color=ROSA), 8.2),
+ weight=BOLD, color=C_PINK), 8.2),
self.fit(Text("tu plata vale la mitad", font=FONT, font_size=44,
weight=BOLD, color=WHITE), 8.2),
self.fit(Text("en 2,4 años", font=FONT, font_size=56,
- weight=BOLD, color=ROSA), 8.2),
+ weight=BOLD, color=C_PINK), 8.2),
).arrange(DOWN, buff=0.35).move_to(UP * 0.35)
b.play(FadeIn(infl[0], shift=UP * 0.15), run_time=0.6)
b.play(FadeIn(infl[1], shift=UP * 0.15), run_time=0.6)
b.play(FadeIn(infl[2], scale=0.7), run_time=0.7)
with self.beat(8) as b:
- c4 = MathTex(r"72 \div 30 = 2{,}4", color=ROSA).scale(1.45).move_to(DOWN * 2.5)
+ c4 = MathTex(r"72 \div 30 = 2{,}4", color=C_PINK).scale(1.45).move_to(DOWN * 2.5)
b.play(Write(c4), run_time=1.0)
with self.beat(9) as b:
b.play(FadeOut(VGroup(infl, c4)), run_time=0.4)
cmp = VGroup(
- Text("exacto: 11,9 años", font=FONT, font_size=42, color=GRIS),
- Text("regla: 12 años", font=FONT, font_size=42, weight=BOLD, color=VERDE),
+ Text("exacto: 11,9 años", font=FONT, font_size=42, color=C_GRAY),
+ Text("regla: 12 años", font=FONT, font_size=42, weight=BOLD, color=C_GREEN),
).arrange(DOWN, buff=0.3, aligned_edge=LEFT).move_to(UP * 0.4)
ok = self.fit(Text("es aproximada, pero se clava", font=FONT, font_size=42,
weight=BOLD, color=WHITE), 8.2).next_to(cmp, DOWN, buff=0.6)
@@ -116,9 +116,9 @@ class Regla72(TikTok):
with self.beat(10) as b:
b.play(FadeOut(VGroup(cmp, ok)), run_time=0.35)
- cta = self.fit(Text("guardate esta cuenta", font=FONT, font_size=60,
- weight=BOLD, color=AMBAR), 8.0).move_to(UP * 0.4)
- b.play(Write(cta), run_time=0.9)
- b.play(Circumscribe(cta, color=AMBAR, buff=0.3, stroke_width=7), run_time=1.0)
+ count_txt = self.fit(Text("guardate esta cuenta", font=FONT, font_size=60,
+ weight=BOLD, color=AMBER), 8.0).move_to(UP * 0.4)
+ b.play(Write(count_txt), run_time=0.9)
+ b.play(Circumscribe(count_txt, color=AMBER, buff=0.3, stroke_width=7), run_time=1.0)
self.finish()