Skip to content

Screen Effects ​

Full-screen visual effects that sit above all HA and LCARdS UI

Screen effects cover the entire viewport with composited overlays: blur, colour tints, TV static, pixelation, glitch artefacts, CRT scanlines, and more. They are designed for alert states, dramatic transitions, and automation-triggered feedback.


Quick Start ​

js
// Browser console - play for 2 seconds then auto-dismiss
window.lcards.screenEffect.play('static', { duration: 2000 })

// Apply slot effects persistently (stays until cleared)
window.lcards.screenEffect.applySlot('backdrop', 'blur', { amount: '12px' })
window.lcards.screenEffect.applySlot('color', 'color-tint', { color: 'rgba(180,0,0,0.35)' })
window.lcards.screenEffect.clear()
yaml
# HA automation
service: lcards.trigger_effect
data:
  layers:
    canvas:
      preset: glitch
  duration: 1500

Preset Reference ​

Backdrop presets ​

These use the CSS backdrop-filter property; they filter the browser content visually without obscuring it with an opaque layer. Works best on content-rich dashboards.

blur ​

Applies a Gaussian blur to everything behind the overlay.

ParameterTypeDefaultDescription
amountstring'8px'CSS blur radius, e.g. '4px', '20px'
yaml
service: lcards.trigger_effect
data:
  layers:
    backdrop:
      preset: blur
      amount: "12px"
  duration: 3000

saturate ​

Boosts colour saturation of the screen behind the overlay.

ParameterTypeDefaultDescription
amountstring'200%'CSS saturation, e.g. '150%', '400%'

grayscale ​

Desaturates the screen behind the overlay.

ParameterTypeDefaultDescription
amountstring'100%'CSS grayscale amount. '100%' = full B&W, '50%' = partial

contrast ​

Increases or decreases contrast.

ParameterTypeDefaultDescription
amountstring'200%'CSS contrast amount, e.g. '150%', '300%'

hue-rotate ​

Rotates all hues on screen.

ParameterTypeDefaultDescription
anglestring'180deg'CSS hue rotation, e.g. '90deg', '-45deg'

Color tint presets ​

These render a <div> with a CSS background above all screen content.

color-tint ​

Semi-transparent colour flood over the entire screen.

ParameterTypeDefaultDescription
colorstring'rgba(0,0,0,0.5)'Any CSS colour: hex, rgb, rgba, hsl
yaml
service: lcards.trigger_effect
data:
  layers:
    color:
      preset: color-tint
      color: "rgba(180, 0, 0, 0.4)"
  duration: 2000

vignette ​

Dark radial gradient at the screen edges, like a cinematic vignette.

ParameterTypeDefaultDescription
opacitynumber0.7Darkness of the edge fade (0–1)

Canvas presets ​

These draw directly above all content using a Canvas2D rAF loop. They blend with the underlying screen using CSS mix-blend-mode so content shows through.

Canvas and screen content

For browser security reasons, canvas effects cannot read the actual pixels of the HA dashboard; they generate synthetic overlays. The visual result is an obscuring or distorting texture layered over the real content.

static ​

TV static noise. Chunky random pixel noise scaled up with image-rendering: pixelated.

ParameterTypeDefaultDescription
opacitynumber0.55Overall canvas opacity (0–1)
scalenumber4Down-sample factor. Higher = larger/chunkier pixels. 2 = fine grain, 8 = very coarse
colorstring'#ffffff'Tint colour for noise pixels
tintStrengthnumber00–1 blend toward color. 0 = pure noise, 1 = solid colour
yaml
service: lcards.trigger_effect
data:
  layers:
    canvas:
      preset: static
      scale: 6
      opacity: 0.7
  duration: 800

pixelate ​

Mosaic of small dark blocks with subtle lightness variance. Simulates low-resolution signal degradation. Uses mix-blend-mode: multiply; blocks darken content proportionally.

ParameterTypeDefaultDescription
pixelSizenumber8Block size in px. Larger = chunkier mosaic
opacitynumber0.75Overall canvas opacity (0–1)
variancenumber0.35Lightness jitter per block (0–1). 0 = uniform, 1 = max contrast
baseLightnumber80Base grey lightness (0–255). Lower = darker blocks
colorstring'#8c9aa6'Tint colour blended into each mosaic block
tintStrengthnumber00–1 blend toward color. 0 = neutral gray mosaic, 1 = solid colour blocks
yaml
service: lcards.trigger_effect
data:
  layers:
    canvas:
      preset: pixelate
      pixelSize: 12
      opacity: 0.6
  duration: 2000

glitch ​

Sparse horizontal displacement bands with thin chroma-aberration edge lines. Uses mix-blend-mode: overlay. Keeps only a small fraction of rows active per frame for an authentic data-corruption look.

