Skip to content
Halorav0.1.0

Components

Page lights and glows

Soft light that never ends in a visible edge.

Page lights#

One fixed layer behind the content. Three radial gradients, each fading to transparent by 70%. Put it first in <body>. The base layer paints the canvas color on <html>, so the lights show above it and below the content.

HTML
<div class="dm-lights"><div class="ha-page-lights" aria-hidden="true"></div></div>

In a page, use position: fixed, which is the default. Here it is scoped to the box.

HTML
<body>
  <div class="ha-page-lights" aria-hidden="true"></div>
  ...
</body>

Hero glow#

For a halo behind a hero, put .ha-glow inside a positioned, isolated parent. The gradient uses closest-side so the fade finishes inside the box. Size it with --ha-glow-w and --ha-glow-h; it is capped to 100vw and 80vmax so it never causes horizontal scroll.

Halo

HTML
<div style="position:relative;isolation:isolate;width:100%;height:240px;display:grid;place-items:center;border-radius:16px;overflow:hidden">
  <div class="ha-glow" style="--ha-glow-w:520px;--ha-glow-h:260px" aria-hidden="true"></div>
  <p class="ha-h2" style="text-align:center">Halo</p>
</div>

Particles#

.ha-particles is the canvas the particles behavior draws into. See Particles.

ClassPurpose
ha-page-lightsFixed lights behind content.
ha-glowHero halo. Uses --ha-halo and --ha-halo-soft.
ha-particlesFixed canvas for the particles field.

Mobile#

  • The lights are sized in percentages of the viewport, so they scale from 320px up.
  • No section boundary clips them. If scrolling feels heavy on a low-end phone, remove per-section halos and keep the one fixed layer.

Edit this page on GitHub

Type to search.