Update README and code to set default sparkle shape to 'none' and add opacity control

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
2026-04-15 11:24:32 +02:00
parent 0fec97163d
commit c7382c11a5
7 changed files with 257 additions and 80 deletions
+13 -2
View File
@@ -13,8 +13,9 @@ It exposes two widget layers:
- Optional motion input via sensors or custom tilt stream
- Generic wrapper API for any widget via `Shiny(child: ...)`
- Card API with `background`, `foreground`, `shape`, and drag tilt via `ShinyCard`
- Built-in sparkle presets including 8-point star, 5-point star, rectangle, diamond, hexagon, random polygon, and confetti
- Built-in sparkle presets including `none` (default), 8-point star, 5-point star, rectangle, diamond, hexagon, random polygon, and confetti
- Custom sparkle shapes via parameterized `SparkleShapeSpec` factories
- Global shader opacity control via `opacity`
- Cross-platform Flutter support (mobile, web, desktop)
## Installation
@@ -60,7 +61,8 @@ ShinyCard(
controller: controller,
background: Container(color: const Color(0xFF1B2D4B)),
foreground: const Center(child: Text('HOLO')),
sparkleShape: SparkleShapeSpec.eightPointStar,
sparkleShape: SparkleShapeSpec.none,
opacity: 1.0,
)
```
@@ -80,6 +82,10 @@ Shiny(
Use built-in sparkle presets:
```dart
ShinyCard(
sparkleShape: SparkleShapeSpec.none,
)
ShinyCard(
sparkleShape: SparkleShapeSpec.hexagon,
)
@@ -120,6 +126,11 @@ final ShinyController controller = ShinyController(tiltStream: input.stream);
- `ShinyController`: optional source selection for tilt
- `SensorTiltController`: low-level sensor fusion stream utility
Important defaults:
- `sparkleShape` defaults to `SparkleShapeSpec.none` (no sparkles)
- `opacity` defaults to `1.0`
## Platform Notes
- Shader uses Flutter runtime effects and avoids derivative functions (`dFdx`, `dFdy`, `fwidth`) for web compatibility.