Installation
Install the component
Run the following command to install the component and its dependencies:
npx @motion-core/cli add god-raysImport the component
Import the component into your Svelte file:
Canvas
High-performance procedural god rays (crepuscular rays) effect with customizable colors, pulsating intensity, and distortion.
npx @motion-core/cli add god-raysimport { GodRays } from "$lib/motion-core";import { GodRays } from "$lib/motion-core";<script lang="ts">
import { GodRays } from "motion-core";
</script>
<GodRays
class="h-full min-h-96 w-full"
color="#FFFFFF"
backgroundColor="#191A1D"
intensity={0.35}
/>
| Prop | Type | Default |
|---|---|---|
color | "THREE.ColorRepresentation" | "#FFFFFF" |
backgroundColor | "THREE.ColorRepresentation" | "#000000" |
anchorX | number | 0.5 |
anchorY | number | 1.2 |
directionX | number | 0.0 |
directionY | number | -1.0 |
speed | number | 1.0 |
lightSpread | number | 1.0 |
rayLength | number | 1.0 |
pulsating | boolean | false |
fadeDistance | number | 1.0 |
saturation | number | 1.0 |
noiseAmount | number | 0.0 |
distortion | number | 0.0 |
class | string | "" |