All Projects โ†’ DanielMartinus โ†’ Konfetti

DanielMartinus / Konfetti

Licence: isc
Celebrate more with this lightweight confetti particle system ๐ŸŽŠ

Programming Languages

kotlin
9241 projects
java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Konfetti

Proton
Javascript particle animation library
Stars: โœญ 1,958 (-14.05%)
Mutual labels:  particles, canvas, particle-system
Audio Visualizer Android
๐ŸŽต [Android Library] A light-weight and easy-to-use Audio Visualizer for Android.
Stars: โœญ 581 (-74.5%)
Mutual labels:  android-animation, android-ui, canvas
React Particle Effect Button
Bursting particle effect buttons for React ๐ŸŽ‰
Stars: โœญ 1,385 (-39.2%)
Mutual labels:  particles, canvas
Canvas Confetti
๐ŸŽ‰ on-demand confetti gun
Stars: โœญ 2,394 (+5.09%)
Mutual labels:  particles, canvas
Black
World's fastest HTML5 2D game engineย ย ย ๐Ÿ›ธ
Stars: โœญ 174 (-92.36%)
Mutual labels:  particles, canvas
Dachshund Tab Layout
Extended Android Tab Layout with animated indicators that have continuous feedback.
Stars: โœญ 853 (-62.55%)
Mutual labels:  animations, android-ui
Bluetooth State View
Material design animated Bluetooth state view for Android
Stars: โœญ 36 (-98.42%)
Mutual labels:  animations, android-ui
Tsparticles
tsParticles - Easily create highly customizable particles animations and use them as animated backgrounds for your website. Ready to use components available for React.js, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Inferno, Solid, Riot and Web Components.
Stars: โœญ 2,694 (+18.26%)
Mutual labels:  particles, animations
Trail Android
๐Ÿš• Simple, smooth animation for route / polylines on google maps using projections.
Stars: โœญ 465 (-79.59%)
Mutual labels:  animations, canvas
Scrawl Canvas
Responsive, integrated and interactive HTML5 canvas elements. Scrawl-canvas is a JavaScript library designed to make using the HTML5 canvas element a bit easier, and a bit more fun!
Stars: โœญ 134 (-94.12%)
Mutual labels:  animations, canvas
Canvas Test
๐ŸŽฎ happy canvas
Stars: โœญ 1,722 (-24.41%)
Mutual labels:  particles, canvas
Vue Canvas Nest
๐Ÿ’ซ A Vue.js background component for canvas-nest.
Stars: โœญ 136 (-94.03%)
Mutual labels:  particles, canvas
Animatedbottombar
A customizable and easy to use BottomBar navigation view with sleek animations, with support for ViewPager, ViewPager2, NavController, and badges.
Stars: โœญ 797 (-65.01%)
Mutual labels:  animations, android-ui
Ubercaranimation
A demo app showing movement of car on map like in Uber.
Stars: โœญ 643 (-71.77%)
Mutual labels:  animations, android-animation
Confetti
An Android particle system library for displaying confetti!
Stars: โœญ 1,194 (-47.59%)
Mutual labels:  android-animation, android-ui
Teammate Android
A Team Management app for creating tournaments and games for various sports
Stars: โœญ 116 (-94.91%)
Mutual labels:  android-animation, android-ui
Canvas Nest.js
โ™‹ Interactive Particle / Nest System With JavaScript and Canvas, no jQuery.
Stars: โœญ 3,966 (+74.1%)
Mutual labels:  particles, canvas
Ticker
An Android text view with scrolling text change animation
Stars: โœญ 4,194 (+84.11%)
Mutual labels:  android-animation, android-ui
Phaser Examples
Contains hundreds of source code examples and related media for the Phaser HTML5 Game Framework.
Stars: โœญ 1,680 (-26.25%)
Mutual labels:  particles, canvas
Layaair discard
This is old LayaAir veriosn writetten by ActionScript 3.0 ,now LayaAir is using TypeScript as the Engine Script,Please use https://github.com/layabox/LayaAir instead.
Stars: โœญ 1,858 (-18.44%)
Mutual labels:  particles, canvas

