Skip to content

Commit

Permalink
Pick random effect from effect gallery
Browse files Browse the repository at this point in the history
  • Loading branch information
ggozad committed Sep 25, 2024
1 parent 9174b2d commit 74124bc
Showing 1 changed file with 54 additions and 8 deletions.
62 changes: 54 additions & 8 deletions src/oterm/app/splash.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import random
from typing import Any, Tuple

from textualeffects.widgets import SplashScreen

from oterm.app.widgets.effect import EffectType

logo = """
@@@@@@. :@@@@@@
@@@@@@@@@ @@@@@@@@@
Expand Down Expand Up @@ -42,12 +47,53 @@
@. .@
"""

effects: list[Tuple[EffectType, dict[str, Any]]] = [
(
"Beams",
{
"beam_delay": 3,
"beam_gradient_steps": 2,
"beam_gradient_frames": 2,
"final_gradient_steps": 2,
"final_gradient_frames": 2,
"final_wipe_speed": 5,
},
),
(
"BouncyBalls",
{
"ball_delay": 1,
},
),
(
"Expand",
{
"movement_speed": 0.1,
},
),
(
"Pour",
{
"pour_speed": 3,
},
),
(
"Rain",
{},
),
(
"RandomSequence",
{},
),
(
"Scattered",
{},
),
(
"Slide",
{},
),
]

splash = SplashScreen(
text=logo,
effect="Spotlights",
config={
"search_duration": 100,
"spotlight_count": 3,
},
)
effect = random.choice(effects)
splash = SplashScreen(text=logo, effect=effect[0], config=effect[1])

0 comments on commit 74124bc

Please sign in to comment.