Snow Effect
A lightweight, peaceful snowfall animation rendered on an HTML5 Canvas. Perfect for seasonal themes or adding a sense of tranquility to hero sections.
Installation
npx raya-ui@latest add snow-effectFile Structure
your-project
components
ui
snow-effect
SnowEffect.vue
API Reference
Props
colorstring"#FFF"The Hex color code for the snowflakes.
quantitynumber100Total number of snowflakes rendered on the screen.
speednumber1Vertical fall speed multiplier. Higher values create a blizzard effect.
minRadiusnumber1Minimum size (in pixels) for the randomly generated snowflakes.
maxRadiusnumber3Maximum size (in pixels) for the randomly generated snowflakes.
Winter Mode
Dynamic Canvas Snowfall
Settings
150 flakes
1.0x
#ffffff
source-code.vue
<script setup lang="ts">
import { SnowEffect } from '@/components/ui/snow-effect'
</script>
<template>
<div class="relative w-full h-[500px] overflow-hidden bg-background">
<SnowEffect
:quantity="150"
/>
<div class="relative z-10 flex items-center justify-center h-full pointer-events-none">
<h1 class="text-4xl font-bold tracking-tighter">Winter Mode</h1>
</div>
</div>
</template>