Code/Demos/AnimationShowcase/Sections/ComposersSection.cs
using Goo;
using Goo.Animation;
using Sandbox.UI;
using static Sandbox.DemoTokens;

namespace Sandbox.AnimationShowcase;

public class ComposersSection
{
    const float RowW   = 480f + 16f + 240f;
    const float RowH   = 120f;

    static readonly Tween LoopFill     = new Tween( Easing.Linear,    duration: 1.5f ).Loop();
    static readonly Tween PulsePos     = new Tween( Easing.SineInOut, duration: 1.0f ).PingPong().Loop();
    static readonly Tween PulseReverse = new Tween( Easing.SineInOut, duration: 1.0f ).PingPong().Reverse().Loop();
    static readonly Tween PulseFast    = new Tween( Easing.SineInOut, duration: 1.0f ).PingPong().Loop().Scale( 3f );

    public Container Build()
    {
        float t = Time.Now;
        return Section.Build(
            "tween composers - continuous",
            new Container
            {
                Width           = RowW,
                Height          = RowH,
                BackgroundColor = BgCard,
                BorderRadius    = Radius2,
                FlexDirection   = FlexDirection.Row,
                Gap             = Space4,
                Padding         = Space4,
                Children =
                {
                    FillCell.Build ( "Loop()",                LoopFill.Eval( t ),     Accent ),
                    PulseCell.Build( "PingPong().Loop()",     PulsePos.Eval( t ),     AccentGreen ),
                    PulseCell.Build( "Reverse().PingPong()",  PulseReverse.Eval( t ), AccentOrange ),
                    PulseCell.Build( "Scale(3).PingPong()",   PulseFast.Eval( t ),    AccentYellow ),
                },
            } );
    }
}