1.0.5 • Published 6 months ago

falling v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Falling

npm GitHub stars

Falling Demo Falling Demo

A customizable falling animation

Installation

npm install falling
yarn add falling

Usage

<Falling
  flowerCount={50}
  flowerImage="/custom-flower.png"
  fallSpeed={-3}
  spreadWidth={2000}
  spreadHeight={2000}
  colors={["#FF0000", "#00FF00", "#0000FF"]}
/>

Example

//Nextjs - pages/index.js

"use client";
import React from "react";
import Falling from "falling";

const FallingDemo = () => {
  return (
    <div
      className="bg-purple-100"
      style={{
        backgroundColor: "#000",
        width: "100%",
        height: "100vh",
        position: "relative",
        overflow: "hidden",
      }}
    >
      <Falling flowerCount={50} flowerImage="/flow.png" fallSpeed={-3} />
    </div>
  );
};

export default FallingDemo;

Props

PropTypeDefaultDescription
flowerCountnumber30Number of flowers to render
flowerImagestring'/flow.png'Path to flower image
fallSpeednumber-5Vertical fall speed of flowers
spreadWidthnumber2000Horizontal spread of flowers
spreadHeightnumber2000Vertical spread of flowers
colorsstring[]'#FFB6C1','#FF69B4','#FFC0CB'Flower color palette

License

MIT © trinhminhhieu

1.0.5

6 months ago

1.0.4

6 months ago

1.0.3

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago