Giter Site home page Giter Site logo

kudit / particleeffects Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 1.0 8.38 MB

ParticleEffects allows developers to create particle systems with minimal effort that are compatible with macOS, iOS, iPadOS, visionOS, tvOS, and watchOS.

License: Apache License 2.0

Swift 100.00%

particleeffects's Introduction

ParticleEffects.swiftpm

ParticleEffects allows developers to create particle systems with minimal effort that are compatible with macOS, iOS, iPadOS, visionOS, tvOS, and watchOS.

The primary goals are to be easily maintainable by multiple individuals and be able to be used across all of Apple's platforms.

This is actively maintained so if there is a feature request or change, we will strive to address within a week.

Features

  • SF Symbol particles
  • Image particles
  • Emoji particles
  • Text particles
  • Easily specify multiple symbols/images/emoji/text to use by comma-separating a string.
  • Emmitter customizations

Requirements

Most of these minimums are dictated by our usage of Date.now which is needed.

  • iOS 15+ (15.2+ minimum required for Swift Playgrounds support)
  • macOS 12+
  • macCatalyst 13.0+ (first version available)
  • tvOS 15.0+
  • watchOS 8.0+
  • visionOS 1.0+
  • Theoretically should work with Linux, Windows, and Vapor, but haven't tested. If you would like to help, please let us know.

Known Issues

None currently.

Installation

Install by adding this as a package dependency to your code. This can be done in Xcode or Swift Playgrounds!

Swift Package Manager

Swift 5

dependencies: [
    .package(url: "https://github.com/kudit/ParticleEffects.git", from: "1.0.0"),
    /// ...
]

You can try these examples in a Swift Playground by adding package: https://github.com/kudit/ParticleEffects

Usage

First make sure to import the framework:

import ParticleEffects

Here are some usage examples.

Create a simple fire emitter.

ParticleSystemView(behavior: .fire)
    .font(.largeTitle)
    .aspectRatio(contentMode: .fit)

Create a rainbow sunburst emitter. Note the ability to take a base behavior and modify specific values.

ParticleSystemView(behavior:
    .sun.modified(
        string: "star.fill",
        birthRate: .frequent,
        blur: Blur.none,
        coloring: .rainbow
    )
).aspectRatio(contentMode: .fit)

Create an emoji confetti emitter.

ParticleSystemView(behavior: .fountain, string: "😊,πŸ‘,☺️,πŸ‘,πŸ™Œ")

All these tests can be demonstrated using the previews in the file DemoViews.swift which can be viewed in Xcode Previews or in Swift Playgrounds!

Thanks

Inspired by Effects Library by GetStream

Contributing

If you have the need for a specific feature that you want implemented or if you experienced a bug, please open an issue.

Donations

This was a lot of work. If you find this useful particularly if you use this in a commercial product, please consider making a donation to http://paypal.me/kudit

License

Feel free to use this in projects, however, please include a link back to this project and credit somewhere in the app. Example Markdown and string interpolation for the version:

Text("Open Source projects used include [ParticleEffects](https://github.com/kudit/ParticleEffects) v\(ParticleEffects.version)

Contributors

The complete list of people who contributed to this project is available here. A big thanks to everyone who has contributed! πŸ™

particleeffects's People

Contributors

kudit avatar finestructure avatar

Stargazers

Basit Mustafa avatar Adam Hill avatar  avatar Davide Casarin avatar Tim Kersey avatar Manjit Bedi avatar  avatar

Watchers

Lucian avatar  avatar

Forkers

finestructure

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.