rain-on-controls
| description | Make 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_scope | signals-cleared-supporting-files |
| license | MIT |
| license_url | https://github.com/MengTo/Skills/blob/2f8cb46167bec49ee3c4a6ca37972fc065b6b47e/LICENSE |
| name | rain-on-controls |
| publisher | MengTo |
| repository_url | https://github.com/MengTo/Skills |
| source_url | https://github.com/MengTo/Skills/blob/2f8cb46167bec49ee3c4a6ca37972fc065b6b47e/agent-skills/web-design/rain-on-controls/SKILL.md |
| upstream_copyright | Copyright (c) 2026 Meng To |
| upstream_revision | 2f8cb46167bec49ee3c4a6ca37972fc065b6b47e |
Rain on Controls

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
- 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]. - Use impacts.glsl inside a fragment shader. Supply
uniform vec4 glassRects[4], seasonMix;anduniform float clock;. Zero unused rectangles. CallglassShower(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. - 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.
- 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.
- 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.