ParameterTypeDefaultDescription
intensitynumber0.08Fraction of row-bands glitched per frame (0–1). Keep low (0.05–0.15) for subtle effect
maxShiftnumber40Maximum horizontal offset in px
bandHeightnumber4Height of each glitch band in px
opacitynumber0.85Overall canvas opacity (0–1)
fpsnumber20Target frame rate
yaml
service: lcards.trigger_effect
data:
  layers:
    canvas:
      preset: glitch
      intensity: 0.12
      maxShift: 60
  duration: 1000

scanlines ​

CRT-style horizontal line overlay. Optionally scrolls vertically.

ParameterTypeDefaultDescription
lineHeightnumber4Height of each line pair in px
opacitynumber0.25Dark line opacity (0–1)
scrollnumber0Scroll speed in px/s. 0 = static, positive = downward
yaml
service: lcards.trigger_effect
data:
  layers:
    canvas:
      preset: scanlines
      lineHeight: 3
      opacity: 0.35
      scroll: 40

borg-assimilation ​

Green tendrils grow across the screen from several injection sites, with nano-probe particles travelling along them. This is the effect behind Borg Assimilation, and it can be triggered on its own.

ParameterTypeDefaultDescription
siteCountnumber7Number of injection sites (1 to 20)
tendrilsPerSitenumber8Tendrils grown from each site (1 to 24)
tendrilLengthnumber600Maximum tendril reach in px (100 to 1200)
particleCountnumber2Particles travelling each tendril (0 to 6; 0 disables)
colorstring'#00cc44'Tendril, branch and site colour (hex, CSS variable or computed token)
glowColorstring'#00ff66'Glow at each site and around particles
yaml
service: lcards.trigger_effect
data:
  layers:
    canvas:
      preset: borg-assimilation
      siteCount: 5
      color: var(--lcars-martian)

HA Service ​

lcards.trigger_effect ​

Fire one or more layered screen effects from an automation, script, or developer tools. Each of the three slots is configured independently; include only the slots you want.

yaml
# Full red alert - blur + red tint + TV static
service: lcards.trigger_effect
data:
  layers:
    backdrop:
      preset: blur
      amount: "12px"
    color:
      preset: color-tint
      color: "rgba(180, 0, 0, 0.35)"
    canvas:
      preset: static
      opacity: 0.3
  duration: 5000              # auto-clear after 5 s
yaml
# Canvas-only effect, broadcast to all browsers
service: lcards.trigger_effect
data:
  layers:
    canvas:
      preset: glitch
      intensity: 0.15
  duration: 1200
yaml
# Persistent blur on a specific user - stays until lcards.clear_effect
service: lcards.trigger_effect
data:
  layers:
    backdrop:
      preset: blur
      amount: "16px"
  target_user_ids:
    - "a1b2c3d4e5f6"
yaml
# Target a specific browser device by UUID
service: lcards.trigger_effect
data:
  layers:
    color:
      preset: vignette
      opacity: 0.8
  duration: 3000
  target_device_ids:
    - "abc123def456"

Slots ​

SlotPresetsRendering
backdropblur, grayscale, saturate, contrast, hue-rotateCSS backdrop-filter
colorcolor-tint, vignetteTransparent <div> overlay
canvasstatic, pixelate, glitch, scanlinesCanvas2D rAF loop

Omit a slot to leave it unchanged. Set a slot to null to explicitly clear it:

yaml
# Clear only the canvas slot, leave blur alone
service: lcards.trigger_effect
data:
  layers:
    canvas: null

lcards.clear_effect ​

Clear one or all active screen effects.

yaml
# Clear everything on all browsers
service: lcards.clear_effect

# Clear only the canvas slot (leaves blur/tint active)
service: lcards.clear_effect
data:
  slot: canvas

# Clear on a specific device only
service: lcards.clear_effect
data:
  target_device_ids:
    - "abc123def456"

To find your browser's device ID and user ID:

js
window.lcards.targeting.getMyIds()
// → { deviceId: 'abc123...', userId: 'a1b2c3...' }

Console API ​

All methods are also available on window.lcards.screenEffect:

js
// Apply a single slot persistently (stays until clear)
window.lcards.screenEffect.applySlot('backdrop', 'blur', { amount: '12px' })
window.lcards.screenEffect.applySlot('color', 'color-tint', { color: 'rgba(180,0,0,0.35)' })
window.lcards.screenEffect.applySlot('canvas', 'static', { opacity: 0.3 })

// apply() is a shorthand for single-slot presets by name
window.lcards.screenEffect.apply('blur', { amount: '12px' })

// Transient single-slot effect - auto-dismisses after duration ms
window.lcards.screenEffect.play('static', { duration: 2000, scale: 6 })

// Remove effects
window.lcards.screenEffect.clearSlot('backdrop')   // one slot only
window.lcards.screenEffect.clear()                  // all slots

// List all registered preset names
window.lcards.screenEffect.list()

// Register a custom preset at runtime
window.lcards.screenEffect.registerPreset('my-green', {
  slot: 'color',
  defaults: { color: 'rgba(0,255,100,0.3)' },
  enter(el, params) {
    el.style.background = params.color;
    return () => { el.style.background = ''; };
  },
})