BPT

Background

BptBackground

Procedural and image-based backgrounds with 10 pattern styles, WebGL rendering with Canvas 2D fallback. Supports animated or still modes, dev-mode config save/load, and image parallax/follow behaviors.

Background Parameters
Preview
Aurora — animated Target: #bg-preview-target

Aurora Background

Procedural animated background with 3 colors

Current Configuration
📋
<BptBackground @ref="bgEffect"
               Style="BptBackgroundStyle.Aurora"
               Animated="true"
               Speed="1"
               Scale="1"
               Intensity="0.7"
               Seed="42"
               BackgroundColor="rgba(15, 15, 35, 1.0)"
               Colors="colors"
               Target="#bg-preview-target">
    <!-- Your content here -->
</BptBackground>

<!-- Optional dev-mode JSON save / load workflow -->
<button @onclick="GenerateRandom">Generate Random</button>
<button @onclick="CopyConfig">Copy Config</button>
<button @onclick="LoadConfig">Load Config</button>
<textarea @bind="configJson" rows="4" placeholder="Paste a saved config JSON and click Load Config"></textarea>

@code {
    private BptBackground? bgEffect;
    private string? configJson;

    private List<string> colors = [
        "rgba(100, 150, 255, 0.6)",
        "rgba(200, 80, 180, 0.5)",
        "rgba(80, 220, 200, 0.5)",
    ];

    // Ask the component to generate a fresh random configuration.
    private async Task GenerateRandom()
    {
        if (bgEffect is null) return;
        configJson = await bgEffect.GenerateRandomAsync();
    }

    // Read the live configuration as JSON (useful for persisting it).
    private async Task CopyConfig()
    {
        if (bgEffect is null) return;
        configJson = await bgEffect.GetConfigAsync();
    }

    // Apply a previously saved configuration JSON to the component.
    private async Task LoadConfig()
    {
        if (bgEffect is null || string.IsNullOrWhiteSpace(configJson)) return;
        await bgEffect.SetConfigAsync(configJson);
    }
}
An unhandled error has occurred. Reload 🗙

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please reload the page.