Flash Fade¶
FlashFade is an animation for fading VMobjects with flashing outlines.
Setup¶
Visit colab.new to create a new Colab notebook.
Installation
The session will restart to apply changes.
%pip install -q mscene
import mscene
%mscene -l manim plugins
Imports
extras
is included in the plugins.
from mscene.manim import *
from mscene.extras import FlashFade
Scenes¶
Scene One¶
%%manim -qm SceneOne
class SceneOne(Scene):
def construct(self):
text = Text("Hello World", font_size=140)
blues = [BLUE_A, BLUE_C, BLUE_E]
kwargs = dict(color=blues, width=6, duration=1.5)
self.play(FlashFade(text, mode="IN", **kwargs))
self.wait(1.5)
self.play(FlashFade(text, mode="OUT", reverse=True, **kwargs))
self.wait()
self.play(FlashFade(text, **kwargs))
self.wait(0.5)
Scene Two¶
%%manim -qm SceneTwo
class SceneTwo(Scene):
def construct(self):
# Aibohphobia is a (humorous) term for the irrational fear of palindromes.
text = Text("AIBOHPHOBIA", font_size=100)
tp1 = text[:5]
tp2 = text[5:]
reds = [RED_A, RED_C, RED_E]
kwargs = dict(color=reds, width=5, duration=1.5, lag_ratio=0.25)
self.play(
FlashFade(tp1, mode="IN", reverse=True, **kwargs),
FlashFade(tp2, mode="IN", **kwargs),
)
self.wait(1.5)
self.play(
FlashFade(tp1, mode="OUT", **kwargs),
FlashFade(tp2, mode="OUT", reverse=True, **kwargs),
)
self.wait(0.5)
Scene Three¶
%%manim -qm SceneThree
class SceneThree(Scene):
def construct(self):
shapes = ManimBanner()[0].fade().center()
self.play(FlashFade(shapes, width=6, opacity=1, lag_ratio=0.5, duration=2))
self.wait(0.5)