- Home
- Skills
- Frontend & Web Apps
- Light Rays Background
More screenshots
Works with the AI Agents you already use
Light Rays Background
A high-performance animated background of 150 glowing threads with scroll parallax and automatic text masking.
Free
Light Rays Background
Example session with this skill installed
Add a flowing light-rays background to my Next.js landing page. Use my brand purple and make sure the headline stays readable.
- Read your context and instructions
- Compiled the light rays background
- Generated the UI component
Summary
Added the light-rays background to your marketing pages. 150 glowing threads now draw in from the top right, pinch into a knot beside your hero headline, and sway down the page behind every section. The light fades out behind all text, follows your light/dark theme, and stays still for visitors with reduced motion turned on.
| What | Where |
|---|---|
| The effect (no dependencies) | src/components/motion/rays.ts |
| React wrapper | src/components/motion/LightRays.tsx |
| Canvas styles | added to app/globals.css |
| Mounted once | app/(marketing)/layout.tsx |
The code
app/(marketing)/layout.tsx
import { LightRays } from "@/components/motion/LightRays";
import type { RaysOptions } from "@/components/motion/rays";
// Defined at module level so a re-render doesn't restart the animation.
const RAYS: RaysOptions = {
colors: { main: "var(--brand-300)", deep: "var(--brand-600)", accent: "#b06cff" },
clear: "header nav, h1, h2, h3, p, li, .btn, footer",
knot: { x: 0.62, y: 0.5 },
};
export default function MarketingLayout({ children }: { children: React.ReactNode }) {
return (
<>
<LightRays options={RAYS} />
{children}
</>
);
}
app/globals.css
/* The background moves to html: a body background would paint over the canvases. */
html { background: var(--background); }
body { background: transparent; }
.rays { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; pointer-events: none; }
.rays-soft { z-index: -3; filter: blur(24px); }
What I changed and why
Moved your page background from body to html. The canvases sit behind the content, and a body background would have covered them.
Made the feature section backgrounds transparent. Your pricing cards keep their translucent backdrop-blur, so they now pick up a soft glow from the threads behind them.
Placed the knot at x: 0.62. Your hero copy sits on the left, so the knot lands in the empty space next to the headline, not under the "Get started" button.
- Used your brand tokens (
--brand-300,--brand-600) so the threads follow your design system in both themes.
Checked in the browser
- Threads draw in and meet beside the headline ✓
- Every bend down the page stays inside the window ✓
- Headline, buttons, section text and footer all read cleanly over the light ✓
- Light and dark mode both look right ✓
- Reduced motion shows a still bundle ✓
- 60 fps at 1280×800 with the GPU on ✓
Next steps
- Want it brighter on light mode? Set
intensity: 1.4inRAYS. - If you add an accordion or late-loading images to the hero, nothing else is needed. The wrapper already refreshes the text mask after load.
LightRays.tsx
TSX · React component
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
About this skill
Stop using static images or flat gradients for hero backgrounds. This skill implements a dynamic system of 150 glowing, animated threads that flow like silk across your layout. It solves the problem of boring marketing pages by providing a high-performance, interactive visual layer that responds to scrolling and cursor movement while maintaining perfect text readability.
What it does
- Dynamic flow draws in 150 threads from the top-right to form a bright hero knot before fanning out down the page.
- Scroll parallax moves the light bundle at a 0.85 ratio relative to content to create a sense of depth.
- Intelligent masking automatically fades the light behind text elements defined in selectors to ensure copy stays legible.
- Theme awareness switches between additive glow for dark mode and subtle ink-like lines for light mode.
- Performance optimization uses a single animation loop, path grouping, and a capped pixel ratio to maintain 60 fps.
How it works
- Integration copies the dependency-free
rays.tsandrays.cssinto your project structure. - Configuration initializes the effect via
startRays()or the React wrapper with custom brand colors and text selectors. - Placement defines the
knotcoordinates to position the primary glow effect precisely next to your hero headline.
Frameworks & tools
Ships with a standalone TypeScript engine, a no-build JavaScript version, and a dedicated React/Next.js client component. Includes implementation guides for Astro, Vite, Vue, and Svelte.
Why this beats prompting it yourself
Generating canvas animations usually results in choppy motion or heavy CPU usage. This skill includes specific math for Catmull-Rom splines, group-stroking optimizations, and a unique CSS-based glow layer that keeps the browser responsive.
Use cases
- SaaS Landing Pages to add high-end visual polish beside the main headline.
- Portfolio Sites as a continuous flowing element that connects different project sections.
- Tech Product Launches for a fiber-optic or energy-themed aesthetic that responds to user interaction.
Known limitations
Requires transparent or translucent backgrounds on page sections to be visible. Text masking may require a manual refresh call if layout shifts occur after the initial page load.
Requires transparent backgrounds on parent elements. Text masking limited by browser canvas height limits (~128k px). Optimized for GPU; software rendering will see lower frame rates.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free forever
No account required to browse
Trust & safety
Security scan
Security scan passed 20 days ago
- Free with an Agensi account