Skip to content

Position and Screen Effects ​

Where the alert symbol sits on the screen, how big it is, and the effects drawn over the dashboard behind it. These settings apply to display: overlay; the band has its own.

Position ​

position places the symbol (or your content card) on the screen: in the middle, along an edge or in a corner. A corner keeps the middle of the dashboard in view while the alert is up.

  • The backdrop still covers the whole screen wherever the symbol sits, and a tap anywhere outside the symbol's box (its width by height) dismisses the alert (Dismiss).
yaml
# A small notification in the top right corner
type: custom:lcards-alert-overlay
position: top-right
width: 380px
conditions:
  red_alert:
    content:
      type: custom:lcards-button
      preset: lozenge
      text:
        name:
          content: RED ALERT
          show: true
      style:
        card:
          color:
            background:
              default: var(--lcards-orange-dark)
ValueWhere
centerIn the middle of the screen (the default)
top, top-centerCentred, at the top
bottom, bottom-centerCentred, at the bottom
left, left-center, center-leftCentred top to bottom, at the left edge
right, right-center, center-rightCentred top to bottom, at the right edge
top-left, top-right, bottom-left, bottom-rightIn that corner
KeyTypeDefaultDescription
positionstringcenterOne of the values above. A condition can set its own

Size ​

width and height size the symbol, or your content card, on the screen. Percentages are of the screen, so 60% is 60% of the screen's width.

  • For the built-in symbol and other SVG component cards a width alone is enough: the height follows from the shape.
  • With neither set, the symbol gets 60% of the width and 50% of the height of the screen and scales to fit inside, so it suits wide, tall and phone screens alike.
  • Set a height for a custom content card that can't size itself from its width.
yaml
type: custom:lcards-alert-overlay
width: 500px # the height follows from the symbol's shape
conditions:
  black_alert:
    width: 40%
    height: 30%
More about size
  • The default height: 50% applies only to the built-in symbol (or a content card that is itself component: alert) when no width is set either. Set a width without a height, or use another content card, and the height is auto: the content sizes itself.
  • Per condition: conditions.<key>.width and conditions.<key>.height fall back to the card's values, then to these defaults.
KeyTypeDefaultDescription
widthstring60%Width as a CSS length (400px, 50%, 50vw)
heightstring50% for the symbol with no width, else autoHeight as a CSS length. auto: the content sizes itself

layers ​

layers sets the screen effects drawn over the dashboard behind the symbol: a filter on the dashboard, an animated canvas over it, and a colour on top. Without layers the overlay shows an 8px blur and nothing else.

  • There are three slots, each with its own presets: backdrop filters the dashboard behind the overlay, color lays a colour over it, and canvas draws an animation between the two (the colour lies over it).
  • Set only the slots you want. Once layers is set, a slot you leave out stays off, so layers with only color has no blur.
  • layers: null turns every layer off: the symbol shows over the dashboard as it is.
  • A condition can change one slot and keep the others, or turn a slot off with null; see Per-Condition Settings.
yaml
type: custom:lcards-alert-overlay
dismiss_mode: reset
layers:
  # blur the dashboard
  backdrop:
    preset: blur
    amount: 12px
  # dim it with a red tint
  color:
    preset: color-tint
    color: alpha(theme:colors.alert.red, 0.35)
  # TV static, under the tint
  canvas:
    preset: static
    opacity: 0.3
