feat: Add festive visual effects (#2252)

<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Introduces an effects system (fireworks, ghost, hearts, shamrocks,
snow), a new `effect` action, and optional date-based loading effects,
integrated into the card with docs, schema, editor, and tests.
> 
> - **Effects System**:
> - Add `EffectsController` and `advanced-camera-card-effects` host with
lazy-loaded effect modules (`fireworks`, `ghost`, `hearts`, `shamrocks`,
`snow`).
> - New base effect component with fade-in/out; SCSS and z-index
updates.
> - **Actions**:
> - New custom action `advanced_camera_card_action: effect` with
`effect_action` (`start`|`stop`|`toggle`).
>   - Wire into `ActionFactory` and add `EffectAction` executor.
> - **Card Integration**:
> - Mount effects host in `advanced-camera-card` and expose
`getEffectsControllerAPI()` via `CardController`.
> - Loading component can trigger date-based effects (e.g., New Year
fireworks) when enabled.
> - **Configuration & Editor**:
> - Add `performance.features.card_loading_effects` (default `true`)
alongside `card_loading_indicator`.
> - Update schemas, defaults, low-performance profile (disables
effects), and editor toggles.
> - **Docs & Examples**:
>   - Document `effect` action parameters and add menu example.
>   - Update performance docs with new option.
> - **Localization & Tests**:
>   - Update i18n strings for new performance option.
> - Add comprehensive tests for effects controller, action, factory,
config defaults/profiles, and utilities.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
cffd4304fe3bd22340316f9cec53e341379b1756. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
This commit is contained in:
Dermot Duffy
2025-12-06 18:21:44 -08:00
committed by GitHub
parent 993e288c14
commit 3279481b0e
58 changed files with 1943 additions and 104 deletions
@@ -94,6 +94,23 @@ advanced_camera_card_action: display_mode_select
| `advanced_camera_card_action` | Must be `display_mode_select`. |
| `display_mode` | `single` to show a single camera at a time in a carousel, or `grid` to show a grid of cameras. |
## `effect`
Trigger a visual effect.
```yaml
action: custom:advanced-camera-card-action
advanced_camera_card_action: effect
# [...]
```
| Parameter | Description |
| ----------------------------- | ------------------------------------------------------------------------------------- |
| `action` | Must be `custom:advanced-camera-card-action`. |
| `advanced_camera_card_action` | Must be `effect`. |
| `effect` | The name of the effect, one of [`fireworks`, `ghost`, `hearts`, `shamrocks`, `snow`]. |
| `effect_action` | One of `start`, `stop` or `toggle`. |
## `download`
Download the displayed media.
@@ -869,4 +886,12 @@ elements:
tap_action:
- action: custom:advanced-camera-card-action
advanced_camera_card_action: reload
- type: custom:advanced-camera-card-menu-icon
icon: mdi:snow
title: Snow Effect
tap_action:
- action: custom:advanced-camera-card-action
advanced_camera_card_action: effect
effect: snow
effect_action: toggle
```
+3 -1
View File
@@ -25,7 +25,8 @@ performance:
| Option | Default | Description |
| ---------------------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `animated_progress_indicator` | `true` | Will show the animated progress indicator 'spinners' when `true`. |
| `card_loading_indicator` | `true` | Will show the card loading indicator (spinner & version number) when `true`. |
| `card_loading_effects` | `true` | Will occasionally show (silly) visual effects during card loading (e.g. fireworks on New Year's Day). |
| `card_loading_indicator` | `true` | Will show the card loading indicator (spinner & version number) and effects (see `card_loading_effects` below) when `true`. |
| `media_chunk_size` | `50` | How many media items to fetch and render at a time (e.g. thumbnails under a live view, or number of snapshots to load in the media viewer). This may only make partial sense in some contexts (e.g. the 'infinite gallery' is still infinite, it just loads thumbnails this many items at a time) or not at all (e.g. the timeline will show the number of events dictated by the time span the user navigates to). |
| `max_simultaneous_engine_requests` | _Infinity_ | How many camera engine requests to allow occur in parallel. Setting lower values will slow the card down since more requests will run in sequence, but it will increase the chances of positive cache hit rates and reduce the chances of overwhelming the backend. |
@@ -60,6 +61,7 @@ For low end devices, the `low-performance` profile will adjust card defaults to
performance:
features:
animated_progress_indicator: true
card_loading_effects: true
card_loading_indicator: true
media_chunk_size: 50
max_simultaneous_engine_requests: 100