GithubHelp home page GithubHelp logo

sanishkr / react-floating-balloons Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 9.0 463 KB

Custom Floating Balloons for ReactJS, with pop sound and animation

Home Page: https://codesandbox.io/s/react-floating-balloons-basic-example-4cx9kh?fontsize=14&hidenavigation=1&theme=dark

License: MIT License

JavaScript 100.00%
balloons birthday

react-floating-balloons's Introduction

React Floating Balloons ๐ŸŽˆ๐Ÿ’ฅ

Version Updates

  • [3.0.1] : Added optional hangOnTop feature, Added NextJS Example
  • [3.0.0] : Removed native elements, used styled-components. Added optional loop prop
  • [2.1.1] : Add optional custom props count, msgText, colors, popVolumeLevel
  • [2.0.2] : Add 2 new colors orange, purple
  • [2.0.1] : Pop event on single click for touch screen devices
  • [2.0.0] : Added Pop animation and Sound

Feature Bonus

  • Double-Click event pops the Balloons
  • Single Click pops on touch enabled devices
  • All Balloons pops with same colored burst animation

Motivation

Twitter and this post

Installation

npm

npm install --save react-floating-balloons

Basic Example

Edit react-floating-balloons-basic-example

NextJS Example(^v3.0.0)

Edit nextjs-react-floating-balloons-example

Props

Name Type Required Options Default Description
count number false 7 Number of balloons on the screen
msgText string false Happy Birthday. Msg written on random balloons(Keep it short)
colors Array<String> false 'yellow', 'green', 'blue', 'red', 'orange', 'purple' ['yellow', 'green', 'blue', 'red', 'orange', 'purple'] list for balloons to choose random colors from
popVolumeLevel Float false 0 to 1 0.5 Volume level for Balloon pop sound
loop Boolean false true|false true Loop Balloon animation until popped
hangOnTop Boolean false true|false false Hangs Balloons on top until popped(set loop to false)

[Todo]

  • Props validation
  • Remove CSS import
  • Fix SSR issues
  • Allow Custom colors
  • Allow custom size
  • Allow style customisation for msgText
  • Better burst animation
  • Test cases
  • Balloons string curved
  • Add more examples

Note for NextJS Usage: Use next-global-css npm module setup for (v2 and below) and use dynamic import feature with { ssr: false } to avoid errors

Maintenance Status

License

Licensed under the MIT License, Copyright ยฉ 2021-present.

See LICENSE for more information.

react-floating-balloons's People

Contributors

sanishkr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

react-floating-balloons's Issues

Support for React 18

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR! react@"^18" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^17.0.2" from [email protected]
npm ERR! node_modules/react-floating-balloons
npm ERR! react-floating-balloons@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

Was wondering if react 18 would ever be supported or if the project has been archived

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.