More about layers
  • Colours: the colour settings (color-tint's color, and color on the static and pixelate canvas presets) take any LCARdS colour: rgb()/rgba(), var(--css-variable), theme tokens (theme:palette.moonlight), CSS colour names and computed expressions (alpha(theme:colors.ui.primary, 0.4)). For colours that follow the alert mode use var(--lcards-*) or var(--lcars-*) variables.
  • Older configs: a card-level backdrop with blur, opacity and color (from older versions) is still read when layers is not set: blur becomes a blur layer and color a color-tint, with opacity (default 0.6) multiplied into the colour's alpha. The Alert Studio converts it to layers when you change a layer.
  • The band: in display: band the layers are off unless you set them; see Alert Band.
  • Effects from actions: the overlay only replaces the layers it sets and, when it closes, clears only its own. A screen effect started with lcards.trigger_effect on a layer the overlay leaves out keeps running, and so does one started on any layer after the overlay appeared.
KeyTypeDefaultDescription
layersobject or null-The screen effects; null turns them all off
layers.backdropobjectan 8px blur when layers is not setThe backdrop filter
layers.colorobject-The colour layer
layers.canvasobject-The canvas animation

layers.backdrop ​

The backdrop slot filters the dashboard behind the overlay: blur it, take the colour out, or shift its hues. It is a CSS backdrop-filter, so the dashboard shows through, changed.

yaml
type: custom:lcards-alert-overlay
layers:
  backdrop:
    preset: grayscale
    amount: 80%
PresetWhat it doesSetting
blurBlurs the dashboardamount, default 8px
grayscaleTakes out the colouramount, default 100%
saturateMakes colours strongeramount, default 200%
contrastRaises the contrastamount, default 200%
hue-rotateShifts every hue round the colour wheelangle, default 180deg
KeyTypeDefaultDescription
presetstringrequiredOne of the presets above
amountstringby presetCSS value for blur (4px subtle, 20px heavy), grayscale, saturate and contrast
anglestring180deghue-rotate only: the angle (90deg, 270deg)

layers.color ​

The colour slot lays a colour over the dashboard, on top of the backdrop filter and the canvas: a flat tint, or a vignette that darkens the edges.

yaml
type: custom:lcards-alert-overlay
layers:
  color:
    preset: vignette
    opacity: 0.8
PresetWhat it does
color-tintA flat colour over the whole screen; use a colour with alpha so the dashboard shows through
vignetteA dark fade from clear in the middle to dark at the edges
KeyTypeDefaultDescription
presetstringrequiredcolor-tint or vignette
colorcolourrgba(0,0,0,0.5)color-tint only: the tint, any colour (alpha sets how much shows through)
opacitynumber0.7vignette only: how dark the edges get, 0 to 1

layers.canvas ​

The canvas slot draws an animation over the dashboard, between the backdrop filter and the colour layer: TV static, a mosaic, glitch bands or scanlines.

yaml
type: custom:lcards-alert-overlay
layers:
  canvas:
    preset: scanlines
    lineHeight: 3
    opacity: 0.3
    scroll: 2
PresetWhat it doesSettings
staticTV static noiseopacity, scale, color, tintStrength
pixelateMosaic blockspixelSize, opacity, variance, baseLight, color, tintStrength
glitchBands shifted sidewaysintensity, maxShift, bandHeight, opacity, fps
scanlinesCRT lines across the screenlineHeight, opacity, scroll
KeyTypeDefaultDescription
presetstringrequiredOne of the presets above
opacitynumber0.55 static, 0.75 pixelate, 0.85 glitch, 0.25 scanlinesHow strong the effect is, 0 to 1
scalenumber4static: grain size, 1 to 16; larger is chunkier
pixelSizenumber8pixelate: block size in px, 2 to 64
variancenumber0.35pixelate: brightness difference between blocks, 0 to 1 (0 is even)
baseLightnumber80pixelate: base grey level, 0 (black) to 255 (white)
colorcolour#ffffff static, #8c9aa6 pixelatestatic and pixelate: the colour blended in, by tintStrength
tintStrengthnumber0static and pixelate: how far to blend toward color, 0 to 1 (0 is white noise or a grey mosaic)
intensitynumber0.08glitch: share of lines shifted each frame, 0.01 to 0.5
maxShiftnumber40glitch: largest sideways shift in px
bandHeightnumber4glitch: height of each band in px
fpsnumber20glitch: frames per second, 1 to 60
lineHeightnumber4scanlines: height of each line in px, 1 to 20
scrollnumber0scanlines: scroll speed, 0 to 10 (0 is still)

Released under the MIT License. | About