UI/HQ/Elements/IntroScreen.razor
@using Sandbox.UI;
@inherits Panel
@namespace PlanetMeat

<root>
	<span class="@(ToVis(ShowIntroTop))">#intro.top.text</span>
	<span class="@(ToVis(ShowIntroBottom))">#intro.bottom.text</span>
	<div>
		@if (ShowIntroTop)
		{
			<span class="top-sound"></span>
		}
		@if (ShowIntroBottom)
		{
			<span class="bottom-sound"></span>
		}
	</div>
</root>

@code
{
	public const float STARTS_AT = 1.0f;
	private static bool ShowIntroTop => Time.Now - STARTS_AT > 0.5f;
	private static bool ShowIntroBottom => Time.Now - STARTS_AT > 3.0f;
	public static bool FadeStarted => Time.Now - STARTS_AT > 6.0f;
	public static bool ShowIntro => Time.Now - STARTS_AT <= 7.0f;

	private string ToVis(bool v) => v ? "" : "invis";

	protected override int BuildHash() => System.HashCode.Combine(ShowIntroTop, ShowIntroBottom);
}