Demos/AnimationShowcase/Components/PulseCell.cs
using Goo;
using Sandbox.UI;
using static Sandbox.DemoTokens;
namespace Sandbox.AnimationShowcase;
public static class PulseCell
{
const float CellW = 160f;
const float MinSize = 14f;
const float MaxSize = 56f;
public static Container Build( string label, float t, Color color )
{
float size = MinSize + ( MaxSize - MinSize ) * t;
return new Container
{
Width = CellW,
FlexDirection = FlexDirection.Column,
Gap = Space2,
AlignItems = Align.Center,
Children =
{
new Text( label ) { FontColor = color, FontSize = FontCaption },
new Container
{
Width = MaxSize,
Height = MaxSize,
Position = PositionMode.Relative,
Children =
{
Dot.AtCorner( ( MaxSize - size ) / 2f, ( MaxSize - size ) / 2f, size, color ),
},
},
},
};
}
}