Konfetti ๐ŸŽŠ


License API level 16 API level 16 API level 16 Build Status

๐Ÿฅณ Celebrate more with this lightweight confetti particle system. Create realistic confetti by implementing this easy to use library.

Demo app

Sample app

Download on Google Play:

Android app on Google Play

Or download the APK here

Usage

XML

All you need in your layout is the KonfettiView to render the particles on:

<nl.dionsegijn.konfetti.KonfettiView
        android:id="@+id/viewKonfetti"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

Example in Kotlin

viewKonfetti.build()
    .addColors(Color.YELLOW, Color.GREEN, Color.MAGENTA)
    .setDirection(0.0, 359.0)
    .setSpeed(1f, 5f)
    .setFadeOutEnabled(true)
    .setTimeToLive(2000L)
    .addShapes(Shape.Square, Shape.Circle)
    .addSizes(Size(12))
    .setPosition(-50f, viewKonfetti.width + 50f, -50f, -50f)
    .streamFor(300, 5000L)

Example in Java

final KonfettiView konfettiView = findViewById(R.id.konfettiView);
konfettiView.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(final View view) {
        konfettiView.build()
                .addColors(Color.YELLOW, Color.GREEN, Color.MAGENTA)
                .setDirection(0.0, 359.0)
                .setSpeed(1f, 5f)
                .setFadeOutEnabled(true)
                .setTimeToLive(2000L)
                .addShapes(Shape.Square.INSTANCE, Shape.Circle.INSTANCE)
                .addSizes(new Size(12, 5f))
                .setPosition(-50f, konfettiView.getWidth() + 50f, -50f, -50f)
                .streamFor(300, 5000L);
    }
});

See sample code here: https://github.com/DanielMartinus/Konfetti/blob/main/demo-simple-java/src/main/java/nl/dionsegijn/simple_demo/MainActivity.java

Custom shapes

Add a custom shape by using:

Shape.DrawableShape(drawable: Drawable)

The 3D flip effect works best for symmetrical shapes, for example a drawable with a width and a height of 24x24.

Indefinite streams

Stream for an indefinite amount of time using StreamEmitter.INDEFINITE

viewKonfetti.build()
    ...
    .streamFor(particlesPerSecond = 300, emittingTime = StreamEmitter.INDEFINITE)

The only way to stop streams that run for an indefinite amount of time is either by calling:

Reset

Call reset to immediately stop rendering all particles.

viewKonfetti.reset()

stopGracefully

Call this function to stop rendering new particles. The ones visible will live out their lifetime.

viewKonfetti.stopGracefully()

Download

Add the following dependency in your app's build.gradle

dependencies {
      implementation 'nl.dionsegijn:konfetti:1.3.2'
}

Java project

If you haven't configured Kotlin for your Java only project, add the following to your project:

implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:$latest_version'

Read more about the latest version and kotlin via gradle here: https://kotlinlang.org/docs/reference/using-gradle.html

Community

Need help or want to receive the latest updates? Join the telegram groups:

Contribute

There is always room for improvement.

Report issue

Did you encounter bugs? Report them here. The more relevant information you provide the easier and faster it can be resolved.

Contribute

As mentioned, there is always room for improvement. Do you have any performance improvement ideas? Please suggest them here. Before submitting a large Pull Request, creating an issue to discuss your ideas would be the preferred way so we can be sure it is in line with other improvements currently being developed. Is it a simple improvement? Go ahead and submit a Pull Request! I very welcome any contributions.

Roadmap

In line with the previous contribute section there are some already known issues that could be resolved and are open for discussion.

  • Determining the size of the particles in the current implementation is not ideal. More here: #7 Confetti size system
  • A performance improvement to the library could for one be to implement a shared object pool amongst all particle systems instead of having them to handle confetti instances themselves.

License

Konfetti is released under the ISC license. See LICENSE for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].