rain-on-controls

Created about 9 hours ago

attributes
descriptionMake rain visibly hit buttons, pills and navigation, gather on curved edges and release as moving drops. Use for contact with UI geometry, including opaque controls.
import_scopesignals-cleared-supporting-files
licenseMIT
license_urlhttps://github.com/MengTo/Skills/blob/2f8cb46167bec49ee3c4a6ca37972fc065b6b47e/LICENSE
namerain-on-controls
publisherMengTo
repository_urlhttps://github.com/MengTo/Skills
source_urlhttps://github.com/MengTo/Skills/blob/2f8cb46167bec49ee3c4a6ca37972fc065b6b47e/agent-skills/web-design/rain-on-controls/SKILL.md
upstream_copyrightCopyright (c) 2026 Meng To
upstream_revision2f8cb46167bec49ee3c4a6ca37972fc065b6b47e

Rain on Controls

Streaks meet the curved rim, then collect, run down the face and drop away.

Make each streak supply the water that appears on the control. A separate random splash emitter breaks the illusion when the control moves.

Attach the rain

  1. Measure visible controls relative to the render surface after layout, font loading and resize. Track transformed bounds during hover or drag. Use CSS pixels throughout. For a bottom-up shader the rectangle is [rect.left - view.left + rect.width/2, view.bottom - rect.bottom + rect.height/2, rect.width/2, rect.height/2].
  2. Use impacts.glsl inside a fragment shader. Supply uniform vec4 glassRects[4], seasonMix; and uniform float clock;. Zero unused rectangles. Call glassShower(uv * viewportCSS, color) on display-referred RGB before drawing labels. Rain intensity is seasonMix.x in 0–1. The four slots assume horizontal capsules. For a rounded card add halfHeight minus cornerRadius to rimHeight and use halfWidth minus cornerRadius for the straight run.
  3. For each lane pick the next impact position once per cycle. Trace the incoming streak back from that point. Exclude the underside and stop the streak on contact. If the scene already has rain, reserve these last few pixels for the contact pass to avoid double streaks.
  4. Let a short pressure wave spread along the rim. Throw a few small beads on ballistic arcs, integrate their velocity over approximately 11 ms, then let the same pool thin as the rivulet forms. Carry its lateral offset to the underside. Pin the top of the hanging drop until its neck thins.
  5. Vary cycles between about 1.8 and 2.7 seconds. Keep the resting film under a pixel. Reject distant fragments before looping. Skip the pass when dry and freeze time or show a static film under reduced motion.

Check

Slow playback around impact, release and the next cycle. Follow a single bead on a rounded end. Look for an air gap, a second splash before impact, bright water crossing text, or a row of simultaneous drips. Resize while hovering and switch to clear midway through a fall. The UI must remain clickable.


Copyright (c) 2026 Meng To

The license files are attached. MIT

The attached ZIP contains the pinned supporting files cleared for import. Applicable license notices are attached or included when cleared.

Like how this is organised?

Build your own Memory tree on knowen.md: notes, decisions and tasks in one connected markdown graph, shared with your team and your AI agents.