An open API service indexing awesome lists of open source software.

https://github.com/cartsp/hero-wave

A reusable Blazor WASM wavy background component — animated canvas waves with simplex noise, packaged as a Razor Class Library
https://github.com/cartsp/hero-wave

animation blazor blazor-client blazor-webassembly canvas dotnet ui ui-components webassembly

Last synced: 3 months ago
JSON representation

A reusable Blazor WASM wavy background component — animated canvas waves with simplex noise, packaged as a Razor Class Library

Awesome Lists containing this project

README

          

# HeroWave

[![CI](https://github.com/cartsp/hero-wave/actions/workflows/ci.yml/badge.svg)](https://github.com/cartsp/hero-wave/actions/workflows/ci.yml)
[![NuGet](https://img.shields.io/nuget/v/HeroWave.svg)](https://www.nuget.org/packages/HeroWave)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![Live Demo](https://img.shields.io/badge/demo-live-blue)](https://cartsp.github.io/hero-wave/)

A reusable Blazor component for animated wavy background effects powered by HTML5 Canvas and simplex noise. Works as a hero section, full-page background, or any container background.

**[View Live Demo](https://cartsp.github.io/hero-wave/)** | [Hero Section](https://cartsp.github.io/hero-wave/) | [Full Page](https://cartsp.github.io/hero-wave/fullpage) | [Color Showcase](https://cartsp.github.io/hero-wave/showcase)

![Hero section demo](assets/screenshots/hero.png)

![Full page background](assets/screenshots/fullpage.png)

![Color presets showcase](assets/screenshots/showcase.png)

## Installation

```bash
dotnet add package HeroWave
```

Add the namespace to your `_Imports.razor`:

```razor
@using HeroWave.Components
```

## Quick Start

```razor

Get Started

```

## Parameters

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `Title` | `string?` | null | Large heading text centered over the waves |
| `Subtitle` | `string?` | null | Smaller text below the title |
| `ChildContent` | `RenderFragment?` | null | Custom Razor markup rendered below title/subtitle |
| `Height` | `string` | `"100vh"` | CSS height of the container |
| `Colors` | `string[]` | `["#38bdf8", "#818cf8", "#c084fc", "#e879f9", "#22d3ee"]` | Wave line colors |
| `BackgroundColor` | `string` | `"#0c0c14"` | Background fill color |
| `WaveCount` | `int` | `5` | Number of wave layers |
| `WaveWidth` | `int` | `50` | Stroke width of each wave (px) |
| `Speed` | `double` | `0.004` | Animation speed — time increment per frame (e.g. `0.004` slow, `0.008` fast) |
| `Opacity` | `double` | `0.5` | Wave opacity (0.0 - 1.0) |
| `CssClass` | `string?` | null | Additional CSS class on the overlay |

## Examples

### Hero Section

```razor

Get Started

```

### Full Page Background

```razor


...
...

```

### Color Presets

**Ocean Aurora** - cool blues and greens
```razor

```

**Sunset Fire** - warm oranges, reds, pinks
```razor

```

**Neon Cyberpunk** - electric, high contrast
```razor

```

**Minimal Frost** - white/silver on dark, subtle
```razor

```

**Northern Lights** - purples, greens, ethereal
```razor

```

**Molten Gold** - luxurious golds and ambers
```razor

```

## Contributing

```bash
# Clone and build
git clone https://github.com/cartsp/hero-wave.git
cd hero-wave
dotnet build

# Run the demo app
dotnet run --project demo/HeroWave.Demo

# Run unit tests
dotnet test tests/HeroWave.Tests/

# Run E2E tests (requires Playwright browsers installed)
dotnet test tests/HeroWave.E2E/
```

## License

[MIT](LICENSE)